@sunggang/ui-lib 0.3.9 → 0.3.11

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.height = (item === null || item === void 0 ? void 0 : item.height) || "300px";
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.height = (item === null || item === void 0 ? void 0 : item.height) || "300px";
66834
+ editorElement.style.backgroundColor = (item === null || item === void 0 ? void 0 : item.bgColor) || "white";
66835
+ });
66826
66836
  }
66827
66837
  }
66828
66838
  }),
package/index.esm2.js CHANGED
@@ -77328,13 +77328,13 @@ var SingleSelect = function(param) {
77328
77328
  };
77329
77329
  var MultipleSelect = function(param) {
77330
77330
  var _param_className = param.className, className = _param_className === void 0 ? "min-h-[6rem]" : _param_className, item = param.item;
77331
- var _item_validateOption;
77331
+ var _item_option, _item_validateOption;
77332
77332
  var _useFormContext = useFormContext(), control = _useFormContext.control, errors = _useFormContext.formState.errors;
77333
- var newOptions = item === null || item === void 0 ? void 0 : item.option.map(function(v) {
77333
+ var newOptions = (item === null || item === void 0 ? void 0 : (_item_option = item.option) === null || _item_option === void 0 ? void 0 : _item_option.length) ? item === null || item === void 0 ? void 0 : item.option.map(function(v) {
77334
77334
  return _object_spread_props(_object_spread({}, v), {
77335
- label: v.name
77335
+ label: v === null || v === void 0 ? void 0 : v.name
77336
77336
  });
77337
- });
77337
+ }) : [];
77338
77338
  var isDisabled = (item === null || item === void 0 ? void 0 : item.disable) || (item === null || item === void 0 ? void 0 : item.disabled);
77339
77339
  var customStyles = {
77340
77340
  control: function(provided) {
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.11",
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 {