@sunggang/ui-lib 0.3.9 → 0.3.10

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.
@@ -66794,7 +66794,7 @@ var BaseCkeditor = function(param) {
66794
66794
  var _item_validateOption;
66795
66795
  var _useFormContext = useFormContext(), control = _useFormContext.control, errors = _useFormContext.formState.errors;
66796
66796
  return /*#__PURE__*/ jsx(Controller, {
66797
- name: item.name,
66797
+ name: item === null || item === void 0 ? void 0 : item.name,
66798
66798
  control: control,
66799
66799
  rules: (item === null || item === void 0 ? void 0 : (_item_validateOption = item.validateOption) === null || _item_validateOption === void 0 ? void 0 : _item_validateOption.required) ? {
66800
66800
  required: item === null || item === void 0 ? void 0 : item.errorText
@@ -66821,8 +66821,18 @@ var BaseCkeditor = function(param) {
66821
66821
  onChange(data);
66822
66822
  },
66823
66823
  onReady: function(editor) {
66824
- if (item === null || item === void 0 ? void 0 : item.disabled) {
66825
- editor.enableReadOnlyMode(item.name);
66824
+ if ((item === null || item === void 0 ? void 0 : item.disable) || (item === null || item === void 0 ? void 0 : item.disabled)) {
66825
+ editor.enableReadOnlyMode(item === null || item === void 0 ? void 0 : item.name);
66826
+ }
66827
+ var editorElement = editor.ui.view.editable.element;
66828
+ if (editorElement) {
66829
+ editorElement.style.minHeight = (item === null || item === void 0 ? void 0 : item.height) || "200px";
66830
+ editorElement.style.backgroundColor = (item === null || item === void 0 ? void 0 : item.bgColor) || "white";
66831
+ // Focus時高度維持一樣
66832
+ editor.ui.view.editable.on("change:isFocused", function() {
66833
+ editorElement.style.minHeight = (item === null || item === void 0 ? void 0 : item.height) || "200px";
66834
+ editorElement.style.backgroundColor = (item === null || item === void 0 ? void 0 : item.bgColor) || "white";
66835
+ });
66826
66836
  }
66827
66837
  }
66828
66838
  }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sunggang/ui-lib",
3
- "version": "0.3.9",
3
+ "version": "0.3.10",
4
4
  "dependencies": {
5
5
  "@emotion/react": "^11.14.0",
6
6
  "@emotion/styled": "^11.14.0",
@@ -71,6 +71,8 @@ export interface FormItem {
71
71
  fieldName?: string;
72
72
  authToken?: string;
73
73
  };
74
+ height?: string;
75
+ bgColor?: string;
74
76
  disabled?: boolean;
75
77
  }
76
78
  export interface FormType {