@ea-lab/reactive-json 0.0.20 → 0.0.21

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 (124) hide show
  1. package/README.md +1 -1
  2. package/dist/esm/types/component/action/HashChangeListener.d.ts +9 -0
  3. package/{lib/component/action/Hide.jsx → dist/esm/types/component/action/Hide.d.ts} +2 -6
  4. package/dist/esm/types/component/action/MessageListener.d.ts +9 -0
  5. package/dist/esm/types/component/action/Popover.d.ts +5 -0
  6. package/dist/esm/types/component/action/ReactOnEvent.d.ts +26 -0
  7. package/dist/esm/types/component/action/Redirect.d.ts +9 -0
  8. package/dist/esm/types/component/action/Tooltip.d.ts +5 -0
  9. package/{lib/component/action/VisuallyHide.jsx → dist/esm/types/component/action/VisuallyHide.d.ts} +1 -4
  10. package/dist/esm/types/component/element/form/CheckBoxField.d.ts +7 -0
  11. package/dist/esm/types/component/element/form/DateField.d.ts +2 -0
  12. package/dist/esm/types/component/element/form/NumberField.d.ts +7 -0
  13. package/dist/esm/types/component/element/form/SelectField.d.ts +7 -0
  14. package/dist/esm/types/component/element/form/TextAreaField.d.ts +6 -0
  15. package/dist/esm/types/component/element/form/TextField.d.ts +6 -0
  16. package/dist/esm/types/component/element/form/formElementsCommon.d.ts +23 -0
  17. package/dist/esm/types/component/element/html/AccordionItem.d.ts +16 -0
  18. package/dist/esm/types/component/element/html/FolderSortableTree.d.ts +6 -0
  19. package/dist/esm/types/component/element/html/FormatNumeral.d.ts +7 -0
  20. package/dist/esm/types/component/element/html/Html.d.ts +8 -0
  21. package/dist/esm/types/component/element/html/LabelFromValue.d.ts +22 -0
  22. package/dist/esm/types/component/element/html/Modal.d.ts +6 -0
  23. package/dist/esm/types/component/element/html/ModalForm.d.ts +9 -0
  24. package/dist/esm/types/component/element/html/Paragraph.d.ts +5 -0
  25. package/dist/esm/types/component/element/html/PreformattedMarkup.d.ts +7 -0
  26. package/dist/esm/types/component/element/html/SortableTreeItemCollapseButton.d.ts +9 -0
  27. package/dist/esm/types/component/element/html/Tabs.d.ts +18 -0
  28. package/dist/esm/types/component/element/special/BootstrapElement.d.ts +10 -0
  29. package/dist/esm/types/component/element/special/Count.d.ts +13 -0
  30. package/dist/esm/types/component/element/special/DataFilter.d.ts +11 -0
  31. package/dist/esm/types/component/element/special/DelayedActions.d.ts +25 -0
  32. package/dist/esm/types/component/element/special/PageControls.d.ts +9 -0
  33. package/dist/esm/types/component/element/special/Phantom.d.ts +17 -0
  34. package/dist/esm/types/component/element/special/Switch.d.ts +6 -0
  35. package/dist/esm/types/component/hook/usePagination.d.ts +30 -0
  36. package/dist/esm/types/component/index.d.ts +5 -0
  37. package/dist/esm/types/component/reaction/addData.d.ts +6 -0
  38. package/dist/esm/types/component/reaction/fetchData.d.ts +8 -0
  39. package/dist/esm/types/component/reaction/moveData.d.ts +6 -0
  40. package/dist/esm/types/component/reaction/postMessage.d.ts +6 -0
  41. package/dist/esm/types/component/reaction/redirectNow.d.ts +6 -0
  42. package/dist/esm/types/component/reaction/removeData.d.ts +6 -0
  43. package/dist/esm/types/component/reaction/setClipboardData.d.ts +6 -0
  44. package/dist/esm/types/component/reaction/setData.d.ts +6 -0
  45. package/dist/esm/types/component/reaction/submitData.d.ts +8 -0
  46. package/dist/esm/types/component/reaction/triggerEvent.d.ts +6 -0
  47. package/dist/esm/types/component/utility/formatString.d.ts +17 -0
  48. package/dist/esm/types/engine/Actions.d.ts +19 -0
  49. package/dist/esm/types/engine/ComponentCollector.d.ts +12 -0
  50. package/{lib/engine/EventDispatcherContext.jsx → dist/esm/types/engine/EventDispatcherContext.d.ts} +4 -7
  51. package/dist/esm/types/engine/EventDispatcherProvider.d.ts +16 -0
  52. package/{lib/engine/GlobalDataContext.jsx → dist/esm/types/engine/GlobalDataContext.d.ts} +1 -4
  53. package/dist/esm/types/engine/GlobalDataContextProvider.d.ts +11 -0
  54. package/{lib/engine/PaginationContext.jsx → dist/esm/types/engine/PaginationContext.d.ts} +3 -4
  55. package/dist/esm/types/engine/PaginationProvider.d.ts +12 -0
  56. package/dist/esm/types/engine/ReactiveJsonRoot.d.ts +28 -0
  57. package/{lib/engine/TemplateContext.jsx → dist/esm/types/engine/TemplateContext.d.ts} +1 -4
  58. package/dist/esm/types/engine/TemplateSystem.d.ts +89 -0
  59. package/dist/esm/types/engine/View.d.ts +7 -0
  60. package/dist/esm/types/index.d.ts +6 -0
  61. package/dist/esm/types/main.d.ts +10 -0
  62. package/dist/index.cjs.js +9201 -0
  63. package/dist/index.cjs.js.map +1 -0
  64. package/dist/index.d.ts +44 -0
  65. package/dist/index.esm.js +9180 -0
  66. package/dist/index.esm.js.map +1 -0
  67. package/package.json +26 -15
  68. package/dist/reactive-json.css +0 -5
  69. package/dist/reactive-json.js +0 -47707
  70. package/dist/reactive-json.js.map +0 -1
  71. package/dist/reactive-json.umd.cjs +0 -366
  72. package/dist/reactive-json.umd.cjs.map +0 -1
  73. package/lib/component/action/HashChangeListener.jsx +0 -66
  74. package/lib/component/action/MessageListener.jsx +0 -62
  75. package/lib/component/action/Popover.jsx +0 -53
  76. package/lib/component/action/ReactOnEvent.jsx +0 -118
  77. package/lib/component/action/Redirect.jsx +0 -26
  78. package/lib/component/action/Tooltip.jsx +0 -27
  79. package/lib/component/element/form/CheckBoxField.jsx +0 -215
  80. package/lib/component/element/form/DateField.jsx +0 -42
  81. package/lib/component/element/form/NumberField.jsx +0 -29
  82. package/lib/component/element/form/SelectField.jsx +0 -130
  83. package/lib/component/element/form/TextAreaField.jsx +0 -48
  84. package/lib/component/element/form/TextField.jsx +0 -65
  85. package/lib/component/element/form/formElementsCommon.jsx +0 -54
  86. package/lib/component/element/html/AccordionItem.jsx +0 -42
  87. package/lib/component/element/html/FolderSortableTree.jsx +0 -307
  88. package/lib/component/element/html/FormatNumeral.jsx +0 -118
  89. package/lib/component/element/html/Html.jsx +0 -107
  90. package/lib/component/element/html/LabelFromValue.jsx +0 -89
  91. package/lib/component/element/html/Modal.jsx +0 -77
  92. package/lib/component/element/html/ModalForm.jsx +0 -30
  93. package/lib/component/element/html/Paragraph.jsx +0 -10
  94. package/lib/component/element/html/PreformattedMarkup.jsx +0 -54
  95. package/lib/component/element/html/SortableTreeItemCollapseButton.jsx +0 -20
  96. package/lib/component/element/html/Tabs.jsx +0 -55
  97. package/lib/component/element/special/BootstrapElement.jsx +0 -32
  98. package/lib/component/element/special/Count.jsx +0 -46
  99. package/lib/component/element/special/DataFilter.jsx +0 -156
  100. package/lib/component/element/special/DelayedActions.jsx +0 -119
  101. package/lib/component/element/special/PageControls.jsx +0 -19
  102. package/lib/component/element/special/Phantom.jsx +0 -25
  103. package/lib/component/element/special/Switch.jsx +0 -131
  104. package/lib/component/hook/usePagination.jsx +0 -184
  105. package/lib/component/reaction/addData.jsx +0 -23
  106. package/lib/component/reaction/fetchData.jsx +0 -83
  107. package/lib/component/reaction/moveData.jsx +0 -52
  108. package/lib/component/reaction/postMessage.jsx +0 -43
  109. package/lib/component/reaction/redirectNow.jsx +0 -17
  110. package/lib/component/reaction/removeData.jsx +0 -48
  111. package/lib/component/reaction/setClipboardData.jsx +0 -20
  112. package/lib/component/reaction/setData.jsx +0 -23
  113. package/lib/component/reaction/submitData.jsx +0 -136
  114. package/lib/component/reaction/triggerEvent.jsx +0 -62
  115. package/lib/component/utility/formatString.jsx +0 -59
  116. package/lib/engine/Actions.jsx +0 -392
  117. package/lib/engine/ComponentCollector.js +0 -28
  118. package/lib/engine/EventDispatcherProvider.jsx +0 -80
  119. package/lib/engine/GlobalDataContextProvider.jsx +0 -33
  120. package/lib/engine/PaginationProvider.jsx +0 -61
  121. package/lib/engine/ReactiveJsonRoot.jsx +0 -318
  122. package/lib/engine/TemplateSystem.jsx +0 -302
  123. package/lib/engine/View.jsx +0 -248
  124. package/lib/main.jsx +0 -52
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Standard implementation of the provider for GlobalDataContext.
3
+ *
4
+ * @param props Component props. Must have the "value" key.
5
+ *
6
+ * @returns {JSX.Element}
7
+ *
8
+ * @constructor
9
+ */
10
+ declare const GlobalDataContextProvider: (props: any) => import("react/jsx-runtime").JSX.Element;
11
+ export default GlobalDataContextProvider;
@@ -1,10 +1,9 @@
1
- import { createContext } from 'react';
2
-
3
1
  /**
4
2
  * This is a context opened when a pagination is needed.
5
3
  *
6
4
  * @type {React.Context<{}>}
7
5
  */
8
- const PaginationContext = createContext({pagination: {}});
9
-
6
+ declare const PaginationContext: import("react").Context<{
7
+ pagination: {};
8
+ }>;
10
9
  export default PaginationContext;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Use this provider in combination with EventDispatcherContext.
3
+ *
4
+ * @param props
5
+ *
6
+ * @returns {JSX.Element}
7
+ *
8
+ * @constructor
9
+ * @deprecated ne fonctionne pas, envisager un système de preemptiveActions pour filtrer les items en amont
10
+ */
11
+ declare const PaginationProvider: (props: any) => import("react/jsx-runtime").JSX.Element;
12
+ export default PaginationProvider;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Production ready app root.
3
+ *
4
+ * @param {string} dataFetchMethod The fetch method for the init data. Case-insensitive.
5
+ * Use "POST" for post. Other values mean "GET".
6
+ * @param {string} dataUrl The URL of the document containing the build data. Either JSON or YAML.
7
+ * @param {{}} headersForData Headers for the data request, such as authentication info.
8
+ * @param {{}} plugins Reactive-JSON plugins.
9
+ * @param {boolean} debugMode Set to true to show the data structure and debug info.
10
+ * @param {React.Element|null} DebugModeContentWrapper Wrapper around the main reactive-json content when in debug mode.
11
+ * @param {React.Element|null} DebugModeDataWrapper Wrapper around the reactive-json debug data when in debug mode.
12
+ * @param {React.Element|null} DebugModeMainWrapper Wrapper around the reactive-json root when in debug mode.
13
+ *
14
+ * @returns {JSX.Element}
15
+ *
16
+ * @constructor
17
+ */
18
+ declare function ReactiveJsonRoot({ dataFetchMethod, dataUrl, headersForData, plugins, debugMode, DebugModeContentWrapper, DebugModeDataWrapper, DebugModeRootWrapper, }: {
19
+ dataFetchMethod: any;
20
+ dataUrl: any;
21
+ headersForData: any;
22
+ plugins: any;
23
+ debugMode: any;
24
+ DebugModeContentWrapper: any;
25
+ DebugModeDataWrapper: any;
26
+ DebugModeRootWrapper: any;
27
+ }): import("react/jsx-runtime").JSX.Element | null;
28
+ export default ReactiveJsonRoot;
@@ -1,5 +1,3 @@
1
- import { createContext } from 'react';
2
-
3
1
  /**
4
2
  * A template context contains the data that is shared between the contained components.
5
3
  *
@@ -8,6 +6,5 @@ import { createContext } from 'react';
8
6
  *
9
7
  * @type {React.Context<{}>}
10
8
  */
11
- const TemplateContext = createContext({});
12
-
9
+ declare const TemplateContext: import("react").Context<{}>;
13
10
  export default TemplateContext;
@@ -0,0 +1,89 @@
1
+ /**
2
+ * Transforms a data location string to a path to be used in the UI components.
3
+ *
4
+ * @param dataLocation
5
+ * @param currentPath
6
+ * @param globalDataContext
7
+ * @param templateContext
8
+ * @returns {string|*}
9
+ * @constructor
10
+ */
11
+ export declare const dataLocationToPath: ({ dataLocation, currentPath, globalDataContext, templateContext }: {
12
+ dataLocation: any;
13
+ currentPath: any;
14
+ globalDataContext: any;
15
+ templateContext: any;
16
+ }) => any;
17
+ /**
18
+ * Evaluates the given attributes with the given contexts.
19
+ *
20
+ * @param {{}} attrs
21
+ * @param {{}} globalDataContext
22
+ * @param {{}} templateContext
23
+ * @param {{normalizeBeforeEvaluation : boolean}} options normalizeBeforeEvaluation is false if unset.
24
+ *
25
+ * @returns {{}}
26
+ */
27
+ export declare const evaluateAttributes: ({ attrs, globalDataContext, templateContext, options }: {
28
+ attrs: any;
29
+ globalDataContext: any;
30
+ templateContext: any;
31
+ options?: {} | undefined;
32
+ }) => {};
33
+ /**
34
+ * Evaluates the template value using the given template and global context.
35
+ *
36
+ * @param valueToEvaluate The value to evaluate.
37
+ * @param globalDataContext The global data context.
38
+ * @param templateContext The template context.
39
+ * @returns {undefined|*}
40
+ */
41
+ export declare const evaluateTemplateValue: ({ valueToEvaluate, globalDataContext, templateContext }: {
42
+ valueToEvaluate: any;
43
+ globalDataContext: any;
44
+ templateContext: any;
45
+ }) => any;
46
+ /**
47
+ * Evaluates an array or object containing values to evaluate.
48
+ *
49
+ * You can also pass a single value to evaluate.
50
+ *
51
+ * @param {Array|object|*} valueToEvaluate The value to evaluate. Usually a string, an array, or an object.
52
+ * @param {{}} globalDataContext The global data context values.
53
+ * @param {{}} templateContext The current template context values.
54
+ *
55
+ * @returns {*} The evaluated value. It tries to keep the same structure (array, object, single) as the given value.
56
+ */
57
+ export declare const evaluateTemplateValueCollection: ({ valueToEvaluate, globalDataContext, templateContext }: {
58
+ valueToEvaluate: any;
59
+ globalDataContext: any;
60
+ templateContext: any;
61
+ }) => any;
62
+ /**
63
+ * Checks if the given value is a value which can be replaced by the template system.
64
+ * @param valueToEvaluate
65
+ * @returns {string|boolean}
66
+ */
67
+ export declare const isTemplateValue: (valueToEvaluate: any) => string | false;
68
+ /**
69
+ * A template value is a value that is retrieved from the current template data.
70
+ *
71
+ * @param valueToEvaluate
72
+ *
73
+ * @returns {{}}
74
+ *
75
+ * @constructor
76
+ */
77
+ declare const TemplateValue: ({ valueToEvaluate }: {
78
+ valueToEvaluate: any;
79
+ }) => any;
80
+ export default TemplateValue;
81
+ /**
82
+ * Evaluates the given attributes with the given contexts.
83
+ *
84
+ * @param {{}} attrs
85
+ * @param {{normalizeBeforeEvaluation : boolean}} options normalizeBeforeEvaluation = true if unset.
86
+ *
87
+ * @returns {{}} Evaluated attributes.
88
+ */
89
+ export declare const useEvaluatedAttributes: (attrs: any, options?: {}) => {};
@@ -0,0 +1,7 @@
1
+ declare function View({ props, currentData, datafield, path }: {
2
+ props: any;
3
+ currentData: any;
4
+ datafield: any;
5
+ path: any;
6
+ }): import("react/jsx-runtime").JSX.Element | import("react/jsx-runtime").JSX.Element[];
7
+ export default View;
@@ -0,0 +1,6 @@
1
+ import ReactiveJsonRoot from "./engine/ReactiveJsonRoot";
2
+ import { mergeComponentCollections } from "./engine/ComponentCollector";
3
+ /**
4
+ * mergeComponentCollections helps in loading plugins when reactive-json is loaded in library mode.
5
+ */
6
+ export { ReactiveJsonRoot, mergeComponentCollections };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Entry point for the lib.
3
+ */
4
+ import "bootstrap/dist/css/bootstrap.min.css";
5
+ import ReactiveJsonRoot from "./engine/ReactiveJsonRoot";
6
+ import { mergeComponentCollections } from "./engine/ComponentCollector";
7
+ /**
8
+ * mergeComponentCollections helps in loading plugins when reactive-json is loaded in library mode.
9
+ */
10
+ export { ReactiveJsonRoot, mergeComponentCollections };