ywana-core8 0.0.231 → 0.0.232

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/dist/index.cjs CHANGED
@@ -3109,38 +3109,51 @@ var StringEditor = function StringEditor(_ref6) {
3109
3109
  return opts;
3110
3110
  }
3111
3111
 
3112
+ function renderFormat(format, options) {
3113
+ switch (format) {
3114
+ case FORMATS.HTML:
3115
+ return /*#__PURE__*/React__default["default"].createElement(Editor, {
3116
+ id: id,
3117
+ value: value,
3118
+ onChange: change,
3119
+ content: content
3120
+ });
3121
+
3122
+ case FORMATS.DATE:
3123
+ return /*#__PURE__*/React__default["default"].createElement(TextField, {
3124
+ outlined: outlined,
3125
+ id: id,
3126
+ type: "date",
3127
+ label: label,
3128
+ value: value,
3129
+ onChange: change,
3130
+ readOnly: !editable
3131
+ });
3132
+
3133
+ default:
3134
+ return options ? /*#__PURE__*/React__default["default"].createElement(DropDown, {
3135
+ outlined: outlined,
3136
+ id: id,
3137
+ label: label,
3138
+ value: value,
3139
+ onChange: change,
3140
+ options: buildOptions(),
3141
+ readOnly: !editable,
3142
+ canFilter: predictive
3143
+ }) : /*#__PURE__*/React__default["default"].createElement(TextField, {
3144
+ outlined: outlined,
3145
+ id: id,
3146
+ label: label,
3147
+ value: value,
3148
+ onChange: change,
3149
+ readOnly: !editable
3150
+ });
3151
+ }
3152
+ }
3153
+
3112
3154
  return /*#__PURE__*/React__default["default"].createElement("div", {
3113
3155
  className: "field-editor string-editor"
3114
- }, format === FORMATS.HTML ? /*#__PURE__*/React__default["default"].createElement(Editor, {
3115
- id: id,
3116
- value: value,
3117
- onChange: change,
3118
- content: content
3119
- }) : null, format === FORMATS.DATE ? /*#__PURE__*/React__default["default"].createElement(TextField, {
3120
- outlined: outlined,
3121
- id: id,
3122
- type: "date",
3123
- label: label,
3124
- value: value,
3125
- onChange: change,
3126
- readOnly: !editable
3127
- }) : options ? /*#__PURE__*/React__default["default"].createElement(DropDown, {
3128
- outlined: outlined,
3129
- id: id,
3130
- label: label,
3131
- value: value,
3132
- onChange: change,
3133
- options: buildOptions(),
3134
- readOnly: !editable,
3135
- canFilter: predictive
3136
- }) : /*#__PURE__*/React__default["default"].createElement(TextField, {
3137
- outlined: outlined,
3138
- id: id,
3139
- label: label,
3140
- value: value,
3141
- onChange: change,
3142
- readOnly: !editable
3143
- }));
3156
+ }, renderFormat(format, options));
3144
3157
  };
3145
3158
  /**
3146
3159
  * Number Editor