utopia-ui 3.0.0-alpha.228 → 3.0.0-alpha.229

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.js CHANGED
@@ -666,8 +666,18 @@ function TextAreaInput(_a) {
666
666
 
667
667
  function TextInput(_a) {
668
668
  var labelTitle = _a.labelTitle, labelStyle = _a.labelStyle, type = _a.type, dataField = _a.dataField, containerStyle = _a.containerStyle, inputStyle = _a.inputStyle, defaultValue = _a.defaultValue, placeholder = _a.placeholder, autocomplete = _a.autocomplete, updateFormValue = _a.updateFormValue;
669
- return (jsxs("div", __assign({ className: "tw-form-control ".concat(containerStyle) }, { children: [labelTitle ? jsx("label", __assign({ className: "tw-label" }, { children: jsx("span", __assign({ className: "tw-label-text tw-text-base-content " + labelStyle }, { children: labelTitle })) }))
670
- : " ", jsx("input", { required: true, type: type || "text", name: dataField, defaultValue: defaultValue, placeholder: placeholder || "", autoComplete: autocomplete, onChange: function (e) { return updateFormValue && updateFormValue(e.target.value); }, className: "tw-input tw-input-bordered tw-w-full ".concat(inputStyle ? inputStyle : "") })] })));
669
+ var _b = useState(defaultValue || ""), inputValue = _b[0], setInputValue = _b[1];
670
+ useEffect(function () {
671
+ setInputValue(defaultValue || "");
672
+ }, [defaultValue]);
673
+ var handleChange = function (e) {
674
+ var newValue = e.target.value;
675
+ setInputValue(newValue);
676
+ if (updateFormValue) {
677
+ updateFormValue(newValue);
678
+ }
679
+ };
680
+ return (jsxs("div", __assign({ className: "tw-form-control ".concat(containerStyle) }, { children: [labelTitle ? (jsx("label", __assign({ className: "tw-label" }, { children: jsx("span", __assign({ className: "tw-label-text tw-text-base-content ".concat(labelStyle) }, { children: labelTitle })) }))) : null, jsx("input", { required: true, type: type || "text", name: dataField, value: inputValue, placeholder: placeholder || "", autoComplete: autocomplete, onChange: handleChange, className: "tw-input tw-input-bordered tw-w-full ".concat(inputStyle || "") })] })));
671
681
  }
672
682
 
673
683
  function SelectBox(props) {
@@ -5004,9 +5014,6 @@ function ProfileForm(_a) {
5004
5014
  setTemplate(((_a = item.layer) === null || _a === void 0 ? void 0 : _a.itemType.template) || userType);
5005
5015
  }, [userType, item]);
5006
5016
  var params = new URLSearchParams(window.location.search);
5007
- useEffect(function () {
5008
- console.log(state.text);
5009
- }, [state]);
5010
5017
  return (jsx(Fragment, { children: jsx(MapOverlayPage, __assign({ backdrop: true, className: 'tw-mx-4 tw-mt-4 tw-mb-4 tw-overflow-x-hidden tw-w-[calc(100%-32px)] md:tw-w-[calc(50%-32px)] tw-max-w-3xl !tw-left-auto tw-top-0 tw-bottom-0' }, { children: jsxs("div", __assign({ className: 'tw-flex tw-flex-col tw-h-full' }, { children: [jsx(FormHeader, { item: item, state: state, setState: setState }), template == "onepager" && (jsx(OnepagerForm, { item: item, state: state, setState: setState })), template == "simple" &&
5011
5018
  jsx(SimpleForm, { state: state, setState: setState }), template == "tabs" &&
5012
5019
  jsx(TabsForm, { loading: loading, item: item, state: state, setState: setState, updatePermission: updatePermission, linkItem: function (id) { return linkItem(id, item, updateItem); }, unlinkItem: function (id) { return unlinkItem(id, item, updateItem); } }), jsx("div", __assign({ className: "tw-mt-4 tw-mb-4" }, { children: jsx("button", __assign({ className: loading ? " tw-loading tw-btn tw-float-right" : "tw-btn tw-float-right", onClick: function () { return onUpdateItem(state, item, tags, addTag, setLoading, navigate, updateItem, addItem, user, params); }, style: { backgroundColor: "".concat(((_b = item.layer) === null || _b === void 0 ? void 0 : _b.itemColorField) && getValue(item, (_c = item.layer) === null || _c === void 0 ? void 0 : _c.itemColorField) ? getValue(item, (_d = item.layer) === null || _d === void 0 ? void 0 : _d.itemColorField) : (getItemTags(item) && getItemTags(item)[0] && getItemTags(item)[0].color ? getItemTags(item)[0].color : (_e = item === null || item === void 0 ? void 0 : item.layer) === null || _e === void 0 ? void 0 : _e.markerDefaultColor)), color: "#fff" } }, { children: "Update" })) }))] })) })) }));