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.
@@ -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$field$;
49
- const fieldValue = (_response$guid$field$ = response[guid][field.id]) === null || _response$guid$field$ === void 0 ? void 0 : _response$guid$field$.toString();
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 => /*#__PURE__*/_react.default.createElement(_TextField.default, _extends({}, params, MuiBoxAttributes, {
104
- inputProps: {
105
- ...params.inputProps,
106
- autoComplete: 'new-password'
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
- ...(0, _helper.getInputProps)(InputProps)
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, MuiInputAdornment, icon && /*#__PURE__*/_react.default.createElement(_material.Icon, null, icon), !(0, _isEmpty.default)(textstyle) ? /*#__PURE__*/_react.default.createElement("div", {
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
  };
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "files": {
3
- "main.js": "/DinakaranS/-dynamic-mui/build/bundle.a0d48865.js",
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.a0d48865.js"
7
+ "build/bundle.5a45b36c.js"
8
8
  ]
9
9
  }