@teamias/rex-design 0.0.30 → 0.0.31
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.
|
@@ -40,7 +40,7 @@ export var DescriptionsModel = function DescriptionsModel(_ref) {
|
|
|
40
40
|
rules = field.rules,
|
|
41
41
|
otherData = _objectWithoutProperties(field, _excluded2);
|
|
42
42
|
return {
|
|
43
|
-
label: /*#__PURE__*/_jsx(Form.Item,
|
|
43
|
+
label: /*#__PURE__*/_jsx(Form.Item, {
|
|
44
44
|
label: label,
|
|
45
45
|
tooltip: tooltip,
|
|
46
46
|
required: isRequired,
|
|
@@ -48,7 +48,8 @@ export var DescriptionsModel = function DescriptionsModel(_ref) {
|
|
|
48
48
|
style: {
|
|
49
49
|
margin: 0
|
|
50
50
|
}
|
|
51
|
-
|
|
51
|
+
// {...formItemProps}
|
|
52
|
+
,
|
|
52
53
|
labelCol: _objectSpread(_objectSpread({}, formItemProps === null || formItemProps === void 0 ? void 0 : formItemProps.labelCol), {}, {
|
|
53
54
|
style: _objectSpread({
|
|
54
55
|
padding: 0,
|
|
@@ -61,7 +62,7 @@ export var DescriptionsModel = function DescriptionsModel(_ref) {
|
|
|
61
62
|
display: 'none'
|
|
62
63
|
}
|
|
63
64
|
}
|
|
64
|
-
})
|
|
65
|
+
}),
|
|
65
66
|
children: /*#__PURE__*/_jsx(BaseForm, _objectSpread(_objectSpread({}, baseFormProps), {}, {
|
|
66
67
|
itemMarginBottom: 0,
|
|
67
68
|
fields: [_objectSpread(_objectSpread({}, otherData), {}, {
|
|
@@ -29,10 +29,10 @@ export default (function () {
|
|
|
29
29
|
messages: _objectSpread({}, crush(enUS))
|
|
30
30
|
})
|
|
31
31
|
},
|
|
32
|
-
children: /*#__PURE__*/_jsx(TiptapEditor
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
children: /*#__PURE__*/_jsx(TiptapEditor
|
|
33
|
+
// readOnly={true}
|
|
34
|
+
// defaultValue={value}
|
|
35
|
+
, {
|
|
36
36
|
value: value,
|
|
37
37
|
onChange: function onChange(e) {
|
|
38
38
|
console.log(e);
|
|
@@ -6,16 +6,26 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
7
|
import { useEffect, useRef, useState } from 'react';
|
|
8
8
|
var withResolvers = function withResolvers() {
|
|
9
|
+
var isPending = {
|
|
10
|
+
value: true
|
|
11
|
+
};
|
|
9
12
|
var resolve = function resolve() {};
|
|
10
13
|
var reject = function reject() {};
|
|
11
14
|
var promise = new Promise(function (rel, rej) {
|
|
12
|
-
resolve =
|
|
13
|
-
|
|
15
|
+
resolve = function resolve() {
|
|
16
|
+
isPending.value = false;
|
|
17
|
+
rel();
|
|
18
|
+
};
|
|
19
|
+
reject = function reject() {
|
|
20
|
+
isPending.value = false;
|
|
21
|
+
rej();
|
|
22
|
+
};
|
|
14
23
|
});
|
|
15
24
|
return {
|
|
16
25
|
promise: promise,
|
|
17
26
|
resolve: resolve,
|
|
18
|
-
reject: reject
|
|
27
|
+
reject: reject,
|
|
28
|
+
isPending: isPending
|
|
19
29
|
};
|
|
20
30
|
};
|
|
21
31
|
|
|
@@ -33,11 +43,17 @@ export var useStateData = function useStateData(stateFn) {
|
|
|
33
43
|
_useState4 = _slicedToArray(_useState3, 1),
|
|
34
44
|
state = _useState4[0];
|
|
35
45
|
var _useRef = useRef({
|
|
46
|
+
/** 销毁锁 */
|
|
36
47
|
lock: false,
|
|
37
48
|
promiseContent: withResolvers(),
|
|
38
49
|
// nextTick: (fn: () => void) => {},
|
|
39
50
|
newUpdateFn: function newUpdateFn() {
|
|
40
51
|
if (!data.lock) update({});
|
|
52
|
+
|
|
53
|
+
// 替换前,把之前的 pending 解决掉,不然会造成死锁
|
|
54
|
+
if (data.promiseContent.isPending.value) {
|
|
55
|
+
data.promiseContent.resolve();
|
|
56
|
+
}
|
|
41
57
|
data.promiseContent = withResolvers();
|
|
42
58
|
return data.promiseContent.promise;
|
|
43
59
|
}
|