@tiny-codes/react-easy 1.1.2 → 1.2.0

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.
Files changed (140) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/es/components/BreakLines/index.d.ts +13 -19
  3. package/es/components/BreakLines/index.js +2 -3
  4. package/es/components/BreakLines/index.js.map +1 -1
  5. package/es/components/ConfigProvider/context.d.ts +20 -26
  6. package/es/components/ConfigProvider/context.js.map +1 -1
  7. package/es/components/ConfigProvider/index.d.ts +5 -7
  8. package/es/components/ConfigProvider/index.js +2 -3
  9. package/es/components/ConfigProvider/index.js.map +1 -1
  10. package/es/components/ConfirmAction/index.d.ts +66 -89
  11. package/es/components/ConfirmAction/index.js +27 -18
  12. package/es/components/ConfirmAction/index.js.map +1 -1
  13. package/es/components/ContextMenu/index.d.ts +42 -0
  14. package/es/components/ContextMenu/index.js +188 -0
  15. package/es/components/ContextMenu/index.js.map +1 -0
  16. package/es/components/ContextMenu/style/index.d.ts +3 -0
  17. package/es/components/ContextMenu/style/index.js +25 -0
  18. package/es/components/ContextMenu/style/index.js.map +1 -0
  19. package/es/components/DeleteConfirmAction/index.d.ts +2 -3
  20. package/es/components/DeleteConfirmAction/index.js +8 -12
  21. package/es/components/DeleteConfirmAction/index.js.map +1 -1
  22. package/es/components/EditableText/form.d.ts +150 -0
  23. package/es/components/EditableText/form.js +359 -0
  24. package/es/components/EditableText/form.js.map +1 -0
  25. package/es/components/EditableText/index.d.ts +160 -0
  26. package/es/components/EditableText/index.js +222 -0
  27. package/es/components/EditableText/index.js.map +1 -0
  28. package/es/components/EditableText/style/index.d.ts +3 -0
  29. package/es/components/EditableText/style/index.js +76 -0
  30. package/es/components/EditableText/style/index.js.map +1 -0
  31. package/es/components/FloatDrawer/index.d.ts +89 -86
  32. package/es/components/FloatDrawer/index.js +43 -20
  33. package/es/components/FloatDrawer/index.js.map +1 -1
  34. package/es/components/FloatDrawer/style/index.js +42 -21
  35. package/es/components/FloatDrawer/style/index.js.map +1 -1
  36. package/es/components/Loading/index.d.ts +9 -14
  37. package/es/components/Loading/index.js +7 -6
  38. package/es/components/Loading/index.js.map +1 -1
  39. package/es/components/Loading/style/index.js +1 -1
  40. package/es/components/Loading/style/index.js.map +1 -1
  41. package/es/components/ModalAction/index.d.ts +98 -139
  42. package/es/components/ModalAction/index.js +25 -37
  43. package/es/components/ModalAction/index.js.map +1 -1
  44. package/es/components/OverflowTags/index.d.ts +30 -8
  45. package/es/components/OverflowTags/index.js +26 -7
  46. package/es/components/OverflowTags/index.js.map +1 -1
  47. package/es/components/OverflowTags/style/index.js +1 -1
  48. package/es/components/OverflowTags/style/index.js.map +1 -1
  49. package/es/components/index.d.ts +4 -0
  50. package/es/components/index.js +2 -0
  51. package/es/components/index.js.map +1 -1
  52. package/es/hooks/useRefFunction.d.ts +4 -5
  53. package/es/hooks/useRefFunction.js +6 -7
  54. package/es/hooks/useRefFunction.js.map +1 -1
  55. package/es/hooks/useRefValue.d.ts +2 -3
  56. package/es/hooks/useRefValue.js +2 -3
  57. package/es/hooks/useRefValue.js.map +1 -1
  58. package/es/hooks/useT.js +1 -2
  59. package/es/hooks/useT.js.map +1 -1
  60. package/es/hooks/useValidator.d.ts +2 -3
  61. package/es/hooks/useValidator.js +2 -3
  62. package/es/hooks/useValidator.js.map +1 -1
  63. package/es/hooks/useValidatorBuilder.d.ts +41 -61
  64. package/es/hooks/useValidatorBuilder.js +4 -6
  65. package/es/hooks/useValidatorBuilder.js.map +1 -1
  66. package/es/hooks/useValidators.d.ts +62 -83
  67. package/es/hooks/useValidators.js +3 -4
  68. package/es/hooks/useValidators.js.map +1 -1
  69. package/es/locales/index.d.ts +15 -0
  70. package/es/locales/langs/en-US.d.ts +5 -0
  71. package/es/locales/langs/en-US.js +5 -0
  72. package/es/locales/langs/en-US.js.map +1 -1
  73. package/es/locales/langs/zh-CN.d.ts +5 -0
  74. package/es/locales/langs/zh-CN.js +5 -0
  75. package/es/locales/langs/zh-CN.js.map +1 -1
  76. package/lib/components/BreakLines/index.d.ts +13 -19
  77. package/lib/components/BreakLines/index.js.map +2 -2
  78. package/lib/components/ConfigProvider/context.d.ts +20 -26
  79. package/lib/components/ConfigProvider/context.js.map +2 -2
  80. package/lib/components/ConfigProvider/index.d.ts +5 -7
  81. package/lib/components/ConfigProvider/index.js.map +2 -2
  82. package/lib/components/ConfirmAction/index.d.ts +66 -89
  83. package/lib/components/ConfirmAction/index.js +9 -0
  84. package/lib/components/ConfirmAction/index.js.map +2 -2
  85. package/lib/components/ContextMenu/index.d.ts +42 -0
  86. package/lib/components/ContextMenu/index.js +190 -0
  87. package/lib/components/ContextMenu/index.js.map +7 -0
  88. package/lib/components/ContextMenu/style/index.d.ts +3 -0
  89. package/lib/components/ContextMenu/style/index.js +48 -0
  90. package/lib/components/ContextMenu/style/index.js.map +7 -0
  91. package/lib/components/DeleteConfirmAction/index.d.ts +2 -3
  92. package/lib/components/DeleteConfirmAction/index.js.map +2 -2
  93. package/lib/components/EditableText/form.d.ts +150 -0
  94. package/lib/components/EditableText/form.js +253 -0
  95. package/lib/components/EditableText/form.js.map +7 -0
  96. package/lib/components/EditableText/index.d.ts +160 -0
  97. package/lib/components/EditableText/index.js +181 -0
  98. package/lib/components/EditableText/index.js.map +7 -0
  99. package/lib/components/EditableText/style/index.d.ts +3 -0
  100. package/lib/components/EditableText/style/index.js +118 -0
  101. package/lib/components/EditableText/style/index.js.map +7 -0
  102. package/lib/components/FloatDrawer/index.d.ts +89 -86
  103. package/lib/components/FloatDrawer/index.js +64 -39
  104. package/lib/components/FloatDrawer/index.js.map +2 -2
  105. package/lib/components/FloatDrawer/style/index.js +60 -23
  106. package/lib/components/FloatDrawer/style/index.js.map +2 -2
  107. package/lib/components/Loading/index.d.ts +9 -14
  108. package/lib/components/Loading/index.js +13 -4
  109. package/lib/components/Loading/index.js.map +2 -2
  110. package/lib/components/Loading/style/index.js +1 -1
  111. package/lib/components/Loading/style/index.js.map +2 -2
  112. package/lib/components/ModalAction/index.d.ts +98 -139
  113. package/lib/components/ModalAction/index.js.map +2 -2
  114. package/lib/components/OverflowTags/index.d.ts +30 -8
  115. package/lib/components/OverflowTags/index.js +7 -5
  116. package/lib/components/OverflowTags/index.js.map +2 -2
  117. package/lib/components/OverflowTags/style/index.js +1 -1
  118. package/lib/components/OverflowTags/style/index.js.map +2 -2
  119. package/lib/components/index.d.ts +4 -0
  120. package/lib/components/index.js +6 -0
  121. package/lib/components/index.js.map +2 -2
  122. package/lib/hooks/useRefFunction.d.ts +4 -5
  123. package/lib/hooks/useRefFunction.js.map +2 -2
  124. package/lib/hooks/useRefValue.d.ts +2 -3
  125. package/lib/hooks/useRefValue.js.map +2 -2
  126. package/lib/hooks/useT.js.map +2 -2
  127. package/lib/hooks/useValidator.d.ts +2 -3
  128. package/lib/hooks/useValidator.js.map +2 -2
  129. package/lib/hooks/useValidatorBuilder.d.ts +41 -61
  130. package/lib/hooks/useValidatorBuilder.js.map +2 -2
  131. package/lib/hooks/useValidators.d.ts +62 -83
  132. package/lib/hooks/useValidators.js.map +2 -2
  133. package/lib/locales/index.d.ts +15 -0
  134. package/lib/locales/langs/en-US.d.ts +5 -0
  135. package/lib/locales/langs/en-US.js +5 -0
  136. package/lib/locales/langs/en-US.js.map +2 -2
  137. package/lib/locales/langs/zh-CN.d.ts +5 -0
  138. package/lib/locales/langs/zh-CN.js +5 -0
  139. package/lib/locales/langs/zh-CN.js.map +2 -2
  140. package/package.json +3 -2
@@ -0,0 +1,150 @@
1
+ import type { CSSProperties, ReactElement } from 'react';
2
+ import type { ButtonProps, FormItemProps, FormProps, InputProps, SpaceProps } from 'antd';
3
+ import type { TextAreaProps } from 'antd/es/input';
4
+ export interface EditableFormProps<V, IT extends 'Input' | 'TextArea' | RenderInputInterface> {
5
+ prefixCls?: string;
6
+ /**
7
+ * - **EN:** The value to edit
8
+ * - **CN:** 编辑的值
9
+ */
10
+ value: V | undefined;
11
+ /**
12
+ * - **EN:** Whether the text is required when editing, default is `true`, if `formItemProps.rules`
13
+ * is set, it will override this value
14
+ * - **CN:** 编辑文本时是否必填,默认值为`true`,如果设置了`formItemProps.rules`,将会覆盖此值
15
+ *
16
+ * @default true
17
+ */
18
+ required?: boolean;
19
+ /**
20
+ * - **EN:** Form properties
21
+ * - **CN:** 表单属性
22
+ */
23
+ formProps?: FormProps;
24
+ /**
25
+ * - **EN:** Form item properties
26
+ * - **CN:** 表单项属性
27
+ */
28
+ formItemProps?: FormItemProps;
29
+ /**
30
+ * - **EN:** Custom component type for rendering the input box
31
+ * - **CN:** 自定义设置渲染输入框的组件类型
32
+ *
33
+ * @default 'Input'
34
+ */
35
+ inputComp?: IT;
36
+ /**
37
+ * - **EN:** Input component properties
38
+ * - **CN:** 输入框组件属性
39
+ */
40
+ inputProps?: IT extends 'TextArea' ? TextAreaProps : IT extends 'Input' ? InputProps : never;
41
+ /**
42
+ * - **EN:** Whether to display as a block-level element, with width 100%
43
+ * - **CN:** 是否显示为块级元素,宽度100%
44
+ *
45
+ * @default false
46
+ */
47
+ block?: boolean;
48
+ /**
49
+ * - **EN:** Semantic class names
50
+ * - **CN:** 语义化类名
51
+ */
52
+ classNames?: {
53
+ /**
54
+ * - **EN:** Edit mode parent container class name
55
+ * - **CN:** 编辑模式父容器类名
56
+ */
57
+ wrapper?: string;
58
+ /**
59
+ * - **EN:** Submit button class name
60
+ * - **CN:** 提交按钮类名
61
+ */
62
+ submitButton?: string;
63
+ /**
64
+ * - **EN:** Cancel button class name
65
+ * - **CN:** 取消按钮类名
66
+ */
67
+ cancelButton?: string;
68
+ /**
69
+ * - **EN:** Submit button icon class name
70
+ * - **CN:** 提交按钮图标类名
71
+ */
72
+ submitIcon?: string;
73
+ /**
74
+ * - **EN:** Cancel button icon class name
75
+ * - **CN:** 取消按钮图标类名
76
+ */
77
+ cancelIcon?: string;
78
+ };
79
+ /**
80
+ * - **EN:** Semantic styles
81
+ * - **CN:** 语义化样式
82
+ */
83
+ styles?: {
84
+ /**
85
+ * - **EN:** Edit mode parent container style
86
+ * - **CN:** 编辑模式父容器样式
87
+ */
88
+ wrapper?: CSSProperties;
89
+ /**
90
+ * - **EN:** Submit button style
91
+ * - **CN:** 提交按钮样式
92
+ */
93
+ submitButton?: CSSProperties;
94
+ /**
95
+ * - **EN:** Cancel button style
96
+ * - **CN:** 取消按钮样式
97
+ */
98
+ cancelButton?: CSSProperties;
99
+ /**
100
+ * - **EN:** Submit button icon style
101
+ * - **CN:** 提交按钮图标样式
102
+ */
103
+ submitIcon?: CSSProperties;
104
+ /**
105
+ * - **EN:** Cancel button icon style
106
+ * - **CN:** 取消按钮图标样式
107
+ */
108
+ cancelIcon?: CSSProperties;
109
+ };
110
+ /**
111
+ * **EN:** Submit and cancel action button alignment
112
+ *
113
+ * **CN:** 提交、取消操作按钮的对齐方式
114
+ *
115
+ * - `start` - align to the top | 顶部对齐
116
+ * - `center` - align to the center | 居中对齐
117
+ * - `end` - align to the bottom | 底部对齐
118
+ *
119
+ * @default 'center'
120
+ */
121
+ actionAlign?: SpaceProps['align'];
122
+ /**
123
+ * - **EN:** Submit button properties
124
+ * - **CN:** 提交操作按钮属性
125
+ */
126
+ submitProps?: ButtonProps;
127
+ /**
128
+ * - **EN:** Cancel button properties
129
+ * - **CN:** 取消操作按钮属性
130
+ */
131
+ cancelProps?: ButtonProps;
132
+ /**
133
+ * - **EN:** Confirm button click event, supports asynchronous operations
134
+ * - **CN:** 确认按钮点击事件,支持异步操作
135
+ */
136
+ onOk: (value: V | undefined) => void | Promise<void>;
137
+ /**
138
+ * - **EN:** Cancel button click event, supports asynchronous operations
139
+ * - **CN:** 取消按钮点击事件,支持异步操作
140
+ */
141
+ onCancel?: () => void | Promise<void>;
142
+ }
143
+ declare const EditableTextForm: <V, IT extends "Input" | RenderInputInterface | "TextArea">(props: EditableFormProps<V, IT>) => import("react/jsx-runtime").JSX.Element;
144
+ export type RenderInputInterface = <V>(props: RenderInputProps<V>) => ReactElement | null;
145
+ export interface RenderInputProps<V> extends Omit<EditableFormProps<V, 'Input'>, 'inputComp' | 'inputProps' | 'onOk' | 'onCancel'> {
146
+ onChange?: (value: V | undefined) => void;
147
+ submit(): Promise<void>;
148
+ cancel(): Promise<void>;
149
+ }
150
+ export default EditableTextForm;
@@ -0,0 +1,359 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ var _excluded = ["render", "value", "onChange"];
3
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
5
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
6
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
7
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
8
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
9
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
10
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
11
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
12
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
13
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
14
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
15
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
16
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
17
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
18
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
19
+ import { useContext, useEffect, useRef, useState } from 'react';
20
+ import { Button, ConfigProvider, Form, Input, Space } from 'antd';
21
+ import names from 'classnames';
22
+ import { CheckSquareFilled, CloseSquareFilled } from '@ant-design/icons';
23
+ import useT from "../../hooks/useT";
24
+ import { jsx as _jsx } from "react/jsx-runtime";
25
+ import { jsxs as _jsxs } from "react/jsx-runtime";
26
+ var defaultInputActionGap = 8;
27
+ // eslint-disable-next-line @typescript-eslint/ban-types
28
+
29
+ // eslint-disable-next-line @typescript-eslint/ban-types
30
+ var EditableTextForm = function EditableTextForm(props) {
31
+ var _formItemProps$style$, _formItemProps$style, _formItemProps$style2;
32
+ var prefixCls = props.prefixCls,
33
+ value = props.value,
34
+ _props$required = props.required,
35
+ required = _props$required === void 0 ? true : _props$required,
36
+ classNames = props.classNames,
37
+ styleNames = props.styles,
38
+ _props$inputComp = props.inputComp,
39
+ inputComp = _props$inputComp === void 0 ? 'Input' : _props$inputComp,
40
+ _props$block = props.block,
41
+ blockInProps = _props$block === void 0 ? false : _props$block,
42
+ formProps = props.formProps,
43
+ formItemProps = props.formItemProps,
44
+ inputProps = props.inputProps,
45
+ _props$actionAlign = props.actionAlign,
46
+ actionAlign = _props$actionAlign === void 0 ? 'center' : _props$actionAlign,
47
+ submitProps = props.submitProps,
48
+ cancelProps = props.cancelProps,
49
+ onOk = props.onOk,
50
+ onCancel = props.onCancel;
51
+ var t = useT();
52
+ var _useContext = useContext(ConfigProvider.ConfigContext),
53
+ getAntPrefixCls = _useContext.getPrefixCls;
54
+ var _Form$useForm = Form.useForm(),
55
+ _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
56
+ form = _Form$useForm2[0];
57
+ var wrapperRef = useRef(null);
58
+ var inputRef = useRef(null);
59
+ var supportAutoScale = inputComp === 'Input' || inputComp === 'TextArea';
60
+ var detectorRef = useRef(null);
61
+ var actionRef = useRef(null);
62
+ var _useState = useState(),
63
+ _useState2 = _slicedToArray(_useState, 2),
64
+ inputWidth = _useState2[0],
65
+ setInputWidth = _useState2[1];
66
+ var _useState3 = useState('hidden'),
67
+ _useState4 = _slicedToArray(_useState3, 2),
68
+ visibility = _useState4[0],
69
+ setVisibility = _useState4[1];
70
+ var _useState5 = useState(false),
71
+ _useState6 = _slicedToArray(_useState5, 2),
72
+ forceBlock = _useState6[0],
73
+ setForceBlock = _useState6[1];
74
+ var _useState7 = useState(false),
75
+ _useState8 = _slicedToArray(_useState7, 2),
76
+ saving = _useState8[0],
77
+ setSaving = _useState8[1];
78
+ var inputActionGapRef = useRef(0);
79
+ inputActionGapRef.current = pxToNumber((_formItemProps$style$ = formItemProps === null || formItemProps === void 0 || (_formItemProps$style = formItemProps.style) === null || _formItemProps$style === void 0 ? void 0 : _formItemProps$style.marginRight) !== null && _formItemProps$style$ !== void 0 ? _formItemProps$style$ : formItemProps === null || formItemProps === void 0 || (_formItemProps$style2 = formItemProps.style) === null || _formItemProps$style2 === void 0 ? void 0 : _formItemProps$style2.marginInlineEnd) || defaultInputActionGap;
80
+ var block = blockInProps || forceBlock;
81
+
82
+ // Update form value when `value` prop changes
83
+ useEffect(function () {
84
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
85
+ form.setFieldsValue({
86
+ value: value
87
+ });
88
+ }, [form, value]);
89
+
90
+ // Detect the width of the text and dynamically scale the input width until it reaches the max width of the container.
91
+ // Only built-in Input and TextArea components are supported.
92
+ useEffect(function () {
93
+ var _inputRef$current, _actionRef$current;
94
+ var contentWidth = 0;
95
+ var inputElement = (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.input;
96
+ if (detectorRef.current && inputElement && supportAutoScale) {
97
+ var inputStyle = getComputedStyle(inputElement);
98
+ contentWidth = detectorRef.current.offsetWidth + pxToNumber(inputStyle.paddingLeft) + pxToNumber(inputStyle.paddingRight) + pxToNumber(inputStyle.borderLeftWidth) + pxToNumber(inputStyle.borderRightWidth);
99
+ setInputWidth(contentWidth);
100
+ }
101
+ var actionWidth = ((_actionRef$current = actionRef.current) === null || _actionRef$current === void 0 ? void 0 : _actionRef$current.offsetWidth) || 0; // Width of action buttons
102
+ var gap = inputActionGapRef.current; // Gap between input box and action buttons
103
+ setVisibility('visible');
104
+ // Listen to the width of the wrapper container, if the input box width is greater than the wrapper container width,
105
+ var observer = new ResizeObserver(function (_ref) {
106
+ var _ref2 = _slicedToArray(_ref, 1),
107
+ entity = _ref2[0];
108
+ var wrapperWidth = entity.contentRect.width;
109
+ // Width deviation greater than 1px is considered overflow, to avoid misjudgment due to pixel density or scaling
110
+ if (contentWidth + actionWidth + gap - wrapperWidth > 1) {
111
+ setForceBlock(true);
112
+ } else {
113
+ setForceBlock(false);
114
+ }
115
+ });
116
+ if (wrapperRef.current) {
117
+ observer.observe(wrapperRef.current);
118
+ }
119
+ return function () {
120
+ return observer.disconnect();
121
+ };
122
+ }, [supportAutoScale]);
123
+
124
+ // Cancel editing
125
+ var handleCancel = /*#__PURE__*/function () {
126
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
127
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
128
+ while (1) switch (_context.prev = _context.next) {
129
+ case 0:
130
+ form.resetFields();
131
+ _context.prev = 1;
132
+ _context.next = 4;
133
+ return onCancel === null || onCancel === void 0 ? void 0 : onCancel();
134
+ case 4:
135
+ _context.next = 9;
136
+ break;
137
+ case 6:
138
+ _context.prev = 6;
139
+ _context.t0 = _context["catch"](1);
140
+ console.error(_context.t0);
141
+ case 9:
142
+ case "end":
143
+ return _context.stop();
144
+ }
145
+ }, _callee, null, [[1, 6]]);
146
+ }));
147
+ return function handleCancel() {
148
+ return _ref3.apply(this, arguments);
149
+ };
150
+ }();
151
+ // Pressing the Escape key to cancel editing
152
+ var handleEscape = /*#__PURE__*/function () {
153
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
154
+ var _cancelProps$onClick;
155
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
156
+ while (1) switch (_context2.prev = _context2.next) {
157
+ case 0:
158
+ if (!((inputComp === 'Input' || inputComp === 'TextArea') && e.key === 'Escape')) {
159
+ _context2.next = 4;
160
+ break;
161
+ }
162
+ _context2.next = 3;
163
+ return handleCancel();
164
+ case 3:
165
+ cancelProps === null || cancelProps === void 0 || (_cancelProps$onClick = cancelProps.onClick) === null || _cancelProps$onClick === void 0 || _cancelProps$onClick.call(cancelProps, e);
166
+ case 4:
167
+ case "end":
168
+ return _context2.stop();
169
+ }
170
+ }, _callee2);
171
+ }));
172
+ return function handleEscape(_x) {
173
+ return _ref4.apply(this, arguments);
174
+ };
175
+ }();
176
+ // Submit editing
177
+ var handleSubmit = /*#__PURE__*/function () {
178
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(values) {
179
+ var value;
180
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
181
+ while (1) switch (_context3.prev = _context3.next) {
182
+ case 0:
183
+ value = values.value;
184
+ _context3.prev = 1;
185
+ setSaving(true);
186
+ _context3.next = 5;
187
+ return onOk === null || onOk === void 0 ? void 0 : onOk(value);
188
+ case 5:
189
+ _context3.next = 10;
190
+ break;
191
+ case 7:
192
+ _context3.prev = 7;
193
+ _context3.t0 = _context3["catch"](1);
194
+ console.error(_context3.t0);
195
+ case 10:
196
+ _context3.prev = 10;
197
+ setSaving(false);
198
+ return _context3.finish(10);
199
+ case 13:
200
+ case "end":
201
+ return _context3.stop();
202
+ }
203
+ }, _callee3, null, [[1, 7, 10, 13]]);
204
+ }));
205
+ return function handleSubmit(_x2) {
206
+ return _ref5.apply(this, arguments);
207
+ };
208
+ }();
209
+ var renderInput = function renderInput() {
210
+ if (inputComp === 'Input' || inputComp === 'TextArea') {
211
+ var COMP = inputComp === 'Input' ? Input : Input.TextArea;
212
+ return /*#__PURE__*/_jsx(COMP, _objectSpread(_objectSpread({
213
+ ref: inputRef,
214
+ placeholder: t('components.EditableText.placeholder')
215
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
216
+ }, inputProps), {}, {
217
+ style: _objectSpread({
218
+ width: block ? undefined : inputWidth
219
+ }, inputProps && 'style' in inputProps ? inputProps === null || inputProps === void 0 ? void 0 : inputProps.style : {}),
220
+ onPressEnter: function onPressEnter() {
221
+ if (inputComp === 'Input') {
222
+ form.submit();
223
+ }
224
+ },
225
+ onKeyUp: handleEscape
226
+ }));
227
+ } else {
228
+ return /*#__PURE__*/_jsx(CustomInput, _objectSpread(_objectSpread({}, props), {}, {
229
+ render: inputComp,
230
+ submit: /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
231
+ var values;
232
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
233
+ while (1) switch (_context4.prev = _context4.next) {
234
+ case 0:
235
+ _context4.next = 2;
236
+ return form.validateFields();
237
+ case 2:
238
+ values = _context4.sent;
239
+ _context4.next = 5;
240
+ return handleSubmit(values);
241
+ case 5:
242
+ case "end":
243
+ return _context4.stop();
244
+ }
245
+ }, _callee4);
246
+ })),
247
+ cancel: handleCancel
248
+ }));
249
+ }
250
+ };
251
+ return /*#__PURE__*/_jsx("div", {
252
+ ref: wrapperRef,
253
+ className: names("".concat(prefixCls, "-form"), classNames === null || classNames === void 0 ? void 0 : classNames.wrapper),
254
+ style: styleNames === null || styleNames === void 0 ? void 0 : styleNames.wrapper,
255
+ children: /*#__PURE__*/_jsxs(Form, _objectSpread(_objectSpread({
256
+ component: "div" // Do not use form tag to avoid conflicts with external form, which may be nested in other forms
257
+ ,
258
+ layout: "inline",
259
+ form: form,
260
+ initialValues: {
261
+ value: value
262
+ },
263
+ autoComplete: "off",
264
+ onFinish: handleSubmit
265
+ }, formProps), {}, {
266
+ style: _objectSpread({
267
+ visibility: visibility
268
+ }, formProps === null || formProps === void 0 ? void 0 : formProps.style),
269
+ children: [/*#__PURE__*/_jsx(Form.Item, _objectSpread(_objectSpread({
270
+ rules: [{
271
+ required: required,
272
+ message: t('components.EditableText.requiredMsg')
273
+ }]
274
+ }, formItemProps), {}, {
275
+ className: names(formItemProps === null || formItemProps === void 0 ? void 0 : formItemProps.className, _defineProperty({}, "".concat(getAntPrefixCls('form-item-block')), block)),
276
+ style: _objectSpread({
277
+ marginInlineEnd: defaultInputActionGap
278
+ }, formItemProps === null || formItemProps === void 0 ? void 0 : formItemProps.style),
279
+ name: "value",
280
+ children: renderInput()
281
+ })), supportAutoScale && /*#__PURE__*/_jsx("span", {
282
+ ref: detectorRef,
283
+ style: {
284
+ position: 'absolute',
285
+ visibility: 'hidden',
286
+ height: 0,
287
+ whiteSpace: 'pre'
288
+ },
289
+ children: value === null || value === void 0 ? void 0 : value.toString()
290
+ }), /*#__PURE__*/_jsxs(Space, {
291
+ ref: actionRef,
292
+ className: "".concat(prefixCls, "-form-btns"),
293
+ align: actionAlign,
294
+ size: 4,
295
+ children: [/*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({
296
+ type: "text",
297
+ disabled: saving,
298
+ loading: saving,
299
+ title: t('components.EditableText.save'),
300
+ icon: /*#__PURE__*/_jsx(CheckSquareFilled, {
301
+ className: classNames === null || classNames === void 0 ? void 0 : classNames.submitIcon,
302
+ style: styleNames === null || styleNames === void 0 ? void 0 : styleNames.submitIcon
303
+ }),
304
+ style: styleNames === null || styleNames === void 0 ? void 0 : styleNames.submitButton,
305
+ onClick: function onClick() {
306
+ return form.submit();
307
+ }
308
+ }, submitProps), {}, {
309
+ className: names("".concat(prefixCls, "-form-btn"), "".concat(prefixCls, "-form-btn-save"), classNames === null || classNames === void 0 ? void 0 : classNames.submitButton, submitProps === null || submitProps === void 0 ? void 0 : submitProps.className)
310
+ })), /*#__PURE__*/_jsx(Button, _objectSpread({
311
+ type: "text",
312
+ style: styleNames === null || styleNames === void 0 ? void 0 : styleNames.cancelButton,
313
+ className: names("".concat(prefixCls, "-form-btn"), "".concat(prefixCls, "-form-btn-close"), classNames === null || classNames === void 0 ? void 0 : classNames.cancelButton),
314
+ title: t('components.EditableText.cancel'),
315
+ icon: /*#__PURE__*/_jsx(CloseSquareFilled, {
316
+ className: classNames === null || classNames === void 0 ? void 0 : classNames.cancelIcon,
317
+ style: styleNames === null || styleNames === void 0 ? void 0 : styleNames.cancelIcon
318
+ }),
319
+ onClick: ( /*#__PURE__*/function () {
320
+ var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(e) {
321
+ var _cancelProps$onClick2;
322
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
323
+ while (1) switch (_context5.prev = _context5.next) {
324
+ case 0:
325
+ _context5.next = 2;
326
+ return handleCancel();
327
+ case 2:
328
+ cancelProps === null || cancelProps === void 0 || (_cancelProps$onClick2 = cancelProps.onClick) === null || _cancelProps$onClick2 === void 0 || _cancelProps$onClick2.call(cancelProps, e);
329
+ case 3:
330
+ case "end":
331
+ return _context5.stop();
332
+ }
333
+ }, _callee5);
334
+ }));
335
+ return function (_x3) {
336
+ return _ref7.apply(this, arguments);
337
+ };
338
+ }())
339
+ }, cancelProps))]
340
+ })]
341
+ }))
342
+ });
343
+ };
344
+ function CustomInput(props) {
345
+ var render = props.render,
346
+ value = props.value,
347
+ onChange = props.onChange,
348
+ restProps = _objectWithoutProperties(props, _excluded);
349
+ var useInput = render;
350
+ return useInput(_objectSpread(_objectSpread({}, restProps), {}, {
351
+ value: value,
352
+ onChange: onChange
353
+ }));
354
+ }
355
+ function pxToNumber(px) {
356
+ return px ? parseFloat(px.toString().replace('px', '')) : 0;
357
+ }
358
+ export default EditableTextForm;
359
+ //# sourceMappingURL=form.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_regeneratorRuntime","e","t","r","Object","prototype","n","hasOwnProperty","o","defineProperty","value","i","Symbol","a","iterator","c","asyncIterator","u","toStringTag","define","enumerable","configurable","writable","wrap","Generator","create","Context","makeInvokeMethod","tryCatch","type","arg","call","h","l","f","s","y","GeneratorFunction","GeneratorFunctionPrototype","p","d","getPrototypeOf","v","values","g","defineIteratorMethods","forEach","_invoke","AsyncIterator","invoke","_typeof","resolve","__await","then","callInvokeWithMethodAndArg","Error","done","method","delegate","maybeInvokeDelegate","sent","_sent","dispatchException","abrupt","return","TypeError","resultName","next","nextLoc","pushTryEntry","tryLoc","catchLoc","finallyLoc","afterLoc","tryEntries","push","resetTryEntry","completion","reset","isNaN","length","displayName","isGeneratorFunction","constructor","name","mark","setPrototypeOf","__proto__","awrap","async","Promise","keys","reverse","pop","prev","charAt","slice","stop","rval","handle","complete","finish","catch","_catch","delegateYield","asyncGeneratorStep","gen","reject","_next","_throw","key","info","error","_asyncToGenerator","fn","self","args","arguments","apply","err","undefined","_slicedToArray","arr","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","minLen","_arrayLikeToArray","toString","Array","from","test","len","arr2","isArray","useContext","useEffect","useRef","useState","Button","ConfigProvider","Form","Input","Space","names","CheckSquareFilled","CloseSquareFilled","useT","jsx","_jsx","jsxs","_jsxs","defaultInputActionGap","EditableTextForm","props","_formItemProps$style$","_formItemProps$style","_formItemProps$style2","prefixCls","_props$required","required","classNames","styleNames","styles","_props$inputComp","inputComp","_props$block","block","blockInProps","formProps","formItemProps","inputProps","_props$actionAlign","actionAlign","submitProps","cancelProps","onOk","onCancel","_useContext","ConfigContext","getAntPrefixCls","getPrefixCls","_Form$useForm","useForm","_Form$useForm2","form","wrapperRef","inputRef","supportAutoScale","detectorRef","actionRef","_useState","_useState2","inputWidth","setInputWidth","_useState3","_useState4","visibility","setVisibility","_useState5","_useState6","forceBlock","setForceBlock","_useState7","_useState8","saving","setSaving","inputActionGapRef","current","pxToNumber","style","marginRight","marginInlineEnd","setFieldsValue","_inputRef$current","_actionRef$current","contentWidth","inputElement","input","inputStyle","getComputedStyle","offsetWidth","paddingLeft","paddingRight","borderLeftWidth","borderRightWidth","actionWidth","gap","observer","ResizeObserver","_ref","_ref2","entity","wrapperWidth","contentRect","width","observe","disconnect","handleCancel","_ref3","_callee","_callee$","_context","resetFields","t0","console","handleEscape","_ref4","_callee2","_cancelProps$onClick","_callee2$","_context2","onClick","_x","handleSubmit","_ref5","_callee3","_callee3$","_context3","_x2","renderInput","COMP","TextArea","_objectSpread","ref","placeholder","onPressEnter","submit","onKeyUp","CustomInput","render","_callee4","_callee4$","_context4","validateFields","cancel","className","concat","wrapper","children","component","layout","initialValues","autoComplete","onFinish","Item","rules","message","_defineProperty","position","height","whiteSpace","align","size","disabled","loading","title","icon","submitIcon","submitButton","cancelButton","cancelIcon","_ref7","_callee5","_cancelProps$onClick2","_callee5$","_context5","_x3","onChange","restProps","_objectWithoutProperties","_excluded","useInput","px","parseFloat","replace"],"sources":["../../../src/components/EditableText/form.tsx"],"sourcesContent":["import type { CSSProperties, ReactElement } from 'react';\nimport { useContext, useEffect, useRef, useState } from 'react';\nimport type { ButtonProps, FormItemProps, FormProps, InputProps, SpaceProps } from 'antd';\nimport { Button, ConfigProvider, Form, Input, Space } from 'antd';\nimport type { InputRef, TextAreaProps } from 'antd/es/input';\nimport names from 'classnames';\nimport { CheckSquareFilled, CloseSquareFilled } from '@ant-design/icons';\nimport useT from '../../hooks/useT';\n\nconst defaultInputActionGap = 8;\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport interface EditableFormProps<V, IT extends 'Input' | 'TextArea' | RenderInputInterface> {\n prefixCls?: string;\n /**\n * - **EN:** The value to edit\n * - **CN:** 编辑的值\n */\n value: V | undefined;\n /**\n * - **EN:** Whether the text is required when editing, default is `true`, if `formItemProps.rules`\n * is set, it will override this value\n * - **CN:** 编辑文本时是否必填,默认值为`true`,如果设置了`formItemProps.rules`,将会覆盖此值\n *\n * @default true\n */\n required?: boolean;\n /**\n * - **EN:** Form properties\n * - **CN:** 表单属性\n */\n formProps?: FormProps;\n /**\n * - **EN:** Form item properties\n * - **CN:** 表单项属性\n */\n formItemProps?: FormItemProps;\n /**\n * - **EN:** Custom component type for rendering the input box\n * - **CN:** 自定义设置渲染输入框的组件类型\n *\n * @default 'Input'\n */\n inputComp?: IT;\n /**\n * - **EN:** Input component properties\n * - **CN:** 输入框组件属性\n */\n inputProps?: IT extends 'TextArea' ? TextAreaProps : IT extends 'Input' ? InputProps : never;\n /**\n * - **EN:** Whether to display as a block-level element, with width 100%\n * - **CN:** 是否显示为块级元素,宽度100%\n *\n * @default false\n */\n block?: boolean;\n /**\n * - **EN:** Semantic class names\n * - **CN:** 语义化类名\n */\n classNames?: {\n /**\n * - **EN:** Edit mode parent container class name\n * - **CN:** 编辑模式父容器类名\n */\n wrapper?: string;\n /**\n * - **EN:** Submit button class name\n * - **CN:** 提交按钮类名\n */\n submitButton?: string;\n /**\n * - **EN:** Cancel button class name\n * - **CN:** 取消按钮类名\n */\n cancelButton?: string;\n /**\n * - **EN:** Submit button icon class name\n * - **CN:** 提交按钮图标类名\n */\n submitIcon?: string;\n /**\n * - **EN:** Cancel button icon class name\n * - **CN:** 取消按钮图标类名\n */\n cancelIcon?: string;\n };\n /**\n * - **EN:** Semantic styles\n * - **CN:** 语义化样式\n */\n styles?: {\n /**\n * - **EN:** Edit mode parent container style\n * - **CN:** 编辑模式父容器样式\n */\n wrapper?: CSSProperties;\n /**\n * - **EN:** Submit button style\n * - **CN:** 提交按钮样式\n */\n submitButton?: CSSProperties;\n /**\n * - **EN:** Cancel button style\n * - **CN:** 取消按钮样式\n */\n cancelButton?: CSSProperties;\n /**\n * - **EN:** Submit button icon style\n * - **CN:** 提交按钮图标样式\n */\n submitIcon?: CSSProperties;\n /**\n * - **EN:** Cancel button icon style\n * - **CN:** 取消按钮图标样式\n */\n cancelIcon?: CSSProperties;\n };\n /**\n * **EN:** Submit and cancel action button alignment\n *\n * **CN:** 提交、取消操作按钮的对齐方式\n *\n * - `start` - align to the top | 顶部对齐\n * - `center` - align to the center | 居中对齐\n * - `end` - align to the bottom | 底部对齐\n *\n * @default 'center'\n */\n actionAlign?: SpaceProps['align'];\n /**\n * - **EN:** Submit button properties\n * - **CN:** 提交操作按钮属性\n */\n submitProps?: ButtonProps;\n /**\n * - **EN:** Cancel button properties\n * - **CN:** 取消操作按钮属性\n */\n cancelProps?: ButtonProps;\n /**\n * - **EN:** Confirm button click event, supports asynchronous operations\n * - **CN:** 确认按钮点击事件,支持异步操作\n */\n onOk: (value: V | undefined) => void | Promise<void>;\n /**\n * - **EN:** Cancel button click event, supports asynchronous operations\n * - **CN:** 取消按钮点击事件,支持异步操作\n */\n onCancel?: () => void | Promise<void>;\n}\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nconst EditableTextForm = <V, IT extends 'Input' | 'TextArea' | RenderInputInterface>(\n props: EditableFormProps<V, IT>\n) => {\n const {\n prefixCls,\n value,\n required = true,\n classNames,\n styles: styleNames,\n inputComp = 'Input' as IT,\n block: blockInProps = false,\n formProps,\n formItemProps,\n inputProps,\n actionAlign = 'center',\n submitProps,\n cancelProps,\n onOk,\n onCancel,\n } = props;\n const t = useT();\n const { getPrefixCls: getAntPrefixCls } = useContext(ConfigProvider.ConfigContext);\n const [form] = Form.useForm<{ value: V | undefined }>();\n const wrapperRef = useRef<HTMLDivElement>(null);\n const inputRef = useRef<InputRef>(null);\n const supportAutoScale = inputComp === 'Input' || inputComp === 'TextArea';\n const detectorRef = useRef<HTMLSpanElement>(null);\n const actionRef = useRef<HTMLDivElement>(null);\n const [inputWidth, setInputWidth] = useState<number>();\n const [visibility, setVisibility] = useState<CSSProperties['visibility']>('hidden');\n const [forceBlock, setForceBlock] = useState(false);\n const [saving, setSaving] = useState(false);\n const inputActionGapRef = useRef<number>(0);\n inputActionGapRef.current =\n pxToNumber(formItemProps?.style?.marginRight ?? formItemProps?.style?.marginInlineEnd) || defaultInputActionGap;\n const block = blockInProps || forceBlock;\n\n // Update form value when `value` prop changes\n useEffect(() => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n form.setFieldsValue({ value: value as any });\n }, [form, value]);\n\n // Detect the width of the text and dynamically scale the input width until it reaches the max width of the container.\n // Only built-in Input and TextArea components are supported.\n useEffect(() => {\n let contentWidth = 0;\n const inputElement = inputRef.current?.input;\n if (detectorRef.current && inputElement && supportAutoScale) {\n const inputStyle = getComputedStyle(inputElement);\n contentWidth =\n detectorRef.current.offsetWidth +\n pxToNumber(inputStyle.paddingLeft) +\n pxToNumber(inputStyle.paddingRight) +\n pxToNumber(inputStyle.borderLeftWidth) +\n pxToNumber(inputStyle.borderRightWidth);\n setInputWidth(contentWidth);\n }\n const actionWidth = actionRef.current?.offsetWidth || 0; // Width of action buttons\n const gap = inputActionGapRef.current; // Gap between input box and action buttons\n setVisibility('visible');\n // Listen to the width of the wrapper container, if the input box width is greater than the wrapper container width,\n const observer = new ResizeObserver(([entity]) => {\n const wrapperWidth = entity.contentRect.width;\n // Width deviation greater than 1px is considered overflow, to avoid misjudgment due to pixel density or scaling\n if (contentWidth + actionWidth + gap - wrapperWidth > 1) {\n setForceBlock(true);\n } else {\n setForceBlock(false);\n }\n });\n if (wrapperRef.current) {\n observer.observe(wrapperRef.current);\n }\n return () => observer.disconnect();\n }, [supportAutoScale]);\n\n // Cancel editing\n const handleCancel = async () => {\n form.resetFields();\n try {\n await onCancel?.();\n } catch (error) {\n console.error(error);\n }\n };\n // Pressing the Escape key to cancel editing\n const handleEscape: InputProps['onKeyUp'] = async (e) => {\n if ((inputComp === 'Input' || inputComp === 'TextArea') && e.key === 'Escape') {\n await handleCancel();\n cancelProps?.onClick?.(e as unknown as React.MouseEvent<HTMLElement>);\n }\n };\n // Submit editing\n const handleSubmit = async (values: { value: V | undefined }) => {\n const { value } = values;\n try {\n setSaving(true);\n await onOk?.(value);\n } catch (error) {\n console.error(error);\n } finally {\n setSaving(false);\n }\n };\n\n const renderInput = () => {\n if (inputComp === 'Input' || inputComp === 'TextArea') {\n const COMP = inputComp === 'Input' ? Input : Input.TextArea;\n return (\n <COMP\n ref={inputRef}\n placeholder={t('components.EditableText.placeholder')}\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n {...(inputProps as any)}\n style={{\n width: block ? undefined : inputWidth, // Width is 100% in block mode, no need to set width\n ...(inputProps && 'style' in inputProps ? inputProps?.style : {}),\n }}\n onPressEnter={() => {\n if (inputComp === 'Input') {\n form.submit();\n }\n }}\n onKeyUp={handleEscape}\n />\n );\n } else {\n return (\n <CustomInput<V>\n {...props}\n render={inputComp}\n submit={async () => {\n const values = await form.validateFields();\n await handleSubmit(values);\n }}\n cancel={handleCancel}\n />\n );\n }\n };\n\n return (\n <div ref={wrapperRef} className={names(`${prefixCls}-form`, classNames?.wrapper)} style={styleNames?.wrapper}>\n <Form\n component=\"div\" // Do not use form tag to avoid conflicts with external form, which may be nested in other forms\n layout=\"inline\"\n form={form}\n initialValues={{ value }}\n autoComplete=\"off\"\n onFinish={handleSubmit}\n {...formProps}\n style={{\n visibility,\n ...formProps?.style,\n }}\n >\n {/* Input box */}\n <Form.Item\n rules={[{ required, message: t('components.EditableText.requiredMsg') }]}\n {...formItemProps}\n className={names(formItemProps?.className, { [`${getAntPrefixCls('form-item-block')}`]: block })}\n style={{\n marginInlineEnd: defaultInputActionGap,\n ...formItemProps?.style,\n }}\n name=\"value\"\n >\n {renderInput()}\n </Form.Item>\n {/* Used to calculate the width of the text content */}\n {supportAutoScale && (\n <span\n ref={detectorRef}\n style={{\n position: 'absolute',\n visibility: 'hidden',\n height: 0,\n whiteSpace: 'pre',\n }}\n >\n {value?.toString()}\n </span>\n )}\n\n {/* Action buttons */}\n <Space ref={actionRef} className={`${prefixCls}-form-btns`} align={actionAlign} size={4}>\n <Button\n type=\"text\"\n disabled={saving}\n loading={saving}\n title={t('components.EditableText.save')}\n icon={<CheckSquareFilled className={classNames?.submitIcon} style={styleNames?.submitIcon} />}\n style={styleNames?.submitButton}\n onClick={() => form.submit()}\n {...submitProps}\n className={names(\n `${prefixCls}-form-btn`,\n `${prefixCls}-form-btn-save`,\n classNames?.submitButton,\n submitProps?.className\n )}\n />\n <Button\n type=\"text\"\n style={styleNames?.cancelButton}\n className={names(`${prefixCls}-form-btn`, `${prefixCls}-form-btn-close`, classNames?.cancelButton)}\n title={t('components.EditableText.cancel')}\n icon={<CloseSquareFilled className={classNames?.cancelIcon} style={styleNames?.cancelIcon} />}\n onClick={async (e) => {\n await handleCancel();\n cancelProps?.onClick?.(e);\n }}\n {...cancelProps}\n />\n </Space>\n </Form>\n </div>\n );\n};\n\nfunction CustomInput<V>(\n props: RenderInputProps<V> & {\n render: RenderInputInterface;\n }\n): ReactElement | null {\n const { render, value, onChange, ...restProps } = props;\n const useInput = render;\n return useInput({ ...restProps, value, onChange });\n}\n\nfunction pxToNumber(px: string | number | null | undefined) {\n return px ? parseFloat(px.toString().replace('px', '')) : 0;\n}\n\nexport type RenderInputInterface = <V>(props: RenderInputProps<V>) => ReactElement | null;\nexport interface RenderInputProps<V>\n extends Omit<EditableFormProps<V, 'Input'>, 'inputComp' | 'inputProps' | 'onOk' | 'onCancel'> {\n onChange?: (value: V | undefined) => void;\n submit(): Promise<void>;\n cancel(): Promise<void>;\n}\n\nexport default EditableTextForm;\n"],"mappings":";;;;;;;;;+CACA,qJAAAA,mBAAA,YAAAA,oBAAA,WAAAC,CAAA,SAAAC,CAAA,EAAAD,CAAA,OAAAE,CAAA,GAAAC,MAAA,CAAAC,SAAA,EAAAC,CAAA,GAAAH,CAAA,CAAAI,cAAA,EAAAC,CAAA,GAAAJ,MAAA,CAAAK,cAAA,cAAAP,CAAA,EAAAD,CAAA,EAAAE,CAAA,IAAAD,CAAA,CAAAD,CAAA,IAAAE,CAAA,CAAA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