@funcd-dev/ui 0.0.0-bootstrap.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 (200) hide show
  1. package/Readme.md +10 -0
  2. package/dist/atoms/index.d.ts +1 -0
  3. package/dist/atoms/logo/cnd.d.ts +6 -0
  4. package/dist/atoms/logo/index.d.ts +1 -0
  5. package/dist/auth/auth.context.d.ts +3 -0
  6. package/dist/auth/auth.guard.d.ts +7 -0
  7. package/dist/auth/auth.hooks.d.ts +3 -0
  8. package/dist/auth/auth.provider.d.ts +10 -0
  9. package/dist/auth/index.d.ts +4 -0
  10. package/dist/favicon.svg +1 -0
  11. package/dist/hm-flow/components/canvas-form/canvas-form.d.ts +10 -0
  12. package/dist/hm-flow/components/canvas-form/index.d.ts +1 -0
  13. package/dist/hm-flow/components/header-status/header-status.d.ts +11 -0
  14. package/dist/hm-flow/components/header-status/header-status.types.d.ts +13 -0
  15. package/dist/hm-flow/components/header-status/index.d.ts +2 -0
  16. package/dist/hm-flow/components/hm-flow-bottom/hm-flow-bottom.d.ts +7 -0
  17. package/dist/hm-flow/components/hm-flow-bottom/hm-flow-bottom.type.d.ts +5 -0
  18. package/dist/hm-flow/components/hm-flow-bottom/index.d.ts +3 -0
  19. package/dist/hm-flow/components/hm-flow-header/hm-flow-header.d.ts +7 -0
  20. package/dist/hm-flow/components/hm-flow-header/hm-flow-header.type.d.ts +5 -0
  21. package/dist/hm-flow/components/hm-flow-header/index.d.ts +3 -0
  22. package/dist/hm-flow/components/hm-flow-modal/hm-flow-modal.d.ts +11 -0
  23. package/dist/hm-flow/components/hm-flow-modal/hm-flow-modal.type.d.ts +13 -0
  24. package/dist/hm-flow/components/hm-flow-modal/index.d.ts +3 -0
  25. package/dist/hm-flow/components/hm-flow-sidebar/hm-flow-sidebar.d.ts +11 -0
  26. package/dist/hm-flow/components/hm-flow-sidebar/hm-flow-sidebar.type.d.ts +5 -0
  27. package/dist/hm-flow/components/hm-flow-sidebar/index.d.ts +3 -0
  28. package/dist/hm-flow/components/index.d.ts +9 -0
  29. package/dist/hm-flow/components/node-editor/index.d.ts +1 -0
  30. package/dist/hm-flow/components/node-editor/node-editor.d.ts +7 -0
  31. package/dist/hm-flow/components/node-search/index.d.ts +2 -0
  32. package/dist/hm-flow/components/node-search/nodes-item.d.ts +8 -0
  33. package/dist/hm-flow/components/node-search/nodes-search.d.ts +8 -0
  34. package/dist/hm-flow/components/toolbar/index.d.ts +1 -0
  35. package/dist/hm-flow/components/toolbar/toolbar.d.ts +7 -0
  36. package/dist/hm-flow/components/toolbar/toolbar.types.d.ts +17 -0
  37. package/dist/hm-flow/hm-flow-base.d.ts +18 -0
  38. package/dist/hm-flow/hm-flow-base.types.d.ts +61 -0
  39. package/dist/hm-flow/hm-flow.d.ts +18 -0
  40. package/dist/hm-flow/hm-flow.types.d.ts +60 -0
  41. package/dist/hm-flow/hooks/index.d.ts +7 -0
  42. package/dist/hm-flow/hooks/use-hm-flow-children-deps.d.ts +2 -0
  43. package/dist/hm-flow/hooks/use-hm-flow-interactions.d.ts +28 -0
  44. package/dist/hm-flow/hooks/use-hm-flow-service.d.ts +19 -0
  45. package/dist/hm-flow/hooks/use-hm-flow.d.ts +2 -0
  46. package/dist/hm-flow/hooks/use-nodes-edges-handlers.d.ts +21 -0
  47. package/dist/hm-flow/hooks/use-nodes-service.d.ts +11 -0
  48. package/dist/hm-flow/index.d.ts +9 -0
  49. package/dist/hm-flow/node/index.d.ts +4 -0
  50. package/dist/hm-flow/node/node-wrapper.d.ts +9 -0
  51. package/dist/hm-flow/node/node.d.ts +5 -0
  52. package/dist/hm-flow/node/types.d.ts +35 -0
  53. package/dist/hm-flow/node/utils.d.ts +3 -0
  54. package/dist/hm-flow/provider/hm-flow-children-deps-context.d.ts +5 -0
  55. package/dist/hm-flow/provider/hm-flow-children-deps-provider.d.ts +8 -0
  56. package/dist/hm-flow/provider/hm-flow-context.d.ts +5 -0
  57. package/dist/hm-flow/provider/hm-flow-provider.d.ts +8 -0
  58. package/dist/hm-flow/provider/index.d.ts +5 -0
  59. package/dist/hm-flow/utils.d.ts +5 -0
  60. package/dist/index.d.ts +11 -0
  61. package/dist/index.es.js +6905 -0
  62. package/dist/index.umd.js +1 -0
  63. package/dist/layouts/app-layout/app-layout.d.ts +15 -0
  64. package/dist/layouts/app-layout/index.d.ts +1 -0
  65. package/dist/layouts/bottom-bar/bottom-bar-button.d.ts +12 -0
  66. package/dist/layouts/bottom-bar/bottom-bar.d.ts +8 -0
  67. package/dist/layouts/bottom-bar/index.d.ts +1 -0
  68. package/dist/layouts/header/header.d.ts +8 -0
  69. package/dist/layouts/header/index.d.ts +1 -0
  70. package/dist/layouts/index.d.ts +5 -0
  71. package/dist/layouts/sidebar/index.d.ts +1 -0
  72. package/dist/layouts/sidebar/navbar-button.d.ts +11 -0
  73. package/dist/layouts/sidebar/sidebar.d.ts +7 -0
  74. package/dist/layouts/types/common.d.ts +10 -0
  75. package/dist/layouts/types/index.d.ts +1 -0
  76. package/dist/mantine.theme.d.ts +6 -0
  77. package/dist/molecules/data-grid/data-grid.d.ts +5 -0
  78. package/dist/molecules/data-grid/hm/data-grid-container.d.ts +8 -0
  79. package/dist/molecules/data-grid/hm/hm-data-grid.util.d.ts +7 -0
  80. package/dist/molecules/data-grid/hm/render-checkbox.d.ts +3 -0
  81. package/dist/molecules/data-grid/hm/render-row.d.ts +7 -0
  82. package/dist/molecules/data-grid/hm/types.d.ts +171 -0
  83. package/dist/molecules/data-grid/hm/use-data-gri-parser.hook.d.ts +359 -0
  84. package/dist/molecules/data-grid/hm/use-render-row.hook.d.ts +3 -0
  85. package/dist/molecules/data-grid/hm-data-grid.d.ts +4 -0
  86. package/dist/molecules/data-grid/index.d.ts +2 -0
  87. package/dist/molecules/flow-card/card.d.ts +14 -0
  88. package/dist/molecules/flow-card/index.d.ts +1 -0
  89. package/dist/molecules/hm-chart/hm-chart.util.d.ts +113 -0
  90. package/dist/molecules/hm-chart/index.d.ts +21 -0
  91. package/dist/molecules/hm-drawer.d.ts +5 -0
  92. package/dist/molecules/index.d.ts +9 -0
  93. package/dist/molecules/nav-bar-link.d.ts +7 -0
  94. package/dist/molecules/search-bar/index.d.ts +4 -0
  95. package/dist/molecules/stats-ring/index.d.ts +10 -0
  96. package/dist/molecules/table/HmTableAction.d.ts +8 -0
  97. package/dist/molecules/table/HmTableHead.d.ts +7 -0
  98. package/dist/molecules/table/HmTableRow.d.ts +8 -0
  99. package/dist/molecules/table/index.d.ts +9 -0
  100. package/dist/molecules/table/types.d.ts +15 -0
  101. package/dist/molecules/toggle-theme-mode/index.d.ts +4 -0
  102. package/dist/reactive-chart/chart-builder.d.ts +15 -0
  103. package/dist/reactive-chart/dashboard/chart-group.d.ts +9 -0
  104. package/dist/reactive-chart/dashboard/dynamic-chart.d.ts +12 -0
  105. package/dist/reactive-chart/dashboard/index.d.ts +3 -0
  106. package/dist/reactive-chart/dashboard/reactive-dashboard.d.ts +13 -0
  107. package/dist/reactive-chart/dashboard/types.d.ts +58 -0
  108. package/dist/reactive-chart/dashboard-layout/layout-grid-item.d.ts +10 -0
  109. package/dist/reactive-chart/dashboard-layout/layout-grid.d.ts +8 -0
  110. package/dist/reactive-chart/index.d.ts +3 -0
  111. package/dist/reactive-chart/reactive-charts/index.d.ts +5 -0
  112. package/dist/reactive-chart/reactive-charts/reactive-bar-chart/index.d.ts +2 -0
  113. package/dist/reactive-chart/reactive-charts/reactive-bar-chart/reactive-bar-chart.d.ts +5 -0
  114. package/dist/reactive-chart/reactive-charts/reactive-bar-chart/types.d.ts +11 -0
  115. package/dist/reactive-chart/reactive-charts/reactive-line-chart/index.d.ts +2 -0
  116. package/dist/reactive-chart/reactive-charts/reactive-line-chart/reactive-line-chart.d.ts +5 -0
  117. package/dist/reactive-chart/reactive-charts/reactive-line-chart/types.d.ts +11 -0
  118. package/dist/reactive-chart/reactive-charts/reactive-pie-chart/index.d.ts +2 -0
  119. package/dist/reactive-chart/reactive-charts/reactive-pie-chart/reactive-pie-chart.d.ts +5 -0
  120. package/dist/reactive-chart/reactive-charts/reactive-pie-chart/types.d.ts +12 -0
  121. package/dist/reactive-chart/reactive-charts/types/chart-custom-meta.d.ts +13 -0
  122. package/dist/reactive-chart/reactive-charts/types/chart-custom-props.d.ts +10 -0
  123. package/dist/reactive-chart/reactive-charts/types/index.d.ts +3 -0
  124. package/dist/reactive-chart/reactive-charts/types/reactive-chart-base.d.ts +37 -0
  125. package/dist/reactive-chart/reactive-charts/utils/chart-container.d.ts +13 -0
  126. package/dist/reactive-chart/reactive-charts/utils/chart-option.util.d.ts +9 -0
  127. package/dist/reactive-chart/reactive-charts/utils/index.d.ts +3 -0
  128. package/dist/reactive-chart/reactive-charts/utils/use-chart-rows.d.ts +10 -0
  129. package/dist/reactive-form/form/dynamic-field.d.ts +10 -0
  130. package/dist/reactive-form/form/form-group.d.ts +9 -0
  131. package/dist/reactive-form/form/index.d.ts +3 -0
  132. package/dist/reactive-form/form/reactive-form.d.ts +8 -0
  133. package/dist/reactive-form/form/types.d.ts +25 -0
  134. package/dist/reactive-form/form-builder.d.ts +16 -0
  135. package/dist/reactive-form/form-layout/layout-flex.d.ts +5 -0
  136. package/dist/reactive-form/index.d.ts +3 -0
  137. package/dist/reactive-form/reactive-fields/index.d.ts +14 -0
  138. package/dist/reactive-form/reactive-fields/reactive-autocomplete/index.d.ts +2 -0
  139. package/dist/reactive-form/reactive-fields/reactive-autocomplete/reactive-autocomplete.d.ts +5 -0
  140. package/dist/reactive-form/reactive-fields/reactive-autocomplete/types.d.ts +12 -0
  141. package/dist/reactive-form/reactive-fields/reactive-checkbox/index.d.ts +2 -0
  142. package/dist/reactive-form/reactive-fields/reactive-checkbox/reactive-checkbox.d.ts +5 -0
  143. package/dist/reactive-form/reactive-fields/reactive-checkbox/types.d.ts +4 -0
  144. package/dist/reactive-form/reactive-fields/reactive-list/index.d.ts +2 -0
  145. package/dist/reactive-form/reactive-fields/reactive-list/reactive-list-field.d.ts +5 -0
  146. package/dist/reactive-form/reactive-fields/reactive-list/types.d.ts +10 -0
  147. package/dist/reactive-form/reactive-fields/reactive-multi-select/index.d.ts +2 -0
  148. package/dist/reactive-form/reactive-fields/reactive-multi-select/reactive-multi-select.d.ts +5 -0
  149. package/dist/reactive-form/reactive-fields/reactive-multi-select/types.d.ts +12 -0
  150. package/dist/reactive-form/reactive-fields/reactive-number-field/index.d.ts +2 -0
  151. package/dist/reactive-form/reactive-fields/reactive-number-field/number-field.d.ts +5 -0
  152. package/dist/reactive-form/reactive-fields/reactive-number-field/types.d.ts +6 -0
  153. package/dist/reactive-form/reactive-fields/reactive-password-field/index.d.ts +2 -0
  154. package/dist/reactive-form/reactive-fields/reactive-password-field/reactive-password-field.d.ts +5 -0
  155. package/dist/reactive-form/reactive-fields/reactive-password-field/types.d.ts +11 -0
  156. package/dist/reactive-form/reactive-fields/reactive-radio/index.d.ts +2 -0
  157. package/dist/reactive-form/reactive-fields/reactive-radio/reactive-radio.d.ts +5 -0
  158. package/dist/reactive-form/reactive-fields/reactive-radio/types.d.ts +9 -0
  159. package/dist/reactive-form/reactive-fields/reactive-range/index.d.ts +2 -0
  160. package/dist/reactive-form/reactive-fields/reactive-range/reactive-range.d.ts +5 -0
  161. package/dist/reactive-form/reactive-fields/reactive-range/types.d.ts +18 -0
  162. package/dist/reactive-form/reactive-fields/reactive-select/index.d.ts +2 -0
  163. package/dist/reactive-form/reactive-fields/reactive-select/reactive-select.d.ts +5 -0
  164. package/dist/reactive-form/reactive-fields/reactive-select/types.d.ts +6 -0
  165. package/dist/reactive-form/reactive-fields/reactive-switch/index.d.ts +2 -0
  166. package/dist/reactive-form/reactive-fields/reactive-switch/reactive-switch.d.ts +5 -0
  167. package/dist/reactive-form/reactive-fields/reactive-switch/types.d.ts +4 -0
  168. package/dist/reactive-form/reactive-fields/reactive-text-field/index.d.ts +2 -0
  169. package/dist/reactive-form/reactive-fields/reactive-text-field/reactive-text-field.d.ts +5 -0
  170. package/dist/reactive-form/reactive-fields/reactive-text-field/types.d.ts +4 -0
  171. package/dist/reactive-form/reactive-fields/reactive-textarea-field/index.d.ts +2 -0
  172. package/dist/reactive-form/reactive-fields/reactive-textarea-field/reactive-textarea-field.d.ts +5 -0
  173. package/dist/reactive-form/reactive-fields/reactive-textarea-field/types.d.ts +6 -0
  174. package/dist/reactive-form/reactive-fields/types/field-custom-meta.d.ts +22 -0
  175. package/dist/reactive-form/reactive-fields/types/field-custom-props.d.ts +29 -0
  176. package/dist/reactive-form/reactive-fields/types/field-filter-key.d.ts +6 -0
  177. package/dist/reactive-form/reactive-fields/types/index.d.ts +4 -0
  178. package/dist/reactive-form/reactive-fields/types/reactive-field-base.d.ts +35 -0
  179. package/dist/reactive-form/reactive-fields/utils/field-error-interceptor.d.ts +4 -0
  180. package/dist/reactive-form/reactive-fields/utils/index.d.ts +1 -0
  181. package/dist/template/create-node-form/create-node-form.d.ts +8 -0
  182. package/dist/template/create-node-form/index.d.ts +3 -0
  183. package/dist/template/create-node-form/parameter-block.d.ts +16 -0
  184. package/dist/template/create-node-form/useCreateNodeForm.d.ts +27 -0
  185. package/dist/template/index.d.ts +1 -0
  186. package/dist/theme/index.d.ts +2 -0
  187. package/dist/theme/theme.context.d.ts +10 -0
  188. package/dist/theme/theme.provider.d.ts +8 -0
  189. package/dist/types/common.d.ts +1 -0
  190. package/dist/types/form.d.ts +2 -0
  191. package/dist/types/index.d.ts +5 -0
  192. package/dist/types/nested-props.d.ts +60 -0
  193. package/dist/types/object-utils.d.ts +43 -0
  194. package/dist/types/path-value.d.ts +10 -0
  195. package/dist/ui.css +2 -0
  196. package/dist/utils/async-response-parser.util.d.ts +31 -0
  197. package/dist/utils/data-utils.d.ts +3 -0
  198. package/dist/utils/field-regex.util.d.ts +6 -0
  199. package/dist/utils/index.d.ts +3 -0
  200. package/package.json +115 -0
@@ -0,0 +1,113 @@
1
+ import { PyColorsType } from '@/mantine.theme';
2
+ import { MantineTheme } from '@mantine/core';
3
+ export declare const getPaletteColor: (theme: MantineTheme, color: PyColorsType, colorScheme: 'light' | 'dark') => string;
4
+ export declare const getSeriesColors: (theme: MantineTheme, colorScheme: 'light' | 'dark') => string[];
5
+ /** The chart card's background, used for the gaps and rings between marks */
6
+ export declare const getSurfaceColor: (theme: MantineTheme, colorScheme: 'light' | 'dark') => string;
7
+ export declare const getChartTheme: (theme: MantineTheme, colorScheme: 'light' | 'dark') => {
8
+ darkMode: boolean;
9
+ color: string[];
10
+ backgroundColor: string;
11
+ textStyle: {
12
+ fontFamily: string;
13
+ color: string;
14
+ };
15
+ title: {
16
+ textStyle: {
17
+ color: string;
18
+ };
19
+ };
20
+ legend: {
21
+ textStyle: {
22
+ color: string;
23
+ };
24
+ };
25
+ tooltip: {
26
+ backgroundColor: string;
27
+ borderWidth: number;
28
+ padding: number[];
29
+ textStyle: {
30
+ color: string;
31
+ };
32
+ extraCssText: string;
33
+ axisPointer: {
34
+ lineStyle: {
35
+ color: string;
36
+ type: string;
37
+ };
38
+ shadowStyle: {
39
+ color: string;
40
+ };
41
+ };
42
+ };
43
+ categoryAxis: {
44
+ axisLine: {
45
+ lineStyle: {
46
+ color: string;
47
+ };
48
+ };
49
+ axisTick: {
50
+ show: boolean;
51
+ };
52
+ axisLabel: {
53
+ color: string;
54
+ };
55
+ splitLine: {
56
+ lineStyle: {
57
+ color: string[];
58
+ };
59
+ };
60
+ };
61
+ valueAxis: {
62
+ axisLine: {
63
+ show: boolean;
64
+ };
65
+ axisTick: {
66
+ show: boolean;
67
+ };
68
+ axisLabel: {
69
+ color: string;
70
+ formatter: (value: number) => string;
71
+ };
72
+ splitLine: {
73
+ lineStyle: {
74
+ color: string[];
75
+ };
76
+ };
77
+ };
78
+ timeAxis: {
79
+ axisLine: {
80
+ lineStyle: {
81
+ color: string;
82
+ };
83
+ };
84
+ axisTick: {
85
+ show: boolean;
86
+ };
87
+ axisLabel: {
88
+ color: string;
89
+ };
90
+ splitLine: {
91
+ lineStyle: {
92
+ color: string[];
93
+ };
94
+ };
95
+ };
96
+ logAxis: {
97
+ axisLine: {
98
+ show: boolean;
99
+ };
100
+ axisTick: {
101
+ show: boolean;
102
+ };
103
+ axisLabel: {
104
+ color: string;
105
+ formatter: (value: number) => string;
106
+ };
107
+ splitLine: {
108
+ lineStyle: {
109
+ color: string[];
110
+ };
111
+ };
112
+ };
113
+ };
@@ -0,0 +1,21 @@
1
+ import { BarSeriesOption, LineSeriesOption, PieSeriesOption } from 'echarts/charts';
2
+ import { DatasetComponentOption, GridComponentOption, LegendComponentOption, TitleComponentOption, TooltipComponentOption } from 'echarts/components';
3
+ import * as echarts from 'echarts/core';
4
+ import { ECElementEvent, SetOptionOpts } from 'echarts/core';
5
+ import { CSSProperties, FC } from 'react';
6
+ export type ECOption = echarts.ComposeOption<BarSeriesOption | LineSeriesOption | TitleComponentOption | TooltipComponentOption | GridComponentOption | DatasetComponentOption | LegendComponentOption | PieSeriesOption>;
7
+ export interface IHMChart {
8
+ option: ECOption;
9
+ style?: CSSProperties;
10
+ settings?: SetOptionOpts;
11
+ loading?: boolean;
12
+ /** Forces a color scheme; by default the chart follows Mantine's */
13
+ theme?: 'light' | 'dark';
14
+ onClick?: (params: ECElementEvent) => void;
15
+ }
16
+ /**
17
+ * Renders an ECharts `option`. The chart follows the size of its container
18
+ * and the Mantine theme, including the color scheme.
19
+ */
20
+ declare const HMChart: FC<IHMChart>;
21
+ export default HMChart;
@@ -0,0 +1,5 @@
1
+ import { FC, ReactNode } from 'react';
2
+ declare const HMDrawer: FC<{
3
+ children: ReactNode;
4
+ }>;
5
+ export default HMDrawer;
@@ -0,0 +1,9 @@
1
+ export { default as NavBarLink } from './nav-bar-link';
2
+ export { default as SearchBar } from './search-bar';
3
+ export { default as ToggleThemeMode } from './toggle-theme-mode';
4
+ export { default as HMDrawer } from './hm-drawer';
5
+ export { default as StatsRing } from './stats-ring';
6
+ export { default as HMChart } from './hm-chart';
7
+ export type { ECOption, IHMChart } from './hm-chart';
8
+ export * from './data-grid';
9
+ export * from './flow-card';
@@ -0,0 +1,7 @@
1
+ import { FC } from 'react';
2
+ import { LinkProps } from 'react-router-dom';
3
+ interface INavBarLink extends LinkProps {
4
+ handleIsActive: (isActive: boolean) => void;
5
+ }
6
+ declare const NavBarLink: FC<INavBarLink>;
7
+ export default NavBarLink;
@@ -0,0 +1,4 @@
1
+ import { TextInputProps } from '@mantine/core';
2
+ import { FC } from 'react';
3
+ declare const SearchBar: FC<TextInputProps>;
4
+ export default SearchBar;
@@ -0,0 +1,10 @@
1
+ import { FC } from 'react';
2
+ interface IStatsRing {
3
+ label: string;
4
+ stats: string;
5
+ progress: number;
6
+ color: string;
7
+ icon: 'up' | 'down';
8
+ }
9
+ declare const StatsRing: FC<IStatsRing>;
10
+ export default StatsRing;
@@ -0,0 +1,8 @@
1
+ import { IRowAction } from './types';
2
+ interface ITableActions<TRow extends Record<string, any>> {
3
+ actions: IRowAction<TRow>[];
4
+ row: TRow;
5
+ index: number;
6
+ }
7
+ declare const HMTableAction: <TRow extends Record<string, any>>(props: ITableActions<TRow>) => "" | import("react").JSX.Element;
8
+ export default HMTableAction;
@@ -0,0 +1,7 @@
1
+ import { IHMColumn, IRowAction } from './types';
2
+ interface IHmTableHead<TRow extends Record<string, any>> {
3
+ columns: IHMColumn<TRow>[];
4
+ actions?: IRowAction<TRow>[];
5
+ }
6
+ declare const HmTableHead: <TRow extends Record<string, any>>(props: IHmTableHead<TRow>) => import("react").JSX.Element;
7
+ export default HmTableHead;
@@ -0,0 +1,8 @@
1
+ import { IHMColumn, IRowAction } from './types';
2
+ interface IHmTableRow<TRow extends Record<string, any>> {
3
+ rows: TRow[];
4
+ columns: IHMColumn<TRow>[];
5
+ actions?: IRowAction<TRow>[];
6
+ }
7
+ declare const HmTableRow: <TRow extends Record<string, any>>(props: IHmTableRow<TRow>) => import("react").JSX.Element;
8
+ export default HmTableRow;
@@ -0,0 +1,9 @@
1
+ import { TableProps } from '@mantine/core';
2
+ import { IHMColumn, IRowAction } from './types';
3
+ export interface IHmTable<TRow extends Record<string, any>> extends TableProps {
4
+ columns: IHMColumn<TRow>[];
5
+ rows: TRow[];
6
+ actions?: IRowAction<TRow>[];
7
+ }
8
+ declare const HmTable: <TRow extends Record<string, any>>(props: IHmTable<TRow>) => import("react").JSX.Element;
9
+ export default HmTable;
@@ -0,0 +1,15 @@
1
+ import { FC, JSX } from 'react';
2
+ export interface IHMColumn<TRow = Record<string, any>> {
3
+ key: keyof TRow;
4
+ label: string;
5
+ rowRender?: (val: any, index: number, id: string) => JSX.Element;
6
+ }
7
+ export interface IRowAction<TRow = Record<string, any>> {
8
+ name: string;
9
+ fn: (row: TRow, index: number) => void;
10
+ actionRender: FC<{
11
+ row: TRow;
12
+ index: number;
13
+ name: string;
14
+ }>;
15
+ }
@@ -0,0 +1,4 @@
1
+ import { ActionIconProps } from '@mantine/core';
2
+ import { FC } from 'react';
3
+ declare const ToggleThemeMode: FC<ActionIconProps>;
4
+ export default ToggleThemeMode;
@@ -0,0 +1,15 @@
1
+ import { ElementType, FunctionComponent } from 'react';
2
+ import { ChartType, IReactiveChart } from './reactive-charts/types';
3
+ type ChartMapType = Record<string, ElementType<IReactiveChart<any>>>;
4
+ declare function getChart(chart: string): ElementType<IReactiveChart<any>> | undefined;
5
+ interface IDefineComponent {
6
+ name: ChartType;
7
+ component: FunctionComponent<IReactiveChart<any>>;
8
+ }
9
+ declare const defineWidget: (params: IDefineComponent) => void;
10
+ declare const _default: {
11
+ chartMap: ChartMapType;
12
+ defineWidget: typeof defineWidget;
13
+ getChart: typeof getChart;
14
+ };
15
+ export default _default;
@@ -0,0 +1,9 @@
1
+ import { FC, ReactNode } from 'react';
2
+ import { ChartGroupComponentType } from './types';
3
+ interface IChartGroup {
4
+ name?: string;
5
+ component?: ChartGroupComponentType;
6
+ children?: ReactNode;
7
+ }
8
+ declare const ChartGroup: FC<IChartGroup>;
9
+ export default ChartGroup;
@@ -0,0 +1,12 @@
1
+ import { JSONData } from '@/types';
2
+ import { FC } from 'react';
3
+ import { IChartClickParams } from '../reactive-charts/types';
4
+ import { IDynamicChartMeta } from './types';
5
+ interface IDynamicChart {
6
+ chart: IDynamicChartMeta;
7
+ data: JSONData;
8
+ loading?: boolean;
9
+ onChartClick?: (params: IChartClickParams) => void;
10
+ }
11
+ declare const DynamicChart: FC<IDynamicChart>;
12
+ export default DynamicChart;
@@ -0,0 +1,3 @@
1
+ export { default as ReactiveDashboard } from './reactive-dashboard';
2
+ export * from './reactive-dashboard';
3
+ export type { ChartMeta, IChartLayout, IReactiveChartMeta } from './types';
@@ -0,0 +1,13 @@
1
+ import { JSONData } from '@/types';
2
+ import { IChartClickParams } from '../reactive-charts/types';
3
+ import { IReactiveChartMeta } from './types';
4
+ export interface IReactiveDashboard<TChartData extends JSONData> {
5
+ meta: IReactiveChartMeta<TChartData>[];
6
+ data: TChartData;
7
+ loading?: boolean;
8
+ /** Height of one layout row, in pixels */
9
+ rowHeight?: number;
10
+ onChartClick?: (params: IChartClickParams) => void;
11
+ }
12
+ declare const ReactiveDashboard: <TChartData extends JSONData>(props: IReactiveDashboard<TChartData>) => import("react").JSX.Element;
13
+ export default ReactiveDashboard;
@@ -0,0 +1,58 @@
1
+ import { ECOption } from '@/molecules/hm-chart';
2
+ import { DataKeyOf, JSONData, RowOf } from '@/types';
3
+ import { ReactElement, ReactNode } from 'react';
4
+ import { ChartType, CommonChartProps, IConditionalChartProp } from '../reactive-charts/types';
5
+ export interface IChartLayout {
6
+ /** Start column, from 0 to 11 */
7
+ x: number;
8
+ /** Start row, from 0 */
9
+ y: number;
10
+ /** Width in columns, from 1 to 12 */
11
+ w: number;
12
+ /** Height in rows; leave it out for a height that follows the width */
13
+ h?: number;
14
+ /** Minimum height in rows, ignored when `h` is set */
15
+ minRows?: number;
16
+ /** Maximum height in rows, ignored when `h` is set */
17
+ maxRows?: number;
18
+ /** Maximum width of the chart, in pixels */
19
+ maxWidth?: number;
20
+ }
21
+ interface IPartialReactiveChart<TChartType extends ChartType, TDataKey extends string> {
22
+ /** Stable id of the chart: React key, test id and saved layouts */
23
+ chartKey: string;
24
+ /** Path to the chart's rows in the dashboard's `data` */
25
+ dataKey: TDataKey;
26
+ /** Title displayed above the chart */
27
+ title: string;
28
+ /** Position on the group's 12-column grid */
29
+ layout: IChartLayout;
30
+ /** ECharts option merged last; plain values only, so the meta can be saved */
31
+ options?: ECOption;
32
+ /** Chart type => "bar", "line", "pie" */
33
+ type: TChartType;
34
+ }
35
+ type ReactiveChartMeta<TChartData extends JSONData, TDataKey extends string, TChartType extends ChartType> = IConditionalChartProp<RowOf<TChartData, TDataKey>>[TChartType] & IPartialReactiveChart<TChartType, TDataKey>;
36
+ /** One chart; its custom props are typed from the rows at its `dataKey` */
37
+ export type ChartMeta<TChartData extends JSONData, TChartType extends ChartType = ChartType> = {
38
+ [TDataKey in DataKeyOf<TChartData>]: TChartType extends ChartType ? ReactiveChartMeta<TChartData, TDataKey, TChartType> : never;
39
+ }[DataKeyOf<TChartData>];
40
+ /**
41
+ * A chart's meta without the typing that ties its keys to the dashboard's
42
+ * data. DynamicChart takes this shape: TypeScript can't relate two
43
+ * `ChartMeta<TChartData>` built inside a generic component.
44
+ */
45
+ export interface IDynamicChartMeta extends IPartialReactiveChart<ChartType, string> {
46
+ customProps: CommonChartProps<JSONData>;
47
+ }
48
+ export interface IReactiveChartMeta<TChartData extends JSONData> {
49
+ /** Stable id of the group */
50
+ groupKey: string;
51
+ /** Title displayed above the group */
52
+ name?: string;
53
+ charts: ChartMeta<TChartData>[];
54
+ }
55
+ export type ChartGroupComponentType = ReactElement<{
56
+ children?: ReactNode;
57
+ }>;
58
+ export {};
@@ -0,0 +1,10 @@
1
+ import { FC, ReactNode } from 'react';
2
+ import { IChartLayout } from '../dashboard/types';
3
+ export interface ILayoutGridItem {
4
+ layout: IChartLayout;
5
+ /** Set by LayoutGrid: empty columns before the item in its row */
6
+ offset?: number;
7
+ children?: ReactNode;
8
+ }
9
+ declare const LayoutGridItem: FC<ILayoutGridItem>;
10
+ export default LayoutGridItem;
@@ -0,0 +1,8 @@
1
+ import { FC, ReactNode } from 'react';
2
+ interface ILayoutGrid {
3
+ /** Height of one layout row, in pixels */
4
+ rowHeight?: number;
5
+ children?: ReactNode;
6
+ }
7
+ declare const LayoutGrid: FC<ILayoutGrid>;
8
+ export default LayoutGrid;
@@ -0,0 +1,3 @@
1
+ export * from './reactive-charts';
2
+ export * from './dashboard';
3
+ export { default as ChartBuilder } from './chart-builder';
@@ -0,0 +1,5 @@
1
+ export * from './reactive-bar-chart';
2
+ export * from './reactive-line-chart';
3
+ export * from './reactive-pie-chart';
4
+ export * from './types';
5
+ export * from './utils';
@@ -0,0 +1,2 @@
1
+ export { default as ReactiveBarChart } from './reactive-bar-chart';
2
+ export * from './types';
@@ -0,0 +1,5 @@
1
+ import { FC } from 'react';
2
+ import { IReactiveChart } from '../types';
3
+ import { BarChartCustomProps } from './types';
4
+ declare const ReactiveBarChart: FC<IReactiveChart<BarChartCustomProps>>;
5
+ export default ReactiveBarChart;
@@ -0,0 +1,11 @@
1
+ import { JSONData, NestedKeyOf } from '@/types';
2
+ import { IChartSeries } from '../types/reactive-chart-base';
3
+ export type BarChartCustomProps<TRow extends JSONData = JSONData> = {
4
+ /** Row key of the categories */
5
+ xKey: NestedKeyOf<TRow>;
6
+ series: IChartSeries<TRow>[];
7
+ /** Stacks the series on top of each other */
8
+ stacked?: boolean;
9
+ /** Draws the bars from left to right */
10
+ horizontal?: boolean;
11
+ };
@@ -0,0 +1,2 @@
1
+ export { default as ReactiveLineChart } from './reactive-line-chart';
2
+ export * from './types';
@@ -0,0 +1,5 @@
1
+ import { FC } from 'react';
2
+ import { IReactiveChart } from '../types';
3
+ import { LineChartCustomProps } from './types';
4
+ declare const ReactiveLineChart: FC<IReactiveChart<LineChartCustomProps>>;
5
+ export default ReactiveLineChart;
@@ -0,0 +1,11 @@
1
+ import { JSONData, NestedKeyOf } from '@/types';
2
+ import { IChartSeries } from '../types/reactive-chart-base';
3
+ export type LineChartCustomProps<TRow extends JSONData = JSONData> = {
4
+ /** Row key of the x axis values */
5
+ xKey: NestedKeyOf<TRow>;
6
+ series: IChartSeries<TRow>[];
7
+ /** Draws curved lines */
8
+ smooth?: boolean;
9
+ /** Fills the area under each line */
10
+ area?: boolean;
11
+ };
@@ -0,0 +1,2 @@
1
+ export { default as ReactivePieChart } from './reactive-pie-chart';
2
+ export * from './types';
@@ -0,0 +1,5 @@
1
+ import { FC } from 'react';
2
+ import { IReactiveChart } from '../types';
3
+ import { PieChartCustomProps } from './types';
4
+ declare const ReactivePieChart: FC<IReactiveChart<PieChartCustomProps>>;
5
+ export default ReactivePieChart;
@@ -0,0 +1,12 @@
1
+ import { PyColorsType } from '@/mantine.theme';
2
+ import { JSONData, NestedKeyOf } from '@/types';
3
+ export type PieChartCustomProps<TRow extends JSONData = JSONData> = {
4
+ /** Row key of the slice names */
5
+ nameKey: NestedKeyOf<TRow>;
6
+ /** Row key of the slice values */
7
+ valueKey: NestedKeyOf<TRow>;
8
+ /** Draws a ring instead of a full pie, with the total in the middle */
9
+ donut?: boolean;
10
+ /** Theme palette per slice name, for slices that mean a status; by default the chart theme picks one */
11
+ colors?: Record<string, PyColorsType>;
12
+ };
@@ -0,0 +1,13 @@
1
+ import { JSONData } from '@/types';
2
+ import { IChartCustomProps } from './chart-custom-props';
3
+ export interface IConditionalChartProp<TRow extends JSONData> {
4
+ bar: {
5
+ customProps: IChartCustomProps<TRow>['bar'];
6
+ };
7
+ line: {
8
+ customProps: IChartCustomProps<TRow>['line'];
9
+ };
10
+ pie: {
11
+ customProps: IChartCustomProps<TRow>['pie'];
12
+ };
13
+ }
@@ -0,0 +1,10 @@
1
+ import { JSONData } from '@/types';
2
+ import { BarChartCustomProps } from '../reactive-bar-chart/types';
3
+ import { LineChartCustomProps } from '../reactive-line-chart/types';
4
+ import { PieChartCustomProps } from '../reactive-pie-chart/types';
5
+ import { CommonChartProps } from './reactive-chart-base';
6
+ export interface IChartCustomProps<TRow extends JSONData> {
7
+ bar: CommonChartProps<BarChartCustomProps<TRow>>;
8
+ line: CommonChartProps<LineChartCustomProps<TRow>>;
9
+ pie: CommonChartProps<PieChartCustomProps<TRow>>;
10
+ }
@@ -0,0 +1,3 @@
1
+ export * from './reactive-chart-base';
2
+ export * from './chart-custom-props';
3
+ export * from './chart-custom-meta';
@@ -0,0 +1,37 @@
1
+ import { PyColorsType } from '@/mantine.theme';
2
+ import { ECOption } from '@/molecules/hm-chart';
3
+ import { JSONData, NestedKeyOf } from '@/types';
4
+ import { ECElementEvent } from 'echarts/core';
5
+ export type ChartType = 'bar' | 'line' | 'pie';
6
+ export interface IChartClickParams {
7
+ chartKey: string;
8
+ /** The clicked row, as it is in `data` */
9
+ row: JSONData;
10
+ event: ECElementEvent;
11
+ }
12
+ export interface IChartSeries<TRow extends JSONData = JSONData> {
13
+ /** Row key holding the values */
14
+ key: NestedKeyOf<TRow>;
15
+ /** Legend and tooltip label */
16
+ name: string;
17
+ /** Theme palette of the series; by default the chart theme picks one */
18
+ color?: PyColorsType;
19
+ }
20
+ export type CommonChartProps<TChartProps extends JSONData> = {
21
+ hidden?: boolean;
22
+ } & TChartProps;
23
+ export interface IReactiveChart<TChartProps extends JSONData, TChartData extends JSONData = JSONData> {
24
+ /** Key is used for the React key and the test id */
25
+ chartKey: string;
26
+ /** Path to the chart's rows in `data` */
27
+ dataKey: string;
28
+ /** Title displayed above the chart */
29
+ title: string;
30
+ /** ECharts option merged last, for what the custom props don't cover */
31
+ options?: ECOption;
32
+ data: TChartData;
33
+ loading?: boolean;
34
+ onChartClick?: (params: IChartClickParams) => void;
35
+ customProps: CommonChartProps<TChartProps>;
36
+ }
37
+ export type ReactiveChartStoryType<TChartProps extends JSONData, TChartData extends JSONData = JSONData> = Omit<IReactiveChart<TChartProps, TChartData>, 'data' | 'onChartClick'>;
@@ -0,0 +1,13 @@
1
+ import { FC, ReactNode } from 'react';
2
+ interface IChartContainer {
3
+ chartKey: string;
4
+ title: string;
5
+ hidden?: boolean;
6
+ loading?: boolean;
7
+ isEmpty?: boolean;
8
+ /** Replaces the chart, for a meta that can't be drawn */
9
+ error?: string;
10
+ children?: ReactNode;
11
+ }
12
+ declare const ChartContainer: FC<IChartContainer>;
13
+ export default ChartContainer;
@@ -0,0 +1,9 @@
1
+ import { JSONData } from '@/types';
2
+ export type ChartAxisType = 'category' | 'value' | 'time';
3
+ /** Axis type of the values at `key`, read from the first row like the data grid does */
4
+ export declare const getChartAxisType: (rows: JSONData[], key: string) => ChartAxisType;
5
+ /**
6
+ * Deep-merges `override` into `option`. Arrays such as `series` are merged
7
+ * item by item, so an override can change one series and keep the others.
8
+ */
9
+ export declare const mergeChartOptions: <TOption extends JSONData>(option: TOption, override?: JSONData) => TOption;
@@ -0,0 +1,3 @@
1
+ export { default as ChartContainer } from './chart-container';
2
+ export * from './chart-option.util';
3
+ export * from './use-chart-rows';
@@ -0,0 +1,10 @@
1
+ import { JSONData } from '@/types';
2
+ interface IUseChartRows {
3
+ data: JSONData;
4
+ dataKey: string;
5
+ }
6
+ export declare const useChartRows: (params: IUseChartRows) => {
7
+ rows: JSONData[];
8
+ flatRows: JSONData[];
9
+ };
10
+ export {};
@@ -0,0 +1,10 @@
1
+ import { InputType, ReactiveFieldErrorType } from '@/reactive-form/reactive-fields';
2
+ import { FormProps, JSONData } from '../../types';
3
+ import { FieldMeta } from './types';
4
+ interface IDynamicField<TFormValues extends JSONData> {
5
+ field: FieldMeta<TFormValues, InputType>;
6
+ form: FormProps<TFormValues>;
7
+ errors: ReactiveFieldErrorType;
8
+ }
9
+ declare const DynamicField: <TFormValues extends JSONData>(props: IDynamicField<TFormValues>) => import("react").JSX.Element;
10
+ export default DynamicField;
@@ -0,0 +1,9 @@
1
+ import { FC, ReactNode } from 'react';
2
+ import { FormGroupComponentType } from './types';
3
+ interface IFormGroup {
4
+ name?: string;
5
+ component?: FormGroupComponentType;
6
+ children?: ReactNode;
7
+ }
8
+ declare const FormGroup: FC<IFormGroup>;
9
+ export default FormGroup;
@@ -0,0 +1,3 @@
1
+ export { default as ReactiveForm } from './reactive-form';
2
+ export * from './reactive-form';
3
+ export type { IReactiveFieldMeta, FieldMeta } from './types';
@@ -0,0 +1,8 @@
1
+ import { FormProps, JSONData } from '../../types';
2
+ import { IReactiveFieldMeta } from './types';
3
+ export interface IReactiveForm<TFormValues extends JSONData> {
4
+ meta: IReactiveFieldMeta<TFormValues>[];
5
+ form: FormProps<TFormValues>;
6
+ }
7
+ declare const ReactiveForm: <TFormValues extends JSONData>(props: IReactiveForm<TFormValues>) => import("react").JSX.Element;
8
+ export default ReactiveForm;
@@ -0,0 +1,25 @@
1
+ import { ReactElement, ReactNode } from 'react';
2
+ import { FormFieldOption, IConditionalProp, InputType } from '@/reactive-form/reactive-fields/types';
3
+ import { JSONData, NestedKeyOf } from '@/types';
4
+ type PartialOption<TFormValues extends JSONData> = Omit<FormFieldOption<TFormValues>, 'onChange' | 'onBlur'>;
5
+ interface IPatialReactiveField<TFormValues extends JSONData, TInputType extends InputType> {
6
+ /** Key is used for register, input id and array map key */
7
+ fieldKey: NestedKeyOf<TFormValues>;
8
+ /** label is used for the input displayed name */
9
+ label: string;
10
+ /** react-hook-form register's options */
11
+ options?: PartialOption<TFormValues>;
12
+ /** Field type => "text", "switch" ... */
13
+ type: TInputType;
14
+ }
15
+ type ReactiveFieldMeta<TInputType extends InputType, TFormValues extends JSONData> = IConditionalProp<TFormValues>[TInputType] & IPatialReactiveField<TFormValues, TInputType>;
16
+ export type FieldMeta<TFormValues extends JSONData, TInputType extends InputType> = TInputType extends InputType ? ReactiveFieldMeta<TInputType, TFormValues> : never;
17
+ export interface IReactiveFieldMeta<TFormValues extends JSONData> {
18
+ name?: string;
19
+ fields: ReturnType<<TInputType extends InputType>(params: FieldMeta<TFormValues, TInputType>[]) => typeof params>;
20
+ }
21
+ export type FormGroupComponentType = ReactElement<{
22
+ title: string;
23
+ children: ReactNode;
24
+ }>;
25
+ export {};