@knockout-js/layout 0.0.3 → 0.0.4-beta.0

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.
Files changed (53) hide show
  1. package/es2017/components/gather-menu/index.d.ts +34 -0
  2. package/es2017/components/gather-menu/index.js +278 -0
  3. package/es2017/components/gather-menu/index.js.map +1 -0
  4. package/es2017/components/gather-menu/index.module.css +120 -0
  5. package/es2017/components/gather-menu/locale/en_US.d.ts +3 -0
  6. package/es2017/components/gather-menu/locale/en_US.js +7 -0
  7. package/es2017/components/gather-menu/locale/en_US.js.map +1 -0
  8. package/es2017/components/gather-menu/locale/zh_CN.d.ts +3 -0
  9. package/es2017/components/gather-menu/locale/zh_CN.js +7 -0
  10. package/es2017/components/gather-menu/locale/zh_CN.js.map +1 -0
  11. package/es2017/components/index.d.ts +2 -0
  12. package/es2017/components/index.js +2 -0
  13. package/es2017/components/index.js.map +1 -1
  14. package/es2017/components/layout/index.d.ts +5 -0
  15. package/es2017/components/layout/index.js +103 -74
  16. package/es2017/components/layout/index.js.map +1 -1
  17. package/es2017/components/locale/en_US.js +3 -1
  18. package/es2017/components/locale/en_US.js.map +1 -1
  19. package/es2017/components/locale/index.d.ts +2 -0
  20. package/es2017/components/locale/index.js.map +1 -1
  21. package/es2017/components/locale/zh_CN.js +3 -1
  22. package/es2017/components/locale/zh_CN.js.map +1 -1
  23. package/es2017/components/modal/index.d.ts +18 -0
  24. package/es2017/components/modal/index.js +89 -0
  25. package/es2017/components/modal/index.js.map +1 -0
  26. package/es2017/components/modal/index.module.css +20 -0
  27. package/esm/components/gather-menu/index.d.ts +34 -0
  28. package/esm/components/gather-menu/index.js +320 -0
  29. package/esm/components/gather-menu/index.js.map +1 -0
  30. package/esm/components/gather-menu/index.module.css +120 -0
  31. package/esm/components/gather-menu/locale/en_US.d.ts +3 -0
  32. package/esm/components/gather-menu/locale/en_US.js +7 -0
  33. package/esm/components/gather-menu/locale/en_US.js.map +1 -0
  34. package/esm/components/gather-menu/locale/zh_CN.d.ts +3 -0
  35. package/esm/components/gather-menu/locale/zh_CN.js +7 -0
  36. package/esm/components/gather-menu/locale/zh_CN.js.map +1 -0
  37. package/esm/components/index.d.ts +2 -0
  38. package/esm/components/index.js +2 -0
  39. package/esm/components/index.js.map +1 -1
  40. package/esm/components/layout/index.d.ts +5 -0
  41. package/esm/components/layout/index.js +119 -90
  42. package/esm/components/layout/index.js.map +1 -1
  43. package/esm/components/locale/en_US.js +3 -1
  44. package/esm/components/locale/en_US.js.map +1 -1
  45. package/esm/components/locale/index.d.ts +2 -0
  46. package/esm/components/locale/index.js.map +1 -1
  47. package/esm/components/locale/zh_CN.js +3 -1
  48. package/esm/components/locale/zh_CN.js.map +1 -1
  49. package/esm/components/modal/index.d.ts +18 -0
  50. package/esm/components/modal/index.js +90 -0
  51. package/esm/components/modal/index.js.map +1 -0
  52. package/esm/components/modal/index.module.css +20 -0
  53. package/package.json +6 -2
@@ -0,0 +1,320 @@
1
+ import _async_to_generator from "@swc/helpers/src/_async_to_generator.mjs";
2
+ import _object_spread from "@swc/helpers/src/_object_spread.mjs";
3
+ import _object_spread_props from "@swc/helpers/src/_object_spread_props.mjs";
4
+ import _sliced_to_array from "@swc/helpers/src/_sliced_to_array.mjs";
5
+ import _to_consumable_array from "@swc/helpers/src/_to_consumable_array.mjs";
6
+ import _ts_generator from "@swc/helpers/src/_ts_generator.mjs";
7
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "@ice/jsx-runtime/jsx-runtime";
8
+ import { CloseOutlined, DragOutlined, SearchOutlined, StarOutlined } from "@ant-design/icons";
9
+ import { useCallback, useEffect, useState } from "react";
10
+ import styles from "./index.module.css";
11
+ import { Drawer, Empty, Input, Space } from "antd";
12
+ import { gql, paging, query } from "@knockout-js/ice-urql/request";
13
+ import { iceUrqlInstance } from "../index";
14
+ import { DndContext, closestCenter, KeyboardSensor, PointerSensor, useSensor, useSensors } from "@dnd-kit/core";
15
+ import { arrayMove, SortableContext, useSortable, sortableKeyboardCoordinates, verticalListSortingStrategy } from "@dnd-kit/sortable";
16
+ import { CSS } from "@dnd-kit/utilities";
17
+ import { useLocale } from "../locale/index";
18
+ var userMenuListQuery = gql("query userMenuList($appCode:String!){\n userMenus(appCode: $appCode){\n id,name,route,appID\n }\n}");
19
+ var userOrgAppsQuery = gql("query layoutPkgUserRootOrgs($first:Int){\n userRootOrgs{\n id,\n apps(first: $first){\n totalCount,\n edges{ node{ id,name,code } }\n }\n }\n}");
20
+ /**
21
+ * 排序拖拽使用的控件
22
+ * https://docs.dndkit.com/
23
+ * @param props
24
+ * @returns
25
+ */ var DargItem = function(props) {
26
+ var id = "".concat(props.value.id, "-").concat(props.value.appID);
27
+ var _useSortable = useSortable({
28
+ id: id
29
+ }), setNodeRef = _useSortable.setNodeRef, listeners = _useSortable.listeners, attributes = _useSortable.attributes, transform = _useSortable.transform, transition = _useSortable.transition, setDraggableNodeRef = _useSortable.setDraggableNodeRef;
30
+ var style = {
31
+ transform: CSS.Transform.toString(transform),
32
+ transition: transition
33
+ };
34
+ return /*#__PURE__*/ _jsxs("div", _object_spread_props(_object_spread({
35
+ ref: setNodeRef,
36
+ style: style
37
+ }, attributes), {
38
+ className: styles.customMenuDrawerMenuItem,
39
+ onClick: function() {
40
+ props.onClick();
41
+ },
42
+ children: [
43
+ /*#__PURE__*/ _jsx("div", {
44
+ className: styles.customMenuDrawerMenuItemName,
45
+ children: props.value.name
46
+ }),
47
+ /*#__PURE__*/ _jsx("div", {
48
+ className: styles.customMenuDrawerMenuItemIcons,
49
+ children: /*#__PURE__*/ _jsxs(Space, {
50
+ children: [
51
+ /*#__PURE__*/ _jsx(CloseOutlined, {
52
+ rev: undefined,
53
+ onClick: function() {
54
+ props.onDel();
55
+ }
56
+ }),
57
+ /*#__PURE__*/ _jsx(DragOutlined, _object_spread_props(_object_spread({
58
+ rev: undefined
59
+ }, listeners), {
60
+ className: "dragIcon"
61
+ }))
62
+ ]
63
+ })
64
+ })
65
+ ]
66
+ }));
67
+ };
68
+ export default function(props) {
69
+ var _useState = _sliced_to_array(useState([]), 2), all = _useState[0], setAll = _useState[1], _useState1 = _sliced_to_array(useState([]), 2), filterList = _useState1[0], setFilterList = _useState1[1], _useState2 = _sliced_to_array(useState([]), 2), collects = _useState2[0], setCollects = _useState2[1], locale = useLocale("GatherMenu"), sensors = useSensors(useSensor(PointerSensor), useSensor(KeyboardSensor, {
70
+ coordinateGetter: sortableKeyboardCoordinates
71
+ }));
72
+ var request = useCallback(/*#__PURE__*/ _async_to_generator(function() {
73
+ var _appsResult_data, appsResult, apps, newAll, _tmp, _tmp1, _i, i, _menuResult_data, menuResult, menu;
74
+ return _ts_generator(this, function(_state) {
75
+ switch(_state.label){
76
+ case 0:
77
+ return [
78
+ 4,
79
+ paging(userOrgAppsQuery, {
80
+ first: 30
81
+ }, 1, {
82
+ instanceName: iceUrqlInstance.ucenter
83
+ })
84
+ ];
85
+ case 1:
86
+ appsResult = _state.sent(), apps = [];
87
+ if ((_appsResult_data = appsResult.data) === null || _appsResult_data === void 0 ? void 0 : _appsResult_data.userRootOrgs) appsResult.data.userRootOrgs.forEach(function(org) {
88
+ var _org_apps_edges;
89
+ (_org_apps_edges = org.apps.edges) === null || _org_apps_edges === void 0 ? void 0 : _org_apps_edges.forEach(function(oApp) {
90
+ if (oApp === null || oApp === void 0 ? void 0 : oApp.node) {
91
+ if (!apps.find(function(app) {
92
+ var _oApp_node;
93
+ return app.id === ((_oApp_node = oApp.node) === null || _oApp_node === void 0 ? void 0 : _oApp_node.id);
94
+ })) apps.push(oApp.node);
95
+ }
96
+ });
97
+ });
98
+ newAll = [];
99
+ _tmp = [];
100
+ for(_tmp1 in apps)_tmp.push(_tmp1);
101
+ _i = 0;
102
+ _state.label = 2;
103
+ case 2:
104
+ if (!(_i < _tmp.length)) return [
105
+ 3,
106
+ 5
107
+ ];
108
+ i = _tmp[_i];
109
+ return [
110
+ 4,
111
+ query(userMenuListQuery, {
112
+ appCode: apps[i].code
113
+ }, {
114
+ instanceName: iceUrqlInstance.ucenter
115
+ })
116
+ ];
117
+ case 3:
118
+ menuResult = _state.sent();
119
+ if ((_menuResult_data = menuResult.data) === null || _menuResult_data === void 0 ? void 0 : _menuResult_data.userMenus) {
120
+ menu = menuResult.data.userMenus.filter(function(item) {
121
+ return item.route;
122
+ });
123
+ newAll.push({
124
+ app: apps[i],
125
+ menu: menu
126
+ });
127
+ }
128
+ _state.label = 4;
129
+ case 4:
130
+ _i++;
131
+ return [
132
+ 3,
133
+ 2
134
+ ];
135
+ case 5:
136
+ setAll(newAll);
137
+ setFilterList(newAll);
138
+ return [
139
+ 2
140
+ ];
141
+ }
142
+ });
143
+ }), []), checkCollect = useCallback(function(menuItem) {
144
+ return !!collects.find(function(item) {
145
+ return item.id === menuItem.id && item.appID === menuItem.appID;
146
+ });
147
+ }, [
148
+ collects
149
+ ]);
150
+ useEffect(function() {
151
+ if (props.dataSource) {
152
+ setAll(props.dataSource);
153
+ setFilterList(props.dataSource);
154
+ } else request();
155
+ }, [
156
+ props.dataSource
157
+ ]);
158
+ useEffect(function() {
159
+ if (props.storeKey) {
160
+ var store = localStorage.getItem(props.storeKey);
161
+ if (store) try {
162
+ setCollects(JSON.parse(store));
163
+ } catch (error) {}
164
+ }
165
+ }, [
166
+ props.storeKey
167
+ ]);
168
+ useEffect(function() {
169
+ if (props.storeKey) {
170
+ if (collects.length) localStorage.setItem(props.storeKey, JSON.stringify(collects));
171
+ else localStorage.removeItem(props.storeKey);
172
+ }
173
+ }, [
174
+ collects
175
+ ]);
176
+ return /*#__PURE__*/ _jsx(_Fragment, {
177
+ children: /*#__PURE__*/ _jsx(Drawer, {
178
+ className: styles.customMenuDrawer,
179
+ placement: "left",
180
+ open: props.open,
181
+ width: 1060,
182
+ onClose: function() {
183
+ var _props_onChangeOpen;
184
+ (_props_onChangeOpen = props.onChangeOpen) === null || _props_onChangeOpen === void 0 ? void 0 : _props_onChangeOpen.call(props, false);
185
+ },
186
+ children: /*#__PURE__*/ _jsxs("div", {
187
+ className: styles.customMenuDrawerRow,
188
+ children: [
189
+ /*#__PURE__*/ _jsx("div", {
190
+ style: {
191
+ width: 240
192
+ },
193
+ className: styles.customMenuDrawerMenu,
194
+ children: collects.length ? /*#__PURE__*/ _jsx(DndContext, {
195
+ sensors: sensors,
196
+ collisionDetection: closestCenter,
197
+ onDragEnd: function(event) {
198
+ var active = event.active, over = event.over;
199
+ if (over && active.id !== over.id) setCollects(function(items) {
200
+ var oldIndex = items.findIndex(function(oItem) {
201
+ return "".concat(oItem.id, "-").concat(oItem.appID) == active.id;
202
+ });
203
+ var newIndex = items.findIndex(function(nItem) {
204
+ return "".concat(nItem.id, "-").concat(nItem.appID) == over.id;
205
+ });
206
+ return arrayMove(items, oldIndex, newIndex);
207
+ });
208
+ },
209
+ children: /*#__PURE__*/ _jsx(SortableContext, {
210
+ items: collects.map(function(item) {
211
+ return "".concat(item.id, "-").concat(item.appID);
212
+ }),
213
+ strategy: verticalListSortingStrategy,
214
+ children: collects.map(function(item) {
215
+ /*#__PURE__*/ return _jsx(DargItem, {
216
+ value: item,
217
+ onDel: function() {
218
+ setCollects(collects.filter(function(c) {
219
+ return !(c.id === item.id && c.appID === item.appID);
220
+ }));
221
+ },
222
+ onClick: function() {
223
+ var _props_onClick;
224
+ var allApp = all.find(function(allItem) {
225
+ return allItem.app.id == item.appID;
226
+ });
227
+ if (allApp) (_props_onClick = props.onClick) === null || _props_onClick === void 0 ? void 0 : _props_onClick.call(props, item, allApp.app);
228
+ }
229
+ }, "c".concat(item.id, "-").concat(item.appID));
230
+ })
231
+ })
232
+ }) : /*#__PURE__*/ _jsx(Empty, {
233
+ image: Empty.PRESENTED_IMAGE_SIMPLE,
234
+ description: locale.notText
235
+ })
236
+ }),
237
+ /*#__PURE__*/ _jsxs("div", {
238
+ style: {
239
+ width: 820
240
+ },
241
+ children: [
242
+ /*#__PURE__*/ _jsx("div", {
243
+ className: styles.customMenuDrawerAllInput,
244
+ children: /*#__PURE__*/ _jsx(Input, {
245
+ bordered: false,
246
+ prefix: /*#__PURE__*/ _jsx(SearchOutlined, {
247
+ rev: undefined
248
+ }),
249
+ placeholder: locale.searchPlaceholder,
250
+ onChange: function(event) {
251
+ var keyword = event.target.value;
252
+ if (keyword) {
253
+ var fList = all.map(function(f) {
254
+ return {
255
+ app: f.app,
256
+ menu: f.menu.filter(function(fMenuItem) {
257
+ return fMenuItem.name.indexOf(keyword) > -1;
258
+ })
259
+ };
260
+ }).filter(function(f) {
261
+ return f.menu.length;
262
+ });
263
+ setFilterList(fList);
264
+ } else setFilterList(_to_consumable_array(all));
265
+ }
266
+ })
267
+ }),
268
+ /*#__PURE__*/ _jsx("div", {
269
+ className: styles.customMenuDrawerAllMenu,
270
+ children: filterList.map(function(item) {
271
+ /*#__PURE__*/ return _jsxs("div", {
272
+ className: styles.customMenuDrawerAllMenuColumn,
273
+ children: [
274
+ /*#__PURE__*/ _jsx("div", {
275
+ className: styles.customMenuDrawerAllMenuTitle,
276
+ children: item.app.name
277
+ }),
278
+ item.menu.map(function(menuItem) {
279
+ /*#__PURE__*/ return _jsxs("div", {
280
+ className: styles.customMenuDrawerAllMenuItem,
281
+ onClick: function() {
282
+ var _props_onClick;
283
+ (_props_onClick = props.onClick) === null || _props_onClick === void 0 ? void 0 : _props_onClick.call(props, menuItem, item.app);
284
+ },
285
+ children: [
286
+ /*#__PURE__*/ _jsx("div", {
287
+ className: styles.customMenuDrawerAllMenuItemName,
288
+ children: menuItem.name
289
+ }),
290
+ /*#__PURE__*/ _jsx("div", {
291
+ children: /*#__PURE__*/ _jsx(StarOutlined, {
292
+ rev: undefined,
293
+ className: checkCollect(menuItem) ? "collect" : "",
294
+ onClick: function(event) {
295
+ event.stopPropagation();
296
+ if (checkCollect(menuItem)) setCollects(collects.filter(function(c) {
297
+ return !(c.id === menuItem.id && c.appID === menuItem.appID);
298
+ }));
299
+ else setCollects(_to_consumable_array(collects).concat([
300
+ menuItem
301
+ ]));
302
+ }
303
+ })
304
+ })
305
+ ]
306
+ }, "".concat(menuItem.appID, "-").concat(menuItem.id));
307
+ })
308
+ ]
309
+ }, item.app.code);
310
+ })
311
+ })
312
+ ]
313
+ })
314
+ ]
315
+ })
316
+ })
317
+ });
318
+ };
319
+
320
+ //# sourceMappingURL=D:\codeing\git\github\knockout-js\packages\layout\esm\components\gather-menu\index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["D:\\codeing\\git\\github\\knockout-js\\packages\\layout\\src\\components\\gather-menu\\index.tsx"],"sourcesContent":["import { CloseOutlined, DragOutlined, SearchOutlined, StarOutlined } from \"@ant-design/icons\"\r\nimport { useCallback, useEffect, useState } from \"react\"\r\nimport styles from \"./index.module.css\"\r\nimport { Col, Drawer, Empty, Input, Row, Space } from \"antd\";\r\nimport { gql, paging, query } from \"@knockout-js/ice-urql/request\";\r\nimport { App, AppMenu, LayoutPkgUserRootOrgsQuery, LayoutPkgUserRootOrgsQueryVariables, UserMenuListQuery, UserMenuListQueryVariables } from \"@knockout-js/api\";\r\nimport { iceUrqlInstance } from \"..\";\r\nimport { DndContext, closestCenter, KeyboardSensor, PointerSensor, useSensor, useSensors, } from \"@dnd-kit/core\";\r\nimport { arrayMove, SortableContext, useSortable, sortableKeyboardCoordinates, verticalListSortingStrategy } from \"@dnd-kit/sortable\";\r\nimport { CSS } from '@dnd-kit/utilities';\r\nimport { useLocale } from \"../locale\";\r\n\r\nconst userMenuListQuery = gql(/* GraphQL */`query userMenuList($appCode:String!){\r\n userMenus(appCode: $appCode){\r\n id,name,route,appID\r\n }\r\n}`);\r\n\r\nconst userOrgAppsQuery = gql(/* GraphQL */`query layoutPkgUserRootOrgs($first:Int){\r\n userRootOrgs{\r\n id,\r\n apps(first: $first){\r\n totalCount,\r\n edges{ node{ id,name,code } }\r\n }\r\n }\r\n}`);\r\n\r\nexport type GatherMenuLocale = {\r\n notText: string;\r\n searchPlaceholder: string;\r\n}\r\n\r\nexport type GatherMenuDataSource = {\r\n app: App;\r\n menu: AppMenu[];\r\n}[]\r\n\r\nexport interface GatherMenuProps {\r\n /**\r\n * 弹出开关\r\n */\r\n open?: boolean;\r\n /**\r\n * 数据源\r\n */\r\n dataSource?: GatherMenuDataSource;\r\n /**\r\n * 存储key\r\n */\r\n storeKey?: string;\r\n /**\r\n * 弹出开关变更\r\n */\r\n onChangeOpen?: (open: boolean) => void;\r\n /**\r\n * 选中菜单\r\n */\r\n onClick?: (menuItem: AppMenu, app: App) => void;\r\n}\r\n\r\n/**\r\n * 排序拖拽使用的控件\r\n * https://docs.dndkit.com/\r\n * @param props\r\n * @returns\r\n */\r\nconst DargItem = (props: {\r\n value: AppMenu;\r\n onDel: () => void;\r\n onClick: () => void;\r\n}) => {\r\n const id = `${props.value.id}-${props.value.appID}`;\r\n const { setNodeRef, listeners, attributes, transform, transition, setDraggableNodeRef } = useSortable({ id });\r\n const style = {\r\n transform: CSS.Transform.toString(transform),\r\n transition,\r\n };\r\n\r\n return <div\r\n ref={setNodeRef}\r\n style={style}\r\n {...attributes}\r\n className={styles.customMenuDrawerMenuItem}\r\n onClick={() => {\r\n props.onClick();\r\n }}\r\n >\r\n <div className={styles.customMenuDrawerMenuItemName}>{props.value.name}</div>\r\n <div className={styles.customMenuDrawerMenuItemIcons}>\r\n <Space>\r\n <CloseOutlined rev={undefined} onClick={() => {\r\n props.onDel();\r\n }} />\r\n <DragOutlined rev={undefined} {...listeners} className=\"dragIcon\" />\r\n </Space>\r\n </div>\r\n </div>\r\n}\r\n\r\nexport default (props: GatherMenuProps) => {\r\n const [all, setAll] = useState<GatherMenuDataSource>([]),\r\n [filterList, setFilterList] = useState<GatherMenuDataSource>([]),\r\n [collects, setCollects] = useState<AppMenu[]>([]),\r\n locale = useLocale('GatherMenu'),\r\n sensors = useSensors(\r\n useSensor(PointerSensor),\r\n useSensor(KeyboardSensor, {\r\n coordinateGetter: sortableKeyboardCoordinates,\r\n })\r\n );\r\n ;\r\n\r\n const\r\n request = useCallback(async () => {\r\n const appsResult = await paging<LayoutPkgUserRootOrgsQuery, LayoutPkgUserRootOrgsQueryVariables>(userOrgAppsQuery, {\r\n first: 30,\r\n }, 1, { instanceName: iceUrqlInstance.ucenter }), apps: App[] = [];\r\n if (appsResult.data?.userRootOrgs) {\r\n appsResult.data.userRootOrgs.forEach(org => {\r\n org.apps.edges?.forEach(oApp => {\r\n if (oApp?.node) {\r\n if (!apps.find(app => app.id === oApp.node?.id)) {\r\n apps.push(oApp.node as App);\r\n }\r\n }\r\n })\r\n })\r\n }\r\n const newAll: GatherMenuDataSource = [];\r\n for (let i in apps) {\r\n const menuResult = await query<UserMenuListQuery, UserMenuListQueryVariables>(userMenuListQuery, {\r\n appCode: apps[i].code,\r\n }, { instanceName: iceUrqlInstance.ucenter });\r\n if (menuResult.data?.userMenus) {\r\n const menu = menuResult.data.userMenus.filter(item => item.route) as AppMenu[];\r\n newAll.push({\r\n app: apps[i],\r\n menu,\r\n })\r\n }\r\n }\r\n setAll(newAll);\r\n setFilterList(newAll);\r\n }, []),\r\n checkCollect = useCallback((menuItem: AppMenu) => {\r\n return !!collects.find(item => item.id === menuItem.id && item.appID === menuItem.appID);\r\n }, [collects])\r\n\r\n useEffect(() => {\r\n if (props.dataSource) {\r\n setAll(props.dataSource);\r\n setFilterList(props.dataSource);\r\n } else {\r\n request();\r\n }\r\n }, [props.dataSource]);\r\n\r\n useEffect(() => {\r\n if (props.storeKey) {\r\n const store = localStorage.getItem(props.storeKey);\r\n if (store) {\r\n try {\r\n setCollects(JSON.parse(store));\r\n } catch (error) {\r\n }\r\n }\r\n }\r\n }, [props.storeKey]);\r\n\r\n useEffect(() => {\r\n if (props.storeKey) {\r\n if (collects.length) {\r\n localStorage.setItem(props.storeKey, JSON.stringify(collects));\r\n } else {\r\n localStorage.removeItem(props.storeKey);\r\n }\r\n }\r\n }, [collects]);\r\n\r\n return <>\r\n <Drawer\r\n className={styles.customMenuDrawer}\r\n placement=\"left\"\r\n open={props.open}\r\n width={1060}\r\n onClose={() => {\r\n props.onChangeOpen?.(false);\r\n }}\r\n >\r\n <div className={styles.customMenuDrawerRow}>\r\n <div style={{ width: 240 }} className={styles.customMenuDrawerMenu}>\r\n {collects.length ?\r\n <DndContext sensors={sensors}\r\n collisionDetection={closestCenter}\r\n onDragEnd={(event) => {\r\n const { active, over } = event;\r\n if (over && active.id !== over.id) {\r\n setCollects((items) => {\r\n const oldIndex = items.findIndex(oItem => `${oItem.id}-${oItem.appID}` == active.id);\r\n const newIndex = items.findIndex(nItem => `${nItem.id}-${nItem.appID}` == over.id);\r\n return arrayMove(items, oldIndex, newIndex);\r\n });\r\n }\r\n }}\r\n >\r\n <SortableContext items={collects.map(item => `${item.id}-${item.appID}`)} strategy={verticalListSortingStrategy}>\r\n {\r\n collects.map(item => (<DargItem\r\n key={`c${item.id}-${item.appID}`}\r\n value={item}\r\n onDel={() => {\r\n setCollects(collects.filter(c => !(c.id === item.id && c.appID === item.appID)));\r\n }}\r\n onClick={() => {\r\n const allApp = all.find(allItem => allItem.app.id == item.appID);\r\n if (allApp) {\r\n props.onClick?.(item, allApp.app);\r\n }\r\n }}\r\n />))\r\n }\r\n </SortableContext>\r\n </DndContext>\r\n : <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} description={locale.notText} />\r\n }\r\n </div>\r\n <div style={{ width: 820 }}>\r\n <div className={styles.customMenuDrawerAllInput}>\r\n <Input\r\n bordered={false}\r\n prefix={<SearchOutlined rev={undefined} />}\r\n placeholder={locale.searchPlaceholder}\r\n onChange={(event) => {\r\n const keyword = event.target.value;\r\n if (keyword) {\r\n const fList = all.map(f => {\r\n return {\r\n app: f.app,\r\n menu: f.menu.filter(fMenuItem => fMenuItem.name.indexOf(keyword) > -1),\r\n };\r\n }).filter(f => f.menu.length);\r\n\r\n setFilterList(fList);\r\n } else {\r\n setFilterList([...all]);\r\n }\r\n }}\r\n />\r\n </div>\r\n <div className={styles.customMenuDrawerAllMenu}>\r\n {filterList.map(item => (\r\n <div key={item.app.code} className={styles.customMenuDrawerAllMenuColumn}>\r\n <div className={styles.customMenuDrawerAllMenuTitle}>{item.app.name}</div>\r\n {item.menu.map(menuItem => (\r\n <div\r\n key={`${menuItem.appID}-${menuItem.id}`}\r\n className={styles.customMenuDrawerAllMenuItem}\r\n onClick={() => {\r\n props.onClick?.(menuItem, item.app);\r\n }}\r\n >\r\n <div className={styles.customMenuDrawerAllMenuItemName}>{menuItem.name}</div>\r\n <div>\r\n <StarOutlined rev={undefined} className={checkCollect(menuItem) ? 'collect' : ''} onClick={(event) => {\r\n event.stopPropagation();\r\n if (checkCollect(menuItem)) {\r\n setCollects(collects.filter(c => !(c.id === menuItem.id && c.appID === menuItem.appID)));\r\n } else {\r\n setCollects([...collects, menuItem]);\r\n }\r\n }} />\r\n </div>\r\n </div>\r\n ))}\r\n </div>\r\n ))}\r\n </div>\r\n </div>\r\n </div>\r\n </Drawer>\r\n </>\r\n}\r\n"],"names":["CloseOutlined","DragOutlined","SearchOutlined","StarOutlined","useCallback","useEffect","useState","styles","Drawer","Empty","Input","Space","gql","paging","query","iceUrqlInstance","DndContext","closestCenter","KeyboardSensor","PointerSensor","useSensor","useSensors","arrayMove","SortableContext","useSortable","sortableKeyboardCoordinates","verticalListSortingStrategy","CSS","useLocale","userMenuListQuery","userOrgAppsQuery","DargItem","props","id","value","appID","setNodeRef","listeners","attributes","transform","transition","setDraggableNodeRef","style","Transform","toString","div","ref","className","customMenuDrawerMenuItem","onClick","customMenuDrawerMenuItemName","name","customMenuDrawerMenuItemIcons","rev","undefined","onDel","all","setAll","filterList","setFilterList","collects","setCollects","locale","sensors","coordinateGetter","request","appsResult","apps","newAll","i","menuResult","menu","first","instanceName","ucenter","data","userRootOrgs","forEach","org","edges","oApp","node","find","app","push","appCode","code","userMenus","filter","item","route","checkCollect","menuItem","dataSource","storeKey","store","localStorage","getItem","JSON","parse","error","length","setItem","stringify","removeItem","customMenuDrawer","placement","open","width","onClose","onChangeOpen","customMenuDrawerRow","customMenuDrawerMenu","collisionDetection","onDragEnd","event","active","over","items","oldIndex","findIndex","oItem","newIndex","nItem","map","strategy","c","allApp","allItem","image","PRESENTED_IMAGE_SIMPLE","description","notText","customMenuDrawerAllInput","bordered","prefix","placeholder","searchPlaceholder","onChange","keyword","target","fList","f","fMenuItem","indexOf","customMenuDrawerAllMenu","customMenuDrawerAllMenuColumn","customMenuDrawerAllMenuTitle","customMenuDrawerAllMenuItem","customMenuDrawerAllMenuItemName","stopPropagation"],"mappings":";;;;;;;AAAA,SAASA,aAAa,EAAEC,YAAY,EAAEC,cAAc,EAAEC,YAAY,QAAQ,oBAAmB;AAC7F,SAASC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,QAAO;AACxD,OAAOC,YAAY,qBAAoB;AACvC,SAAcC,MAAM,EAAEC,KAAK,EAAEC,KAAK,EAAOC,KAAK,QAAQ,OAAO;AAC7D,SAASC,GAAG,EAAEC,MAAM,EAAEC,KAAK,QAAQ,gCAAgC;AAEnE,SAASC,eAAe,QAAQ,WAAK;AACrC,SAASC,UAAU,EAAEC,aAAa,EAAEC,cAAc,EAAEC,aAAa,EAAEC,SAAS,EAAEC,UAAU,QAAS,gBAAgB;AACjH,SAASC,SAAS,EAAEC,eAAe,EAAEC,WAAW,EAAEC,2BAA2B,EAAEC,2BAA2B,QAAQ,oBAAoB;AACtI,SAASC,GAAG,QAAQ,qBAAqB;AACzC,SAASC,SAAS,QAAQ,kBAAY;AAEtC,IAAMC,oBAAoBjB,IAAkB;AAM5C,IAAMkB,mBAAmBlB,IAAkB;AA2C3C;;;;;CAKC,GACD,IAAMmB,WAAW,SAACC,OAIZ;IACJ,IAAMC,KAAK,AAAC,GAAoBD,OAAlBA,MAAME,KAAK,CAACD,EAAE,EAAC,KAAqB,OAAlBD,MAAME,KAAK,CAACC,KAAK;IACjD,IAA0FX,eAAAA,YAAY;QAAES,IAAAA;IAAG,IAAnGG,aAAkFZ,aAAlFY,YAAYC,YAAsEb,aAAtEa,WAAWC,aAA2Dd,aAA3Dc,YAAYC,YA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KN,GAAG;oDACpC;;sEAEA,KAACtC;4DAAIE,WAAWxC,OAAO8I,+BAA+B;sEAAGzD,SAASzC,IAAI;;sEACtE,KAACN;sEACC,cAAA,KAAC1C;gEAAakD,KAAKC;gEAAWP,WAAW4C,aAAaC,YAAY,YAAY,EAAE;gEAAE3C,SAAS,SAACkE,OAAU;oEACpGA,MAAMmC,eAAe;oEACrB,IAAI3D,aAAaC,WACf/B,YAAYD,SAAS4B,MAAM,CAACsC,SAAAA;+EAAK,CAAEA,CAAAA,EAAE7F,EAAE,KAAK2D,SAAS3D,EAAE,IAAI6F,EAAE3F,KAAK,KAAKyD,SAASzD,KAAK,AAAD;;yEAEpF0B,YAAY,AAAC,qBAAGD,iBAAJ;wEAAcgC;qEAAS;gEAEvC;;;;mDAfG,AAAC,GAAoBA,OAAlBA,SAASzD,KAAK,EAAC,KAAe,OAAZyD,SAAS3D,EAAE;;;uCAJjCwD,KAAKN,GAAG,CAACG,IAAI;;;;;;;;;AA8BrC,EAAC"}
@@ -0,0 +1,120 @@
1
+ .customMenu {
2
+ margin-right: 8px;
3
+ cursor: pointer;
4
+ }
5
+
6
+ .customMenuDrawer {
7
+
8
+ :global(.ant-drawer-header-title) {
9
+ flex-direction: row-reverse;
10
+ }
11
+
12
+ :global(.ant-drawer-body) {
13
+ padding: 0;
14
+ }
15
+
16
+ }
17
+
18
+ .customMenuDrawerRow {
19
+ height: 100%;
20
+ display: flex;
21
+ }
22
+
23
+ .customMenuDrawerMenu {
24
+ height: 100%;
25
+ border-right: 1px solid rgba(5, 5, 5, 0.06);
26
+ }
27
+
28
+ .customMenuDrawerAllMenu {
29
+ height: calc(100% - 52px);
30
+ padding: 16px;
31
+ overflow-y: auto;
32
+ column-count: 3;
33
+ column-gap: 10px;
34
+ }
35
+
36
+ .customMenuDrawerAllMenuColumn {
37
+ /* 瀑布流关键写法 */
38
+ break-inside: avoid;
39
+ margin-bottom: 16px;
40
+ }
41
+
42
+
43
+ .customMenuDrawerAllMenuTitle {
44
+ font-weight: bold;
45
+ height: 32px;
46
+ line-height: 32px;
47
+ padding: 0 16px;
48
+ }
49
+
50
+ .customMenuDrawerAllMenuItem {
51
+ height: 32px;
52
+ line-height: 32px;
53
+ cursor: pointer;
54
+ padding: 0 16px;
55
+ display: flex;
56
+
57
+ &:hover {
58
+ background-color: #f1f1f1;
59
+
60
+ :global(.anticon-star) {
61
+ display: inline;
62
+ }
63
+ }
64
+
65
+ :global(.anticon-star.collect) {
66
+ color: rgb(255, 106, 0);
67
+ }
68
+
69
+ :global(.anticon-star) {
70
+ display: none;
71
+ }
72
+ }
73
+
74
+ .customMenuDrawerAllMenuItemName {
75
+ overflow: hidden;
76
+ text-overflow: ellipsis;
77
+ white-space: nowrap;
78
+ flex: auto;
79
+ }
80
+
81
+ .customMenuDrawerAllInput {
82
+ padding: 10px 0;
83
+ margin: 0 16px;
84
+ border-bottom: 1px solid rgba(5, 5, 5, 0.06);
85
+ }
86
+
87
+ .customMenuDrawerMenuItem {
88
+ height: 40px;
89
+ line-height: 40px;
90
+ cursor: pointer;
91
+ padding: 0 16px;
92
+ display: flex;
93
+
94
+ &:hover {
95
+ background-color: #f1f1f1;
96
+
97
+ .customMenuDrawerMenuItemIcons {
98
+ display: block;
99
+ }
100
+ }
101
+ }
102
+
103
+ .customMenuDrawerMenuItemIcons {
104
+ display: none;
105
+
106
+ :global(.anticon) {
107
+ color: #c1c1c1;
108
+
109
+ &:hover {
110
+ color: #8c8c8c;
111
+ }
112
+ }
113
+ }
114
+
115
+ .customMenuDrawerMenuItemName {
116
+ flex: auto;
117
+ text-overflow: ellipsis;
118
+ white-space: nowrap;
119
+ overflow: hidden;
120
+ }
@@ -0,0 +1,3 @@
1
+ import { GatherMenuLocale } from "../index";
2
+ declare const locale: GatherMenuLocale;
3
+ export default locale;
@@ -0,0 +1,7 @@
1
+ var locale = {
2
+ notText: "The favorites list is empty, you can add your usual addresses to your favorites on the right.",
3
+ searchPlaceholder: "Please enter keyword"
4
+ };
5
+ export default locale;
6
+
7
+ //# sourceMappingURL=D:\codeing\git\github\knockout-js\packages\layout\esm\components\gather-menu\locale\en_US.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["D:\\codeing\\git\\github\\knockout-js\\packages\\layout\\src\\components\\gather-menu\\locale\\en_US.ts"],"sourcesContent":["import { GatherMenuLocale } from \"../index\";\r\n\r\nconst locale: GatherMenuLocale = {\r\n notText: 'The favorites list is empty, you can add your usual addresses to your favorites on the right.',\r\n searchPlaceholder: \"Please enter keyword\",\r\n};\r\n\r\nexport default locale\r\n"],"names":["locale","notText","searchPlaceholder"],"mappings":"AAEA,IAAMA,SAA2B;IAC/BC,SAAS;IACTC,mBAAmB;AACrB;AAEA,eAAeF,OAAM"}
@@ -0,0 +1,3 @@
1
+ import { GatherMenuLocale } from "../index";
2
+ declare const locale: GatherMenuLocale;
3
+ export default locale;
@@ -0,0 +1,7 @@
1
+ var locale = {
2
+ notText: "收藏列表为空,可在右侧将您常用地址添加到收藏。",
3
+ searchPlaceholder: "请输入关键词"
4
+ };
5
+ export default locale;
6
+
7
+ //# sourceMappingURL=D:\codeing\git\github\knockout-js\packages\layout\esm\components\gather-menu\locale\zh_CN.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["D:\\codeing\\git\\github\\knockout-js\\packages\\layout\\src\\components\\gather-menu\\locale\\zh_CN.ts"],"sourcesContent":["import { GatherMenuLocale } from \"../index\";\r\n\r\nconst locale: GatherMenuLocale = {\r\n notText: '收藏列表为空,可在右侧将您常用地址添加到收藏。',\r\n searchPlaceholder: \"请输入关键词\",\r\n};\r\n\r\nexport default locale\r\n"],"names":["locale","notText","searchPlaceholder"],"mappings":"AAEA,IAAMA,SAA2B;IAC/BC,SAAS;IACTC,mBAAmB;AACrB;AAEA,eAAeF,OAAM"}
@@ -7,6 +7,8 @@ export { default as LeavePrompt, useLeavePrompt } from './leave-prompt';
7
7
  export { default as I18nDropdown } from './i18n-dropdown';
8
8
  export { default as CollectProviders } from './collect-providers';
9
9
  export { default as Layout } from './layout';
10
+ export { default as Modal, type ModalProps } from './modal';
11
+ export { default as GatherMenu, type GatherMenuDataSource } from './gather-menu';
10
12
  export declare enum iceUrqlInstance {
11
13
  ucenter = "ucenter"
12
14
  }
@@ -7,6 +7,8 @@ export { default as LeavePrompt, useLeavePrompt } from "./leave-prompt/index";
7
7
  export { default as I18nDropdown } from "./i18n-dropdown/index";
8
8
  export { default as CollectProviders } from "./collect-providers/index";
9
9
  export { default as Layout } from "./layout/index";
10
+ export { default as Modal } from "./modal/index";
11
+ export { default as GatherMenu } from "./gather-menu/index";
10
12
  export var iceUrqlInstance;
11
13
  (function(iceUrqlInstance) {
12
14
  iceUrqlInstance["ucenter"] = "ucenter";
@@ -1 +1 @@
1
- {"version":3,"sources":["D:\\codeing\\git\\github\\knockout-js\\packages\\layout\\src\\components\\index.ts"],"sourcesContent":["export { default as BasicProvider, BasicContext, type BasicProviderProps, LocaleType } from './locale';\r\nexport { default as ThemeSwitch } from './theme-switch';\r\nexport { default as AvatarDropdown } from './avatar-dropdown';\r\nexport { default as KeepAlive } from './keep-alive';\r\nexport { default as TenantDropdown } from './tenant-dropdown';\r\nexport { default as LeavePrompt, useLeavePrompt } from './leave-prompt';\r\nexport { default as I18nDropdown } from './i18n-dropdown';\r\nexport { default as CollectProviders } from './collect-providers';\r\nexport { default as Layout } from './layout';\r\nexport enum iceUrqlInstance {\r\n ucenter = \"ucenter\"\r\n}\r\n"],"names":["default","BasicProvider","BasicContext","LocaleType","ThemeSwitch","AvatarDropdown","KeepAlive","TenantDropdown","LeavePrompt","useLeavePrompt","I18nDropdown","CollectProviders","Layout","iceUrqlInstance","ucenter"],"mappings":"AAAA,SAASA,WAAWC,aAAa,EAAEC,YAAY,EAA2BC,UAAU,QAAQ,iBAAW;AACvG,SAASH,WAAWI,WAAW,QAAQ,uBAAiB;AACxD,SAASJ,WAAWK,cAAc,QAAQ,0BAAoB;AAC9D,SAASL,WAAWM,SAAS,QAAQ,qBAAe;AACpD,SAASN,WAAWO,cAAc,QAAQ,0BAAoB;AAC9D,SAASP,WAAWQ,WAAW,EAAEC,cAAc,QAAQ,uBAAiB;AACxE,SAAST,WAAWU,YAAY,QAAQ,wBAAkB;AAC1D,SAASV,WAAWW,gBAAgB,QAAQ,4BAAsB;AAClE,SAASX,WAAWY,MAAM,QAAQ,iBAAW;WACtC;UAAKC,eAAe;IAAfA,gBACVC,aAAAA;GADUD,oBAAAA"}
1
+ {"version":3,"sources":["D:\\codeing\\git\\github\\knockout-js\\packages\\layout\\src\\components\\index.ts"],"sourcesContent":["export { default as BasicProvider, BasicContext, type BasicProviderProps, LocaleType } from './locale';\r\nexport { default as ThemeSwitch } from './theme-switch';\r\nexport { default as AvatarDropdown } from './avatar-dropdown';\r\nexport { default as KeepAlive } from './keep-alive';\r\nexport { default as TenantDropdown } from './tenant-dropdown';\r\nexport { default as LeavePrompt, useLeavePrompt } from './leave-prompt';\r\nexport { default as I18nDropdown } from './i18n-dropdown';\r\nexport { default as CollectProviders } from './collect-providers';\r\nexport { default as Layout } from './layout';\r\nexport { default as Modal, type ModalProps } from './modal';\r\nexport { default as GatherMenu, type GatherMenuDataSource } from './gather-menu';\r\nexport enum iceUrqlInstance {\r\n ucenter = \"ucenter\"\r\n}\r\n"],"names":["default","BasicProvider","BasicContext","LocaleType","ThemeSwitch","AvatarDropdown","KeepAlive","TenantDropdown","LeavePrompt","useLeavePrompt","I18nDropdown","CollectProviders","Layout","Modal","GatherMenu","iceUrqlInstance","ucenter"],"mappings":"AAAA,SAASA,WAAWC,aAAa,EAAEC,YAAY,EAA2BC,UAAU,QAAQ,iBAAW;AACvG,SAASH,WAAWI,WAAW,QAAQ,uBAAiB;AACxD,SAASJ,WAAWK,cAAc,QAAQ,0BAAoB;AAC9D,SAASL,WAAWM,SAAS,QAAQ,qBAAe;AACpD,SAASN,WAAWO,cAAc,QAAQ,0BAAoB;AAC9D,SAASP,WAAWQ,WAAW,EAAEC,cAAc,QAAQ,uBAAiB;AACxE,SAAST,WAAWU,YAAY,QAAQ,wBAAkB;AAC1D,SAASV,WAAWW,gBAAgB,QAAQ,4BAAsB;AAClE,SAASX,WAAWY,MAAM,QAAQ,iBAAW;AAC7C,SAASZ,WAAWa,KAAK,QAAyB,gBAAU;AAC5D,SAASb,WAAWc,UAAU,QAAmC,sBAAgB;WAC1E;UAAKC,eAAe;IAAfA,gBACVC,aAAAA;GADUD,oBAAAA"}
@@ -5,6 +5,7 @@ import { AvatarDropdownProps } from '../avatar-dropdown';
5
5
  import { ThemeSwitchProps } from '../theme-switch';
6
6
  import { ReactNode } from 'react';
7
7
  import { IconFontProps } from '@ant-design/icons/lib/components/IconFont';
8
+ import { GatherMenuProps } from '../gather-menu';
8
9
  export interface LayoutProps {
9
10
  /**
10
11
  * 应用code
@@ -18,6 +19,10 @@ export interface LayoutProps {
18
19
  * 菜单启用iconfont
19
20
  */
20
21
  IconFont?: React.FC<IconFontProps<string>>;
22
+ /**
23
+ * 集成菜单
24
+ */
25
+ gatherMenuProps?: GatherMenuProps;
21
26
  /**
22
27
  * I18nDropdown组件对应的参数
23
28
  */