dynamic-mui 1.0.61 → 1.0.63
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/build/asset-manifest.json +3 -3
- package/build/index.html +1 -1
- package/build/static/js/main.4dbadf17.js +3 -0
- package/build/static/js/main.4dbadf17.js.map +1 -0
- package/dist-modules/components/FormGenerator.js +2 -2
- package/dist-modules/components/controls/Select/select.js +21 -14
- package/dist-modules/data/select.js +37 -0
- package/dist-modules/util/helper.js +4 -1
- package/docs/asset-manifest.json +2 -2
- package/docs/build/bundle.5a45b36c.js +2 -0
- package/docs/index.html +1 -1
- package/package.json +10 -10
- package/build/static/js/main.a7616168.js +0 -3
- package/build/static/js/main.a7616168.js.map +0 -1
- package/docs/build/bundle.a0d48865.js +0 -2
- /package/build/static/js/{main.a7616168.js.LICENSE.txt → main.4dbadf17.js.LICENSE.txt} +0 -0
- /package/docs/build/{bundle.a0d48865.js.LICENSE.txt → bundle.5a45b36c.js.LICENSE.txt} +0 -0
|
@@ -45,8 +45,8 @@ const getErrors = (fields, guid) => {
|
|
|
45
45
|
return mandatoryFields === null || mandatoryFields === void 0 ? void 0 : mandatoryFields.reduce((acc, field) => {
|
|
46
46
|
var _field$rules2;
|
|
47
47
|
field === null || field === void 0 || (_field$rules2 = field.rules) === null || _field$rules2 === void 0 || (_field$rules2 = _field$rules2.validation) === null || _field$rules2 === void 0 || _field$rules2.forEach(rule => {
|
|
48
|
-
var _response$guid$
|
|
49
|
-
const fieldValue = (_response$guid
|
|
48
|
+
var _response$guid, _field$props;
|
|
49
|
+
const fieldValue = (_response$guid = response[guid][(field === null || field === void 0 ? void 0 : field.id) || (field === null || field === void 0 || (_field$props = field.props) === null || _field$props === void 0 ? void 0 : _field$props.id)]) === null || _response$guid === void 0 ? void 0 : _response$guid.toString();
|
|
50
50
|
const isClean = fieldValue && _validation.default[rule.rule](fieldValue, rule.value);
|
|
51
51
|
if (!isClean) {
|
|
52
52
|
acc.push({
|
|
@@ -30,13 +30,13 @@ const getValue = function () {
|
|
|
30
30
|
let isMultiple = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
31
31
|
if (isMultiple) {
|
|
32
32
|
let separator = ',';
|
|
33
|
-
if (defaultValue.includes(',')) separator = ',';else if (defaultValue.includes(';')) separator = ';';
|
|
34
|
-
const dValueSet = new Set(defaultValue.split(separator));
|
|
35
|
-
return options.filter(_ref => {
|
|
33
|
+
if (defaultValue !== null && defaultValue !== void 0 && defaultValue.includes(',')) separator = ',';else if (defaultValue !== null && defaultValue !== void 0 && defaultValue.includes(';')) separator = ';';
|
|
34
|
+
const dValueSet = new Set(defaultValue === null || defaultValue === void 0 ? void 0 : defaultValue.split(separator));
|
|
35
|
+
return options === null || options === void 0 ? void 0 : options.filter(_ref => {
|
|
36
36
|
let {
|
|
37
37
|
value
|
|
38
38
|
} = _ref;
|
|
39
|
-
return dValueSet.has(value);
|
|
39
|
+
return dValueSet === null || dValueSet === void 0 ? void 0 : dValueSet.has(value);
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
return options.find(_ref2 => {
|
|
@@ -86,7 +86,7 @@ function Select(_ref3) {
|
|
|
86
86
|
const data = MuiAttributes.multiple ? newValue.map(extractValue) : extractValue(newValue);
|
|
87
87
|
onChange({
|
|
88
88
|
id,
|
|
89
|
-
value: data,
|
|
89
|
+
value: MuiAttributes.multiple ? data.toString() : data,
|
|
90
90
|
option: newValue
|
|
91
91
|
});
|
|
92
92
|
} else onChange({
|
|
@@ -100,16 +100,23 @@ function Select(_ref3) {
|
|
|
100
100
|
options: options,
|
|
101
101
|
value: value,
|
|
102
102
|
onChange: onChangeEvent,
|
|
103
|
-
renderInput: params =>
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
},
|
|
108
|
-
InputProps: {
|
|
103
|
+
renderInput: params => {
|
|
104
|
+
// Ensure custom adornments are incorporated without overriding other essential props
|
|
105
|
+
const customInputProps = (0, _helper.getInputProps)(InputProps);
|
|
106
|
+
const mergedInputProps = {
|
|
109
107
|
...params.InputProps,
|
|
110
|
-
...
|
|
111
|
-
|
|
112
|
-
|
|
108
|
+
...customInputProps,
|
|
109
|
+
startAdornment: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, customInputProps === null || customInputProps === void 0 ? void 0 : customInputProps.startAdornment, params.InputProps.startAdornment, " "),
|
|
110
|
+
endAdornment: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, customInputProps === null || customInputProps === void 0 ? void 0 : customInputProps.endAdornment, params.InputProps.endAdornment)
|
|
111
|
+
};
|
|
112
|
+
return /*#__PURE__*/_react.default.createElement(_TextField.default, _extends({}, params, MuiBoxAttributes, {
|
|
113
|
+
inputProps: {
|
|
114
|
+
...params.inputProps,
|
|
115
|
+
autoComplete: 'new-password' // Disables browser autocomplete
|
|
116
|
+
},
|
|
117
|
+
InputProps: mergedInputProps
|
|
118
|
+
}));
|
|
119
|
+
}
|
|
113
120
|
}));
|
|
114
121
|
}
|
|
115
122
|
Select.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
@@ -86,4 +86,41 @@ const multiSelect = exports.multiSelect = [{
|
|
|
86
86
|
xs: 12,
|
|
87
87
|
sm: 12
|
|
88
88
|
}
|
|
89
|
+
}, {
|
|
90
|
+
type: 'select',
|
|
91
|
+
props: {
|
|
92
|
+
id: 'billingmode',
|
|
93
|
+
MuiAttributes: {
|
|
94
|
+
multiple: true,
|
|
95
|
+
disableCloseOnSelect: true
|
|
96
|
+
},
|
|
97
|
+
options: [{
|
|
98
|
+
value: 'SMS',
|
|
99
|
+
label: 'SMS'
|
|
100
|
+
}, {
|
|
101
|
+
value: 'E-mail',
|
|
102
|
+
label: 'E-mail'
|
|
103
|
+
}, {
|
|
104
|
+
value: 'Printed Statement of Account',
|
|
105
|
+
label: 'Printed Statement of Account'
|
|
106
|
+
}],
|
|
107
|
+
MuiBoxAttributes: {
|
|
108
|
+
label: 'Received Billing thru *'
|
|
109
|
+
},
|
|
110
|
+
InputProps: {
|
|
111
|
+
position: 'start',
|
|
112
|
+
icon: 'class'
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
layout: {
|
|
116
|
+
row: 90,
|
|
117
|
+
xs: 12,
|
|
118
|
+
sm: 6
|
|
119
|
+
},
|
|
120
|
+
rules: {
|
|
121
|
+
validation: [{
|
|
122
|
+
rule: 'mandatory',
|
|
123
|
+
message: 'Please select Billing Mode!'
|
|
124
|
+
}]
|
|
125
|
+
}
|
|
89
126
|
}];
|
|
@@ -14,6 +14,7 @@ var _xDatePickers = require("@mui/x-date-pickers");
|
|
|
14
14
|
var _react = _interopRequireDefault(require("react"));
|
|
15
15
|
var _utils = require("@mui/x-data-grid/utils/utils");
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
17
18
|
function generateLayout(data) {
|
|
18
19
|
const layout = {
|
|
19
20
|
wrows: [],
|
|
@@ -54,7 +55,9 @@ function getInputProps(InputProps) {
|
|
|
54
55
|
textstyle = {}
|
|
55
56
|
} = InputProps;
|
|
56
57
|
return {
|
|
57
|
-
["".concat(position, "Adornment")]: /*#__PURE__*/_react.default.createElement(_material.InputAdornment,
|
|
58
|
+
["".concat(position, "Adornment")]: /*#__PURE__*/_react.default.createElement(_material.InputAdornment, _extends({}, MuiInputAdornment, {
|
|
59
|
+
key: "custom-icon-Adornment-".concat(position)
|
|
60
|
+
}), icon && /*#__PURE__*/_react.default.createElement(_material.Icon, null, icon), !(0, _isEmpty.default)(textstyle) ? /*#__PURE__*/_react.default.createElement("div", {
|
|
58
61
|
style: textstyle
|
|
59
62
|
}, text || '') : text || '')
|
|
60
63
|
};
|
package/docs/asset-manifest.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"files": {
|
|
3
|
-
"main.js": "/DinakaranS/-dynamic-mui/build/bundle.
|
|
3
|
+
"main.js": "/DinakaranS/-dynamic-mui/build/bundle.5a45b36c.js",
|
|
4
4
|
"index.html": "/DinakaranS/-dynamic-mui/index.html"
|
|
5
5
|
},
|
|
6
6
|
"entrypoints": [
|
|
7
|
-
"build/bundle.
|
|
7
|
+
"build/bundle.5a45b36c.js"
|
|
8
8
|
]
|
|
9
9
|
}
|