@arquimedes.co/eureka-forms 2.0.24 → 2.0.25-test

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 (46) hide show
  1. package/dist/@Types/Form.d.ts +1 -1
  2. package/dist/@Types/FormStep.d.ts +0 -1
  3. package/dist/App/App.d.ts +2 -0
  4. package/dist/App/App.js +1 -1
  5. package/dist/App/AppFunctions.js +2 -3
  6. package/dist/Form/Form.d.ts +3 -1
  7. package/dist/Form/Form.js +3 -3
  8. package/dist/Form/FormFunctions.d.ts +3 -0
  9. package/dist/Form/FormFunctions.js +19 -17
  10. package/dist/Form/FormTypes/StepperForm/StepperForm.d.ts +1 -1
  11. package/dist/Form/FormTypes/StepperForm/StepperForm.js +3 -1
  12. package/dist/FormSteps/MapperStep/MaterialMapperStep/MaterialMapperStep.d.ts +8 -4
  13. package/dist/FormSteps/MapperStep/MaterialMapperStep/MaterialMapperStep.js +50 -79
  14. package/dist/FormSteps/StepFunctions.d.ts +2 -2
  15. package/dist/FormSteps/StepFunctions.js +1 -1
  16. package/dist/Shared/Navbar/Navbar.stories.d.ts +13 -0
  17. package/dist/Shared/Navbar/Navbar.stories.js +13 -0
  18. package/dist/Shared/Rating/Rating.stories.d.ts +15 -0
  19. package/dist/Shared/Rating/Rating.stories.js +59 -0
  20. package/dist/Shared/RoundedButton/RoundedButton.stories.d.ts +23 -0
  21. package/dist/Shared/RoundedButton/RoundedButton.stories.js +36 -0
  22. package/dist/Shared/RoundedCheckBox/RoundedCheckBox.stories.d.ts +21 -0
  23. package/dist/Shared/RoundedCheckBox/RoundedCheckBox.stories.js +50 -0
  24. package/dist/Shared/RoundedDatePicker/RoundedDatePicker.d.ts +3 -2
  25. package/dist/Shared/RoundedDatePicker/RoundedDatePicker.js +3 -3
  26. package/dist/Shared/RoundedDatePicker/RoundedDatePicker.stories.d.ts +36 -0
  27. package/dist/Shared/RoundedDatePicker/RoundedDatePicker.stories.js +223 -0
  28. package/dist/Shared/RoundedSelect/RoundedSelect.stories.d.ts +28 -0
  29. package/dist/Shared/RoundedSelect/RoundedSelect.stories.js +91 -0
  30. package/dist/Shared/RoundedSmartSelect/RoundedSmartSelect.d.ts +0 -2
  31. package/dist/Shared/RoundedSmartSelect/RoundedSmartSelect.js +3 -3
  32. package/dist/Shared/RoundedSmartSelect/RoundedSmartSelect.stories.d.ts +36 -0
  33. package/dist/Shared/RoundedSmartSelect/RoundedSmartSelect.stories.js +318 -0
  34. package/dist/Shared/RoundedTextField/RoundedTextField.js +2 -2
  35. package/dist/Shared/RoundedTextField/RoundedTextField.stories.d.ts +13 -0
  36. package/dist/Shared/RoundedTextField/RoundedTextField.stories.js +200 -1
  37. package/dist/Utils/TestUtils.d.ts +77 -0
  38. package/dist/Utils/TestUtils.js +65 -0
  39. package/dist/Utils/store.d.ts +2 -0
  40. package/dist/Utils/store.js +1 -1
  41. package/dist/__mocks__/axios.d.ts +2 -0
  42. package/dist/__mocks__/axios.js +2 -0
  43. package/dist/index.js +5 -1
  44. package/package.json +15 -1
  45. /package/dist/Form/{Hooks.d.ts → FormHooks.d.ts} +0 -0
  46. /package/dist/Form/{Hooks.js → FormHooks.js} +0 -0
@@ -0,0 +1,65 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import { jsx as _jsx } from "react/jsx-runtime";
24
+ import React from 'react';
25
+ import { render } from '@testing-library/react';
26
+ import { configureStore, nanoid } from '@reduxjs/toolkit';
27
+ import { Provider } from 'react-redux';
28
+ // As a basic setup, import your same slice reducers
29
+ import { EurekaFormsReducer } from './store';
30
+ import { renderHook } from '@testing-library/react-hooks';
31
+ import { IdFormContext } from '../App/App';
32
+ import { StoreContext } from '../hooks';
33
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
34
+ export function renderWithProviders(ui, _a) {
35
+ if (_a === void 0) { _a = {}; }
36
+ var
37
+ // Automatically create a store instance if no store was passed in
38
+ _b = _a.store,
39
+ // Automatically create a store instance if no store was passed in
40
+ store = _b === void 0 ? configureStore({
41
+ reducer: EurekaFormsReducer,
42
+ }) : _b, renderOptions = __rest(_a, ["store"]);
43
+ // eslint-disable-next-line @typescript-eslint/ban-types
44
+ function Wrapper(_a) {
45
+ var children = _a.children;
46
+ return _jsx(Provider, __assign({ store: store }, { children: children }));
47
+ }
48
+ // Return an object with the store and all of RTL's query functions
49
+ return __assign({ store: store }, render(ui, __assign({ wrapper: Wrapper }, renderOptions)));
50
+ }
51
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type
52
+ export function renderHookWithProviders(callback, _a) {
53
+ if (_a === void 0) { _a = {}; }
54
+ var _b = _a.store, store = _b === void 0 ? configureStore({
55
+ reducer: EurekaFormsReducer,
56
+ }) : _b, renderHookOptions = __rest(_a, ["store"]);
57
+ // eslint-disable-next-line @typescript-eslint/ban-types
58
+ function Wrapper(_a) {
59
+ var children = _a.children;
60
+ var idForm = React.useState(nanoid(6))[0];
61
+ return (_jsx(IdFormContext.Provider, __assign({ value: idForm }, { children: _jsx(Provider, __assign({ store: store, context: StoreContext }, { children: children })) })));
62
+ }
63
+ // Return an object with the store and all of RTL's query functions
64
+ return __assign({ store: store }, renderHook(callback, __assign({ wrapper: Wrapper }, renderHookOptions)));
65
+ }
@@ -9,8 +9,10 @@ export interface RootState {
9
9
  }
10
10
  export declare const defaultRootState: RootState;
11
11
  export type EurekaFormsState = Record<string, RootState>;
12
+ export declare function EurekaFormsReducer(state: EurekaFormsState | undefined, action: AnyAction): EurekaFormsState;
12
13
  export declare const store: import("@reduxjs/toolkit/dist/configureStore").ToolkitStore<EurekaFormsState, AnyAction, [import("@reduxjs/toolkit").ThunkMiddleware<EurekaFormsState, AnyAction, undefined>]>;
13
14
  export type AppDispatch = typeof store.dispatch;
15
+ export type AppStore = typeof store;
14
16
  export declare const getAppState: import("@reduxjs/toolkit").AsyncThunk<RootState, {
15
17
  idForm: string;
16
18
  }, {
@@ -59,7 +59,7 @@ var FormReducer = combineReducers({
59
59
  site: SiteSlice.reducer,
60
60
  widthStats: WidthStatsSlice.reducer,
61
61
  });
62
- function EurekaFormsReducer(state, action) {
62
+ export function EurekaFormsReducer(state, action) {
63
63
  var _a, _b;
64
64
  var _c;
65
65
  if (state === void 0) { state = {}; }
@@ -0,0 +1,2 @@
1
+ import mockAxios from 'jest-mock-axios';
2
+ export default mockAxios;
@@ -0,0 +1,2 @@
1
+ import mockAxios from 'jest-mock-axios';
2
+ export default mockAxios;
package/dist/index.js CHANGED
@@ -24,4 +24,8 @@ if (values) {
24
24
  console.error('Invalid data-values JSON', error);
25
25
  }
26
26
  }
27
- ReactDOM.render(_jsx("div", __assign({ className: styles.eurekaForm }, { children: _jsx(App, { isWidget: false, apiKey: window.location.pathname.replace('/', ''), valuesData: dataValues }) })), document.getElementById('eureka-root'));
27
+ ReactDOM.render(_jsx("div", __assign({ className: styles.eurekaForm }, { children: _jsx(App, { isWidget: false, apiKey: window.location.pathname.replace('/', ''), valuesData: dataValues, scrollToTop: function () {
28
+ location.href = '#';
29
+ location.href = '#eureka-root';
30
+ location.href = '#';
31
+ } }) })), document.getElementById('eureka-root'));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@arquimedes.co/eureka-forms",
3
3
  "repository": "git://github.com/Arquimede5/Eureka-Forms.git",
4
- "version": "2.0.24",
4
+ "version":"2.0.25-test",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
7
7
  "build": "react-scripts build",
@@ -66,9 +66,11 @@
66
66
  "@storybook/react": "^7.6.4",
67
67
  "@storybook/react-webpack5": "^7.6.4",
68
68
  "@storybook/test": "^7.6.4",
69
+ "@storybook/testing-library": "^0.2.2",
69
70
  "@testing-library/dom": "^9.3.3",
70
71
  "@testing-library/jest-dom": "^6.1.5",
71
72
  "@testing-library/react": "^12.1.5",
73
+ "@testing-library/react-hooks": "^8.0.1",
72
74
  "@testing-library/user-event": "^14.5.1",
73
75
  "@types/draft-js": "^0.11.16",
74
76
  "@types/jest": "^29.5.10",
@@ -86,13 +88,17 @@
86
88
  "eslint-plugin-css-modules": "^2.12.0",
87
89
  "eslint-plugin-prettier": "^5.0.1",
88
90
  "eslint-plugin-storybook": "^0.6.15",
91
+ "identity-obj-proxy": "^3.0.0",
89
92
  "jest": "^29.7.0",
90
93
  "jest-environment-jsdom": "^29.7.0",
91
94
  "jest-junit": "^16.0.0",
95
+ "jest-mock-axios": "^4.7.3",
92
96
  "prettier": "^3.1.0",
97
+ "react-docgen-typescript": "^2.2.2",
93
98
  "react-refresh": "^0.11.0",
94
99
  "react-scripts": "5.0.1",
95
100
  "storybook": "^7.6.4",
101
+ "storybook-mock-date-decorator": "^1.0.1",
96
102
  "ts-jest": "^29.1.1"
97
103
  },
98
104
  "peerDependencies": {
@@ -106,5 +112,13 @@
106
112
  "files": [
107
113
  "/dist"
108
114
  ],
115
+ "jest": {
116
+ "transformIgnorePatterns": [
117
+ "node_modules/(?!axios)"
118
+ ],
119
+ "moduleNameMapper": {
120
+ "\\.(scss|sass|css)$": "identity-obj-proxy"
121
+ }
122
+ },
109
123
  "proxy": "https://api.forms.eureka-test.click"
110
124
  }
File without changes
File without changes