@thefreshop/tb 1.0.23 → 1.0.25

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/cjs/index.js CHANGED
@@ -190,14 +190,14 @@ var css_248z$a = ".top-module_topframe__LhKDg{align-items:center;border-bottom:1
190
190
  var styles$8 = {"topframe":"top-module_topframe__LhKDg","top_left":"top-module_top_left__MBLyP","toplogo":"top-module_toplogo__lQMPi","top_menu":"top-module_top_menu__vOqqG","top_menu_item":"top-module_top_menu_item__pHknH","top_menu_item_icon":"top-module_top_menu_item_icon__-Ckvh","top_menu_item_text":"top-module_top_menu_item_text__SmZnj","menu_nomal":"top-module_menu_nomal__n4Rl-","menu_hover":"top-module_menu_hover__KmK0A"};
191
191
  styleInject(css_248z$a);
192
192
 
193
- const Top = ({ setting, top: { title = topbase.title, titleimage, topMenuSetting, menuStyle, imgstyle, titleStyle, topRight, defalultTopKey }, }) => {
193
+ const Top = ({ setting, top: { title = topbase.title, titleimage, topMenuSetting, menuStyle, imgstyle, titleStyle, topRight }, }) => {
194
194
  const { logout, user, addTabKey, setCurrentTabKey } = useTbState();
195
195
  const navigate = reactRouter.useNavigate();
196
196
  const userTop = () => {
197
197
  let topmenutable = [];
198
198
  if (user?.user_group?.group_key === "master" || setting.islogin === false) {
199
199
  topMenuSetting.forEach((m, index) => {
200
- topmenutable.push(React.createElement(TopMenu, { key: index, topMenuSetting: m, menuStyle: menuStyle, defalultTopKey: defalultTopKey }));
200
+ topmenutable.push(React.createElement(TopMenu, { key: index, topMenuSetting: m, menuStyle: menuStyle }));
201
201
  });
202
202
  }
203
203
  else {
@@ -205,7 +205,7 @@ const Top = ({ setting, top: { title = topbase.title, titleimage, topMenuSetting
205
205
  return user?.user_group?.group_section_auth.includes(m.key);
206
206
  });
207
207
  userSection.forEach((m, index) => {
208
- topmenutable.push(React.createElement(TopMenu, { key: index, topMenuSetting: m, menuStyle: menuStyle, defalultTopKey: defalultTopKey }));
208
+ topmenutable.push(React.createElement(TopMenu, { key: index, topMenuSetting: m, menuStyle: menuStyle }));
209
209
  });
210
210
  }
211
211
  return topmenutable;
@@ -224,15 +224,9 @@ const Top = ({ setting, top: { title = topbase.title, titleimage, topMenuSetting
224
224
  React.createElement("div", { className: styles$8.top_menu }, userTop()),
225
225
  topRight ? (topRight) : !setting?.islogin ? null : setting?.logoutComponent ? (setting?.logoutComponent) : (React.createElement("button", { onClick: () => logout() }, "\uB85C\uADF8\uC544\uC6C3"))));
226
226
  };
227
- const TopMenu = ({ topMenuSetting: { title, icon, key }, menuStyle = {}, defalultTopKey, }) => {
227
+ const TopMenu = ({ topMenuSetting: { title, icon, key }, menuStyle = {} }) => {
228
228
  const [hover, setHover] = React.useState(false);
229
229
  const { topkey, setTopkey } = useTbState();
230
- React.useEffect(() => {
231
- if (defalultTopKey) {
232
- console.log(defalultTopKey);
233
- setTopkey(defalultTopKey);
234
- }
235
- }, [defalultTopKey]);
236
230
  return (React.createElement("div", { className: `${styles$8.top_menu_item} ${hover ? styles$8.menu_hover : styles$8.menu_nomal}`, style: menuStyle.menuWidth ? { width: menuStyle.menuWidth } : {}, onMouseEnter: () => {
237
231
  setHover(true);
238
232
  }, onMouseLeave: () => {
@@ -23090,7 +23084,7 @@ const useFormColumns = ({ isModify, columns, onChange, }) => {
23090
23084
  }
23091
23085
  else if (i.formatProps.type === "code") {
23092
23086
  ant_form.push(React.createElement(antd.Form.Item, { key: i.tableProps.dataIndex, name: i.tableProps.dataIndex, label: i.tableProps.title, tooltip: i.tooltip, rules: i.rules, hidden: i.formatProps.hidden },
23093
- React.createElement(antd.Input, { ...i.formatProps.itemProps, placeholder: i.placeholder, defaultValue: moment$1().format("X") })));
23087
+ React.createElement(antd.Input, { ...i.formatProps.itemProps, placeholder: i.placeholder, initialValues: moment$1().format("X") })));
23094
23088
  }
23095
23089
  else if (i.formatProps.type === "switch") {
23096
23090
  ant_form.push(React.createElement(antd.Form.Item, { key: i.tableProps.dataIndex, name: i.tableProps.dataIndex, label: i.tableProps.title, tooltip: i.tooltip, rules: i.rules, hidden: i.formatProps.hidden },
@@ -23228,7 +23222,7 @@ const useFormColumns = ({ isModify, columns, onChange, }) => {
23228
23222
  * @author 송영내
23229
23223
  */
23230
23224
  const UploadImage = (props) => {
23231
- const { onChange, value } = props;
23225
+ const { onChange, value, maxWidth = 500, maxHeight = 500, compressFormat = "PNG", quality = 100, outputType = "blob" } = props;
23232
23226
  // const readfileData = (file: any) => {
23233
23227
  // return new Promise<string>((resolve, reject) => {
23234
23228
  // if (file) {
@@ -23243,17 +23237,17 @@ const UploadImage = (props) => {
23243
23237
  // })
23244
23238
  // }
23245
23239
  const resizeFile = (file) => new Promise((resolve) => {
23246
- Resizer.imageFileResizer(file, 500, 500, "PNG", 100, 0, (uri) => {
23240
+ Resizer.imageFileResizer(file, maxWidth, maxHeight, compressFormat, quality, 0, (uri) => {
23247
23241
  resolve(uri);
23248
- }, "base64");
23242
+ }, outputType);
23249
23243
  });
23250
23244
  return (React.createElement(antd.Flex, { style: { padding: 2, alignItems: "center" }, gap: 3 },
23251
23245
  React.createElement(antd.Image, { src: value ?? baseImage, width: 50, height: 50 }),
23252
- React.createElement(ImgCrop, { showGrid: true, modalWidth: 800, zoomSlider: true, quality: 1, modalClassName: "ImgCropModal", modalProps: { style: { height: 1000 } }, cropperProps: {
23253
- cropSize: { width: 500, height: 500 },
23246
+ React.createElement(ImgCrop, { showGrid: true, modalWidth: 800, zoomSlider: true, quality: 1, minZoom: 0.1, modalClassName: "ImgCropModal", modalProps: { style: { height: 600 } }, cropperProps: {
23247
+ cropSize: { width: maxWidth, height: maxHeight },
23254
23248
  style: {},
23255
23249
  mediaProps: {},
23256
- zoomSpeed: 1,
23250
+ zoomSpeed: 0.1,
23257
23251
  restrictPosition: false,
23258
23252
  keyboardStep: 1,
23259
23253
  } },