@webiny/app-scheduler 0.0.0-unstable.0d717d18dd

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 (229) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +11 -0
  3. package/domain/schedulerEntry.d.ts +16 -0
  4. package/domain/schedulerEntry.js +19 -0
  5. package/domain/schedulerEntry.js.map +1 -0
  6. package/features/cancelScheduledAction/CancelScheduledActionGateway.d.ts +11 -0
  7. package/features/cancelScheduledAction/CancelScheduledActionGateway.js +41 -0
  8. package/features/cancelScheduledAction/CancelScheduledActionGateway.js.map +1 -0
  9. package/features/cancelScheduledAction/abstractions.d.ts +11 -0
  10. package/features/cancelScheduledAction/abstractions.js +5 -0
  11. package/features/cancelScheduledAction/abstractions.js.map +1 -0
  12. package/features/cancelScheduledAction/feature.d.ts +1 -0
  13. package/features/cancelScheduledAction/feature.js +11 -0
  14. package/features/cancelScheduledAction/feature.js.map +1 -0
  15. package/features/feature.d.ts +1 -0
  16. package/features/feature.js +19 -0
  17. package/features/feature.js.map +1 -0
  18. package/features/getScheduledAction/GetScheduledActionGateway.d.ts +11 -0
  19. package/features/getScheduledAction/GetScheduledActionGateway.js +57 -0
  20. package/features/getScheduledAction/GetScheduledActionGateway.js.map +1 -0
  21. package/features/getScheduledAction/abstractions.d.ts +13 -0
  22. package/features/getScheduledAction/abstractions.js +5 -0
  23. package/features/getScheduledAction/abstractions.js.map +1 -0
  24. package/features/getScheduledAction/feature.d.ts +1 -0
  25. package/features/getScheduledAction/feature.js +11 -0
  26. package/features/getScheduledAction/feature.js.map +1 -0
  27. package/features/graphqlFields.d.ts +2 -0
  28. package/features/graphqlFields.js +23 -0
  29. package/features/graphqlFields.js.map +1 -0
  30. package/features/listScheduledActions/ListScheduledActionsGateway.d.ts +11 -0
  31. package/features/listScheduledActions/ListScheduledActionsGateway.js +84 -0
  32. package/features/listScheduledActions/ListScheduledActionsGateway.js.map +1 -0
  33. package/features/listScheduledActions/abstractions.d.ts +30 -0
  34. package/features/listScheduledActions/abstractions.js +5 -0
  35. package/features/listScheduledActions/abstractions.js.map +1 -0
  36. package/features/listScheduledActions/feature.d.ts +1 -0
  37. package/features/listScheduledActions/feature.js +11 -0
  38. package/features/listScheduledActions/feature.js.map +1 -0
  39. package/features/schedulePublishAction/SchedulePublishActionGateway.d.ts +11 -0
  40. package/features/schedulePublishAction/SchedulePublishActionGateway.js +67 -0
  41. package/features/schedulePublishAction/SchedulePublishActionGateway.js.map +1 -0
  42. package/features/schedulePublishAction/abstractions.d.ts +16 -0
  43. package/features/schedulePublishAction/abstractions.js +5 -0
  44. package/features/schedulePublishAction/abstractions.js.map +1 -0
  45. package/features/schedulePublishAction/feature.d.ts +1 -0
  46. package/features/schedulePublishAction/feature.js +11 -0
  47. package/features/schedulePublishAction/feature.js.map +1 -0
  48. package/features/scheduleUnpublishAction/ScheduleUnpublishActionGateway.d.ts +11 -0
  49. package/features/scheduleUnpublishAction/ScheduleUnpublishActionGateway.js +71 -0
  50. package/features/scheduleUnpublishAction/ScheduleUnpublishActionGateway.js.map +1 -0
  51. package/features/scheduleUnpublishAction/abstractions.d.ts +16 -0
  52. package/features/scheduleUnpublishAction/abstractions.js +5 -0
  53. package/features/scheduleUnpublishAction/abstractions.js.map +1 -0
  54. package/features/scheduleUnpublishAction/feature.d.ts +1 -0
  55. package/features/scheduleUnpublishAction/feature.js +11 -0
  56. package/features/scheduleUnpublishAction/feature.js.map +1 -0
  57. package/index.d.ts +9 -0
  58. package/index.js +17 -0
  59. package/index.js.map +1 -0
  60. package/package.json +56 -0
  61. package/presentation/SchedulerConfigs/SchedulerConfigs.d.ts +2 -0
  62. package/presentation/SchedulerConfigs/SchedulerConfigs.js +52 -0
  63. package/presentation/SchedulerConfigs/SchedulerConfigs.js.map +1 -0
  64. package/presentation/SchedulerConfigs/index.d.ts +1 -0
  65. package/presentation/SchedulerConfigs/index.js +1 -0
  66. package/presentation/components/Actions/CancelItem/CancelItem.d.ts +2 -0
  67. package/presentation/components/Actions/CancelItem/CancelItem.js +18 -0
  68. package/presentation/components/Actions/CancelItem/CancelItem.js.map +1 -0
  69. package/presentation/components/Actions/CancelItem/index.d.ts +1 -0
  70. package/presentation/components/Actions/CancelItem/index.js +1 -0
  71. package/presentation/components/Actions/index.d.ts +1 -0
  72. package/presentation/components/Actions/index.js +1 -0
  73. package/presentation/components/BottomInfoBar/BottomInfoBar.styled.d.ts +20 -0
  74. package/presentation/components/BottomInfoBar/BottomInfoBar.styled.js +43 -0
  75. package/presentation/components/BottomInfoBar/BottomInfoBar.styled.js.map +1 -0
  76. package/presentation/components/BottomInfoBar/ListMeta.d.ts +7 -0
  77. package/presentation/components/BottomInfoBar/ListMeta.js +9 -0
  78. package/presentation/components/BottomInfoBar/ListMeta.js.map +1 -0
  79. package/presentation/components/BottomInfoBar/ListStatus.d.ts +5 -0
  80. package/presentation/components/BottomInfoBar/ListStatus.js +12 -0
  81. package/presentation/components/BottomInfoBar/ListStatus.js.map +1 -0
  82. package/presentation/components/Cells/CellActions/CellActions.d.ts +2 -0
  83. package/presentation/components/Cells/CellActions/CellActions.js +18 -0
  84. package/presentation/components/Cells/CellActions/CellActions.js.map +1 -0
  85. package/presentation/components/Cells/CellActions/index.d.ts +1 -0
  86. package/presentation/components/Cells/CellActions/index.js +1 -0
  87. package/presentation/components/Cells/CellRevision/CellRevision.d.ts +2 -0
  88. package/presentation/components/Cells/CellRevision/CellRevision.js +15 -0
  89. package/presentation/components/Cells/CellRevision/CellRevision.js.map +1 -0
  90. package/presentation/components/Cells/CellRevision/CellRevision.styled.d.ts +11 -0
  91. package/presentation/components/Cells/CellRevision/CellRevision.styled.js +18 -0
  92. package/presentation/components/Cells/CellRevision/CellRevision.styled.js.map +1 -0
  93. package/presentation/components/Cells/CellRevision/index.d.ts +1 -0
  94. package/presentation/components/Cells/CellRevision/index.js +1 -0
  95. package/presentation/components/Cells/CellScheduledBy/CellScheduledBy.d.ts +2 -0
  96. package/presentation/components/Cells/CellScheduledBy/CellScheduledBy.js +10 -0
  97. package/presentation/components/Cells/CellScheduledBy/CellScheduledBy.js.map +1 -0
  98. package/presentation/components/Cells/CellScheduledBy/index.d.ts +1 -0
  99. package/presentation/components/Cells/CellScheduledBy/index.js +1 -0
  100. package/presentation/components/Cells/CellScheduledOn/CellScheduledOn.d.ts +24 -0
  101. package/presentation/components/Cells/CellScheduledOn/CellScheduledOn.js +19 -0
  102. package/presentation/components/Cells/CellScheduledOn/CellScheduledOn.js.map +1 -0
  103. package/presentation/components/Cells/CellScheduledOn/index.d.ts +1 -0
  104. package/presentation/components/Cells/CellScheduledOn/index.js +1 -0
  105. package/presentation/components/Cells/CellTitle/CellTitle.d.ts +2 -0
  106. package/presentation/components/Cells/CellTitle/CellTitle.js +14 -0
  107. package/presentation/components/Cells/CellTitle/CellTitle.js.map +1 -0
  108. package/presentation/components/Cells/CellTitle/CellTitle.styled.d.ts +11 -0
  109. package/presentation/components/Cells/CellTitle/CellTitle.styled.js +18 -0
  110. package/presentation/components/Cells/CellTitle/CellTitle.styled.js.map +1 -0
  111. package/presentation/components/Cells/CellTitle/index.d.ts +1 -0
  112. package/presentation/components/Cells/CellTitle/index.js +1 -0
  113. package/presentation/components/Cells/CellType/CellActionType.d.ts +2 -0
  114. package/presentation/components/Cells/CellType/CellActionType.js +15 -0
  115. package/presentation/components/Cells/CellType/CellActionType.js.map +1 -0
  116. package/presentation/components/Cells/CellType/CellActionType.styled.d.ts +11 -0
  117. package/presentation/components/Cells/CellType/CellActionType.styled.js +18 -0
  118. package/presentation/components/Cells/CellType/CellActionType.styled.js.map +1 -0
  119. package/presentation/components/Cells/CellType/index.d.ts +1 -0
  120. package/presentation/components/Cells/CellType/index.js +1 -0
  121. package/presentation/components/Cells/index.d.ts +6 -0
  122. package/presentation/components/Cells/index.js +6 -0
  123. package/presentation/components/Empty/Empty.styled.d.ts +8 -0
  124. package/presentation/components/Empty/Empty.styled.js +16 -0
  125. package/presentation/components/Empty/Empty.styled.js.map +1 -0
  126. package/presentation/components/Title/Title.d.ts +5 -0
  127. package/presentation/components/Title/Title.js +10 -0
  128. package/presentation/components/Title/Title.js.map +1 -0
  129. package/presentation/components/Title/Title.styled.d.ts +3 -0
  130. package/presentation/components/Title/Title.styled.js +13 -0
  131. package/presentation/components/Title/Title.styled.js.map +1 -0
  132. package/presentation/components/Title/index.d.ts +1 -0
  133. package/presentation/components/Title/index.js +1 -0
  134. package/presentation/configs/index.d.ts +1 -0
  135. package/presentation/configs/index.js +1 -0
  136. package/presentation/configs/list/Browser/EntryAction.d.ts +8 -0
  137. package/presentation/configs/list/Browser/EntryAction.js +13 -0
  138. package/presentation/configs/list/Browser/EntryAction.js.map +1 -0
  139. package/presentation/configs/list/Browser/Table/Column.d.ts +15 -0
  140. package/presentation/configs/list/Browser/Table/Column.js +11 -0
  141. package/presentation/configs/list/Browser/Table/Column.js.map +1 -0
  142. package/presentation/configs/list/Browser/Table/Sorting.d.ts +5 -0
  143. package/presentation/configs/list/Browser/Table/Sorting.js +7 -0
  144. package/presentation/configs/list/Browser/Table/Sorting.js.map +1 -0
  145. package/presentation/configs/list/Browser/Table/index.d.ts +19 -0
  146. package/presentation/configs/list/Browser/Table/index.js +9 -0
  147. package/presentation/configs/list/Browser/Table/index.js.map +1 -0
  148. package/presentation/configs/list/Browser/index.d.ts +23 -0
  149. package/presentation/configs/list/Browser/index.js +9 -0
  150. package/presentation/configs/list/Browser/index.js.map +1 -0
  151. package/presentation/configs/list/SchedulerListConfig.d.ts +35 -0
  152. package/presentation/configs/list/SchedulerListConfig.js +30 -0
  153. package/presentation/configs/list/SchedulerListConfig.js.map +1 -0
  154. package/presentation/configs/list/index.d.ts +1 -0
  155. package/presentation/configs/list/index.js +1 -0
  156. package/presentation/hooks/index.d.ts +2 -0
  157. package/presentation/hooks/index.js +2 -0
  158. package/presentation/hooks/useCancelSchedulerItem.d.ts +8 -0
  159. package/presentation/hooks/useCancelSchedulerItem.js +32 -0
  160. package/presentation/hooks/useCancelSchedulerItem.js.map +1 -0
  161. package/presentation/hooks/useSchedulerItem.d.ts +11 -0
  162. package/presentation/hooks/useSchedulerItem.js +7 -0
  163. package/presentation/hooks/useSchedulerItem.js.map +1 -0
  164. package/presentation/scheduleDialog/ScheduleDialogPresenter.d.ts +26 -0
  165. package/presentation/scheduleDialog/ScheduleDialogPresenter.js +115 -0
  166. package/presentation/scheduleDialog/ScheduleDialogPresenter.js.map +1 -0
  167. package/presentation/scheduleDialog/abstractions.d.ts +35 -0
  168. package/presentation/scheduleDialog/abstractions.js +5 -0
  169. package/presentation/scheduleDialog/abstractions.js.map +1 -0
  170. package/presentation/scheduleDialog/components/CancelButtonComponent.d.ts +10 -0
  171. package/presentation/scheduleDialog/components/CancelButtonComponent.js +20 -0
  172. package/presentation/scheduleDialog/components/CancelButtonComponent.js.map +1 -0
  173. package/presentation/scheduleDialog/components/FormComponent.d.ts +9 -0
  174. package/presentation/scheduleDialog/components/FormComponent.js +32 -0
  175. package/presentation/scheduleDialog/components/FormComponent.js.map +1 -0
  176. package/presentation/scheduleDialog/components/ReschedulingAlert.d.ts +7 -0
  177. package/presentation/scheduleDialog/components/ReschedulingAlert.js +14 -0
  178. package/presentation/scheduleDialog/components/ReschedulingAlert.js.map +1 -0
  179. package/presentation/scheduleDialog/components/SchedulerDialogFormComponentDateTimeInput.d.ts +24 -0
  180. package/presentation/scheduleDialog/components/SchedulerDialogFormComponentDateTimeInput.js +15 -0
  181. package/presentation/scheduleDialog/components/SchedulerDialogFormComponentDateTimeInput.js.map +1 -0
  182. package/presentation/scheduleDialog/createMinDateValidator.d.ts +7 -0
  183. package/presentation/scheduleDialog/createMinDateValidator.js +14 -0
  184. package/presentation/scheduleDialog/createMinDateValidator.js.map +1 -0
  185. package/presentation/scheduleDialog/feature.d.ts +3 -0
  186. package/presentation/scheduleDialog/feature.js +17 -0
  187. package/presentation/scheduleDialog/feature.js.map +1 -0
  188. package/presentation/scheduleDialog/useScheduleDialog.d.ts +20 -0
  189. package/presentation/scheduleDialog/useScheduleDialog.js +128 -0
  190. package/presentation/scheduleDialog/useScheduleDialog.js.map +1 -0
  191. package/presentation/schedulerList/Scheduler.d.ts +18 -0
  192. package/presentation/schedulerList/Scheduler.js +28 -0
  193. package/presentation/schedulerList/Scheduler.js.map +1 -0
  194. package/presentation/schedulerList/SchedulerListDataSource.d.ts +15 -0
  195. package/presentation/schedulerList/SchedulerListDataSource.js +41 -0
  196. package/presentation/schedulerList/SchedulerListDataSource.js.map +1 -0
  197. package/presentation/schedulerList/SchedulerListPresenter.d.ts +21 -0
  198. package/presentation/schedulerList/SchedulerListPresenter.js +47 -0
  199. package/presentation/schedulerList/SchedulerListPresenter.js.map +1 -0
  200. package/presentation/schedulerList/abstractions.d.ts +13 -0
  201. package/presentation/schedulerList/abstractions.js +5 -0
  202. package/presentation/schedulerList/abstractions.js.map +1 -0
  203. package/presentation/schedulerList/components/BottomInfoBar.d.ts +9 -0
  204. package/presentation/schedulerList/components/BottomInfoBar.js +18 -0
  205. package/presentation/schedulerList/components/BottomInfoBar.js.map +1 -0
  206. package/presentation/schedulerList/components/Empty.d.ts +9 -0
  207. package/presentation/schedulerList/components/Empty.js +21 -0
  208. package/presentation/schedulerList/components/Empty.js.map +1 -0
  209. package/presentation/schedulerList/components/SchedulerListView.d.ts +8 -0
  210. package/presentation/schedulerList/components/SchedulerListView.js +40 -0
  211. package/presentation/schedulerList/components/SchedulerListView.js.map +1 -0
  212. package/presentation/schedulerList/components/SchedulerOverlay.d.ts +11 -0
  213. package/presentation/schedulerList/components/SchedulerOverlay.js +38 -0
  214. package/presentation/schedulerList/components/SchedulerOverlay.js.map +1 -0
  215. package/presentation/schedulerList/components/SchedulerTable.d.ts +9 -0
  216. package/presentation/schedulerList/components/SchedulerTable.js +48 -0
  217. package/presentation/schedulerList/components/SchedulerTable.js.map +1 -0
  218. package/presentation/schedulerList/components/SearchInput.d.ts +9 -0
  219. package/presentation/schedulerList/components/SearchInput.js +30 -0
  220. package/presentation/schedulerList/components/SearchInput.js.map +1 -0
  221. package/presentation/schedulerList/feature.d.ts +3 -0
  222. package/presentation/schedulerList/feature.js +17 -0
  223. package/presentation/schedulerList/feature.js.map +1 -0
  224. package/presentation/schedulerList/useSchedulerListPresenter.d.ts +1 -0
  225. package/presentation/schedulerList/useSchedulerListPresenter.js +6 -0
  226. package/presentation/schedulerList/useSchedulerListPresenter.js.map +1 -0
  227. package/types.d.ts +30 -0
  228. package/types.js +8 -0
  229. package/types.js.map +1 -0
@@ -0,0 +1,48 @@
1
+ import react, { useMemo } from "react";
2
+ import { observer } from "mobx-react-lite";
3
+ import { Table, createRecordsData } from "@webiny/app-aco";
4
+ import { useSchedulerListConfig } from "../../configs/index.js";
5
+ const SchedulerTable = observer(({ presenter })=>{
6
+ const { vm } = presenter.list;
7
+ const { browser } = useSchedulerListConfig();
8
+ const data = useMemo(()=>createRecordsData(vm.rows), [
9
+ vm.rows
10
+ ]);
11
+ const selected = useMemo(()=>{
12
+ const selectedIds = vm.selection.selectedIds;
13
+ return data.filter((row)=>selectedIds.has(row.id));
14
+ }, [
15
+ data,
16
+ vm.selection.selectedIds
17
+ ]);
18
+ const sorting = useMemo(()=>{
19
+ if (!vm.sort) return [];
20
+ return [
21
+ {
22
+ id: vm.sort.field,
23
+ desc: "DESC" === vm.sort.direction
24
+ }
25
+ ];
26
+ }, [
27
+ vm.sort
28
+ ]);
29
+ return /*#__PURE__*/ react.createElement(Table, {
30
+ columns: browser.table.columns,
31
+ data: data,
32
+ loading: vm.pagination.loading,
33
+ onSelectRow: (entries)=>presenter.list.actions.selection.selectRows(entries.map((entry)=>entry.id)),
34
+ sorting: sorting,
35
+ onSortingChange: (sort)=>{
36
+ if ("function" == typeof sort) {
37
+ const newSort = sort(sorting);
38
+ if (newSort.length > 0) presenter.list.actions.sort.set(newSort[0].id, newSort[0].desc ? "DESC" : "ASC");
39
+ }
40
+ },
41
+ selected: selected,
42
+ nameColumnId: "title",
43
+ namespace: "scheduler/list"
44
+ });
45
+ });
46
+ export { SchedulerTable };
47
+
48
+ //# sourceMappingURL=SchedulerTable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presentation/schedulerList/components/SchedulerTable.js","sources":["../../../../src/presentation/schedulerList/components/SchedulerTable.tsx"],"sourcesContent":["import React, { useMemo } from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { createRecordsData, Table as AcoTable } from \"@webiny/app-aco\";\nimport { useSchedulerListConfig } from \"~/presentation/configs/index.js\";\nimport type { SchedulerEntryTableRow } from \"~/types.js\";\nimport type { ISchedulerListPresenter } from \"../abstractions.js\";\n\ninterface SchedulerTableProps {\n presenter: ISchedulerListPresenter;\n}\n\nexport const SchedulerTable = observer(({ presenter }: SchedulerTableProps) => {\n const { vm } = presenter.list;\n const { browser } = useSchedulerListConfig();\n\n const data = useMemo<SchedulerEntryTableRow[]>(() => {\n return createRecordsData(vm.rows);\n }, [vm.rows]);\n\n const selected = useMemo<SchedulerEntryTableRow[]>(() => {\n const selectedIds = vm.selection.selectedIds;\n return data.filter(row => selectedIds.has(row.id));\n }, [data, vm.selection.selectedIds]);\n\n const sorting = useMemo(() => {\n if (!vm.sort) {\n return [];\n }\n return [{ id: vm.sort.field, desc: vm.sort.direction === \"DESC\" }];\n }, [vm.sort]);\n\n return (\n <AcoTable<SchedulerEntryTableRow>\n columns={browser.table.columns}\n data={data}\n loading={vm.pagination.loading}\n onSelectRow={entries =>\n presenter.list.actions.selection.selectRows(entries.map(entry => entry.id))\n }\n sorting={sorting}\n onSortingChange={sort => {\n if (typeof sort === \"function\") {\n const newSort = sort(sorting);\n if (newSort.length > 0) {\n presenter.list.actions.sort.set(\n newSort[0].id,\n newSort[0].desc ? \"DESC\" : \"ASC\"\n );\n }\n }\n }}\n selected={selected}\n nameColumnId={\"title\"}\n namespace={\"scheduler/list\"}\n />\n );\n});\n"],"names":["SchedulerTable","observer","presenter","vm","browser","useSchedulerListConfig","data","useMemo","createRecordsData","selected","selectedIds","row","sorting","AcoTable","entries","entry","sort","newSort"],"mappings":";;;;AAWO,MAAMA,iBAAiBC,SAAS,CAAC,EAAEC,SAAS,EAAuB;IACtE,MAAM,EAAEC,EAAE,EAAE,GAAGD,UAAU,IAAI;IAC7B,MAAM,EAAEE,OAAO,EAAE,GAAGC;IAEpB,MAAMC,OAAOC,QAAkC,IACpCC,kBAAkBL,GAAG,IAAI,GACjC;QAACA,GAAG,IAAI;KAAC;IAEZ,MAAMM,WAAWF,QAAkC;QAC/C,MAAMG,cAAcP,GAAG,SAAS,CAAC,WAAW;QAC5C,OAAOG,KAAK,MAAM,CAACK,CAAAA,MAAOD,YAAY,GAAG,CAACC,IAAI,EAAE;IACpD,GAAG;QAACL;QAAMH,GAAG,SAAS,CAAC,WAAW;KAAC;IAEnC,MAAMS,UAAUL,QAAQ;QACpB,IAAI,CAACJ,GAAG,IAAI,EACR,OAAO,EAAE;QAEb,OAAO;YAAC;gBAAE,IAAIA,GAAG,IAAI,CAAC,KAAK;gBAAE,MAAMA,AAAsB,WAAtBA,GAAG,IAAI,CAAC,SAAS;YAAY;SAAE;IACtE,GAAG;QAACA,GAAG,IAAI;KAAC;IAEZ,OAAO,WAAP,GACI,oBAACU,OAAQA;QACL,SAAST,QAAQ,KAAK,CAAC,OAAO;QAC9B,MAAME;QACN,SAASH,GAAG,UAAU,CAAC,OAAO;QAC9B,aAAaW,CAAAA,UACTZ,UAAU,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,UAAU,CAACY,QAAQ,GAAG,CAACC,CAAAA,QAASA,MAAM,EAAE;QAE7E,SAASH;QACT,iBAAiBI,CAAAA;YACb,IAAI,AAAgB,cAAhB,OAAOA,MAAqB;gBAC5B,MAAMC,UAAUD,KAAKJ;gBACrB,IAAIK,QAAQ,MAAM,GAAG,GACjBf,UAAU,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAC3Be,OAAO,CAAC,EAAE,CAAC,EAAE,EACbA,OAAO,CAAC,EAAE,CAAC,IAAI,GAAG,SAAS;YAGvC;QACJ;QACA,UAAUR;QACV,cAAc;QACd,WAAW;;AAGvB"}
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ import type { ISchedulerListPresenter } from "../abstractions.js";
3
+ interface SearchInputProps {
4
+ presenter: ISchedulerListPresenter;
5
+ }
6
+ export declare const SearchInput: (({ presenter }: SearchInputProps) => React.JSX.Element) & React.NamedExoticComponent<SearchInputProps> & {
7
+ readonly type: ({ presenter }: SearchInputProps) => React.JSX.Element;
8
+ };
9
+ export {};
@@ -0,0 +1,30 @@
1
+ import react from "react";
2
+ import { observer } from "mobx-react-lite";
3
+ import { ReactComponent } from "@webiny/icons/search.svg";
4
+ import { DelayedOnChange, Icon, Input } from "@webiny/admin-ui";
5
+ const SearchInput = observer(({ presenter })=>{
6
+ const { vm } = presenter.list;
7
+ return /*#__PURE__*/ react.createElement(DelayedOnChange, {
8
+ value: vm.search,
9
+ onChange: (value)=>{
10
+ if (value === vm.search) return;
11
+ presenter.list.actions.search.set(value);
12
+ }
13
+ }, ({ value, onChange })=>/*#__PURE__*/ react.createElement(Input, {
14
+ id: "scheduler__search-input",
15
+ value: value,
16
+ onChange: (e)=>onChange(e.target.value),
17
+ forwardEventOnChange: true,
18
+ placeholder: "Search all items",
19
+ "data-testid": "scheduler.search-input",
20
+ startIcon: /*#__PURE__*/ react.createElement(Icon, {
21
+ icon: /*#__PURE__*/ react.createElement(ReactComponent, null),
22
+ label: "Search"
23
+ }),
24
+ size: "md",
25
+ variant: "ghost"
26
+ }));
27
+ });
28
+ export { SearchInput };
29
+
30
+ //# sourceMappingURL=SearchInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presentation/schedulerList/components/SearchInput.js","sources":["../../../../src/presentation/schedulerList/components/SearchInput.tsx"],"sourcesContent":["import React from \"react\";\nimport { observer } from \"mobx-react-lite\";\nimport { ReactComponent as SearchIcon } from \"@webiny/icons/search.svg\";\nimport { DelayedOnChange, Icon, Input } from \"@webiny/admin-ui\";\nimport type { ISchedulerListPresenter } from \"../abstractions.js\";\n\ninterface SearchInputProps {\n presenter: ISchedulerListPresenter;\n}\n\nexport const SearchInput = observer(({ presenter }: SearchInputProps) => {\n const { vm } = presenter.list;\n\n return (\n <DelayedOnChange\n value={vm.search}\n onChange={value => {\n if (value === vm.search) {\n return;\n }\n presenter.list.actions.search.set(value);\n }}\n >\n {({ value, onChange }) => (\n <Input\n id={\"scheduler__search-input\"}\n value={value}\n onChange={e => onChange(e.target.value)}\n forwardEventOnChange={true}\n placeholder={\"Search all items\"}\n data-testid={\"scheduler.search-input\"}\n startIcon={<Icon icon={<SearchIcon />} label=\"Search\" />}\n size={\"md\"}\n variant={\"ghost\"}\n />\n )}\n </DelayedOnChange>\n );\n});\n"],"names":["SearchInput","observer","presenter","vm","DelayedOnChange","value","onChange","Input","e","Icon","SearchIcon"],"mappings":";;;;AAUO,MAAMA,cAAcC,SAAS,CAAC,EAAEC,SAAS,EAAoB;IAChE,MAAM,EAAEC,EAAE,EAAE,GAAGD,UAAU,IAAI;IAE7B,OAAO,WAAP,GACI,oBAACE,iBAAeA;QACZ,OAAOD,GAAG,MAAM;QAChB,UAAUE,CAAAA;YACN,IAAIA,UAAUF,GAAG,MAAM,EACnB;YAEJD,UAAU,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAACG;QACtC;OAEC,CAAC,EAAEA,KAAK,EAAEC,QAAQ,EAAE,iBACjB,oBAACC,OAAKA;YACF,IAAI;YACJ,OAAOF;YACP,UAAUG,CAAAA,IAAKF,SAASE,EAAE,MAAM,CAAC,KAAK;YACtC,sBAAsB;YACtB,aAAa;YACb,eAAa;YACb,yBAAW,oBAACC,MAAIA;gBAAC,oBAAM,oBAACC,gBAAUA;gBAAK,OAAM;;YAC7C,MAAM;YACN,SAAS;;AAK7B"}
@@ -0,0 +1,3 @@
1
+ export declare const SchedulerListPresenterFeature: import("@webiny/feature/admin").FeatureDefinition<{
2
+ presenter: import("./abstractions.js").ISchedulerListPresenter;
3
+ }, []>;
@@ -0,0 +1,17 @@
1
+ import { createFeature } from "@webiny/feature/admin";
2
+ import { SchedulerListPresenter } from "./abstractions.js";
3
+ import { SchedulerListPresenter as external_SchedulerListPresenter_js_SchedulerListPresenter } from "./SchedulerListPresenter.js";
4
+ const SchedulerListPresenterFeature = createFeature({
5
+ name: "Scheduler/ListPresenter",
6
+ register (container) {
7
+ container.register(external_SchedulerListPresenter_js_SchedulerListPresenter).inSingletonScope();
8
+ },
9
+ resolve (container) {
10
+ return {
11
+ presenter: container.resolve(SchedulerListPresenter)
12
+ };
13
+ }
14
+ });
15
+ export { SchedulerListPresenterFeature };
16
+
17
+ //# sourceMappingURL=feature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presentation/schedulerList/feature.js","sources":["../../../src/presentation/schedulerList/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/admin\";\nimport { SchedulerListPresenter as PresenterAbstraction } from \"./abstractions.js\";\nimport { SchedulerListPresenter } from \"./SchedulerListPresenter.js\";\n\nexport const SchedulerListPresenterFeature = createFeature({\n name: \"Scheduler/ListPresenter\",\n register(container) {\n container.register(SchedulerListPresenter).inSingletonScope();\n },\n resolve(container) {\n return { presenter: container.resolve(PresenterAbstraction) };\n }\n});\n"],"names":["SchedulerListPresenterFeature","createFeature","container","SchedulerListPresenter","PresenterAbstraction"],"mappings":";;;AAIO,MAAMA,gCAAgCC,cAAc;IACvD,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC,2DAAwB,gBAAgB;IAC/D;IACA,SAAQD,SAAS;QACb,OAAO;YAAE,WAAWA,UAAU,OAAO,CAACE;QAAsB;IAChE;AACJ"}
@@ -0,0 +1 @@
1
+ export declare const useSchedulerListPresenter: () => import("./abstractions.js").ISchedulerListPresenter;
@@ -0,0 +1,6 @@
1
+ import { useFeature } from "@webiny/app";
2
+ import { SchedulerListPresenterFeature } from "./feature.js";
3
+ const useSchedulerListPresenter = ()=>useFeature(SchedulerListPresenterFeature).presenter;
4
+ export { useSchedulerListPresenter };
5
+
6
+ //# sourceMappingURL=useSchedulerListPresenter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"presentation/schedulerList/useSchedulerListPresenter.js","sources":["../../../src/presentation/schedulerList/useSchedulerListPresenter.ts"],"sourcesContent":["import { useFeature } from \"@webiny/app\";\nimport { SchedulerListPresenterFeature } from \"./feature.js\";\n\nexport const useSchedulerListPresenter = () => {\n return useFeature(SchedulerListPresenterFeature).presenter;\n};\n"],"names":["useSchedulerListPresenter","useFeature","SchedulerListPresenterFeature"],"mappings":";;AAGO,MAAMA,4BAA4B,IAC9BC,WAAWC,+BAA+B,SAAS"}
package/types.d.ts ADDED
@@ -0,0 +1,30 @@
1
+ import type { CmsIdentity } from "@webiny/app-headless-cms-common/types/index.js";
2
+ import type { TableRow } from "@webiny/app-aco";
3
+ type SchedulerIdentity = Pick<CmsIdentity, "id" | "displayName" | "type">;
4
+ export type { SchedulerIdentity };
5
+ export declare enum ScheduleActionType {
6
+ publish = "publish",
7
+ unpublish = "unpublish"
8
+ }
9
+ export interface SchedulerErrorResponse {
10
+ code: string;
11
+ message: string;
12
+ data?: Record<string, any>;
13
+ stack?: string;
14
+ }
15
+ export interface SchedulerMetaResponse {
16
+ totalCount: number;
17
+ cursor: string | null;
18
+ hasMoreItems: boolean;
19
+ }
20
+ export interface SchedulerEntry {
21
+ id: string;
22
+ targetId: string;
23
+ namespace: string;
24
+ scheduledBy: SchedulerIdentity;
25
+ publishOn?: Date;
26
+ unpublishOn?: Date;
27
+ actionType: ScheduleActionType;
28
+ title: string;
29
+ }
30
+ export type SchedulerEntryTableRow = TableRow<SchedulerEntry>;
package/types.js ADDED
@@ -0,0 +1,8 @@
1
+ var types_ScheduleActionType = /*#__PURE__*/ function(ScheduleActionType) {
2
+ ScheduleActionType["publish"] = "publish";
3
+ ScheduleActionType["unpublish"] = "unpublish";
4
+ return ScheduleActionType;
5
+ }({});
6
+ export { types_ScheduleActionType as ScheduleActionType };
7
+
8
+ //# sourceMappingURL=types.js.map
package/types.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sources":["../src/types.ts"],"sourcesContent":["import type { CmsIdentity } from \"@webiny/app-headless-cms-common/types/index.js\";\nimport type { TableRow } from \"@webiny/app-aco\";\n\ntype SchedulerIdentity = Pick<CmsIdentity, \"id\" | \"displayName\" | \"type\">;\n\nexport type { SchedulerIdentity };\n\nexport enum ScheduleActionType {\n publish = \"publish\",\n unpublish = \"unpublish\"\n}\n\nexport interface SchedulerErrorResponse {\n code: string;\n message: string;\n data?: Record<string, any>;\n stack?: string;\n}\n\nexport interface SchedulerMetaResponse {\n totalCount: number;\n cursor: string | null;\n hasMoreItems: boolean;\n}\n\nexport interface SchedulerEntry {\n id: string;\n targetId: string;\n namespace: string;\n scheduledBy: SchedulerIdentity;\n publishOn?: Date;\n unpublishOn?: Date;\n actionType: ScheduleActionType;\n title: string;\n}\n\nexport type SchedulerEntryTableRow = TableRow<SchedulerEntry>;\n"],"names":["ScheduleActionType"],"mappings":"AAOO,IAAKA,2BAAkBA,WAAAA,GAAAA,SAAlBA,kBAAkB;;;WAAlBA"}