@tiny-codes/react-easy 1.0.7 → 1.0.9

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/CHANGELOG.md CHANGED
@@ -2,6 +2,23 @@
2
2
 
3
3
  # Changelog
4
4
 
5
+ ## 1.0.9
6
+
7
+ 2025-6-18
8
+
9
+ ### Features
10
+
11
+ - Add export entries for utils
12
+ - Remove zIndex from `FloatDrawer` container
13
+
14
+ ## 1.0.8
15
+
16
+ 2025-6-18
17
+
18
+ ### Features
19
+
20
+ - 🔥 add `getColorLuminance` util method
21
+
5
22
  ## 1.0.7
6
23
 
7
24
  2025-6-15
@@ -110,51 +110,7 @@ export declare const genRenderer: (defaultProps: Partial<ConfirmActionProps<any,
110
110
  * @param WrappedComponent ConfirmAction component | ConfirmAction组件
111
111
  * @param defaultProps Default properties | 默认属性
112
112
  */
113
- export declare const withDefaultConfirmActionProps: <TP extends object, E extends keyof TP>(WrappedComponent: ComponentType<Omit<ModalFuncProps, "onOk"> & ConfirmActionTrigger<TP, E> & {
114
- /**
115
- * **EN:** Whether to display in red danger mode, which will automatically affect the color of
116
- * the title, icon, and confirm button. Default is `false`, for DeleteConfirmAction, the
117
- * defaults is `true`.
118
- *
119
- * - You can explicitly set `titleColor`, `iconColor`, and `okButtonProps.type` to override
120
- *
121
- * **CN:** 是否显示为红色危险模式,会自动影响标题、图标和确认按钮的颜色。默认`false`,DeleteConfirmAction组件的默认值为`true`。
122
- *
123
- * - 可以显式设置`titleColor`、`iconColor`和`okButtonProps.type`来覆盖
124
- */
125
- danger?: boolean | undefined;
126
- /**
127
- * **EN:** The color of confirm box title, default is `warning`
128
- *
129
- * **CN:** 弹框标题颜色,默认`warning`
130
- */
131
- titleColor?: TextProps['type'] | 'primary';
132
- /**
133
- * **EN:** The color of confirm box content
134
- *
135
- * **CN:** 弹框内容文本颜色
136
- */
137
- contentColor?: TextProps['type'] | 'primary';
138
- /**
139
- * **EN:** The color of confirm box title icon, default is the same as `titleColor`
140
- *
141
- * **CN:** 弹框标题图标颜色,默认与`titleColor`相同
142
- */
143
- iconColor?: TextProps['type'] | 'primary';
144
- /**
145
- * **EN:** Callback when click confirm button
146
- *
147
- * **CN:** 点击确认按钮的回调
148
- */
149
- onOk?: ((...args: Parameters<TP[E]>) => unknown | Promise<unknown>) | undefined;
150
- /**
151
- * **EN:** Callback after confirm event, won't trigger if failed, the argument is the return
152
- * value of `onOk`
153
- *
154
- * **CN:** 确认事件完成后的回调,失败时不会触发,参数为`onOk`的返回值
155
- */
156
- afterOk?: ((data?: any) => void) | undefined;
157
- } & RefAttributes<ConfirmActionRef>>, defaultProps?: Partial<ConfirmActionProps<TP, E>> | undefined) => import("react").ForwardRefExoticComponent<Omit<ModalFuncProps, "onOk"> & ConfirmActionTrigger<TP, E> & {
113
+ export declare const withDefaultConfirmActionProps: <TP extends object, E extends keyof TP>(WrappedComponent: ComponentType<PropsWithoutRef<ConfirmActionProps<TP, E>> & RefAttributes<ConfirmActionRef>>, defaultProps?: Partial<ConfirmActionProps<TP, E>>) => import("react").ForwardRefExoticComponent<Omit<ModalFuncProps, "onOk"> & ConfirmActionTrigger<TP, E> & {
158
114
  /**
159
115
  * **EN:** Whether to display in red danger mode, which will automatically affect the color of
160
116
  * the title, icon, and confirm button. Default is `false`, for DeleteConfirmAction, the
@@ -1,22 +1,16 @@
1
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
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
3
- 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."); }
4
- 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); }
5
- 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; }
6
- 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; } }
7
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
8
2
  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; }
9
3
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
10
4
  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); }
11
5
  import { genStyleHooks } from 'antd/es/theme/internal';
6
+ import { getColorLuminance } from "../../../utils";
12
7
  var genStyle = function genStyle(token) {
13
8
  var _componentCls;
14
9
  var componentCls = token.componentCls;
15
10
  return _defineProperty({}, componentCls, (_componentCls = {
16
11
  position: 'absolute',
17
12
  display: 'flex',
18
- overflow: 'visible',
19
- zIndex: token.zIndexPopupBase
13
+ overflow: 'visible'
20
14
  }, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_componentCls, '&-left', {
21
15
  left: 0,
22
16
  top: 0,
@@ -67,14 +61,14 @@ var genStyle = function genStyle(token) {
67
61
  zIndex: 2,
68
62
  cursor: 'pointer',
69
63
  color: token.colorTextTertiary,
70
- backgroundColor: isLightColor(token.colorBgBase) ? '#fafafa' : '#141414',
64
+ backgroundColor: getColorLuminance(token.colorBgBase) > 0.5 ? '#fafafa' : '#141414',
71
65
  display: 'flex',
72
66
  alignItems: 'center',
73
67
  justifyContent: 'center',
74
68
  pointerEvents: 'all',
75
69
  '&:hover': {
76
70
  color: token.colorText,
77
- backgroundColor: isLightColor(token.colorBgBase) ? '#f0f0f0' : '#1a1a1a'
71
+ backgroundColor: getColorLuminance(token.colorBgBase) > 0.5 ? '#f0f0f0' : '#1a1a1a'
78
72
  }
79
73
  }), "&".concat(componentCls, "-left ").concat(componentCls, "-expand-handle,\n &").concat(componentCls, "-right ").concat(componentCls, "-expand-handle"), {
80
74
  top: '50%',
@@ -150,37 +144,6 @@ var genStyle = function genStyle(token) {
150
144
  overflow: 'auto'
151
145
  })))));
152
146
  };
153
- function isLightColor(color) {
154
- var r = 0,
155
- g = 0,
156
- b = 0;
157
- if (color.startsWith('#')) {
158
- var hex = color.substring(1);
159
- if (hex.length === 3) {
160
- hex = hex.split('').map(function (c) {
161
- return c + c;
162
- }).join('');
163
- }
164
- r = parseInt(hex.substring(0, 2), 16);
165
- g = parseInt(hex.substring(2, 4), 16);
166
- b = parseInt(hex.substring(4, 6), 16);
167
- } else if (color.startsWith('rgb')) {
168
- var _color$match;
169
- var values = ((_color$match = color.match(/\d+/g)) === null || _color$match === void 0 ? void 0 : _color$match.map(Number)) || [];
170
- var _values = _slicedToArray(values, 3);
171
- r = _values[0];
172
- g = _values[1];
173
- b = _values[2];
174
- }
175
- r = r / 255;
176
- g = g / 255;
177
- b = b / 255;
178
- r = r <= 0.03928 ? r / 12.92 : Math.pow((r + 0.055) / 1.055, 2.4);
179
- g = g <= 0.03928 ? g / 12.92 : Math.pow((g + 0.055) / 1.055, 2.4);
180
- b = b <= 0.03928 ? b / 12.92 : Math.pow((b + 0.055) / 1.055, 2.4);
181
- var luminance = 0.2126 * r + 0.7152 * g + 0.0722 * b;
182
- return luminance > 0.5;
183
- }
184
147
 
185
148
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
186
149
  export default genStyleHooks('re-float-drawer', genStyle);
@@ -1 +1 @@
1
- {"version":3,"names":["genStyleHooks","genStyle","token","_componentCls","componentCls","_defineProperty","position","display","overflow","zIndex","zIndexPopupBase","left","top","bottom","right","concat","pointerEvents","transition","height","width","transform","boxShadow","colorFill","cursor","color","colorTextTertiary","backgroundColor","isLightColor","colorBgBase","alignItems","justifyContent","colorText","borderRadius","userSelect","lineHeight","border","colorBgTextHover","colorBgTextActive","flexDirection","antCls","flex","minHeight","r","g","b","startsWith","hex","substring","length","split","map","c","join","parseInt","_color$match","values","match","Number","_values","_slicedToArray","Math","pow","luminance"],"sources":["../../../../src/components/FloatDrawer/style/index.ts"],"sourcesContent":["import { genStyleHooks } from 'antd/es/theme/internal';\nimport type { AliasToken, GenerateStyle } from 'antd/es/theme/internal';\nimport type { CSSObject } from '@ant-design/cssinjs';\nimport type { FullToken } from '@ant-design/cssinjs-utils';\n\ntype REFloatDrawerToken = FullToken<{ ''?: object }, AliasToken, ''>;\n\nconst genStyle: GenerateStyle<REFloatDrawerToken> = (token): CSSObject => {\n const { componentCls } = token;\n return {\n [componentCls]: {\n position: 'absolute',\n display: 'flex',\n overflow: 'visible',\n zIndex: token.zIndexPopupBase,\n ['&-left']: {\n left: 0,\n top: 0,\n bottom: 0,\n },\n ['&-right']: {\n right: 0,\n top: 0,\n bottom: 0,\n },\n ['&-top']: {\n left: 0,\n right: 0,\n top: 0,\n },\n ['&-bottom']: {\n left: 0,\n right: 0,\n bottom: 0,\n },\n\n [`&${componentCls}-open`]: {\n // visibility: 'visible',\n },\n [`&${componentCls}-closed`]: {\n pointerEvents: 'none',\n },\n [`${componentCls}-drawer`]: {\n transition: 'transform 0.3s ease-in-out',\n overflow: 'visible',\n },\n [`&${componentCls}-left ${componentCls}-drawer,\n &${componentCls}-right ${componentCls}-drawer`]: {\n height: '100%',\n },\n [`&${componentCls}-top ${componentCls}-drawer,\n &${componentCls}-bottom ${componentCls}-drawer`]: {\n width: '100%',\n },\n [`&${componentCls}-open${componentCls}-left ${componentCls}-drawer,\n &${componentCls}-open${componentCls}-right ${componentCls}-drawer,\n &${componentCls}-open${componentCls}-top ${componentCls}-drawer,\n &${componentCls}-open${componentCls}-bottom ${componentCls}-drawer`]: {\n transform: 'translate(0, 0)',\n },\n [`&${componentCls}-open${componentCls}-left ${componentCls}-drawer`]: {\n boxShadow: `2px 0 10px ${token.colorFill}`,\n },\n [`&${componentCls}-open${componentCls}-right ${componentCls}-drawer`]: {\n boxShadow: `-2px 0 10px ${token.colorFill}`,\n },\n [`&${componentCls}-open${componentCls}-top ${componentCls}-drawer`]: {\n boxShadow: `0 2px 10px ${token.colorFill}`,\n },\n [`&${componentCls}-open${componentCls}-bottom ${componentCls}-drawer`]: {\n boxShadow: `0 -2px 10px ${token.colorFill}`,\n },\n [`&${componentCls}-closed${componentCls}-left ${componentCls}-drawer`]: {\n transform: 'translateX(-100%)',\n },\n [`&${componentCls}-closed${componentCls}-right ${componentCls}-drawer`]: {\n transform: 'translateX(100%)',\n },\n [`&${componentCls}-closed${componentCls}-top ${componentCls}-drawer`]: {\n transform: 'translateY(-100%)',\n },\n [`&${componentCls}-closed${componentCls}-bottom ${componentCls}-drawer`]: {\n transform: 'translateY(100%)',\n },\n [`${componentCls}-expand-handle`]: {\n position: 'absolute',\n zIndex: 2,\n cursor: 'pointer',\n color: token.colorTextTertiary,\n backgroundColor: isLightColor(token.colorBgBase) ? '#fafafa' : '#141414',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n pointerEvents: 'all',\n '&:hover': {\n color: token.colorText,\n backgroundColor: isLightColor(token.colorBgBase) ? '#f0f0f0' : '#1a1a1a',\n },\n },\n [`&${componentCls}-left ${componentCls}-expand-handle,\n &${componentCls}-right ${componentCls}-expand-handle`]: {\n top: '50%',\n width: 24,\n height: 60,\n },\n [`&${componentCls}-top ${componentCls}-expand-handle,\n &${componentCls}-bottom ${componentCls}-expand-handle`]: {\n left: '50%',\n width: 60,\n height: 24,\n },\n [`&${componentCls}-left ${componentCls}-expand-handle`]: {\n right: 0,\n transform: 'translate(100%, -50%)',\n borderRadius: '0 8px 8px 0',\n boxShadow: `2px 0 5px ${token.colorFill}`,\n },\n [`&${componentCls}-right ${componentCls}-expand-handle`]: {\n left: 0,\n transform: 'translate(-100%, -50%)',\n borderRadius: '8px 0 0 8px',\n boxShadow: `-2px 0 5px ${token.colorFill}`,\n },\n [`&${componentCls}-top ${componentCls}-expand-handle`]: {\n bottom: 0,\n transform: 'translate(-50%, 100%)',\n borderRadius: '0 0 8px 8px',\n boxShadow: `0 2px 5px ${token.colorFill}`,\n },\n [`&${componentCls}-bottom ${componentCls}-expand-handle`]: {\n top: 0,\n transform: 'translate(-50%, -100%)',\n borderRadius: '8px 8px 0 0',\n boxShadow: `0 -2px 5px ${token.colorFill}`,\n },\n [`${componentCls}-handle-icon`]: {\n userSelect: 'none',\n lineHeight: 0,\n },\n [`${componentCls}-resize-handle`]: {\n position: 'absolute',\n border: `1px solid transparent`,\n zIndex: 1,\n backgroundColor: token.colorBgTextHover,\n '&:hover': {\n backgroundColor: token.colorBgTextActive,\n },\n '&&-dragging': {\n backgroundColor: token.colorBgTextActive,\n },\n },\n [`&${componentCls}-left ${componentCls}-resize-handle`]: {\n right: 0,\n width: 1,\n height: '100%',\n cursor: 'col-resize',\n },\n [`&${componentCls}-right ${componentCls}-resize-handle`]: {\n left: 0,\n width: 1,\n height: '100%',\n cursor: 'col-resize',\n },\n [`&${componentCls}-top ${componentCls}-resize-handle`]: {\n bottom: 0,\n height: 1,\n width: '100%',\n cursor: 'row-resize',\n },\n [`&${componentCls}-bottom ${componentCls}-resize-handle`]: {\n top: 0,\n height: 1,\n width: '100%',\n cursor: 'row-resize',\n },\n [`${componentCls}-content`]: {\n height: '100%',\n [`${componentCls}-card`]: {\n display: 'flex',\n flexDirection: 'column',\n height: '100%',\n\n [`${token.antCls}-card-body`]: {\n flex: 1,\n minHeight: 0,\n overflow: 'auto',\n },\n },\n },\n },\n };\n};\n\nfunction isLightColor(color: string): boolean {\n let r = 0,\n g = 0,\n b = 0;\n\n if (color.startsWith('#')) {\n let hex = color.substring(1);\n if (hex.length === 3) {\n hex = hex\n .split('')\n .map((c) => c + c)\n .join('');\n }\n r = parseInt(hex.substring(0, 2), 16);\n g = parseInt(hex.substring(2, 4), 16);\n b = parseInt(hex.substring(4, 6), 16);\n } else if (color.startsWith('rgb')) {\n const values = color.match(/\\d+/g)?.map(Number) || [];\n [r, g, b] = values;\n }\n r = r / 255;\n g = g / 255;\n b = b / 255;\n\n r = r <= 0.03928 ? r / 12.92 : Math.pow((r + 0.055) / 1.055, 2.4);\n g = g <= 0.03928 ? g / 12.92 : Math.pow((g + 0.055) / 1.055, 2.4);\n b = b <= 0.03928 ? b / 12.92 : Math.pow((b + 0.055) / 1.055, 2.4);\n\n const luminance = 0.2126 * r + 0.7152 * g + 0.0722 * b;\n\n return luminance > 0.5;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport default genStyleHooks('re-float-drawer' as any, genStyle);\n"],"mappings":";;;;;;;;;;AAAA,SAASA,aAAa,QAAQ,wBAAwB;AAOtD,IAAMC,QAA2C,GAAG,SAA9CA,QAA2CA,CAAIC,KAAK,EAAgB;EAAA,IAAAC,aAAA;EACxE,IAAQC,YAAY,GAAKF,KAAK,CAAtBE,YAAY;EACpB,OAAAC,eAAA,KACGD,YAAY,GAAAD,aAAA;IACXG,Q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AC,GAAG,KAAK,GAAGiB,IAAI,CAACC,GAAG,CAAC,CAAClB,CAAC,GAAG,KAAK,IAAI,KAAK,EAAE,GAAG,CAAC;EACjEC,CAAC,GAAGA,CAAC,IAAI,OAAO,GAAGA,CAAC,GAAG,KAAK,GAAGgB,IAAI,CAACC,GAAG,CAAC,CAACjB,CAAC,GAAG,KAAK,IAAI,KAAK,EAAE,GAAG,CAAC;EAEjE,IAAMkB,SAAS,GAAG,MAAM,GAAGpB,CAAC,GAAG,MAAM,GAAGC,CAAC,GAAG,MAAM,GAAGC,CAAC;EAEtD,OAAOkB,SAAS,GAAG,GAAG;AACxB;;AAEA;AACA,eAAe9D,aAAa,CAAC,iBAAiB,EAASC,QAAQ,CAAC"}
1
+ {"version":3,"names":["genStyleHooks","getColorLuminance","genStyle","token","_componentCls","componentCls","_defineProperty","position","display","overflow","left","top","bottom","right","concat","pointerEvents","transition","height","width","transform","boxShadow","colorFill","zIndex","cursor","color","colorTextTertiary","backgroundColor","colorBgBase","alignItems","justifyContent","colorText","borderRadius","userSelect","lineHeight","border","colorBgTextHover","colorBgTextActive","flexDirection","antCls","flex","minHeight"],"sources":["../../../../src/components/FloatDrawer/style/index.ts"],"sourcesContent":["import { genStyleHooks } from 'antd/es/theme/internal';\nimport type { AliasToken, GenerateStyle } from 'antd/es/theme/internal';\nimport type { CSSObject } from '@ant-design/cssinjs';\nimport type { FullToken } from '@ant-design/cssinjs-utils';\nimport { getColorLuminance } from '../../../utils';\n\ntype REFloatDrawerToken = FullToken<{ ''?: object }, AliasToken, ''>;\n\nconst genStyle: GenerateStyle<REFloatDrawerToken> = (token): CSSObject => {\n const { componentCls } = token;\n return {\n [componentCls]: {\n position: 'absolute',\n display: 'flex',\n overflow: 'visible',\n ['&-left']: {\n left: 0,\n top: 0,\n bottom: 0,\n },\n ['&-right']: {\n right: 0,\n top: 0,\n bottom: 0,\n },\n ['&-top']: {\n left: 0,\n right: 0,\n top: 0,\n },\n ['&-bottom']: {\n left: 0,\n right: 0,\n bottom: 0,\n },\n\n [`&${componentCls}-open`]: {\n // visibility: 'visible',\n },\n [`&${componentCls}-closed`]: {\n pointerEvents: 'none',\n },\n [`${componentCls}-drawer`]: {\n transition: 'transform 0.3s ease-in-out',\n overflow: 'visible',\n },\n [`&${componentCls}-left ${componentCls}-drawer,\n &${componentCls}-right ${componentCls}-drawer`]: {\n height: '100%',\n },\n [`&${componentCls}-top ${componentCls}-drawer,\n &${componentCls}-bottom ${componentCls}-drawer`]: {\n width: '100%',\n },\n [`&${componentCls}-open${componentCls}-left ${componentCls}-drawer,\n &${componentCls}-open${componentCls}-right ${componentCls}-drawer,\n &${componentCls}-open${componentCls}-top ${componentCls}-drawer,\n &${componentCls}-open${componentCls}-bottom ${componentCls}-drawer`]: {\n transform: 'translate(0, 0)',\n },\n [`&${componentCls}-open${componentCls}-left ${componentCls}-drawer`]: {\n boxShadow: `2px 0 10px ${token.colorFill}`,\n },\n [`&${componentCls}-open${componentCls}-right ${componentCls}-drawer`]: {\n boxShadow: `-2px 0 10px ${token.colorFill}`,\n },\n [`&${componentCls}-open${componentCls}-top ${componentCls}-drawer`]: {\n boxShadow: `0 2px 10px ${token.colorFill}`,\n },\n [`&${componentCls}-open${componentCls}-bottom ${componentCls}-drawer`]: {\n boxShadow: `0 -2px 10px ${token.colorFill}`,\n },\n [`&${componentCls}-closed${componentCls}-left ${componentCls}-drawer`]: {\n transform: 'translateX(-100%)',\n },\n [`&${componentCls}-closed${componentCls}-right ${componentCls}-drawer`]: {\n transform: 'translateX(100%)',\n },\n [`&${componentCls}-closed${componentCls}-top ${componentCls}-drawer`]: {\n transform: 'translateY(-100%)',\n },\n [`&${componentCls}-closed${componentCls}-bottom ${componentCls}-drawer`]: {\n transform: 'translateY(100%)',\n },\n [`${componentCls}-expand-handle`]: {\n position: 'absolute',\n zIndex: 2,\n cursor: 'pointer',\n color: token.colorTextTertiary,\n backgroundColor: getColorLuminance(token.colorBgBase) > 0.5 ? '#fafafa' : '#141414',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n pointerEvents: 'all',\n '&:hover': {\n color: token.colorText,\n backgroundColor: getColorLuminance(token.colorBgBase) > 0.5 ? '#f0f0f0' : '#1a1a1a',\n },\n },\n [`&${componentCls}-left ${componentCls}-expand-handle,\n &${componentCls}-right ${componentCls}-expand-handle`]: {\n top: '50%',\n width: 24,\n height: 60,\n },\n [`&${componentCls}-top ${componentCls}-expand-handle,\n &${componentCls}-bottom ${componentCls}-expand-handle`]: {\n left: '50%',\n width: 60,\n height: 24,\n },\n [`&${componentCls}-left ${componentCls}-expand-handle`]: {\n right: 0,\n transform: 'translate(100%, -50%)',\n borderRadius: '0 8px 8px 0',\n boxShadow: `2px 0 5px ${token.colorFill}`,\n },\n [`&${componentCls}-right ${componentCls}-expand-handle`]: {\n left: 0,\n transform: 'translate(-100%, -50%)',\n borderRadius: '8px 0 0 8px',\n boxShadow: `-2px 0 5px ${token.colorFill}`,\n },\n [`&${componentCls}-top ${componentCls}-expand-handle`]: {\n bottom: 0,\n transform: 'translate(-50%, 100%)',\n borderRadius: '0 0 8px 8px',\n boxShadow: `0 2px 5px ${token.colorFill}`,\n },\n [`&${componentCls}-bottom ${componentCls}-expand-handle`]: {\n top: 0,\n transform: 'translate(-50%, -100%)',\n borderRadius: '8px 8px 0 0',\n boxShadow: `0 -2px 5px ${token.colorFill}`,\n },\n [`${componentCls}-handle-icon`]: {\n userSelect: 'none',\n lineHeight: 0,\n },\n [`${componentCls}-resize-handle`]: {\n position: 'absolute',\n border: `1px solid transparent`,\n zIndex: 1,\n backgroundColor: token.colorBgTextHover,\n '&:hover': {\n backgroundColor: token.colorBgTextActive,\n },\n '&&-dragging': {\n backgroundColor: token.colorBgTextActive,\n },\n },\n [`&${componentCls}-left ${componentCls}-resize-handle`]: {\n right: 0,\n width: 1,\n height: '100%',\n cursor: 'col-resize',\n },\n [`&${componentCls}-right ${componentCls}-resize-handle`]: {\n left: 0,\n width: 1,\n height: '100%',\n cursor: 'col-resize',\n },\n [`&${componentCls}-top ${componentCls}-resize-handle`]: {\n bottom: 0,\n height: 1,\n width: '100%',\n cursor: 'row-resize',\n },\n [`&${componentCls}-bottom ${componentCls}-resize-handle`]: {\n top: 0,\n height: 1,\n width: '100%',\n cursor: 'row-resize',\n },\n [`${componentCls}-content`]: {\n height: '100%',\n [`${componentCls}-card`]: {\n display: 'flex',\n flexDirection: 'column',\n height: '100%',\n\n [`${token.antCls}-card-body`]: {\n flex: 1,\n minHeight: 0,\n overflow: 'auto',\n },\n },\n },\n },\n };\n};\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport default genStyleHooks('re-float-drawer' as any, genStyle);\n"],"mappings":";;;;AAAA,SAASA,aAAa,QAAQ,wBAAwB;AAItD,SAASC,iBAAiB;AAI1B,IAAMC,QAA2C,GAAG,SAA9CA,QAA2CA,CAAIC,KAAK,EAAgB;EAAA,IAAAC,aAAA;EACxE,IAAQC,YAAY,GAAKF,KAAK,CAAtBE,YAAY;EACpB,OAAAC,eAAA,KACGD,YAAY,GAAAD,aAAA;IACXG,QAAQ,EAAE,UAAU;IACpBC,OAAO,EAAE,MAAM;IACfC,QAAQ,EAAE;EAAS,GAAAH,eAAA,CAAAA,eAAA,CAAAA,eAAA,CAAAA,eAAA,CAAAA,eAAA,CAAAA,eAAA,CAAAA,eAAA,CAAAA,eAAA,CAAAA,eAAA,CAAAA,eAAA,CAAAF,aAAA,EAClB,QAAQ,EAAG;IACVM,IAAI,EAAE,CAAC;IACPC,GAAG,EAAE,CAAC;IACNC,MAAM,EAAE;EACV,CAAC,GACA,SAAS,EAAG;IACXC,KAAK,EAAE,CAAC;IACRF,GAAG,EAAE,CAAC;IACNC,MAAM,EAAE;EACV,CAAC,GACA,OAAO,EAAG;IACTF,IAAI,EAAE,CAAC;IACPG,KAAK,EAAE,CAAC;IACRF,GAAG,EAAE;EACP,CAAC,GACA,UAAU,EAAG;IACZD,IAAI,EAAE,CAAC;IACPG,KAAK,EAAE,CAAC;IACR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DM,GAAG,EAAE,CAAC;IACNM,MAAM,EAAE,CAAC;IACTC,KAAK,EAAE,MAAM;IACbK,MAAM,EAAE;EACV,CAAC,MAAAT,MAAA,CACGT,YAAY,eAAAC,eAAA;IACdW,MAAM,EAAE;EAAM,MAAAH,MAAA,CACVT,YAAY,YAAAC,eAAA;IACdE,OAAO,EAAE,MAAM;IACf6B,aAAa,EAAE,QAAQ;IACvBpB,MAAM,EAAE;EAAM,MAAAH,MAAA,CAEVX,KAAK,CAACmC,MAAM,iBAAe;IAC7BC,IAAI,EAAE,CAAC;IACPC,SAAS,EAAE,CAAC;IACZ/B,QAAQ,EAAE;EACZ,CAAC;AAKX,CAAC;;AAED;AACA,eAAeT,aAAa,CAAC,iBAAiB,EAASE,QAAQ,CAAC"}
@@ -70,11 +70,11 @@ export interface FormCompPropsConstraint<FD> {
70
70
  */
71
71
  ...triggerEventData: any[]) => unknown | Promise<unknown>) => void;
72
72
  /**
73
- * **EN:** Listen to the open and close status of the dialog. When `destroyOnClose` is set to
73
+ * **EN:** Listen to the open and close status of the dialog. When `destroyOnHidden` is set to
74
74
  * false, the form component instance is cached, and the dialog can only be listened to in this
75
75
  * way
76
76
  *
77
- * **CN:** 监听弹框打开关闭状态。当`destroyOnClose`设置为false时,表单组件实例被缓存,只能通过这种方式监听弹框
77
+ * **CN:** 监听弹框打开关闭状态。当`destroyOnHidden`设置为false时,表单组件实例被缓存,只能通过这种方式监听弹框
78
78
  *
79
79
  * @param handler Event handler | 事件处理函数
80
80
  */
@@ -160,36 +160,7 @@ export declare const genModalActionRenderer: (defaultProps: Partial<ModalActionP
160
160
  * @param WrappedComponent ModalAction component | ModalAction组件
161
161
  * @param defaultProps Default properties | 默认属性
162
162
  */
163
- export declare const withDefaultModalActionProps: <FD extends object, CP extends FormCompPropsConstraint<FD>, TP extends object, E extends keyof TP, CRef extends object>(WrappedComponent: ComponentType<Omit<ModalProps, "onOk"> & ModalActionTrigger<FD, CP, TP, E> & {
164
- /**
165
- * **EN:** Form editing component, do not use the Form component inside the component, the form
166
- * component and form instance are automatically created by the parent component
167
- *
168
- * **CN:** 表单编辑组件,组件内部不要使用Form组件,表单组件及表单实例由父组件自动创建
169
- */
170
- formComp: ComponentType<CP & RefAttributes<CRef>>;
171
- /**
172
- * **EN:** Props of the form editing component
173
- *
174
- * **CN:** 表单编辑组件的Props属性
175
- */
176
- formProps?: Omit<CP, keyof FormCompPropsConstraint<FD_1>> | undefined;
177
- /**
178
- * **EN:** The callback when clicks the confirmation button, support asynchronous saving, return
179
- * `SubmitWithoutClosingSymbol` can prevent the dialog from closing, return other values will be
180
- * passed to the `afterOk` event, if any
181
- *
182
- * **CN:** 点击确认按钮的回调,支持异步保存,返回`SubmitWithoutClosingSymbol`可以阻止弹框关闭,返回其他值会传递给`afterOk`事件,如果有的话
183
- */
184
- onOk?: ((formData: FD, ...args: Parameters<TP[E]>) => unknown | Promise<unknown>) | undefined;
185
- /**
186
- * **EN:** The callback after the confirmation event is completed, it will not be triggered when
187
- * it fails, the parameter is the return value of `onOk`
188
- *
189
- * **CN:** 确认事件完成后的回调,失败时不会触发,参数为`onOk`的返回值
190
- */
191
- afterOk?: ((data?: any) => void) | undefined;
192
- } & RefAttributes<ModalActionRef<CRef>>>, defaultProps?: Partial<ModalActionProps<FD, CP, TP, E, CRef>> | (() => Partial<ModalActionProps<FD, CP, TP, E, CRef>>) | undefined) => import("react").ForwardRefExoticComponent<Omit<ModalProps, "onOk"> & ModalActionTrigger<FD, CP, TP, E> & {
163
+ export declare const withDefaultModalActionProps: <FD extends object, CP extends FormCompPropsConstraint<FD>, TP extends object, E extends keyof TP, CRef extends object>(WrappedComponent: ComponentType<ModalActionProps<FD, CP, TP, E, CRef> & RefAttributes<ModalActionRef<CRef>>>, defaultProps?: Partial<ModalActionProps<FD, CP, TP, E, CRef>> | (() => Partial<ModalActionProps<FD, CP, TP, E, CRef>>)) => import("react").ForwardRefExoticComponent<Omit<ModalProps, "onOk"> & ModalActionTrigger<FD, CP, TP, E> & {
193
164
  /**
194
165
  * **EN:** Form editing component, do not use the Form component inside the component, the form
195
166
  * component and form instance are automatically created by the parent component
@@ -1,4 +1,4 @@
1
- var _excluded = ["formComp", "formProps", "triggerComponent", "triggerEvent", "triggerProps", "open", "destroyOnClose", "maskClosable", "onOk", "afterOk", "onCancel", "onClose", "children"];
1
+ var _excluded = ["formComp", "formProps", "triggerComponent", "triggerEvent", "triggerProps", "open", "destroyOnClose", "destroyOnHidden", "maskClosable", "onOk", "afterOk", "onCancel", "afterClose", "children"];
2
2
  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); }
3
3
  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; }
4
4
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
@@ -56,12 +56,14 @@ export var genModalActionRenderer = function genModalActionRenderer(defaultProps
56
56
  openInProps = _mergedProps.open,
57
57
  _mergedProps$destroyO = _mergedProps.destroyOnClose,
58
58
  destroyOnClose = _mergedProps$destroyO === void 0 ? true : _mergedProps$destroyO,
59
+ _mergedProps$destroyO2 = _mergedProps.destroyOnHidden,
60
+ destroyOnHidden = _mergedProps$destroyO2 === void 0 ? true : _mergedProps$destroyO2,
59
61
  _mergedProps$maskClos = _mergedProps.maskClosable,
60
62
  maskClosable = _mergedProps$maskClos === void 0 ? false : _mergedProps$maskClos,
61
63
  onOk = _mergedProps.onOk,
62
64
  afterOk = _mergedProps.afterOk,
63
65
  onCancel = _mergedProps.onCancel,
64
- _onClose = _mergedProps.onClose,
66
+ _afterClose = _mergedProps.afterClose,
65
67
  children = _mergedProps.children,
66
68
  restProps = _objectWithoutProperties(_mergedProps, _excluded);
67
69
  useContextValidator();
@@ -88,7 +90,7 @@ export var genModalActionRenderer = function genModalActionRenderer(defaultProps
88
90
  var formRef = useRef(form);
89
91
  formRef.current = form;
90
92
  var destroyOnCloseRef = useRef(destroyOnClose);
91
- destroyOnCloseRef.current = destroyOnClose;
93
+ destroyOnCloseRef.current = destroyOnClose || destroyOnHidden;
92
94
  var openListenerRef = useRef(undefined);
93
95
 
94
96
  // Listen to the open props changes
@@ -170,6 +172,7 @@ export var genModalActionRenderer = function genModalActionRenderer(defaultProps
170
172
  open: open,
171
173
  confirmLoading: isSaving,
172
174
  destroyOnClose: destroyOnClose,
175
+ destroyOnHidden: destroyOnHidden,
173
176
  maskClosable: maskClosable,
174
177
  onOk: ( /*#__PURE__*/function () {
175
178
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(e) {
@@ -255,9 +258,9 @@ export var genModalActionRenderer = function genModalActionRenderer(defaultProps
255
258
  return _ref4.apply(this, arguments);
256
259
  };
257
260
  }()),
258
- onClose: function onClose(e) {
261
+ afterClose: function afterClose() {
259
262
  hideModal();
260
- _onClose === null || _onClose === void 0 || _onClose(e);
263
+ _afterClose === null || _afterClose === void 0 || _afterClose();
261
264
  }
262
265
  }, restProps), {}, {
263
266
  children: [/*#__PURE__*/_jsx(FormCreator, {