dynamic-mui 0.1.7 → 1.0.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.
- package/README.md +24 -17
- package/dist-modules/App.js +1 -7
- package/dist-modules/App.test.js +0 -5
- package/dist-modules/components/DynamicComponent.js +1 -10
- package/dist-modules/components/FormGenerator.js +84 -50
- package/dist-modules/components/controls/CheckBox/checkbox.js +60 -0
- package/dist-modules/components/controls/DataTable/datatable.js +6 -15
- package/dist-modules/components/controls/DateTime/datetime.js +27 -35
- package/dist-modules/components/controls/DateTimePicker/datetimepicker.js +27 -35
- package/dist-modules/components/controls/Select/select.js +43 -57
- package/dist-modules/components/controls/Switch/switch.js +92 -0
- package/dist-modules/components/controls/TextField/textfield.js +36 -52
- package/dist-modules/components/controls/TimePicker/timepicker.js +27 -35
- package/dist-modules/components/controls/Typography/typography.js +7 -16
- package/dist-modules/components/controls/index.js +6 -15
- package/dist-modules/config/mui.js +9 -2
- package/dist-modules/data/checkbox.js +144 -0
- package/dist-modules/data/dataTable.js +3 -4
- package/dist-modules/data/dateTime.js +14 -12
- package/dist-modules/data/select.js +6 -6
- package/dist-modules/data/switch.js +122 -0
- package/dist-modules/data/textfield.js +6 -10
- package/dist-modules/index.js +2 -8
- package/dist-modules/reportWebVitals.js +6 -12
- package/dist-modules/util/helper.js +43 -66
- package/dist-modules/util/validation.js +1 -6
- package/docs/asset-manifest.json +7 -7
- package/docs/build/2.7bd877b6.js +2 -0
- package/docs/build/{2.c9f4fc23.js.LICENSE.txt → 2.7bd877b6.js.LICENSE.txt} +34 -42
- package/docs/build/main.728d1f56.js +1 -0
- package/docs/index.html +5 -4
- package/package.json +35 -34
- package/styleguide.config.js +49 -1
- package/themes/index.js +1 -1
- package/dist-modules/components/controls/DateRangePicker/daterangepicker.js +0 -74
- package/docs/build/2.c9f4fc23.js +0 -2
- package/docs/build/main.992274eb.js +0 -1
- /package/docs/build/{bundle.483fa668.js → bundle.039d7aef.js} +0 -0
|
@@ -3,42 +3,36 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.generateKey = exports.default = exports.checkboxSX = exports.DateComponent = void 0;
|
|
6
7
|
exports.generateLayout = generateLayout;
|
|
7
8
|
exports.getInputProps = getInputProps;
|
|
8
|
-
exports.
|
|
9
|
-
|
|
9
|
+
exports.updatePatchData = void 0;
|
|
10
10
|
var _lodash = require("lodash");
|
|
11
|
-
|
|
12
11
|
var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
|
|
13
|
-
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
var _lab = require("@material-ui/lab");
|
|
17
|
-
|
|
12
|
+
var _material = require("@mui/material");
|
|
13
|
+
var _xDatePickers = require("@mui/x-date-pickers");
|
|
18
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
20
|
-
function ownKeys(
|
|
21
|
-
|
|
22
|
-
function
|
|
23
|
-
|
|
24
|
-
function
|
|
25
|
-
|
|
15
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
16
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
17
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
18
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
19
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
20
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
26
21
|
var response = {};
|
|
27
|
-
|
|
28
22
|
function generateLayout(data) {
|
|
29
23
|
var layout = {
|
|
30
24
|
wrows: [],
|
|
31
25
|
worows: []
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
var wrows = (0, _lodash.clone)(data);
|
|
35
|
-
|
|
26
|
+
};
|
|
27
|
+
// All Items
|
|
28
|
+
var wrows = (0, _lodash.clone)(data);
|
|
29
|
+
// Remove Without Rows
|
|
36
30
|
layout.worows = (0, _lodash.remove)(wrows, function (item) {
|
|
37
31
|
var isLayout = item.layout ? item.layout.row : item.layout;
|
|
38
32
|
return isLayout === undefined;
|
|
39
33
|
}); // Concat all items without rows
|
|
40
|
-
// All row indices
|
|
41
34
|
|
|
35
|
+
// All row indices
|
|
42
36
|
var rowIndex = (0, _lodash.map)(wrows, 'layout.row');
|
|
43
37
|
var uniqIndex = (0, _lodash.uniq)(rowIndex);
|
|
44
38
|
var sortedIndex = (0, _lodash.sortBy)(uniqIndex);
|
|
@@ -55,70 +49,56 @@ function generateLayout(data) {
|
|
|
55
49
|
});
|
|
56
50
|
return layout;
|
|
57
51
|
}
|
|
58
|
-
|
|
59
52
|
function getInputProps(InputProps) {
|
|
60
53
|
if (!(0, _isEmpty.default)(InputProps)) {
|
|
61
54
|
var _InputProps$MuiInputA = InputProps.MuiInputAdornment,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
return _defineProperty({}, "".concat(position, "Adornment"), /*#__PURE__*/React.createElement(
|
|
55
|
+
MuiInputAdornment = _InputProps$MuiInputA === void 0 ? {} : _InputProps$MuiInputA,
|
|
56
|
+
_InputProps$position = InputProps.position,
|
|
57
|
+
position = _InputProps$position === void 0 ? 'start' : _InputProps$position,
|
|
58
|
+
icon = InputProps.icon,
|
|
59
|
+
text = InputProps.text,
|
|
60
|
+
_InputProps$textstyle = InputProps.textstyle,
|
|
61
|
+
textstyle = _InputProps$textstyle === void 0 ? {} : _InputProps$textstyle;
|
|
62
|
+
return _defineProperty({}, "".concat(position, "Adornment"), /*#__PURE__*/React.createElement(_material.InputAdornment, MuiInputAdornment, icon && /*#__PURE__*/React.createElement(_material.Icon, null, icon), !(0, _isEmpty.default)(textstyle) ? /*#__PURE__*/React.createElement("div", {
|
|
70
63
|
style: textstyle
|
|
71
64
|
}, text || '') : text || ''));
|
|
72
65
|
}
|
|
73
|
-
|
|
74
66
|
return {};
|
|
75
67
|
}
|
|
76
|
-
|
|
77
|
-
var generateKey = function generateKey() {
|
|
68
|
+
var generateKey = exports.generateKey = function generateKey() {
|
|
78
69
|
var prefix = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
79
70
|
var index = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
80
71
|
var random = Math.random().toString(36).substr(2, 9);
|
|
81
72
|
var currentTime = new Date().toLocaleTimeString('en').trim();
|
|
82
73
|
return "".concat(prefix, "_").concat(index, "_").concat(random, "_").concat(currentTime);
|
|
83
74
|
};
|
|
84
|
-
|
|
85
|
-
exports.generateKey = generateKey;
|
|
86
|
-
|
|
87
|
-
var updatePatchData = function updatePatchData(fields, patch, guid) {
|
|
75
|
+
var updatePatchData = exports.updatePatchData = function updatePatchData(fields, patch, guid) {
|
|
88
76
|
response[guid] = patch;
|
|
89
|
-
var formData = Object.assign([], fields);
|
|
90
|
-
|
|
77
|
+
var formData = Object.assign([], fields);
|
|
78
|
+
// if (isEmpty(patch)) return fields;
|
|
91
79
|
return (0, _lodash.map)(formData, function (field) {
|
|
92
80
|
var newField = _objectSpread({}, field);
|
|
93
|
-
|
|
94
81
|
if (newField.id && response[guid][field.id]) {
|
|
95
82
|
newField.props.value = response[guid][field.id] || '';
|
|
96
83
|
}
|
|
97
|
-
|
|
98
84
|
return newField;
|
|
99
85
|
});
|
|
100
86
|
};
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
if (name === '
|
|
106
|
-
if (name === '
|
|
107
|
-
if (name === '
|
|
108
|
-
if (name === '
|
|
109
|
-
if (name === '
|
|
110
|
-
if (name === '
|
|
111
|
-
if (name === '
|
|
112
|
-
if (name === '
|
|
113
|
-
|
|
114
|
-
if (name === 'MobileTimePicker') return _lab.MobileTimePicker;
|
|
115
|
-
if (name === 'DesktopTimePicker') return _lab.DesktopTimePicker;
|
|
116
|
-
return _lab.DatePicker;
|
|
87
|
+
var DateComponent = exports.DateComponent = function DateComponent(name) {
|
|
88
|
+
if (name === 'MobileDatePicker') return _xDatePickers.MobileDatePicker;
|
|
89
|
+
if (name === 'DesktopDatePicker') return _xDatePickers.DesktopDatePicker;
|
|
90
|
+
// if (name === 'DateRangePicker') return DateRangePicker;
|
|
91
|
+
// if (name === 'MobileDateRangePicker') return MobileDateRangePicker;
|
|
92
|
+
// if (name === 'DesktopDateRangePicker') return DesktopDateRangePicker;
|
|
93
|
+
if (name === 'DateTimePicker') return _xDatePickers.DateTimePicker;
|
|
94
|
+
if (name === 'MobileDateTimePicker') return _xDatePickers.MobileDateTimePicker;
|
|
95
|
+
if (name === 'DesktopDateTimePicker') return _xDatePickers.DesktopDateTimePicker;
|
|
96
|
+
if (name === 'TimePicker') return _xDatePickers.TimePicker;
|
|
97
|
+
if (name === 'MobileTimePicker') return _xDatePickers.MobileTimePicker;
|
|
98
|
+
if (name === 'DesktopTimePicker') return _xDatePickers.DesktopTimePicker;
|
|
99
|
+
return _xDatePickers.DatePicker;
|
|
117
100
|
};
|
|
118
|
-
|
|
119
|
-
exports.DateComponent = DateComponent;
|
|
120
|
-
|
|
121
|
-
var checkboxSX = function checkboxSX(color) {
|
|
101
|
+
var checkboxSX = exports.checkboxSX = function checkboxSX(color) {
|
|
122
102
|
if (color) return {
|
|
123
103
|
color: color,
|
|
124
104
|
'&.Mui-checked': {
|
|
@@ -127,14 +107,11 @@ var checkboxSX = function checkboxSX(color) {
|
|
|
127
107
|
};
|
|
128
108
|
return {};
|
|
129
109
|
};
|
|
130
|
-
|
|
131
|
-
exports.checkboxSX = checkboxSX;
|
|
132
|
-
var _default = {
|
|
110
|
+
var _default = exports.default = {
|
|
133
111
|
generateLayout: generateLayout,
|
|
134
112
|
getInputProps: getInputProps,
|
|
135
113
|
generateKey: generateKey,
|
|
136
114
|
updatePatchData: updatePatchData,
|
|
137
115
|
DateComponent: DateComponent,
|
|
138
116
|
checkboxSX: checkboxSX
|
|
139
|
-
};
|
|
140
|
-
exports.default = _default;
|
|
117
|
+
};
|
|
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
|
|
8
7
|
var _validator = _interopRequireDefault(require("validator"));
|
|
9
|
-
|
|
10
8
|
var _numeral = _interopRequireDefault(require("numeral"));
|
|
11
|
-
|
|
12
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
|
|
14
10
|
var Validation = {
|
|
15
11
|
email: function email(value, options) {
|
|
16
12
|
return _validator.default.isEmail(value, options);
|
|
@@ -103,5 +99,4 @@ var Validation = {
|
|
|
103
99
|
return (0, _numeral.default)(value).value() > -1;
|
|
104
100
|
}
|
|
105
101
|
};
|
|
106
|
-
var _default = Validation;
|
|
107
|
-
exports.default = _default;
|
|
102
|
+
var _default = exports.default = Validation;
|
package/docs/asset-manifest.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"files": {
|
|
3
|
-
"main.js": "/DinakaranS/-dynamic-mui/build/main.
|
|
4
|
-
"runtime-main.js": "/DinakaranS/-dynamic-mui/build/bundle.
|
|
5
|
-
"build/2.
|
|
6
|
-
"build/2.
|
|
3
|
+
"main.js": "/DinakaranS/-dynamic-mui/build/main.728d1f56.js",
|
|
4
|
+
"runtime-main.js": "/DinakaranS/-dynamic-mui/build/bundle.039d7aef.js",
|
|
5
|
+
"build/2.7bd877b6.js": "/DinakaranS/-dynamic-mui/build/2.7bd877b6.js",
|
|
6
|
+
"build/2.7bd877b6.js.LICENSE.txt": "/DinakaranS/-dynamic-mui/build/2.7bd877b6.js.LICENSE.txt",
|
|
7
7
|
"index.html": "/DinakaranS/-dynamic-mui/index.html"
|
|
8
8
|
},
|
|
9
9
|
"entrypoints": [
|
|
10
|
-
"build/bundle.
|
|
11
|
-
"build/2.
|
|
12
|
-
"build/main.
|
|
10
|
+
"build/bundle.039d7aef.js",
|
|
11
|
+
"build/2.7bd877b6.js",
|
|
12
|
+
"build/main.728d1f56.js"
|
|
13
13
|
]
|
|
14
14
|
}
|