dynamic-mui 1.0.39 → 1.0.41

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.
@@ -0,0 +1,193 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.mui = exports.customMui = void 0;
7
+ const mui = exports.mui = [{
8
+ type: 'stepper',
9
+ props: {
10
+ id: 'stepper',
11
+ MuiBoxAttributes: {},
12
+ MuiStepLabelOptionalLabel: 'Last Step',
13
+ MuiStepperAttributes: {},
14
+ orientation: 'horizontal',
15
+ MuiSteps: [{
16
+ label: 'Select Service Request',
17
+ components: [{
18
+ type: 'select',
19
+ props: {
20
+ id: 'servicetype',
21
+ MuiAttributes: {
22
+ required: true
23
+ },
24
+ options: [{
25
+ value: 'New Installation',
26
+ label: 'New Installation'
27
+ }, {
28
+ value: 'Change Classification',
29
+ label: 'Change Classification'
30
+ }, {
31
+ value: 'Change Meter',
32
+ label: 'Change Meter'
33
+ }, {
34
+ value: 'Change Name',
35
+ label: 'Change Name'
36
+ }, {
37
+ value: 'Transfer Location',
38
+ label: 'Transfer Location'
39
+ }, {
40
+ value: 'Recheck Read',
41
+ label: 'Recheck Read'
42
+ }, {
43
+ value: 'Disconnection - Voluntary',
44
+ label: 'Disconnection - Voluntary'
45
+ }],
46
+ MuiBoxAttributes: {}
47
+ }
48
+ }]
49
+ }, {
50
+ label: 'Assign Priority',
51
+ isScreenChange: true,
52
+ components: [{
53
+ type: 'select',
54
+ props: {
55
+ id: 'priority',
56
+ MuiAttributes: {
57
+ required: true
58
+ },
59
+ options: [{
60
+ value: 'Emergency',
61
+ label: 'Emergency'
62
+ }, {
63
+ value: 'High',
64
+ label: 'High'
65
+ }, {
66
+ value: 'Medium',
67
+ label: 'Medium'
68
+ }, {
69
+ value: 'Low',
70
+ label: 'Low'
71
+ }],
72
+ MuiBoxAttributes: {}
73
+ }
74
+ }]
75
+ }, {
76
+ label: 'Choose Schedule In Calendar',
77
+ components: [{
78
+ id: 'start',
79
+ type: 'datetime',
80
+ props: {
81
+ id: 'start',
82
+ MuiAttributes: {
83
+ label: 'Start',
84
+ fullWidth: true,
85
+ disabled: true,
86
+ sx: {
87
+ width: '100%'
88
+ }
89
+ }
90
+ }
91
+ }, {
92
+ id: 'end',
93
+ type: 'datetime',
94
+ props: {
95
+ id: 'end',
96
+ MuiAttributes: {
97
+ label: 'End',
98
+ fullWidth: true,
99
+ disabled: true,
100
+ sx: {
101
+ width: '100%',
102
+ mt: 1.5
103
+ }
104
+ }
105
+ }
106
+ }]
107
+ }, {
108
+ label: 'Assign User',
109
+ components: [{
110
+ type: 'select',
111
+ props: {
112
+ id: 'assigntouser',
113
+ MuiAttributes: {},
114
+ options: [{
115
+ value: 'Dinakaran',
116
+ label: 'Dinakaran'
117
+ }, {
118
+ value: 'Thiyagarajan',
119
+ label: 'Thiyagarajan'
120
+ }],
121
+ MuiBoxAttributes: {}
122
+ }
123
+ }]
124
+ }, {
125
+ label: 'Determine Cost',
126
+ components: [{
127
+ id: 'determinecost',
128
+ type: 'radio',
129
+ props: {
130
+ id: 'determinecost',
131
+ value: 'Skip',
132
+ MuiAttributes: {},
133
+ MuiFLabelIcon: {},
134
+ MuiFLabel: '',
135
+ MuiFCLAttributes: {},
136
+ MuiFCLabels: ['Skip', 'Assign'],
137
+ MuiRGAttributes: {
138
+ row: true
139
+ }
140
+ }
141
+ }, {
142
+ id: 'cost',
143
+ type: 'textfield',
144
+ props: {
145
+ id: 'cost',
146
+ MuiAttributes: {}
147
+ }
148
+ }]
149
+ }, {
150
+ label: 'Description',
151
+ components: [{
152
+ id: 'description',
153
+ type: 'textfield',
154
+ props: {
155
+ id: 'description',
156
+ MuiAttributes: {
157
+ multiline: true,
158
+ rows: 3
159
+ }
160
+ }
161
+ }]
162
+ }, {
163
+ label: 'Review'
164
+ }],
165
+ MuiStepAttributes: {},
166
+ MuiStepLabelAttributes: {},
167
+ MuiStepContentAttributes: {},
168
+ MuiButtonAttributes: {
169
+ back: {},
170
+ next: {},
171
+ final: {},
172
+ backLabel: '',
173
+ nextLabel: '',
174
+ finalLabel: ''
175
+ }
176
+ },
177
+ layout: {
178
+ row: 1,
179
+ xs: 12,
180
+ sm: 12
181
+ }
182
+ }];
183
+ const customMui = exports.customMui = [{
184
+ type: 'stepper',
185
+ props: {
186
+ MuiAttributes: {}
187
+ },
188
+ layout: {
189
+ row: 1,
190
+ xs: 12,
191
+ sm: 12
192
+ }
193
+ }];
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = StepperComponents;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _propTypes = _interopRequireDefault(require("prop-types"));
9
+ var Controls = _interopRequireWildcard(require("../components/controls"));
10
+ var _mui = _interopRequireDefault(require("../config/mui"));
11
+ var _helper = require("./helper");
12
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
13
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
14
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
+ // eslint-disable-next-line import/no-cycle
16
+
17
+ function StepperComponents(_ref) {
18
+ let {
19
+ components,
20
+ onUpdate
21
+ } = _ref;
22
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, [...components].map((component, index) => {
23
+ const CustomComponent = Controls.default[_mui.default[component.type].map];
24
+ return /*#__PURE__*/_react.default.createElement(CustomComponent, {
25
+ key: (0, _helper.generateKey)('dynamic-stepper-comp', index),
26
+ attributes: component.props,
27
+ onChange: onUpdate
28
+ });
29
+ }));
30
+ }
31
+ StepperComponents.propTypes = process.env.NODE_ENV !== "production" ? {
32
+ /** Attributes for StepperComponent */
33
+ components: _propTypes.default.arrayOf(_propTypes.default.object),
34
+ /** Function */
35
+ onUpdate: _propTypes.default.func
36
+ } : {};
37
+ StepperComponents.defaultProps = {
38
+ components: [],
39
+ // rules: {},
40
+ onUpdate: null
41
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dynamic-mui",
3
- "version": "1.0.39",
3
+ "version": "1.0.41",
4
4
  "author": "Dinakaran S",
5
5
  "user": "dinakarans",
6
6
  "repository": {
@@ -19,8 +19,9 @@
19
19
  "@babel/plugin-transform-modules-commonjs": "^7.23.3",
20
20
  "@emotion/react": "^11.11.1",
21
21
  "@emotion/styled": "^11.11.0",
22
- "@mui/icons-material": "^5.15.0",
23
- "@mui/material": "^5.15.0",
22
+ "@mui/icons-material": "^5.15.1",
23
+ "@mui/material": "^5.15.1",
24
+ "@mui/x-charts": "^6.18.3",
24
25
  "@mui/x-data-grid": "^6.18.5",
25
26
  "@mui/x-date-pickers": "^6.18.5",
26
27
  "@testing-library/jest-dom": "^6.1.5",
@@ -36,15 +37,15 @@
36
37
  "react-dom": "^18.2.0",
37
38
  "react-json-tree": "^0.18.0",
38
39
  "react-number-format": "^5.3.1",
39
- "react-scripts": "4.0.3",
40
+ "react-scripts": "5.0.1",
40
41
  "validator": "^13.11.0",
41
42
  "web-vitals": "^3.5.0"
42
43
  },
43
44
  "scripts": {
44
- "start": "react-scripts start",
45
- "build": "react-scripts build",
46
- "test": "react-scripts test",
47
- "eject": "react-scripts eject",
45
+ "start": "craco start",
46
+ "build": "craco build",
47
+ "test": "craco test",
48
+ "eject": "craco eject",
48
49
  "styleguide": "styleguidist server",
49
50
  "styleguide:build": "rimraf docs && styleguidist build && mkdir docs && mv styleguide/* docs",
50
51
  "lint": "eslint .",
@@ -73,17 +74,19 @@
73
74
  "devDependencies": {
74
75
  "@babel/cli": "^7.23.4",
75
76
  "@babel/core": "^7.23.6",
77
+ "@babel/plugin-proposal-private-property-in-object": "^7.21.11",
76
78
  "@babel/preset-env": "^7.23.6",
79
+ "@craco/craco": "^7.1.0",
77
80
  "eslint": "8.56.0",
78
81
  "eslint-config-airbnb": "^19.0.4",
79
82
  "eslint-config-prettier": "^9.1.0",
80
83
  "eslint-plugin-import": "^2.29.1",
81
84
  "eslint-plugin-jsx-a11y": "^6.8.0",
82
- "eslint-plugin-prettier": "^5.0.1",
85
+ "eslint-plugin-prettier": "^5.1.0",
83
86
  "eslint-plugin-react": "^7.33.2",
84
87
  "eslint-plugin-react-hooks": "^4.6.0",
85
88
  "prettier": "^3.1.1",
86
- "react-styleguidist": "^11.2.0",
89
+ "react-styleguidist": "^13.1.1",
87
90
  "tinycolor2": "^1.6.0"
88
91
  }
89
92
  }
@@ -1,10 +1,29 @@
1
- const path = require('path');
1
+ // eslint-disable-next-line import/no-extraneous-dependencies
2
+ const webpack = require('webpack');
2
3
  const { version } = require('./package.json');
3
4
 
4
5
  module.exports = {
5
6
  version,
6
7
  title: 'Dynamic MUI',
7
- // Check for updates in the template structure for v13
8
+ dangerouslyUpdateWebpackConfig(config) {
9
+ config.module.rules.push({
10
+ test: /.\.md$/,
11
+ type: 'javascript/auto',
12
+ });
13
+ config.plugins.push(
14
+ new webpack.NormalModuleReplacementPlugin(
15
+ /react-styleguidist\/lib\/loaders\/utils\/client\/requireInRuntime$/,
16
+ 'react-styleguidist/lib/loaders/utils/client/requireInRuntime',
17
+ ),
18
+ );
19
+ config.plugins.push(
20
+ new webpack.NormalModuleReplacementPlugin(
21
+ /react-styleguidist\/lib\/loaders\/utils\/client\/evalInContext$/,
22
+ 'react-styleguidist/lib/loaders/utils/client/evalInContext',
23
+ ),
24
+ );
25
+ return config;
26
+ },
8
27
  template: {
9
28
  favicon: 'https://geoviewer.io/img/favicon.ico',
10
29
  head: {
@@ -21,7 +40,6 @@ module.exports = {
21
40
  },
22
41
  },
23
42
  theme: {
24
- // Update the theme configuration according to the new theme structure in v13
25
43
  color: {
26
44
  codeBackground: '#272C34',
27
45
  codeString: '#a6e22e',
@@ -53,11 +71,9 @@ module.exports = {
53
71
  },
54
72
  },
55
73
  styles: {
56
- // Ensure that custom styles are still compatible with v13
57
74
  Logo: {
58
75
  logo: {
59
76
  color: 'white',
60
- // animation: '$blink ease-in-out 300ms infinite',
61
77
  },
62
78
  '@keyframes blink': {
63
79
  to: { opacity: 0 },
@@ -65,7 +81,6 @@ module.exports = {
65
81
  },
66
82
  },
67
83
  pagePerSection: true,
68
- ignore: ['src/components/controls/index.js'],
69
84
  components: 'src/components/controls/**/*.js',
70
85
  sections: [
71
86
  {
@@ -81,8 +96,13 @@ module.exports = {
81
96
  usageMode: 'expand',
82
97
  sectionDepth: 2,
83
98
  },
99
+ {
100
+ name: 'Charts',
101
+ components: 'src/components/charts/**/*.js',
102
+ exampleMode: 'expand',
103
+ usageMode: 'expand',
104
+ sectionDepth: 2,
105
+ },
84
106
  ],
85
- // Confirm if styleguideComponents structure is the same in v13
86
107
  styleguideComponents: {},
87
- // Add any new configuration options introduced in v13
88
108
  };