@etsoo/react 1.5.78 → 1.5.81

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 (255) hide show
  1. package/README.md +7 -2
  2. package/__tests__/ReactUtils.ts +6 -0
  3. package/lib/{mu → components}/DnDList.d.ts +1 -14
  4. package/lib/{mu → components}/DnDList.js +1 -24
  5. package/lib/components/GridMethodRef.d.ts +11 -0
  6. package/lib/{mu → components}/GridMethodRef.js +0 -0
  7. package/lib/components/ScrollerGrid.d.ts +6 -6
  8. package/lib/components/ScrollerList.d.ts +3 -3
  9. package/lib/index.d.ts +2 -74
  10. package/lib/index.js +2 -75
  11. package/lib/notifier/Notifier.d.ts +2 -3
  12. package/lib/uses/useWindowScroll.d.ts +10 -0
  13. package/lib/uses/useWindowScroll.js +46 -0
  14. package/lib/uses/useWindowSize.js +11 -5
  15. package/package.json +9 -21
  16. package/src/{mu → components}/DnDList.tsx +11 -34
  17. package/src/components/GridMethodRef.ts +12 -0
  18. package/src/components/ScrollerGrid.tsx +6 -6
  19. package/src/components/ScrollerList.tsx +5 -3
  20. package/src/index.ts +2 -78
  21. package/src/notifier/Notifier.ts +2 -3
  22. package/src/uses/useWindowScroll.ts +60 -0
  23. package/src/uses/useWindowSize.ts +14 -5
  24. package/__tests__/mu/MUGlobalTests.tsx +0 -58
  25. package/__tests__/mu/NotifierMUTests.tsx +0 -213
  26. package/lib/app/CommonApp.d.ts +0 -39
  27. package/lib/app/CommonApp.js +0 -149
  28. package/lib/app/IServiceAppSettings.d.ts +0 -11
  29. package/lib/app/IServiceAppSettings.js +0 -1
  30. package/lib/app/IServicePage.d.ts +0 -6
  31. package/lib/app/IServicePage.js +0 -1
  32. package/lib/app/IServiceUser.d.ts +0 -14
  33. package/lib/app/IServiceUser.js +0 -1
  34. package/lib/app/ISmartERPUser.d.ts +0 -14
  35. package/lib/app/ISmartERPUser.js +0 -1
  36. package/lib/app/Labels.d.ts +0 -65
  37. package/lib/app/Labels.js +0 -62
  38. package/lib/app/ReactApp.d.ts +0 -194
  39. package/lib/app/ReactApp.js +0 -298
  40. package/lib/app/ServiceApp.d.ts +0 -78
  41. package/lib/app/ServiceApp.js +0 -244
  42. package/lib/components/ShowDataComparison.d.ts +0 -20
  43. package/lib/components/ShowDataComparison.js +0 -60
  44. package/lib/mu/AuditDisplay.d.ts +0 -33
  45. package/lib/mu/AuditDisplay.js +0 -52
  46. package/lib/mu/AutocompleteExtendedProps.d.ts +0 -66
  47. package/lib/mu/AutocompleteExtendedProps.js +0 -1
  48. package/lib/mu/BackButton.d.ts +0 -13
  49. package/lib/mu/BackButton.js +0 -33
  50. package/lib/mu/BridgeCloseButton.d.ts +0 -23
  51. package/lib/mu/BridgeCloseButton.js +0 -32
  52. package/lib/mu/ButtonLink.d.ts +0 -17
  53. package/lib/mu/ButtonLink.js +0 -19
  54. package/lib/mu/ComboBox.d.ts +0 -40
  55. package/lib/mu/ComboBox.js +0 -108
  56. package/lib/mu/CountdownButton.d.ts +0 -23
  57. package/lib/mu/CountdownButton.js +0 -81
  58. package/lib/mu/CustomFabProps.d.ts +0 -27
  59. package/lib/mu/CustomFabProps.js +0 -1
  60. package/lib/mu/DataGridEx.d.ts +0 -96
  61. package/lib/mu/DataGridEx.js +0 -331
  62. package/lib/mu/DataGridRenderers.d.ts +0 -22
  63. package/lib/mu/DataGridRenderers.js +0 -99
  64. package/lib/mu/DialogButton.d.ts +0 -54
  65. package/lib/mu/DialogButton.js +0 -45
  66. package/lib/mu/DraggablePaperComponent.d.ts +0 -8
  67. package/lib/mu/DraggablePaperComponent.js +0 -12
  68. package/lib/mu/EmailInput.d.ts +0 -11
  69. package/lib/mu/EmailInput.js +0 -15
  70. package/lib/mu/FabBox.d.ts +0 -21
  71. package/lib/mu/FabBox.js +0 -31
  72. package/lib/mu/FlexBox.d.ts +0 -14
  73. package/lib/mu/FlexBox.js +0 -18
  74. package/lib/mu/GridDataFormat.d.ts +0 -10
  75. package/lib/mu/GridDataFormat.js +0 -43
  76. package/lib/mu/GridMethodRef.d.ts +0 -11
  77. package/lib/mu/IconButtonLink.d.ts +0 -17
  78. package/lib/mu/IconButtonLink.js +0 -16
  79. package/lib/mu/InputField.d.ts +0 -21
  80. package/lib/mu/InputField.js +0 -39
  81. package/lib/mu/ItemList.d.ts +0 -55
  82. package/lib/mu/ItemList.js +0 -77
  83. package/lib/mu/ListItemRightIcon.d.ts +0 -4
  84. package/lib/mu/ListItemRightIcon.js +0 -8
  85. package/lib/mu/ListMoreDisplay.d.ts +0 -35
  86. package/lib/mu/ListMoreDisplay.js +0 -99
  87. package/lib/mu/LoadingButton.d.ts +0 -16
  88. package/lib/mu/LoadingButton.js +0 -41
  89. package/lib/mu/MUGlobal.d.ts +0 -102
  90. package/lib/mu/MUGlobal.js +0 -184
  91. package/lib/mu/MaskInput.d.ts +0 -34
  92. package/lib/mu/MaskInput.js +0 -43
  93. package/lib/mu/MobileListItemRenderer.d.ts +0 -17
  94. package/lib/mu/MobileListItemRenderer.js +0 -35
  95. package/lib/mu/MoreFab.d.ts +0 -45
  96. package/lib/mu/MoreFab.js +0 -95
  97. package/lib/mu/NotifierMU.d.ts +0 -47
  98. package/lib/mu/NotifierMU.js +0 -387
  99. package/lib/mu/NotifierPromptProps.d.ts +0 -22
  100. package/lib/mu/NotifierPromptProps.js +0 -1
  101. package/lib/mu/OptionGroup.d.ts +0 -62
  102. package/lib/mu/OptionGroup.js +0 -81
  103. package/lib/mu/PList.d.ts +0 -15
  104. package/lib/mu/PList.js +0 -12
  105. package/lib/mu/ProgressCount.d.ts +0 -44
  106. package/lib/mu/ProgressCount.js +0 -79
  107. package/lib/mu/PullToRefreshUI.d.ts +0 -9
  108. package/lib/mu/PullToRefreshUI.js +0 -18
  109. package/lib/mu/RLink.d.ts +0 -14
  110. package/lib/mu/RLink.js +0 -37
  111. package/lib/mu/ResponsibleContainer.d.ts +0 -89
  112. package/lib/mu/ResponsibleContainer.js +0 -159
  113. package/lib/mu/ScrollTopFab.d.ts +0 -7
  114. package/lib/mu/ScrollTopFab.js +0 -25
  115. package/lib/mu/ScrollerListEx.d.ts +0 -81
  116. package/lib/mu/ScrollerListEx.js +0 -167
  117. package/lib/mu/SearchBar.d.ts +0 -29
  118. package/lib/mu/SearchBar.js +0 -262
  119. package/lib/mu/SearchField.d.ts +0 -21
  120. package/lib/mu/SearchField.js +0 -39
  121. package/lib/mu/SearchOptionGroup.d.ts +0 -9
  122. package/lib/mu/SearchOptionGroup.js +0 -14
  123. package/lib/mu/SelectBool.d.ts +0 -14
  124. package/lib/mu/SelectBool.js +0 -22
  125. package/lib/mu/SelectEx.d.ts +0 -54
  126. package/lib/mu/SelectEx.js +0 -156
  127. package/lib/mu/Switch.d.ts +0 -29
  128. package/lib/mu/Switch.js +0 -34
  129. package/lib/mu/SwitchAnt.d.ts +0 -25
  130. package/lib/mu/SwitchAnt.js +0 -40
  131. package/lib/mu/TabBox.d.ts +0 -54
  132. package/lib/mu/TabBox.js +0 -31
  133. package/lib/mu/TableEx.d.ts +0 -68
  134. package/lib/mu/TableEx.js +0 -271
  135. package/lib/mu/TextFieldEx.d.ts +0 -101
  136. package/lib/mu/TextFieldEx.js +0 -127
  137. package/lib/mu/Tiplist.d.ts +0 -18
  138. package/lib/mu/Tiplist.js +0 -158
  139. package/lib/mu/TooltipClick.d.ts +0 -15
  140. package/lib/mu/TooltipClick.js +0 -40
  141. package/lib/mu/UserAvatar.d.ts +0 -24
  142. package/lib/mu/UserAvatar.js +0 -25
  143. package/lib/mu/UserAvatarEditor.d.ts +0 -53
  144. package/lib/mu/UserAvatarEditor.js +0 -129
  145. package/lib/mu/pages/CommonPage.d.ts +0 -11
  146. package/lib/mu/pages/CommonPage.js +0 -60
  147. package/lib/mu/pages/CommonPageProps.d.ts +0 -60
  148. package/lib/mu/pages/CommonPageProps.js +0 -1
  149. package/lib/mu/pages/DataGridPage.d.ts +0 -9
  150. package/lib/mu/pages/DataGridPage.js +0 -81
  151. package/lib/mu/pages/DataGridPageProps.d.ts +0 -17
  152. package/lib/mu/pages/DataGridPageProps.js +0 -1
  153. package/lib/mu/pages/EditPage.d.ts +0 -33
  154. package/lib/mu/pages/EditPage.js +0 -29
  155. package/lib/mu/pages/FixedListPage.d.ts +0 -15
  156. package/lib/mu/pages/FixedListPage.js +0 -72
  157. package/lib/mu/pages/ListPage.d.ts +0 -9
  158. package/lib/mu/pages/ListPage.js +0 -51
  159. package/lib/mu/pages/ListPageProps.d.ts +0 -7
  160. package/lib/mu/pages/ListPageProps.js +0 -1
  161. package/lib/mu/pages/ResponsivePage.d.ts +0 -9
  162. package/lib/mu/pages/ResponsivePage.js +0 -45
  163. package/lib/mu/pages/ResponsivePageProps.d.ts +0 -39
  164. package/lib/mu/pages/ResponsivePageProps.js +0 -1
  165. package/lib/mu/pages/SearchPageProps.d.ts +0 -30
  166. package/lib/mu/pages/SearchPageProps.js +0 -1
  167. package/lib/mu/pages/TablePage.d.ts +0 -9
  168. package/lib/mu/pages/TablePage.js +0 -71
  169. package/lib/mu/pages/TablePageProps.d.ts +0 -7
  170. package/lib/mu/pages/TablePageProps.js +0 -1
  171. package/lib/mu/pages/ViewPage.d.ts +0 -66
  172. package/lib/mu/pages/ViewPage.js +0 -105
  173. package/lib/mu/texts/DateText.d.ts +0 -34
  174. package/lib/mu/texts/DateText.js +0 -25
  175. package/lib/mu/texts/MoneyText.d.ts +0 -21
  176. package/lib/mu/texts/MoneyText.js +0 -14
  177. package/lib/mu/texts/NumberText.d.ts +0 -25
  178. package/lib/mu/texts/NumberText.js +0 -14
  179. package/src/app/CommonApp.ts +0 -225
  180. package/src/app/IServiceAppSettings.ts +0 -13
  181. package/src/app/IServicePage.ts +0 -6
  182. package/src/app/IServiceUser.ts +0 -17
  183. package/src/app/ISmartERPUser.ts +0 -16
  184. package/src/app/Labels.ts +0 -77
  185. package/src/app/ReactApp.ts +0 -500
  186. package/src/app/ServiceApp.ts +0 -353
  187. package/src/components/ShowDataComparison.tsx +0 -108
  188. package/src/mu/AuditDisplay.tsx +0 -117
  189. package/src/mu/AutocompleteExtendedProps.ts +0 -84
  190. package/src/mu/BackButton.tsx +0 -55
  191. package/src/mu/BridgeCloseButton.tsx +0 -69
  192. package/src/mu/ButtonLink.tsx +0 -32
  193. package/src/mu/ComboBox.tsx +0 -244
  194. package/src/mu/CountdownButton.tsx +0 -119
  195. package/src/mu/CustomFabProps.ts +0 -32
  196. package/src/mu/DataGridEx.tsx +0 -712
  197. package/src/mu/DataGridRenderers.tsx +0 -140
  198. package/src/mu/DialogButton.tsx +0 -163
  199. package/src/mu/DraggablePaperComponent.tsx +0 -19
  200. package/src/mu/EmailInput.tsx +0 -24
  201. package/src/mu/FabBox.tsx +0 -51
  202. package/src/mu/FlexBox.tsx +0 -20
  203. package/src/mu/GridDataFormat.tsx +0 -77
  204. package/src/mu/GridMethodRef.ts +0 -12
  205. package/src/mu/IconButtonLink.tsx +0 -29
  206. package/src/mu/InputField.tsx +0 -82
  207. package/src/mu/ItemList.tsx +0 -201
  208. package/src/mu/ListItemRightIcon.tsx +0 -9
  209. package/src/mu/ListMoreDisplay.tsx +0 -205
  210. package/src/mu/LoadingButton.tsx +0 -75
  211. package/src/mu/MUGlobal.ts +0 -220
  212. package/src/mu/MaskInput.tsx +0 -107
  213. package/src/mu/MobileListItemRenderer.tsx +0 -79
  214. package/src/mu/MoreFab.tsx +0 -211
  215. package/src/mu/NotifierMU.tsx +0 -654
  216. package/src/mu/NotifierPromptProps.ts +0 -26
  217. package/src/mu/OptionGroup.tsx +0 -218
  218. package/src/mu/PList.tsx +0 -27
  219. package/src/mu/ProgressCount.tsx +0 -166
  220. package/src/mu/PullToRefreshUI.tsx +0 -21
  221. package/src/mu/RLink.tsx +0 -64
  222. package/src/mu/ResponsibleContainer.tsx +0 -394
  223. package/src/mu/ScrollTopFab.tsx +0 -34
  224. package/src/mu/ScrollerListEx.tsx +0 -387
  225. package/src/mu/SearchBar.tsx +0 -398
  226. package/src/mu/SearchField.tsx +0 -82
  227. package/src/mu/SearchOptionGroup.tsx +0 -25
  228. package/src/mu/SelectBool.tsx +0 -40
  229. package/src/mu/SelectEx.tsx +0 -285
  230. package/src/mu/Switch.tsx +0 -94
  231. package/src/mu/SwitchAnt.tsx +0 -95
  232. package/src/mu/TabBox.tsx +0 -118
  233. package/src/mu/TableEx.tsx +0 -561
  234. package/src/mu/TextFieldEx.tsx +0 -250
  235. package/src/mu/Tiplist.tsx +0 -304
  236. package/src/mu/TooltipClick.tsx +0 -84
  237. package/src/mu/UserAvatar.tsx +0 -64
  238. package/src/mu/UserAvatarEditor.tsx +0 -287
  239. package/src/mu/pages/CommonPage.tsx +0 -128
  240. package/src/mu/pages/CommonPageProps.ts +0 -71
  241. package/src/mu/pages/DataGridPage.tsx +0 -137
  242. package/src/mu/pages/DataGridPageProps.ts +0 -24
  243. package/src/mu/pages/EditPage.tsx +0 -114
  244. package/src/mu/pages/FixedListPage.tsx +0 -134
  245. package/src/mu/pages/ListPage.tsx +0 -86
  246. package/src/mu/pages/ListPageProps.ts +0 -11
  247. package/src/mu/pages/ResponsivePage.tsx +0 -68
  248. package/src/mu/pages/ResponsivePageProps.ts +0 -57
  249. package/src/mu/pages/SearchPageProps.ts +0 -39
  250. package/src/mu/pages/TablePage.tsx +0 -119
  251. package/src/mu/pages/TablePageProps.ts +0 -11
  252. package/src/mu/pages/ViewPage.tsx +0 -285
  253. package/src/mu/texts/DateText.tsx +0 -74
  254. package/src/mu/texts/MoneyText.tsx +0 -49
  255. package/src/mu/texts/NumberText.tsx +0 -40
@@ -1,102 +0,0 @@
1
- /// <reference types="react" />
2
- import { ListItemButtonProps, Theme } from '@mui/material';
3
- /**
4
- * Mouse event handler with data
5
- */
6
- export declare type MouseEventWithDataHandler<T> = (event: React.MouseEvent<HTMLDivElement>, data: T) => void;
7
- /**
8
- * MUGlobal for global configurations
9
- */
10
- export declare class MUGlobal {
11
- /**
12
- * Search field shrink
13
- */
14
- static searchFieldShrink: boolean;
15
- /**
16
- * Search field size
17
- */
18
- static searchFieldSize: 'small' | 'medium';
19
- /**
20
- * Search field variant
21
- */
22
- static searchFieldVariant: 'standard' | 'filled' | 'outlined';
23
- /**
24
- * Input field shrink
25
- */
26
- static inputFieldShrink: boolean;
27
- /**
28
- * Input field size
29
- */
30
- static inputFieldSize: 'small' | 'medium';
31
- /**
32
- * Input field variant
33
- */
34
- static inputFieldVariant: 'standard' | 'filled' | 'outlined';
35
- /**
36
- * TextField variant
37
- */
38
- static textFieldVariant: 'standard' | 'filled' | 'outlined';
39
- /**
40
- * Page default paddings
41
- */
42
- static pagePaddings: {
43
- xs: number;
44
- sm: number;
45
- };
46
- /**
47
- * Get menu item props
48
- * @param path Current path
49
- * @param href Item's href
50
- * @returns Props
51
- */
52
- static getMenuItem(path: string, href: string): ListItemButtonProps<"div", {}>;
53
- /**
54
- * Update object number properties with half of it
55
- * @param input Input object
56
- * @returns Updated object
57
- */
58
- static half(input: object): {};
59
- /**
60
- * Reverse object number properties, like 5 to -5
61
- * @param input Input object
62
- * @returns Updated object
63
- */
64
- static reverse(input: object): {};
65
- /**
66
- * Update object number properties with adjustment
67
- * @param input Input object
68
- * @param adjust Adjust value or new size object
69
- * @param field Specific field
70
- * @returns Updated object
71
- */
72
- static increase(input: object, adjust: number | object, field?: string): {};
73
- /**
74
- * Adjust size with theme update
75
- * @param size Base size
76
- * @param adjust Adjustment
77
- * @param updateFunc Theme update function
78
- * @returns Updated object
79
- */
80
- static adjustWithTheme(size: number, adjust: object, updateFunc: (value: number) => string): {};
81
- /**
82
- * Break points defined
83
- */
84
- static breakpoints: readonly ["xs", "sm", "md", "lg", "xl"];
85
- /**
86
- * Get multple medias theme space
87
- * Responsive values and Breakpoints as an object
88
- * xs = theme.breakpoints.up('xs')
89
- * https://mui.com/system/basics/
90
- * @param spaces Spaces
91
- * @param theme Theme
92
- * @returns Result
93
- */
94
- static getSpace(spaces: object, theme: Theme): number;
95
- /**
96
- * Update object number properties with theme
97
- * @param input Input object
98
- * @param updateFunc Theme update function
99
- * @returns Updated object
100
- */
101
- static updateWithTheme(input: {}, updateFunc: (value: number) => string): {};
102
- }
@@ -1,184 +0,0 @@
1
- import { NumberUtils } from '@etsoo/shared';
2
- import { RLink } from './RLink';
3
- /**
4
- * MUGlobal for global configurations
5
- */
6
- export class MUGlobal {
7
- /**
8
- * Get menu item props
9
- * @param path Current path
10
- * @param href Item's href
11
- * @returns Props
12
- */
13
- static getMenuItem(path, href) {
14
- let selected = false;
15
- if (path === href) {
16
- // Exact match, most common case
17
- selected = true;
18
- }
19
- else if (href.endsWith('*')) {
20
- href = href.slice(0, -1);
21
- selected = path.startsWith(href);
22
- }
23
- else if (href.endsWith('/all')) {
24
- selected = path.startsWith(href.slice(0, -3));
25
- }
26
- return {
27
- component: RLink,
28
- selected,
29
- href,
30
- sx: {
31
- ...(selected && {
32
- '.MuiListItemIcon-root': {
33
- color: (theme) => theme.palette.primary.main
34
- }
35
- })
36
- }
37
- };
38
- }
39
- /**
40
- * Update object number properties with half of it
41
- * @param input Input object
42
- * @returns Updated object
43
- */
44
- static half(input) {
45
- const newObj = { ...input };
46
- Object.entries(newObj).forEach(([key, value]) => {
47
- if (typeof value === 'number') {
48
- Reflect.set(newObj, key, value / 2.0);
49
- }
50
- });
51
- return newObj;
52
- }
53
- /**
54
- * Reverse object number properties, like 5 to -5
55
- * @param input Input object
56
- * @returns Updated object
57
- */
58
- static reverse(input) {
59
- const newObj = { ...input };
60
- Object.entries(newObj).forEach(([key, value]) => {
61
- if (typeof value === 'number') {
62
- Reflect.set(newObj, key, -value);
63
- }
64
- });
65
- return newObj;
66
- }
67
- /**
68
- * Update object number properties with adjustment
69
- * @param input Input object
70
- * @param adjust Adjust value or new size object
71
- * @param field Specific field
72
- * @returns Updated object
73
- */
74
- static increase(input, adjust, field) {
75
- const newObj = { ...input };
76
- Object.entries(newObj).forEach(([key, value]) => {
77
- if (typeof value === 'number') {
78
- if (field == null || field === key) {
79
- const adjustValue = typeof adjust === 'number'
80
- ? adjust
81
- : Reflect.get(adjust, key);
82
- if (adjustValue == null || typeof adjustValue !== 'number')
83
- return;
84
- Reflect.set(newObj, key, value + adjustValue);
85
- }
86
- }
87
- });
88
- return newObj;
89
- }
90
- /**
91
- * Adjust size with theme update
92
- * @param size Base size
93
- * @param adjust Adjustment
94
- * @param updateFunc Theme update function
95
- * @returns Updated object
96
- */
97
- static adjustWithTheme(size, adjust, updateFunc) {
98
- const newObj = { ...adjust };
99
- Object.entries(newObj).forEach(([key, value]) => {
100
- if (typeof value === 'number') {
101
- const newValue = NumberUtils.parseWithUnit(updateFunc(value));
102
- if (newValue != null) {
103
- Reflect.set(newObj, key, `${size - newValue[0]}${newValue[1]}`);
104
- }
105
- }
106
- });
107
- return newObj;
108
- }
109
- /**
110
- * Get multple medias theme space
111
- * Responsive values and Breakpoints as an object
112
- * xs = theme.breakpoints.up('xs')
113
- * https://mui.com/system/basics/
114
- * @param spaces Spaces
115
- * @param theme Theme
116
- * @returns Result
117
- */
118
- static getSpace(spaces, theme) {
119
- const start = this.breakpoints.length - 1;
120
- for (let i = start; i >= 0; i--) {
121
- const key = this.breakpoints[i];
122
- const value = Reflect.get(spaces, key);
123
- if (typeof value === 'number') {
124
- const mediaRaw = theme.breakpoints.up(key);
125
- const mediaQuery = mediaRaw.substring(mediaRaw.indexOf('('));
126
- if (window.matchMedia(mediaQuery).matches) {
127
- return parseInt(theme.spacing(value), 10);
128
- }
129
- }
130
- }
131
- return 0;
132
- }
133
- /**
134
- * Update object number properties with theme
135
- * @param input Input object
136
- * @param updateFunc Theme update function
137
- * @returns Updated object
138
- */
139
- static updateWithTheme(input, updateFunc) {
140
- const newObj = { ...input };
141
- Object.entries(newObj).forEach(([key, value]) => {
142
- if (typeof value === 'number') {
143
- Reflect.set(newObj, key, updateFunc(value));
144
- }
145
- });
146
- return newObj;
147
- }
148
- }
149
- /**
150
- * Search field shrink
151
- */
152
- MUGlobal.searchFieldShrink = true;
153
- /**
154
- * Search field size
155
- */
156
- MUGlobal.searchFieldSize = 'small';
157
- /**
158
- * Search field variant
159
- */
160
- MUGlobal.searchFieldVariant = 'outlined';
161
- /**
162
- * Input field shrink
163
- */
164
- MUGlobal.inputFieldShrink = true;
165
- /**
166
- * Input field size
167
- */
168
- MUGlobal.inputFieldSize = 'medium';
169
- /**
170
- * Input field variant
171
- */
172
- MUGlobal.inputFieldVariant = 'outlined';
173
- /**
174
- * TextField variant
175
- */
176
- MUGlobal.textFieldVariant = 'filled';
177
- /**
178
- * Page default paddings
179
- */
180
- MUGlobal.pagePaddings = { xs: 2, sm: 3 };
181
- /**
182
- * Break points defined
183
- */
184
- MUGlobal.breakpoints = ['xs', 'sm', 'md', 'lg', 'xl'];
@@ -1,34 +0,0 @@
1
- /// <reference types="react" />
2
- import { TextFieldProps } from '@mui/material';
3
- /**
4
- * Mask input props
5
- */
6
- export declare type MaskInputProps<T extends IMask.AnyMaskedOptions> = TextFieldProps & {
7
- /**
8
- * Mask props
9
- */
10
- mask: T;
11
- /**
12
- * Accept hanlder
13
- */
14
- onAccept?: (value: unknown, maskRef: IMask.InputMask<T>, e?: InputEvent) => void;
15
- /**
16
- * Complete handler
17
- */
18
- onComplete?: (value: unknown, maskRef: IMask.InputMask<T>, e?: InputEvent) => void;
19
- /**
20
- * Is the field read only?
21
- */
22
- readOnly?: boolean;
23
- /**
24
- * Search case
25
- */
26
- search?: boolean;
27
- };
28
- /**
29
- * Mask input
30
- * https://imask.js.org/
31
- * @param props Props
32
- * @returns Component
33
- */
34
- export declare function MaskInput<T extends IMask.AnyMaskedOptions = IMask.AnyMaskedOptions>(props: MaskInputProps<T>): JSX.Element;
@@ -1,43 +0,0 @@
1
- import { TextField } from '@mui/material';
2
- import React from 'react';
3
- import { MUGlobal } from './MUGlobal';
4
- import { useIMask } from 'react-imask';
5
- /**
6
- * Mask input
7
- * https://imask.js.org/
8
- * @param props Props
9
- * @returns Component
10
- */
11
- export function MaskInput(props) {
12
- // Destruct
13
- const { defaultValue, mask, InputLabelProps = {}, InputProps = {}, onAccept, onComplete, readOnly, search = false, size = search ? MUGlobal.searchFieldSize : MUGlobal.inputFieldSize, value, variant = search
14
- ? MUGlobal.searchFieldVariant
15
- : MUGlobal.inputFieldVariant, ...rest } = props;
16
- const { ref, maskRef } = useIMask(mask, {
17
- onAccept: (value, maskRef, event) => {
18
- if (onAccept)
19
- onAccept(value, maskRef, event);
20
- },
21
- onComplete: (value, maskRef, event) => {
22
- if (onComplete)
23
- onComplete(value, maskRef, event);
24
- }
25
- });
26
- const localValue = defaultValue !== null && defaultValue !== void 0 ? defaultValue : value;
27
- // Shrink
28
- InputLabelProps.shrink = search
29
- ? MUGlobal.searchFieldShrink
30
- : MUGlobal.inputFieldShrink;
31
- // Read only
32
- if (readOnly != null)
33
- InputProps.readOnly = readOnly;
34
- InputProps.inputRef = ref;
35
- React.useEffect(() => {
36
- if (maskRef.current == null || localValue == null)
37
- return;
38
- maskRef.current.value = String(localValue);
39
- maskRef.current.updateValue();
40
- }, [maskRef.current, localValue]);
41
- // Layout
42
- return (React.createElement(TextField, { InputLabelProps: InputLabelProps, InputProps: InputProps, size: size, variant: variant, ...rest }));
43
- }
@@ -1,17 +0,0 @@
1
- import React from 'react';
2
- import { ListItemReact } from '../components/ListItemReact';
3
- import { ScrollerListExInnerItemRendererProps } from './ScrollerListEx';
4
- /**
5
- * Default mobile list item renderer
6
- * @param param0 List renderer props
7
- * @param margin Margin
8
- * @param renderer Renderer for card content
9
- * @returns Component
10
- */
11
- export declare function MobileListItemRenderer<T>({ data, itemHeight, margins }: ScrollerListExInnerItemRendererProps<T>, renderer: (data: T) => [
12
- string,
13
- string | undefined,
14
- React.ReactNode | (ListItemReact | boolean)[],
15
- React.ReactNode,
16
- React.ReactNode?
17
- ]): JSX.Element;
@@ -1,35 +0,0 @@
1
- import { Card, CardContent, CardHeader, LinearProgress } from '@mui/material';
2
- import React from 'react';
3
- import { MoreFab } from './MoreFab';
4
- /**
5
- * Default mobile list item renderer
6
- * @param param0 List renderer props
7
- * @param margin Margin
8
- * @param renderer Renderer for card content
9
- * @returns Component
10
- */
11
- export function MobileListItemRenderer({ data, itemHeight, margins }, renderer) {
12
- // Loading
13
- if (data == null)
14
- return React.createElement(LinearProgress, null);
15
- // Elements
16
- const [title, subheader, actions, children, cardActions] = renderer(data);
17
- return (React.createElement(Card, { sx: {
18
- height: itemHeight,
19
- ...margins
20
- } },
21
- React.createElement(CardHeader, { sx: { paddingBottom: 0.5 }, action: Array.isArray(actions) ? (React.createElement(MoreFab, { iconButton: true, size: "small", anchorOrigin: {
22
- vertical: 'bottom',
23
- horizontal: 'right'
24
- }, transformOrigin: {
25
- vertical: 'top',
26
- horizontal: 'right'
27
- }, actions: actions })) : (actions), title: title, titleTypographyProps: { variant: 'body2' }, subheader: subheader, subheaderTypographyProps: { variant: 'caption' } }),
28
- React.createElement(CardContent, { sx: {
29
- paddingTop: 0,
30
- paddingBottom: cardActions == null
31
- ? Reflect.get(margins, 'marginBottom')
32
- : 0
33
- } }, children),
34
- cardActions));
35
- }
@@ -1,45 +0,0 @@
1
- import { CustomFabProps } from './CustomFabProps';
2
- import React from 'react';
3
- import { PaperProps, PopoverOrigin } from '@mui/material';
4
- import { ListItemReact } from '../components/ListItemReact';
5
- /**
6
- * More fab props
7
- */
8
- export interface MoreFabProps extends CustomFabProps {
9
- /**
10
- * Actions
11
- */
12
- actions?: (ListItemReact | boolean)[];
13
- /**
14
- * Dray arrow
15
- */
16
- drawArrow?: boolean;
17
- /**
18
- * Main icon
19
- */
20
- icon?: React.ReactNode;
21
- /**
22
- * Show as icon button
23
- */
24
- iconButton?: boolean;
25
- /**
26
- * This is the point on the anchor where the popover's
27
- * `anchorEl` will attach to
28
- */
29
- anchorOrigin?: PopoverOrigin;
30
- /**
31
- * Props applied to the [`Paper`](/api/paper/) element.
32
- * @default {}
33
- */
34
- PaperProps?: Partial<PaperProps>;
35
- /**
36
- * This is the point on the popover which
37
- * will attach to the anchor's origin
38
- */
39
- transformOrigin?: PopoverOrigin;
40
- }
41
- /**
42
- * More fab
43
- * @returns Component
44
- */
45
- export declare function MoreFab(props: MoreFabProps): JSX.Element;
package/lib/mu/MoreFab.js DELETED
@@ -1,95 +0,0 @@
1
- import MoreHorizIcon from '@mui/icons-material/MoreHoriz';
2
- import React from 'react';
3
- import { Divider, Fab, IconButton, ListItemIcon, ListItemText, Menu, MenuItem } from '@mui/material';
4
- import { Link } from 'react-router-dom';
5
- function getActions(input) {
6
- // Actions
7
- const actions = [];
8
- input.forEach((action) => {
9
- if (typeof action === 'boolean')
10
- return;
11
- actions.push(action);
12
- });
13
- return actions;
14
- }
15
- /**
16
- * More fab
17
- * @returns Component
18
- */
19
- export function MoreFab(props) {
20
- // Destruct
21
- const { actions, drawArrow = true, anchorOrigin = {
22
- vertical: 'top',
23
- horizontal: 'right'
24
- }, color = 'primary', icon = React.createElement(MoreHorizIcon, null), iconButton = false, PaperProps = drawArrow
25
- ? {
26
- elevation: 0,
27
- sx: {
28
- overflow: 'visible',
29
- filter: 'drop-shadow(0px 2px 8px rgba(0,0,0,0.32))',
30
- mt: -0.4,
31
- '& .MuiAvatar-root': {
32
- width: 32,
33
- height: 32,
34
- ml: -0.5,
35
- mr: 1
36
- },
37
- '&:before': {
38
- content: '""',
39
- display: 'block',
40
- position: 'absolute',
41
- top: 0,
42
- right: 14,
43
- width: 10,
44
- height: 10,
45
- bgcolor: 'background.paper',
46
- transform: 'translateY(-50%) rotate(45deg)',
47
- zIndex: 0
48
- }
49
- }
50
- }
51
- : undefined, size, title, transformOrigin = {
52
- vertical: 'bottom',
53
- horizontal: 'right'
54
- } } = props;
55
- // State
56
- const [anchorEl, setAnchorEl] = React.useState();
57
- // Open state
58
- const open = Boolean(anchorEl);
59
- // Handle click
60
- const handleClick = (event) => {
61
- setAnchorEl(event.currentTarget);
62
- };
63
- // Handle close
64
- const handleClose = () => {
65
- setAnchorEl(undefined);
66
- };
67
- // No actions
68
- if (actions == null || actions.length == 0)
69
- return React.createElement(React.Fragment, null);
70
- // Actions
71
- const actionsLocal = getActions(actions);
72
- // Has any icon
73
- const hasIcon = actionsLocal.some((action) => action.icon != null);
74
- // Main
75
- const main = iconButton ? (React.createElement(IconButton, { color: color, size: size, title: title, onClick: handleClick }, icon)) : (React.createElement(Fab, { color: color, size: size, title: title, onClick: handleClick }, icon));
76
- return (React.createElement(React.Fragment, null,
77
- main,
78
- React.createElement(Menu, { disableScrollLock: true, anchorEl: anchorEl, anchorOrigin: anchorOrigin, keepMounted: true, transformOrigin: transformOrigin, open: open, onClose: handleClose, PaperProps: PaperProps }, actionsLocal.map(({ label, icon, action }, index) => label === '-' ? (React.createElement(Divider, { key: index })) : (React.createElement(MenuItem, { key: label, ...(typeof action === 'string'
79
- ? action.includes('://')
80
- ? {
81
- component: 'a',
82
- href: action,
83
- target: '_blank'
84
- }
85
- : { component: Link, to: action }
86
- : {
87
- onClick: () => {
88
- handleClose();
89
- if (typeof action === 'function')
90
- action();
91
- }
92
- }) },
93
- icon != null && (React.createElement(ListItemIcon, null, icon)),
94
- React.createElement(ListItemText, { inset: icon == null && hasIcon }, label)))))));
95
- }
@@ -1,47 +0,0 @@
1
- import { NotificationAlign, NotificationRenderProps } from '@etsoo/notificationbase';
2
- import React from 'react';
3
- import { INotificationBaseReact, INotificationReact, NotificationReact, NotifierReact } from '../notifier/Notifier';
4
- /**
5
- * MU notification
6
- */
7
- export declare class NotificationMU extends NotificationReact {
8
- private returnValue;
9
- private createAlert;
10
- private createConfirm;
11
- private createMessageColor;
12
- private createMessage;
13
- private createPrompt;
14
- private createLoading;
15
- /**
16
- * Render method
17
- * @param props Props
18
- * @param className Style class name
19
- * @param classes Style classes
20
- */
21
- render(props: NotificationRenderProps, className: string): JSX.Element;
22
- }
23
- /**
24
- * Antd notifier
25
- */
26
- export declare class NotifierMU extends NotifierReact {
27
- /**
28
- * Create state and return provider
29
- * @param className Style class name
30
- * @returns Provider
31
- */
32
- static setup(className?: string): React.FunctionComponent<React.PropsWithChildren<import("../notifier/Notifier").NotificationReactRenderProps>>;
33
- private static getOrigin;
34
- /**
35
- * Create align container
36
- * @param align Align
37
- * @param children Children
38
- * @param options Other options
39
- */
40
- protected createContainer: (align: NotificationAlign, children: React.ReactNode[]) => JSX.Element;
41
- /**
42
- * Add raw definition
43
- * @param data Notification data definition
44
- * @param modal Show as modal
45
- */
46
- protected addRaw(data: INotificationBaseReact, modal?: boolean): INotificationReact;
47
- }