@flatbiz/antd 5.0.33 → 5.0.35

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 (186) hide show
  1. package/dist/_commonjsHelpers-B0GIDhER.js +33 -0
  2. package/dist/_commonjsHelpers-B0GIDhER.js.map +1 -0
  3. package/dist/ace-editor-json/index.js +1 -0
  4. package/dist/ace-editor-json/index.js.map +1 -1
  5. package/dist/ace-editor-mysql/index.js +1 -0
  6. package/dist/ace-editor-mysql/index.js.map +1 -1
  7. package/dist/ace-editor-xml/index.js +1 -0
  8. package/dist/ace-editor-xml/index.js.map +1 -1
  9. package/dist/ai-search/index.css +1 -0
  10. package/dist/ai-search/index.d.ts +25 -0
  11. package/dist/ai-search/index.js +39 -0
  12. package/dist/ai-search/index.js.map +1 -0
  13. package/dist/ai-search-WcG2oakE.js +161 -0
  14. package/dist/ai-search-WcG2oakE.js.map +1 -0
  15. package/dist/bootstrap/index.js +1 -0
  16. package/dist/bootstrap/index.js.map +1 -1
  17. package/dist/button-operate/index.js +1 -0
  18. package/dist/button-operate/index.js.map +1 -1
  19. package/dist/button-wrapper/index.js +1 -0
  20. package/dist/button-wrapper/index.js.map +1 -1
  21. package/dist/cascader-wrapper/index.js +1 -0
  22. package/dist/cascader-wrapper/index.js.map +1 -1
  23. package/dist/check-list/index.js +1 -0
  24. package/dist/check-list/index.js.map +1 -1
  25. package/dist/config-provider-wrapper/index.js +1 -0
  26. package/dist/config-provider-wrapper/index.js.map +1 -1
  27. package/dist/date-range-picker-wrapper-form-item/index.js +1 -0
  28. package/dist/date-range-picker-wrapper-form-item/index.js.map +1 -1
  29. package/dist/dialog-alert/index.js +1 -0
  30. package/dist/dialog-alert/index.js.map +1 -1
  31. package/dist/dialog-confirm/index.js +1 -0
  32. package/dist/dialog-confirm/index.js.map +1 -1
  33. package/dist/dialog-drag-modal/index.css +1 -1
  34. package/dist/dialog-drag-modal/index.d.ts +18 -5
  35. package/dist/dialog-drag-modal/index.js +5 -2
  36. package/dist/dialog-drag-modal/index.js.map +1 -1
  37. package/dist/dialog-drawer/index.js +1 -0
  38. package/dist/dialog-drawer/index.js.map +1 -1
  39. package/dist/dialog-drawer-content/index.js +1 -0
  40. package/dist/dialog-drawer-content/index.js.map +1 -1
  41. package/dist/dialog-loading/index.js +1 -0
  42. package/dist/dialog-loading/index.js.map +1 -1
  43. package/dist/dialog-modal/index.js +1 -0
  44. package/dist/dialog-modal/index.js.map +1 -1
  45. package/dist/dialog-preview-image/index.js +1 -0
  46. package/dist/dialog-preview-image/index.js.map +1 -1
  47. package/dist/drag-collapse/index.js +1 -0
  48. package/dist/drag-collapse/index.js.map +1 -1
  49. package/dist/drag-collapse-form-list/index.js +1 -0
  50. package/dist/drag-collapse-form-list/index.js.map +1 -1
  51. package/dist/drag-editable-card/index.d.ts +7 -4
  52. package/dist/drag-editable-card/index.js +8 -7
  53. package/dist/drag-editable-card/index.js.map +1 -1
  54. package/dist/drag-editable-table/index.js +1 -0
  55. package/dist/drag-editable-table/index.js.map +1 -1
  56. package/dist/drag-editable-table-pro/index.js +1 -0
  57. package/dist/drag-editable-table-pro/index.js.map +1 -1
  58. package/dist/drag-form-list/index.js +1 -0
  59. package/dist/drag-form-list/index.js.map +1 -1
  60. package/dist/{drag-modal-DTbr-E0g.js → drag-modal-DVq260Mc.js} +56 -53
  61. package/dist/drag-modal-DVq260Mc.js.map +1 -0
  62. package/dist/drawer-BI8T3w7e.js +257 -0
  63. package/dist/drawer-BI8T3w7e.js.map +1 -0
  64. package/dist/dropdown-menu-wrapper/index.js +1 -0
  65. package/dist/dropdown-menu-wrapper/index.js.map +1 -1
  66. package/dist/easy-form/index.d.ts +0 -4
  67. package/dist/easy-form/index.js +2 -1
  68. package/dist/easy-form/index.js.map +1 -1
  69. package/dist/easy-table/index.d.ts +0 -4
  70. package/dist/easy-table/index.js +2 -1
  71. package/dist/easy-table/index.js.map +1 -1
  72. package/dist/editable-card/index.d.ts +7 -4
  73. package/dist/editable-card/index.js +7 -6
  74. package/dist/editable-card/index.js.map +1 -1
  75. package/dist/{editable-card-DlqrwXa0.js → editable-card-BN9ViZz0.js} +69 -56
  76. package/dist/editable-card-BN9ViZz0.js.map +1 -0
  77. package/dist/{editable-card-eGAbYXAH.js → editable-card-BrnWDl8j.js} +2 -2
  78. package/dist/{editable-card-eGAbYXAH.js.map → editable-card-BrnWDl8j.js.map} +1 -1
  79. package/dist/editable-field/index.js +1 -0
  80. package/dist/editable-field/index.js.map +1 -1
  81. package/dist/editable-table/index.js +1 -0
  82. package/dist/editable-table/index.js.map +1 -1
  83. package/dist/editable-table-pro/index.js +1 -0
  84. package/dist/editable-table-pro/index.js.map +1 -1
  85. package/dist/fba-app/index.js +1 -0
  86. package/dist/fba-app/index.js.map +1 -1
  87. package/dist/fba-hooks/index.d.ts +1 -0
  88. package/dist/fba-hooks/index.js +10 -1
  89. package/dist/fba-hooks/index.js.map +1 -1
  90. package/dist/{form-3qaPduiy.js → form-DNtjXzAW.js} +35 -36
  91. package/dist/form-DNtjXzAW.js.map +1 -0
  92. package/dist/form-item-group/index.js +1 -0
  93. package/dist/form-item-group/index.js.map +1 -1
  94. package/dist/form-item-text/index.js +1 -0
  95. package/dist/form-item-text/index.js.map +1 -1
  96. package/dist/form-item-wrapper/index.js +1 -0
  97. package/dist/form-item-wrapper/index.js.map +1 -1
  98. package/dist/form-list-wrapper/index.js +1 -0
  99. package/dist/form-list-wrapper/index.js.map +1 -1
  100. package/dist/index.d.ts +507 -444
  101. package/dist/index.js +13 -5
  102. package/dist/index.js.map +1 -1
  103. package/dist/input-search-wrapper/index.js +1 -0
  104. package/dist/input-search-wrapper/index.js.map +1 -1
  105. package/dist/input-text-area-wrapper/index.js +1 -0
  106. package/dist/input-text-area-wrapper/index.js.map +1 -1
  107. package/dist/input-wrapper/index.js +1 -0
  108. package/dist/input-wrapper/index.js.map +1 -1
  109. package/dist/label-value-render/index.js +1 -0
  110. package/dist/label-value-render/index.js.map +1 -1
  111. package/dist/local-loading/index.js +1 -0
  112. package/dist/local-loading/index.js.map +1 -1
  113. package/dist/mention-editor/index.js +1 -0
  114. package/dist/mention-editor/index.js.map +1 -1
  115. package/dist/mentions-wrapper/index.js +1 -0
  116. package/dist/mentions-wrapper/index.js.map +1 -1
  117. package/dist/number-range-form-item/index.js +1 -0
  118. package/dist/number-range-form-item/index.js.map +1 -1
  119. package/dist/pdf/index.js +1 -0
  120. package/dist/pdf/index.js.map +1 -1
  121. package/dist/pdf-preview/index.js +1 -0
  122. package/dist/pdf-preview/index.js.map +1 -1
  123. package/dist/relation-tree/index.js +1 -0
  124. package/dist/relation-tree/index.js.map +1 -1
  125. package/dist/request-status/index.js +1 -0
  126. package/dist/request-status/index.js.map +1 -1
  127. package/dist/resizable-drawer/index.css +1 -0
  128. package/dist/resizable-drawer/index.d.ts +29 -0
  129. package/dist/resizable-drawer/index.js +41 -0
  130. package/dist/resizable-drawer/index.js.map +1 -0
  131. package/dist/rich-text-editor/index.js +1 -0
  132. package/dist/rich-text-editor/index.js.map +1 -1
  133. package/dist/rich-text-viewer/index.js +1 -0
  134. package/dist/rich-text-viewer/index.js.map +1 -1
  135. package/dist/roll-location-center/index.js +1 -0
  136. package/dist/roll-location-center/index.js.map +1 -1
  137. package/dist/roll-location-in-view/index.js +1 -0
  138. package/dist/roll-location-in-view/index.js.map +1 -1
  139. package/dist/rule-describe/index.js +1 -0
  140. package/dist/rule-describe/index.js.map +1 -1
  141. package/dist/search-form/index.js +1 -0
  142. package/dist/search-form/index.js.map +1 -1
  143. package/dist/search-menu/index.js +1 -0
  144. package/dist/search-menu/index.js.map +1 -1
  145. package/dist/selector-wrapper/index.js +1 -0
  146. package/dist/selector-wrapper/index.js.map +1 -1
  147. package/dist/selector-wrapper-search/index.js +1 -0
  148. package/dist/selector-wrapper-search/index.js.map +1 -1
  149. package/dist/selector-wrapper-simple/index.js +1 -0
  150. package/dist/selector-wrapper-simple/index.js.map +1 -1
  151. package/dist/simple-layout/index.js +1 -0
  152. package/dist/simple-layout/index.js.map +1 -1
  153. package/dist/switch-confirm-wrapper/index.js +1 -0
  154. package/dist/switch-confirm-wrapper/index.js.map +1 -1
  155. package/dist/table-cell-render/index.js +1 -0
  156. package/dist/table-cell-render/index.js.map +1 -1
  157. package/dist/table-scrollbar/index.js +1 -0
  158. package/dist/table-scrollbar/index.js.map +1 -1
  159. package/dist/tag-group/index.js +1 -0
  160. package/dist/tag-group/index.js.map +1 -1
  161. package/dist/tag-wrapper/index.js +1 -0
  162. package/dist/tag-wrapper/index.js.map +1 -1
  163. package/dist/text-overflow/index.js +1 -0
  164. package/dist/text-overflow/index.js.map +1 -1
  165. package/dist/time-range-picker-wrapper-form-item/index.js +1 -0
  166. package/dist/time-range-picker-wrapper-form-item/index.js.map +1 -1
  167. package/dist/tips-title/index.css +1 -1
  168. package/dist/tips-title/index.d.ts +1 -0
  169. package/dist/tips-title/index.js +1 -1
  170. package/dist/{tips-title-Bst97YH9.js → tips-title-B7ifvKpk.js} +4 -5
  171. package/dist/tips-title-B7ifvKpk.js.map +1 -0
  172. package/dist/tree-modal/index.js +1 -0
  173. package/dist/tree-modal/index.js.map +1 -1
  174. package/dist/tree-modal-selector/index.js +1 -0
  175. package/dist/tree-modal-selector/index.js.map +1 -1
  176. package/dist/tree-selector-wrapper/index.js +1 -0
  177. package/dist/tree-selector-wrapper/index.js.map +1 -1
  178. package/dist/tree-wrapper/index.js +1 -0
  179. package/dist/tree-wrapper/index.js.map +1 -1
  180. package/dist/upload-wrapper/index.js +1 -0
  181. package/dist/upload-wrapper/index.js.map +1 -1
  182. package/package.json +12 -1
  183. package/dist/drag-modal-DTbr-E0g.js.map +0 -1
  184. package/dist/editable-card-DlqrwXa0.js.map +0 -1
  185. package/dist/form-3qaPduiy.js.map +0 -1
  186. package/dist/tips-title-Bst97YH9.js.map +0 -1
@@ -0,0 +1,33 @@
1
+ /*! @flatjs/forge MIT @flatbiz/antd */
2
+
3
+ function getDefaultExportFromCjs (x) {
4
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
5
+ }
6
+
7
+ function getAugmentedNamespace(n) {
8
+ if (n.__esModule) return n;
9
+ var f = n.default;
10
+ if (typeof f == "function") {
11
+ var a = function a () {
12
+ if (this instanceof a) {
13
+ return Reflect.construct(f, arguments, this.constructor);
14
+ }
15
+ return f.apply(this, arguments);
16
+ };
17
+ a.prototype = f.prototype;
18
+ } else a = {};
19
+ Object.defineProperty(a, '__esModule', {value: true});
20
+ Object.keys(n).forEach(function (k) {
21
+ var d = Object.getOwnPropertyDescriptor(n, k);
22
+ Object.defineProperty(a, k, d.get ? d : {
23
+ enumerable: true,
24
+ get: function () {
25
+ return n[k];
26
+ }
27
+ });
28
+ });
29
+ return a;
30
+ }
31
+
32
+ export { getAugmentedNamespace as a, getDefaultExportFromCjs as g };
33
+ //# sourceMappingURL=_commonjsHelpers-B0GIDhER.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_commonjsHelpers-B0GIDhER.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -29,6 +29,7 @@ import 'dayjs/plugin/weekYear.js';
29
29
  import '@dimjs/utils/extend/extend';
30
30
  import '../fba-hooks/index.js';
31
31
  import '../use-responsive-point-Bp3D3lZT.js';
32
+ import '@dimjs/utils/uuid/uuid';
32
33
  import 'dayjs/locale/en.js';
33
34
  import 'dayjs/locale/zh-cn.js';
34
35
  import 'react/jsx-runtime';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -29,6 +29,7 @@ import 'dayjs/plugin/weekYear.js';
29
29
  import '@dimjs/utils/extend/extend';
30
30
  import '../fba-hooks/index.js';
31
31
  import '../use-responsive-point-Bp3D3lZT.js';
32
+ import '@dimjs/utils/uuid/uuid';
32
33
  import 'dayjs/locale/en.js';
33
34
  import 'dayjs/locale/zh-cn.js';
34
35
  import 'react/jsx-runtime';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -30,6 +30,7 @@ import 'dayjs/plugin/weekYear.js';
30
30
  import '@dimjs/utils/extend/extend';
31
31
  import '../fba-hooks/index.js';
32
32
  import '../use-responsive-point-Bp3D3lZT.js';
33
+ import '@dimjs/utils/uuid/uuid';
33
34
  import 'dayjs/locale/en.js';
34
35
  import 'dayjs/locale/zh-cn.js';
35
36
  import 'react/jsx-runtime';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1 @@
1
+ .bw-center-loading{left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}.ant-btn.button-remove-gap{height:auto;line-height:normal;margin:0;min-height:auto;padding:0}.v-flex-layout{display:flex}.v-flex-vertical{flex-direction:column}
@@ -0,0 +1,25 @@
1
+ import { TPlainObject } from '@flatbiz/utils';
2
+ import { CSSProperties } from 'react';
3
+
4
+ export type AiSearchProps = {
5
+ /** 获取AI提示词 */
6
+ getPromptValue: (inputValue: string) => string;
7
+ /** AI回调 */
8
+ onAiCallback: (dataList: TPlainObject[]) => void;
9
+ /** 输入框placeholder */
10
+ placeholder?: string;
11
+ /** 默认值:{ minRows: 3, maxRows: 3 } */
12
+ inputAutoSize?: {
13
+ minRows?: number;
14
+ maxRows?: number;
15
+ };
16
+ className?: string;
17
+ style?: CSSProperties;
18
+ /** 是否使用流式交互 */
19
+ stream?: boolean;
20
+ /** 设置进度条跑完时间,单位秒,默认值:10秒 */
21
+ progressTime?: number;
22
+ };
23
+ export declare const AiSearch: (props: AiSearchProps) => import("react").JSX.Element;
24
+
25
+ export {};
@@ -0,0 +1,39 @@
1
+ /* eslint-disable */
2
+ import './../fba-hooks/index.css';
3
+ import './index.css';
4
+ /*! @flatjs/forge MIT @flatbiz/antd */
5
+
6
+ export { A as AiSearch } from '../ai-search-WcG2oakE.js';
7
+ import '@dimjs/utils/class-names/class-names';
8
+ import '../_rollupPluginBabelHelpers-CP5aeNcJ.js';
9
+ import 'react';
10
+ import 'antd';
11
+ import '@flatbiz/ai-request';
12
+ import '@flatbiz/utils';
13
+ import '../button-wrapper-C2koH6hy.js';
14
+ import '@ant-design/icons/es/icons/LoadingOutlined.js';
15
+ import '@dimjs/lang/is-promise';
16
+ import '@wove/react/hooks';
17
+ import '../config-provider-wrapper-Dbk1Er0W.js';
18
+ import 'antd/es/locale/en_US.js';
19
+ import 'antd/es/locale/zh_CN.js';
20
+ import 'dayjs';
21
+ import 'dayjs/plugin/advancedFormat.js';
22
+ import 'dayjs/plugin/customParseFormat.js';
23
+ import 'dayjs/plugin/localeData.js';
24
+ import 'dayjs/plugin/utc.js';
25
+ import 'dayjs/plugin/weekday.js';
26
+ import 'dayjs/plugin/weekOfYear.js';
27
+ import 'dayjs/plugin/weekYear.js';
28
+ import '@dimjs/utils/extend/extend';
29
+ import '../fba-hooks/index.js';
30
+ import '../use-responsive-point-Bp3D3lZT.js';
31
+ import '@dimjs/utils/uuid/uuid';
32
+ import 'dayjs/locale/en.js';
33
+ import 'dayjs/locale/zh-cn.js';
34
+ import 'react/jsx-runtime';
35
+ import '../fba-utils-Dfbczn1S.js';
36
+ import '@dimjs/lang/is-array';
37
+ import '@dimjs/model';
38
+ import '../flex-layout-zremxICp.js';
39
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,161 @@
1
+ /*! @flatjs/forge MIT @flatbiz/antd */
2
+
3
+ import { classNames } from '@dimjs/utils/class-names/class-names';
4
+ import { a as _slicedToArray } from './_rollupPluginBabelHelpers-CP5aeNcJ.js';
5
+ import { useState, useEffect } from 'react';
6
+ import { Spin, Input, Progress, message } from 'antd';
7
+ import { aiRequestStop, aiRequest } from '@flatbiz/ai-request';
8
+ import { isNotEmptyArray } from '@flatbiz/utils';
9
+ import { B as ButtonWrapper } from './button-wrapper-C2koH6hy.js';
10
+ import { F as FlexLayout } from './flex-layout-zremxICp.js';
11
+ import { jsxs, jsx } from 'react/jsx-runtime';
12
+
13
+ var AiSearch = function AiSearch(props) {
14
+ var _useState = useState(0),
15
+ _useState2 = _slicedToArray(_useState, 2),
16
+ percent = _useState2[0],
17
+ setPercent = _useState2[1];
18
+ var _useState3 = useState(false),
19
+ _useState4 = _slicedToArray(_useState3, 2),
20
+ loading = _useState4[0],
21
+ setLoading = _useState4[1];
22
+ var _useState5 = useState(),
23
+ _useState6 = _slicedToArray(_useState5, 2),
24
+ value = _useState6[0],
25
+ setValue = _useState6[1];
26
+ var _useState7 = useState(false),
27
+ _useState8 = _slicedToArray(_useState7, 2),
28
+ submitFlag = _useState8[0],
29
+ setSubmitFlag = _useState8[1];
30
+ var timeoutCount = (props.progressTime || 10) * 1000 / 100;
31
+ useEffect(function () {
32
+ if (loading) {
33
+ var interval = setTimeout(function () {
34
+ var progress = percent + 1;
35
+ setPercent(progress > 95 ? 95 : progress);
36
+ }, timeoutCount);
37
+ return function () {
38
+ clearInterval(interval);
39
+ };
40
+ } else {
41
+ setPercent(0);
42
+ }
43
+ return function () {
44
+ //
45
+ };
46
+ }, [loading, percent, timeoutCount]);
47
+ var onRequest = function onRequest() {
48
+ return new Promise(function ($return, $error) {
49
+ var timeStart, respData, timeEnd;
50
+ setSubmitFlag(true);
51
+ if (!value) return $return();
52
+ var $Try_1_Post = function () {
53
+ try {
54
+ return $return();
55
+ } catch ($boundEx) {
56
+ return $error($boundEx);
57
+ }
58
+ };
59
+ var $Try_1_Catch = function (error) {
60
+ try {
61
+ void message.error((error === null || error === void 0 ? void 0 : error['message']) || 'AI搜索异常');
62
+ setLoading(false);
63
+ return $Try_1_Post();
64
+ } catch ($boundEx) {
65
+ return $error($boundEx);
66
+ }
67
+ };
68
+ try {
69
+ timeStart = Date.now();
70
+ setLoading(true);
71
+ return Promise.resolve(aiRequest({
72
+ questionContent: props.getPromptValue(value),
73
+ stream: props.stream
74
+ })).then(function ($await_2) {
75
+ try {
76
+ respData = $await_2;
77
+ setLoading(false);
78
+ if (isNotEmptyArray(respData)) {
79
+ props.onAiCallback(respData);
80
+ } else {
81
+ props.onAiCallback([]);
82
+ void message.warning('AI搜索结果为空');
83
+ }
84
+ timeEnd = Date.now();
85
+ console.log('AI智能查询耗时', (timeEnd - timeStart) / 1000);
86
+ return $Try_1_Post();
87
+ } catch ($boundEx) {
88
+ return $Try_1_Catch($boundEx);
89
+ }
90
+ }, $Try_1_Catch);
91
+ } catch (error) {
92
+ $Try_1_Catch(error);
93
+ }
94
+ });
95
+ };
96
+ return /*#__PURE__*/jsxs("div", {
97
+ className: classNames('ai-search', props.className),
98
+ style: props.style,
99
+ children: [/*#__PURE__*/jsxs("div", {
100
+ style: {
101
+ position: 'relative'
102
+ },
103
+ children: [/*#__PURE__*/jsx(Spin, {
104
+ spinning: loading,
105
+ children: /*#__PURE__*/jsx(Input.TextArea, {
106
+ placeholder: props.placeholder,
107
+ autoSize: props.inputAutoSize || {
108
+ minRows: 3,
109
+ maxRows: 3
110
+ },
111
+ status: submitFlag && !value ? 'error' : undefined,
112
+ onChange: function onChange(e) {
113
+ setValue(e.target.value);
114
+ }
115
+ })
116
+ }), /*#__PURE__*/jsx("div", {
117
+ style: {
118
+ position: 'absolute',
119
+ left: 0,
120
+ right: 0,
121
+ zIndex: 99,
122
+ bottom: -20
123
+ },
124
+ children: percent > 0 ? /*#__PURE__*/jsx(Progress, {
125
+ percent: percent,
126
+ strokeColor: {
127
+ '0%': '#108ee9',
128
+ '100%': '#87d068'
129
+ },
130
+ style: {
131
+ margin: 0
132
+ }
133
+ }) : null
134
+ })]
135
+ }), /*#__PURE__*/jsxs(FlexLayout, {
136
+ fullIndex: [0, 1],
137
+ direction: "horizontal",
138
+ gap: 15,
139
+ style: {
140
+ marginTop: 20
141
+ },
142
+ children: [/*#__PURE__*/jsx(ButtonWrapper, {
143
+ type: "primary",
144
+ ghost: true,
145
+ onClick: function onClick() {
146
+ aiRequestStop();
147
+ setLoading(false);
148
+ },
149
+ children: "\u505C\u6B62"
150
+ }), /*#__PURE__*/jsx(ButtonWrapper, {
151
+ type: "primary",
152
+ onClick: onRequest,
153
+ loadingPosition: "center",
154
+ children: "\u751F\u6210"
155
+ })]
156
+ })]
157
+ });
158
+ };
159
+
160
+ export { AiSearch as A };
161
+ //# sourceMappingURL=ai-search-WcG2oakE.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-search-WcG2oakE.js","sources":["@flatbiz/antd/src/ai-search/ai-search.tsx"],"sourcesContent":["import { type CSSProperties, useEffect, useState } from 'react';\nimport { Input, message, Progress, Spin } from 'antd';\nimport { classNames } from '@dimjs/utils';\nimport { aiRequest, aiRequestStop } from '@flatbiz/ai-request';\nimport { isNotEmptyArray, type TPlainObject } from '@flatbiz/utils';\nimport { ButtonWrapper } from '../button-wrapper/button-wrapper.jsx';\nimport { FlexLayout } from '../flex-layout/flex-layout.jsx';\n\ntype AiSearchProps = {\n /** 获取AI提示词 */\n getPromptValue: (inputValue: string) => string;\n /** AI回调 */\n onAiCallback: (dataList: TPlainObject[]) => void;\n /** 输入框placeholder */\n placeholder?: string;\n /** 默认值:{ minRows: 3, maxRows: 3 } */\n inputAutoSize?: { minRows?: number; maxRows?: number };\n className?: string;\n style?: CSSProperties;\n /** 是否使用流式交互 */\n stream?: boolean;\n /** 设置进度条跑完时间,单位秒,默认值:10秒 */\n progressTime?: number;\n};\n\nexport const AiSearch = (props: AiSearchProps) => {\n const [percent, setPercent] = useState(0);\n const [loading, setLoading] = useState(false);\n const [value, setValue] = useState<string | undefined>();\n const [submitFlag, setSubmitFlag] = useState<boolean>(false);\n\n const timeoutCount = ((props.progressTime || 10) * 1000) / 100;\n\n useEffect(() => {\n if (loading) {\n const interval = setTimeout(() => {\n const progress = percent + 1;\n setPercent(progress > 95 ? 95 : progress);\n }, timeoutCount);\n return () => {\n clearInterval(interval);\n };\n } else {\n setPercent(0);\n }\n return () => {\n //\n };\n }, [loading, percent, timeoutCount]);\n\n const onRequest = async () => {\n setSubmitFlag(true);\n if (!value) return;\n try {\n const timeStart = Date.now();\n setLoading(true);\n const respData = await aiRequest({\n questionContent: props.getPromptValue(value),\n stream: props.stream,\n });\n setLoading(false);\n if (isNotEmptyArray(respData)) {\n props.onAiCallback(respData);\n } else {\n props.onAiCallback([]);\n void message.warning('AI搜索结果为空');\n }\n const timeEnd = Date.now();\n console.log('AI智能查询耗时', (timeEnd - timeStart) / 1000);\n } catch (error) {\n void message.error(error?.['message'] || 'AI搜索异常');\n setLoading(false);\n }\n };\n\n return (\n <div\n className={classNames('ai-search', props.className)}\n style={props.style}\n >\n <div style={{ position: 'relative' }}>\n <Spin spinning={loading}>\n <Input.TextArea\n placeholder={props.placeholder}\n autoSize={props.inputAutoSize || { minRows: 3, maxRows: 3 }}\n status={submitFlag && !value ? 'error' : undefined}\n onChange={(e) => {\n setValue(e.target.value);\n }}\n />\n </Spin>\n <div\n style={{\n position: 'absolute',\n left: 0,\n right: 0,\n zIndex: 99,\n bottom: -20,\n }}\n >\n {percent > 0 ? (\n <Progress\n percent={percent}\n strokeColor={{\n '0%': '#108ee9',\n '100%': '#87d068',\n }}\n style={{ margin: 0 }}\n />\n ) : null}\n </div>\n </div>\n <FlexLayout\n fullIndex={[0, 1]}\n direction=\"horizontal\"\n gap={15}\n style={{ marginTop: 20 }}\n >\n <ButtonWrapper\n type=\"primary\"\n ghost\n onClick={() => {\n aiRequestStop();\n setLoading(false);\n }}\n >\n 停止\n </ButtonWrapper>\n <ButtonWrapper\n type=\"primary\"\n onClick={onRequest}\n loadingPosition=\"center\"\n >\n 生成\n </ButtonWrapper>\n </FlexLayout>\n </div>\n );\n};\n"],"names":["AiSearch","props","_useState","useState","_useState2","_slicedToArray","percent","setPercent","_useState3","_useState4","loading","setLoading","_useState5","_useState6","value","setValue","_useState7","_useState8","submitFlag","setSubmitFlag","timeoutCount","progressTime","useEffect","interval","setTimeout","progress","clearInterval","onRequest","Promise","$return","$error","timeStart","respData","timeEnd","$Try_1_Post","$boundEx","$Try_1_Catch","error","message","Date","now","resolve","aiRequest","questionContent","getPromptValue","stream","then","$await_2","isNotEmptyArray","onAiCallback","warning","console","log","_jsxs","className","_classNames","style","children","position","_jsx","Spin","spinning","Input","TextArea","placeholder","autoSize","inputAutoSize","minRows","maxRows","status","undefined","onChange","e","target","left","right","zIndex","bottom","Progress","strokeColor","margin","FlexLayout","fullIndex","direction","gap","marginTop","ButtonWrapper","type","ghost","onClick","aiRequestStop","loadingPosition"],"mappings":";;;;;;;;;;;;IAyBaA,QAAQ,GAAG,SAAXA,QAAQA,CAAIC,KAAoB,EAAK;AAChD,EAAA,IAAAC,SAAA,GAA8BC,QAAQ,CAAC,CAAC,CAAC;IAAAC,UAAA,GAAAC,cAAA,CAAAH,SAAA,EAAA,CAAA,CAAA;AAAlCI,IAAAA,OAAO,GAAAF,UAAA,CAAA,CAAA,CAAA;AAAEG,IAAAA,UAAU,GAAAH,UAAA,CAAA,CAAA,CAAA;AAC1B,EAAA,IAAAI,UAAA,GAA8BL,QAAQ,CAAC,KAAK,CAAC;IAAAM,UAAA,GAAAJ,cAAA,CAAAG,UAAA,EAAA,CAAA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AED,OAAe,CAAC;AAAA,KACN,CAAC;AAAA,GACV,CAAC;AAEV;;;;"}
@@ -25,6 +25,7 @@ import '@dimjs/utils/extend/extend';
25
25
  import '../fba-hooks/index.js';
26
26
  import '@wove/react/hooks';
27
27
  import '../use-responsive-point-Bp3D3lZT.js';
28
+ import '@dimjs/utils/uuid/uuid';
28
29
  import 'dayjs/locale/en.js';
29
30
  import 'dayjs/locale/zh-cn.js';
30
31
  import 'react/jsx-runtime';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -33,6 +33,7 @@ import 'dayjs/plugin/weekYear.js';
33
33
  import '@dimjs/utils/extend/extend';
34
34
  import '../fba-hooks/index.js';
35
35
  import '../use-responsive-point-Bp3D3lZT.js';
36
+ import '@dimjs/utils/uuid/uuid';
36
37
  import 'dayjs/locale/en.js';
37
38
  import 'dayjs/locale/zh-cn.js';
38
39
  import 'react/jsx-runtime';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -26,6 +26,7 @@ import 'dayjs/plugin/weekYear.js';
26
26
  import '@dimjs/utils/extend/extend';
27
27
  import '../fba-hooks/index.js';
28
28
  import '../use-responsive-point-Bp3D3lZT.js';
29
+ import '@dimjs/utils/uuid/uuid';
29
30
  import 'dayjs/locale/en.js';
30
31
  import 'dayjs/locale/zh-cn.js';
31
32
  import 'react/jsx-runtime';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -17,6 +17,7 @@ import 'antd';
17
17
  import '@flatbiz/utils';
18
18
  import '../fba-hooks/index.js';
19
19
  import '../use-responsive-point-Bp3D3lZT.js';
20
+ import '@dimjs/utils/uuid/uuid';
20
21
  import '../request-status-CJ_zkp3v.js';
21
22
  import '../text-overflow-MS3fPWKe.js';
22
23
  import '@dimjs/lang/is-string';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;"}
@@ -17,6 +17,7 @@ import '@dimjs/lang/is-array';
17
17
  import '@dimjs/model';
18
18
  import '../use-responsive-point-Bp3D3lZT.js';
19
19
  import 'antd';
20
+ import '@dimjs/utils/uuid/uuid';
20
21
 
21
22
  var _createCtx = createCtx(),
22
23
  _createCtx2 = _slicedToArray(_createCtx, 2),
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["@flatbiz/antd/src/check-list/context.ts","@flatbiz/antd/src/check-list/utils.ts","@flatbiz/antd/src/check-list/check-list.tsx","@flatbiz/antd/src/check-list/check-list-item.tsx","@flatbiz/antd/src/check-list/index.ts"],"sourcesContent":["import { createCtx } from '@wove/react';\nimport type { CheckListItemValue } from './types.js';\n\nexport const [useCheckListCtx, CheckListCtxProvider] = createCtx<{\n checkedValues: CheckListItemValue[];\n onChange: (value: CheckListItemValue, defaultChange?: boolean) => void;\n stopPropagation?: boolean;\n}>();\n","import { toArray } from '@flatbiz/utils';\nimport type { CheckListItemValue, CheckListValue } from './types.js';\n\nexport const getValueList = (value?: CheckListValue, multiple?: boolean) => {\n if (value !== undefined) {\n const valueList = toArray<CheckListItemValue>(value);\n return multiple ? valueList : valueList.splice(0, 1);\n }\n return null;\n};\n","import type { ReactNode } from 'react';\nimport { useMemo } from 'react';\nimport { classNames, extend } from '@dimjs/utils';\nimport { hooks } from '@wove/react';\nimport type { CommonPropsWithChildren } from '../_utils/native-props.js';\nimport { fbaHooks } from '../fba-hooks/index.js';\nimport { CheckListCtxProvider } from './context.js';\nimport type { CheckListItemValue } from './types.js';\nimport { getValueList } from './utils.js';\nimport './style.less';\n\nexport type CheckListSelectedValue<T extends 'multi' | 'radio'> =\n T extends 'multi' ? CheckListItemValue[] : CheckListItemValue;\n\nexport type CheckListProps<T extends 'multi' | 'radio'> = {\n multiple?: boolean;\n onChange?: (\n value: CheckListSelectedValue<T>,\n operateValue: CheckListItemValue\n ) => void;\n onPreChange?: (value: CheckListItemValue) => Promise<void>;\n value?: CheckListSelectedValue<T>;\n defaultValue?: CheckListSelectedValue<T>;\n beforeExtra?: ReactNode;\n afterExtra?: ReactNode;\n stopPropagation?: boolean;\n required?: boolean;\n} & CommonPropsWithChildren;\n\nexport const CheckListInner = <T extends 'multi' | 'radio'>(\n props: CheckListProps<T>\n) => {\n const [checkedValues, arrayOperate] =\n fbaHooks.useArrayChange<CheckListItemValue>([]);\n\n const valueList = useMemo(() => {\n return getValueList(props.value, props.multiple);\n }, [props.value, props.multiple]);\n\n fbaHooks.useEffectCustom(() => {\n const current =\n valueList || getValueList(props.defaultValue, props.multiple);\n arrayOperate.resetList(current || []);\n }, []);\n\n hooks.useUpdateEffect(() => {\n arrayOperate.resetList(valueList || []);\n }, [valueList]);\n\n const onChange = hooks.useCallbackRef(\n async (value: CheckListItemValue, defaultChange) => {\n if (props.onPreChange) {\n await props.onPreChange(value);\n }\n const targetIndex = checkedValues.findIndex((temp) => temp === value);\n if (props.multiple === true) {\n if (checkedValues.length === 1 && targetIndex >= 0 && props.required) {\n return;\n }\n if (targetIndex >= 0) {\n arrayOperate.delete(targetIndex);\n } else {\n arrayOperate.add(value);\n }\n } else {\n if (targetIndex >= 0 && props.required) {\n return;\n } else {\n arrayOperate.resetList(targetIndex >= 0 ? [] : [value]);\n }\n }\n if (!defaultChange) {\n const newValues = arrayOperate.getList();\n let selectedValue;\n if (props.multiple) {\n selectedValue =\n newValues.length > 0 ? extend([], newValues) : undefined;\n } else {\n selectedValue = newValues.length > 0 ? newValues[0] : undefined;\n }\n props.onChange?.(selectedValue as CheckListSelectedValue<T>, value);\n }\n }\n );\n\n return (\n <div\n className={classNames('check-list', props.className)}\n style={props.style}\n >\n <CheckListCtxProvider\n value={{\n onChange,\n checkedValues,\n stopPropagation: props.stopPropagation,\n }}\n >\n {props.beforeExtra}\n {props.children}\n {props.afterExtra}\n </CheckListCtxProvider>\n </div>\n );\n};\n","import type { CSSProperties, ReactElement } from 'react';\nimport { classNames } from '@dimjs/utils';\nimport { hooks } from '@wove/react';\nimport { useCheckListCtx } from './context.js';\nimport type { CheckListItemValue } from './types.js';\n\nexport type CheckListItemContentProps = {\n checked?: boolean;\n disabled?: boolean;\n onClick?: (event) => void;\n className?: string;\n readonly?: boolean;\n style?: CSSProperties;\n};\n\nexport type CheckListItemProps = {\n value: CheckListItemValue;\n disabled?: boolean;\n readonly?: boolean;\n children: (data: CheckListItemContentProps) => ReactElement;\n className?: string;\n style?: CSSProperties;\n};\n\nexport const CheckListItem = (props: CheckListItemProps) => {\n const context = useCheckListCtx();\n\n if (context === null) {\n console.error('CheckList.Item can only be used inside CheckList.');\n return null;\n }\n\n const onClick = hooks.useCallbackRef((event) => {\n if (context.stopPropagation) {\n event.stopPropagation();\n }\n if (!props.disabled) {\n context?.onChange(props.value);\n }\n });\n\n const checked =\n context?.checkedValues.findIndex((temp) => temp === props.value) >= 0;\n const checkedClassPrefix = 'check-list';\n\n const className = classNames(\n `${checkedClassPrefix}-item`,\n {\n [`${checkedClassPrefix}-disabled`]: props.disabled,\n [`${checkedClassPrefix}-readonly`]: props.readonly,\n [`${checkedClassPrefix}-checked`]: checked,\n },\n props.className\n );\n\n return props.children({\n onClick,\n checked,\n disabled: props.disabled,\n readonly: props.readonly,\n className,\n style: props.style,\n });\n};\n","import { fbaUtils } from '../fba-utils/fba-utils.js';\nimport { CheckListInner } from './check-list.jsx';\nimport { CheckListItem } from './check-list-item.jsx';\n\nexport const CheckList = fbaUtils.attachPropertiesToComponent(CheckListInner, {\n Item: CheckListItem,\n});\n"],"names":["_createCtx","_createCtx3","_createCtx2","_slicedToArray","useCheckListCtx","CheckListCtxProvider","getValueList","value","multiple","undefined","valueList","toArray","splice","CheckListInner","props","_fbaHooks$useArrayCha","fbaHooks","useArrayChange","_fbaHooks$useArrayCha2","checkedValues","arrayOperate","useMemo","useEffectCustom","current","defaultValue","resetList","_hooks","useUpdateEffect","onChange","useCallbackRef","defaultChange","Promise","$return","$error","targetIndex","_props$onChange","newValues","selectedValue","onPreChange","resolve","then","$await_2","$If_1","call","$boundEx","bind","findIndex","temp","length","required","delete","add","getList","_extend","_jsx","className","_classNames","style","children","_jsxs","stopPropagation","beforeExtra","afterExtra","CheckListItem","context","console","error","onClick","event","disabled","checked","checkedClassPrefix","concat","_defineProperty","readonly","CheckList","fbaUtils","attachPropertiesToComponent","Item"],"mappings":";;;;;;;;;;;;;;;;;AAGO,IAAAA,UAAA,GAAgDC,SAAA,EAInD;EAAAC,WAAA,GAAAC,cAAA,CAAAH,UAAA,EAAA,CAAA,CAAA;AAJUI,EAAAA,eAAe,GAAAF,WAAA,CAAA,CAAA,CAAA;AAAEG,EAAAA,oBAAoB,GAAAH,WAAA,CAAA,CAAA,CAAA;;ACA5C,IAAMI,YAAY,GAAG,SAAfA,YAAYA,CAAIC,KAAsB,EAAEC,QAAkB,EAAK;EAC1E,IAAID,KAAK,KAAKE,SAAS,EAAE;AACvB,IAAA,IAAMC,SAAS,GAAGC,OAAO,CAAqBJ,KAAK,CAAC;IACpD,OAAOC,QAAQ,GAAGE,SAAS,GAAGA,SAAS,CAACE,MAAM,CAAC,CAAC,EA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AE5D,KAAK,CAAC4D,QAAQ;AACxBnB,IAAAA,SAAS,EAATA,SAAS;IACTE,KAAK,EAAE3C,KAAK,CAAC2C;AACf,GAAC,CAAC;AACJ,CAAC;;AC3DM,IAAMkB,SAAS,GAAGC,QAAQ,CAACC,2BAA2B,CAAChE,cAAc,EAAE;AAC5EiE,EAAAA,IAAI,EAAEf;AACR,CAAC;;;;"}
1
+ {"version":3,"file":"index.js","sources":["@flatbiz/antd/src/check-list/context.ts","@flatbiz/antd/src/check-list/utils.ts","@flatbiz/antd/src/check-list/check-list.tsx","@flatbiz/antd/src/check-list/check-list-item.tsx","@flatbiz/antd/src/check-list/index.ts"],"sourcesContent":["import { createCtx } from '@wove/react';\nimport type { CheckListItemValue } from './types.js';\n\nexport const [useCheckListCtx, CheckListCtxProvider] = createCtx<{\n checkedValues: CheckListItemValue[];\n onChange: (value: CheckListItemValue, defaultChange?: boolean) => void;\n stopPropagation?: boolean;\n}>();\n","import { toArray } from '@flatbiz/utils';\nimport type { CheckListItemValue, CheckListValue } from './types.js';\n\nexport const getValueList = (value?: CheckListValue, multiple?: boolean) => {\n if (value !== undefined) {\n const valueList = toArray<CheckListItemValue>(value);\n return multiple ? valueList : valueList.splice(0, 1);\n }\n return null;\n};\n","import type { ReactNode } from 'react';\nimport { useMemo } from 'react';\nimport { classNames, extend } from '@dimjs/utils';\nimport { hooks } from '@wove/react';\nimport type { CommonPropsWithChildren } from '../_utils/native-props.js';\nimport { fbaHooks } from '../fba-hooks/index.js';\nimport { CheckListCtxProvider } from './context.js';\nimport type { CheckListItemValue } from './types.js';\nimport { getValueList } from './utils.js';\nimport './style.less';\n\nexport type CheckListSelectedValue<T extends 'multi' | 'radio'> =\n T extends 'multi' ? CheckListItemValue[] : CheckListItemValue;\n\nexport type CheckListProps<T extends 'multi' | 'radio'> = {\n multiple?: boolean;\n onChange?: (\n value: CheckListSelectedValue<T>,\n operateValue: CheckListItemValue\n ) => void;\n onPreChange?: (value: CheckListItemValue) => Promise<void>;\n value?: CheckListSelectedValue<T>;\n defaultValue?: CheckListSelectedValue<T>;\n beforeExtra?: ReactNode;\n afterExtra?: ReactNode;\n stopPropagation?: boolean;\n required?: boolean;\n} & CommonPropsWithChildren;\n\nexport const CheckListInner = <T extends 'multi' | 'radio'>(\n props: CheckListProps<T>\n) => {\n const [checkedValues, arrayOperate] =\n fbaHooks.useArrayChange<CheckListItemValue>([]);\n\n const valueList = useMemo(() => {\n return getValueList(props.value, props.multiple);\n }, [props.value, props.multiple]);\n\n fbaHooks.useEffectCustom(() => {\n const current =\n valueList || getValueList(props.defaultValue, props.multiple);\n arrayOperate.resetList(current || []);\n }, []);\n\n hooks.useUpdateEffect(() => {\n arrayOperate.resetList(valueList || []);\n }, [valueList]);\n\n const onChange = hooks.useCallbackRef(\n async (value: CheckListItemValue, defaultChange) => {\n if (props.onPreChange) {\n await props.onPreChange(value);\n }\n const targetIndex = checkedValues.findIndex((temp) => temp === value);\n if (props.multiple === true) {\n if (checkedValues.length === 1 && targetIndex >= 0 && props.required) {\n return;\n }\n if (targetIndex >= 0) {\n arrayOperate.delete(targetIndex);\n } else {\n arrayOperate.add(value);\n }\n } else {\n if (targetIndex >= 0 && props.required) {\n return;\n } else {\n arrayOperate.resetList(targetIndex >= 0 ? [] : [value]);\n }\n }\n if (!defaultChange) {\n const newValues = arrayOperate.getList();\n let selectedValue;\n if (props.multiple) {\n selectedValue =\n newValues.length > 0 ? extend([], newValues) : undefined;\n } else {\n selectedValue = newValues.length > 0 ? newValues[0] : undefined;\n }\n props.onChange?.(selectedValue as CheckListSelectedValue<T>, value);\n }\n }\n );\n\n return (\n <div\n className={classNames('check-list', props.className)}\n style={props.style}\n >\n <CheckListCtxProvider\n value={{\n onChange,\n checkedValues,\n stopPropagation: props.stopPropagation,\n }}\n >\n {props.beforeExtra}\n {props.children}\n {props.afterExtra}\n </CheckListCtxProvider>\n </div>\n );\n};\n","import type { CSSProperties, ReactElement } from 'react';\nimport { classNames } from '@dimjs/utils';\nimport { hooks } from '@wove/react';\nimport { useCheckListCtx } from './context.js';\nimport type { CheckListItemValue } from './types.js';\n\nexport type CheckListItemContentProps = {\n checked?: boolean;\n disabled?: boolean;\n onClick?: (event) => void;\n className?: string;\n readonly?: boolean;\n style?: CSSProperties;\n};\n\nexport type CheckListItemProps = {\n value: CheckListItemValue;\n disabled?: boolean;\n readonly?: boolean;\n children: (data: CheckListItemContentProps) => ReactElement;\n className?: string;\n style?: CSSProperties;\n};\n\nexport const CheckListItem = (props: CheckListItemProps) => {\n const context = useCheckListCtx();\n\n if (context === null) {\n console.error('CheckList.Item can only be used inside CheckList.');\n return null;\n }\n\n const onClick = hooks.useCallbackRef((event) => {\n if (context.stopPropagation) {\n event.stopPropagation();\n }\n if (!props.disabled) {\n context?.onChange(props.value);\n }\n });\n\n const checked =\n context?.checkedValues.findIndex((temp) => temp === props.value) >= 0;\n const checkedClassPrefix = 'check-list';\n\n const className = classNames(\n `${checkedClassPrefix}-item`,\n {\n [`${checkedClassPrefix}-disabled`]: props.disabled,\n [`${checkedClassPrefix}-readonly`]: props.readonly,\n [`${checkedClassPrefix}-checked`]: checked,\n },\n props.className\n );\n\n return props.children({\n onClick,\n checked,\n disabled: props.disabled,\n readonly: props.readonly,\n className,\n style: props.style,\n });\n};\n","import { fbaUtils } from '../fba-utils/fba-utils.js';\nimport { CheckListInner } from './check-list.jsx';\nimport { CheckListItem } from './check-list-item.jsx';\n\nexport const CheckList = fbaUtils.attachPropertiesToComponent(CheckListInner, {\n Item: CheckListItem,\n});\n"],"names":["_createCtx","_createCtx3","_createCtx2","_slicedToArray","useCheckListCtx","CheckListCtxProvider","getValueList","value","multiple","undefined","valueList","toArray","splice","CheckListInner","props","_fbaHooks$useArrayCha","fbaHooks","useArrayChange","_fbaHooks$useArrayCha2","checkedValues","arrayOperate","useMemo","useEffectCustom","current","defaultValue","resetList","_hooks","useUpdateEffect","onChange","useCallbackRef","defaultChange","Promise","$return","$error","targetIndex","_props$onChange","newValues","selectedValue","onPreChange","resolve","then","$await_2","$If_1","call","$boundEx","bind","findIndex","temp","length","required","delete","add","getList","_extend","_jsx","className","_classNames","style","children","_jsxs","stopPropagation","beforeExtra","afterExtra","CheckListItem","context","console","error","onClick","event","disabled","checked","checkedClassPrefix","concat","_defineProperty","readonly","CheckList","fbaUtils","attachPropertiesToComponent","Item"],"mappings":";;;;;;;;;;;;;;;;;;AAGO,IAAAA,UAAA,GAAgDC,SAAA,EAInD;EAAAC,WAAA,GAAAC,cAAA,CAAAH,UAAA,EAAA,CAAA,CAAA;AAJUI,EAAAA,eAAe,GAAAF,WAAA,CAAA,CAAA,CAAA;AAAEG,EAAAA,oBAAoB,GAAAH,WAAA,CAAA,CAAA,CAAA;;ACA5C,IAAMI,YAAY,GAAG,SAAfA,YAAYA,CAAIC,KAAsB,EAAEC,QAAkB,EAAK;EAC1E,IAAID,KAAK,KAAKE,SAAS,EAAE;AACvB,IAAA,IAAMC,SAAS,GAAGC,OAAO,CAAqBJ,KAAK,CAAC;IACpD,OAAOC,QAAQ,GAAGE,SAAS,GAAGA,SAAS,CAACE,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC;AACtD;AACA,EAAA,OAAO,IAAI;AACb,CAAC;;ACoBM,IAAMC,cAAc,GAAG,SAAjBA,cAAcA,CACzBC,KAAwB,EACrB;AACH,EAAA,IAAAC,qBAAA,GACEC,QAAQ,CAACC,cAAc,CAAqB,EAAE,CAAC;IAAAC,sBAAA,GAAAf,cAAA,CAAAY,qBAAA,EAAA,CAAA,CAAA;AAD1CI,IAAAA,aAAa,GAAAD,sBAAA,CAAA,CAAA,CAAA;AAAEE,IAAAA,YAAY,GAAAF,sBAAA,CAAA,CAAA,CAAA;AAGlC,EAAA,IAAMR,SAAS,GAAGW,OAAO,CAAC,YAAM;IAC9B,OAAOf,YAAY,CAACQ,KAAK,CAACP,KAAK,EAAEO,KAAK,CAACN,QAAQ,CAAC;GACjD,EAAE,CAACM,KAAK,CAACP,KAAK,EAAEO,KAAK,CAACN,QA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OAAKA,IAAI,KAAKjC,KAAK,CAACP,KAAK;AAAA,GAAA,CAAC,KAAI,CAAC;EACvE,IAAMgE,kBAAkB,GAAG,YAAY;AAEvC,EAAA,IAAMhB,SAAS,GAAGC,UAAA,CAAAgB,EAAAA,CAAAA,MAAA,CACbD,kBAAkB,EAAA,OAAA,CAAA,EAAAE,eAAA,CAAAA,eAAA,CAAAA,eAAA,QAAAD,MAAA,CAEfD,kBAAkB,EAAczD,WAAAA,CAAAA,EAAAA,KAAK,CAACuD,QAAQ,MAAAG,MAAA,CAC9CD,kBAAkB,EAAczD,WAAAA,CAAAA,EAAAA,KAAK,CAAC4D,QAAQ,CAAA,EAAA,EAAA,CAAAF,MAAA,CAC9CD,kBAAkB,EAAaD,UAAAA,CAAAA,EAAAA,OAAO,GAE5CxD,KAAK,CAACyC,SACR,CAAC;EAED,OAAOzC,KAAK,CAAC4C,QAAQ,CAAC;AACpBS,IAAAA,OAAO,EAAPA,OAAO;AACPG,IAAAA,OAAO,EAAPA,OAAO;IACPD,QAAQ,EAAEvD,KAAK,CAACuD,QAAQ;IACxBK,QAAQ,EAAE5D,KAAK,CAAC4D,QAAQ;AACxBnB,IAAAA,SAAS,EAATA,SAAS;IACTE,KAAK,EAAE3C,KAAK,CAAC2C;AACf,GAAC,CAAC;AACJ,CAAC;;AC3DM,IAAMkB,SAAS,GAAGC,QAAQ,CAACC,2BAA2B,CAAChE,cAAc,EAAE;AAC5EiE,EAAAA,IAAI,EAAEf;AACR,CAAC;;;;"}
@@ -22,6 +22,7 @@ import '@wove/react/hooks';
22
22
  import 'react';
23
23
  import '@flatbiz/utils';
24
24
  import '../use-responsive-point-Bp3D3lZT.js';
25
+ import '@dimjs/utils/uuid/uuid';
25
26
  import 'dayjs/locale/en.js';
26
27
  import 'dayjs/locale/zh-cn.js';
27
28
  import 'react/jsx-runtime';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -17,6 +17,7 @@ import '../time-CeL7904f.js';
17
17
  import 'react/jsx-runtime';
18
18
  import '../fba-hooks/index.js';
19
19
  import '../use-responsive-point-Bp3D3lZT.js';
20
+ import '@dimjs/utils/uuid/uuid';
20
21
  import '../fba-utils-Dfbczn1S.js';
21
22
  import '@dimjs/model';
22
23
  import '../form-item-hidden-BtQvJEx7.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;"}
@@ -32,6 +32,7 @@ import 'dayjs/plugin/weekYear.js';
32
32
  import '@dimjs/utils/extend/extend';
33
33
  import '../fba-hooks/index.js';
34
34
  import '../use-responsive-point-Bp3D3lZT.js';
35
+ import '@dimjs/utils/uuid/uuid';
35
36
  import 'dayjs/locale/en.js';
36
37
  import 'dayjs/locale/zh-cn.js';
37
38
  import 'react/jsx-runtime';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -31,6 +31,7 @@ import 'dayjs/plugin/weekYear.js';
31
31
  import '@dimjs/utils/extend/extend';
32
32
  import '../fba-hooks/index.js';
33
33
  import '../use-responsive-point-Bp3D3lZT.js';
34
+ import '@dimjs/utils/uuid/uuid';
34
35
  import 'dayjs/locale/en.js';
35
36
  import 'dayjs/locale/zh-cn.js';
36
37
  import 'react/jsx-runtime';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- .bw-center-loading{left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}.ant-btn.button-remove-gap{height:auto;line-height:normal;margin:0;min-height:auto;padding:0}.dialog-drag-modal{background-color:#fff;border-radius:8px;box-shadow:0 0 10px 5px rgba(0,0,0,.1);left:50%;opacity:0;padding:0;position:fixed;top:50%;transition:opacity .3s ease-in-out;z-index:99}.dark-theme .dialog-drag-modal{background-color:#1f1f1f}.dialog-drag-modal-move-handle{cursor:move}.dialog-drag-modal-header{padding:20px 24px 8px;position:relative}.dialog-drag-modal-header .icon-wrapper-wrapper{position:absolute;right:24px;top:50%;transform:translateY(-50%)}.dialog-drag-modal-title{font-size:16px;font-weight:600;line-height:1.5;word-wrap:break-word}.dialog-drag-modal-body{display:flex;flex-direction:column;overflow:auto;padding:10px 24px 15px}.dialog-drag-modal-footer{padding:10px 24px 20px;text-align:right}.icon-wrapper{align-items:center;border-radius:6px;display:inline-flex;margin:0 -6px;padding:6px}.icon-wrapper .anticon+.icon-wrapper-text{margin-left:3px}.icon-wrapper .icon-wrapper-text{display:inline-flex}.icon-wrapper-tigger{cursor:pointer}.icon-wrapper-tigger:hover{background-color:rgba(0,0,0,.06);position:relative;transform:scale(1.1);transition:all .1s ease-in}.icon-wrapper-small{border-radius:3px;font-size:14px;margin:0 -3px;padding:3px}.icon-wrapper-middle{font-size:16px}.icon-wrapper-large{font-size:20px}.icon-wrapper.icon-wrapper-hidden-hover-bgcolor{margin:0;padding:0}.icon-wrapper.icon-wrapper-hidden-hover-bgcolor:hover{background-color:transparent}
1
+ .bw-center-loading{left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}.ant-btn.button-remove-gap{height:auto;line-height:normal;margin:0;min-height:auto;padding:0}.dialog-drag-modal{background-color:#fff;border-radius:8px;box-shadow:0 0 10px 5px rgba(0,0,0,.1);left:0;opacity:0;padding:0;position:fixed;top:0;transition:opacity .3s ease-in-out;z-index:99}.dark-theme .dialog-drag-modal{background-color:#1f1f1f}.dialog-drag-modal-move-handle{cursor:move}.dialog-drag-modal-header{padding:20px 24px 8px;position:relative}.dialog-drag-modal-header .icon-wrapper-wrapper{position:absolute;right:24px;top:50%;transform:translateY(-50%)}.dialog-drag-modal-title{font-size:16px;font-weight:600;line-height:1.5;word-wrap:break-word}.dialog-drag-modal-body{display:flex;flex-direction:column;overflow:auto;padding:10px 24px 15px}.dialog-drag-modal-footer{padding:10px 24px 20px;text-align:right}.icon-wrapper{align-items:center;border-radius:6px;display:inline-flex;margin:0 -6px;padding:6px}.icon-wrapper .anticon+.icon-wrapper-text{margin-left:3px}.icon-wrapper .icon-wrapper-text{display:inline-flex}.icon-wrapper-tigger{cursor:pointer}.icon-wrapper-tigger:hover{background-color:rgba(0,0,0,.06);position:relative;transform:scale(1.1);transition:all .1s ease-in}.icon-wrapper-small{border-radius:3px;font-size:14px;margin:0 -3px;padding:3px}.icon-wrapper-middle{font-size:16px}.icon-wrapper-large{font-size:20px}.icon-wrapper.icon-wrapper-hidden-hover-bgcolor{margin:0;padding:0}.icon-wrapper.icon-wrapper-hidden-hover-bgcolor:hover{background-color:transparent}
@@ -3,15 +3,21 @@ import { FormInstance } from 'antd';
3
3
  import { CSSProperties, ReactElement } from 'react';
4
4
 
5
5
  export type DialogDragModalProps = {
6
- /** 定义后,不能弹起多个弹框 */
6
+ /** 相同的modalKey,最多只有一个弹起状态 */
7
7
  modalKey?: string;
8
+ className?: string;
9
+ style?: CSSProperties;
10
+ styles?: {
11
+ header?: CSSProperties;
12
+ body?: CSSProperties;
13
+ footer?: CSSProperties;
14
+ };
8
15
  width?: number;
9
16
  bodyHeight?: number;
10
17
  /** 触发弹起点击事件event,用于计算鼠标位置 */
11
18
  event?: React.MouseEvent<HTMLElement>;
12
- /** 定义弹框左上角弹起X轴偏移量 */
19
+ /** 定义弹出层距离触发点的x轴偏移量 */
13
20
  xOffset?: number;
14
- style?: CSSProperties;
15
21
  title?: string;
16
22
  okText?: string | ReactElement;
17
23
  cancelText?: string | ReactElement;
@@ -23,9 +29,9 @@ export type DialogDragModalProps = {
23
29
  onClose: TNoopDefine;
24
30
  }) => ReactElement);
25
31
  /** 覆盖当前footer,自定义操作按钮 */
26
- footer?: (form: FormInstance, operate: {
32
+ footer?: null | ((form: FormInstance, operate: {
27
33
  onClose: TNoopDefine;
28
- }) => ReactElement;
34
+ }) => ReactElement);
29
35
  /** 当前footer操作按钮,左侧扩展 */
30
36
  footerOperateBeforeRender?: (form: FormInstance, operate: {
31
37
  onClose: TNoopDefine;
@@ -35,6 +41,13 @@ export type DialogDragModalProps = {
35
41
  onClose: TNoopDefine;
36
42
  }) => ReactElement;
37
43
  };
44
+ /**
45
+ * 可移动弹框
46
+ * ```
47
+ * 1. 设置 event 后,弹起位置受鼠标点击位置控制
48
+ * 2. 相同的modalKey,最多只有一个弹起状态
49
+ * ```
50
+ */
38
51
  export declare const dialogDragModal: {
39
52
  open: (props: DialogDragModalProps) => {
40
53
  close: () => void;
@@ -3,13 +3,16 @@ import './../fba-hooks/index.css';
3
3
  import './index.css';
4
4
  /*! @flatjs/forge MIT @flatbiz/antd */
5
5
 
6
- export { d as dialogDragModal } from '../drag-modal-DTbr-E0g.js';
6
+ export { d as dialogDragModal } from '../drag-modal-DVq260Mc.js';
7
7
  import '@dimjs/lang/is-string';
8
8
  import '@ant-design/icons/es/icons/CloseOutlined.js';
9
+ import '@dimjs/utils/class-names/class-names';
10
+ import '@dimjs/lang/is-number';
9
11
  import '../_rollupPluginBabelHelpers-CP5aeNcJ.js';
10
12
  import '@wove/react/hooks';
11
13
  import 'react';
12
14
  import 'react-dom/client';
15
+ import '../_commonjsHelpers-B0GIDhER.js';
13
16
  import 'react-is';
14
17
  import 'react-dom';
15
18
  import 'ahooks';
@@ -18,7 +21,6 @@ import '@flatbiz/utils';
18
21
  import '../button-wrapper-C2koH6hy.js';
19
22
  import '@ant-design/icons/es/icons/LoadingOutlined.js';
20
23
  import '@dimjs/lang/is-promise';
21
- import '@dimjs/utils/class-names/class-names';
22
24
  import '../config-provider-wrapper-Dbk1Er0W.js';
23
25
  import 'antd/es/locale/en_US.js';
24
26
  import 'antd/es/locale/zh_CN.js';
@@ -33,6 +35,7 @@ import 'dayjs/plugin/weekYear.js';
33
35
  import '@dimjs/utils/extend/extend';
34
36
  import '../fba-hooks/index.js';
35
37
  import '../use-responsive-point-Bp3D3lZT.js';
38
+ import '@dimjs/utils/uuid/uuid';
36
39
  import 'dayjs/locale/en.js';
37
40
  import 'dayjs/locale/zh-cn.js';
38
41
  import 'react/jsx-runtime';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -29,6 +29,7 @@ import 'dayjs/plugin/weekYear.js';
29
29
  import '@dimjs/utils/extend/extend';
30
30
  import '../fba-hooks/index.js';
31
31
  import '../use-responsive-point-Bp3D3lZT.js';
32
+ import '@dimjs/utils/uuid/uuid';
32
33
  import 'dayjs/locale/en.js';
33
34
  import 'dayjs/locale/zh-cn.js';
34
35
  import 'react/jsx-runtime';