@tachybase/client 1.6.6 → 1.6.8-alpha.1
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/es/block-provider/hooks/index.mjs +1 -1
- package/es/built-in/page-style/TabHeader.mjs +131 -12
- package/es/collection-manager/interfaces/number.mjs +20 -0
- package/es/collection-manager/interfaces/percent.mjs +20 -0
- package/es/schema-component/antd/input-number/ReadPretty.mjs +4 -1
- package/es/schema-settings/SchemaSettingsNumberFormat.mjs +21 -1
- package/lib/block-provider/hooks/index.js +1 -1
- package/lib/built-in/page-style/TabHeader.js +130 -11
- package/lib/collection-manager/interfaces/number.js +20 -0
- package/lib/collection-manager/interfaces/percent.js +20 -0
- package/lib/schema-component/antd/input-number/ReadPretty.js +4 -1
- package/lib/schema-settings/SchemaSettingsNumberFormat.js +21 -1
- package/package.json +12 -3
|
@@ -48,7 +48,7 @@ function filterByCleanedFields(mergeFilter) {
|
|
|
48
48
|
'$or'
|
|
49
49
|
].includes(p));
|
|
50
50
|
const fieldPath = filteredParts.join('.');
|
|
51
|
-
const uniqueKey = "".concat(fieldPath
|
|
51
|
+
const uniqueKey = "".concat(fieldPath);
|
|
52
52
|
if (!seen.has(uniqueKey)) {
|
|
53
53
|
seen.add(uniqueKey);
|
|
54
54
|
result[key] = value;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useContext } from "react";
|
|
2
|
+
import { useContext, useState } from "react";
|
|
3
|
+
import { observer } from "@tachybase/schema";
|
|
4
|
+
import { DndContext, DragOverlay, MouseSensor, useDraggable, useDroppable, useSensor, useSensors } from "@dnd-kit/core";
|
|
3
5
|
import { css } from "@emotion/css";
|
|
4
6
|
import { Button } from "antd";
|
|
5
7
|
import classnames from "classnames";
|
|
@@ -57,17 +59,134 @@ const TabHeader = ()=>{
|
|
|
57
59
|
const { styles } = useStyles();
|
|
58
60
|
return /*#__PURE__*/ jsx("div", {
|
|
59
61
|
className: styles.tabWrapper,
|
|
60
|
-
children:
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
62
|
+
children: /*#__PURE__*/ jsx(DndProvider, {
|
|
63
|
+
targetKey: targetKey,
|
|
64
|
+
navigate: navigate,
|
|
65
|
+
setItems: setItems,
|
|
66
|
+
items: items,
|
|
67
|
+
children: items.map((item)=>/*#__PURE__*/ jsx(TabTitle, {
|
|
68
|
+
item: item,
|
|
69
|
+
targetKey: targetKey,
|
|
70
|
+
navigate: navigate,
|
|
71
|
+
setItems: setItems
|
|
72
|
+
}))
|
|
73
|
+
})
|
|
71
74
|
});
|
|
72
75
|
};
|
|
76
|
+
const TabTag = (props)=>{
|
|
77
|
+
const { item, targetKey, navigate, setItems } = props;
|
|
78
|
+
return /*#__PURE__*/ jsx(Tag, {
|
|
79
|
+
active: item.key === targetKey,
|
|
80
|
+
onClick: ()=>{
|
|
81
|
+
navigate(item.key);
|
|
82
|
+
},
|
|
83
|
+
onClose: (e)=>{
|
|
84
|
+
e.stopPropagation();
|
|
85
|
+
setItems((items)=>items.filter((i)=>i.key !== item.key));
|
|
86
|
+
},
|
|
87
|
+
children: item.label
|
|
88
|
+
}, item.key);
|
|
89
|
+
};
|
|
90
|
+
const DndProvider = observer((props)=>{
|
|
91
|
+
const { targetKey, navigate, setItems, items } = props;
|
|
92
|
+
const [activeTab, setActiveId] = useState(null);
|
|
93
|
+
const onDragEnd = async (props)=>{
|
|
94
|
+
const { active, over } = props;
|
|
95
|
+
setTimeout(()=>{
|
|
96
|
+
setActiveId(null);
|
|
97
|
+
});
|
|
98
|
+
if (over && over.id !== active.id) {
|
|
99
|
+
const newItems = [
|
|
100
|
+
...items
|
|
101
|
+
];
|
|
102
|
+
const activeIndex = newItems.findIndex((item)=>item.key === active.id);
|
|
103
|
+
const overIndex = newItems.findIndex((item)=>item.key === over.id);
|
|
104
|
+
const item = newItems.splice(activeIndex, 1);
|
|
105
|
+
newItems.splice(overIndex, 0, ...item);
|
|
106
|
+
setItems(newItems);
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
function onDragStart(event) {
|
|
110
|
+
var _event_active;
|
|
111
|
+
setActiveId(null == (_event_active = event.active) ? void 0 : _event_active.data.current);
|
|
112
|
+
}
|
|
113
|
+
const mouseSensor = useSensor(MouseSensor, {
|
|
114
|
+
activationConstraint: {
|
|
115
|
+
distance: 10
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
const sensors = useSensors(mouseSensor);
|
|
119
|
+
return /*#__PURE__*/ jsxs(DndContext, {
|
|
120
|
+
sensors: sensors,
|
|
121
|
+
onDragEnd: onDragEnd,
|
|
122
|
+
onDragStart: onDragStart,
|
|
123
|
+
children: [
|
|
124
|
+
props.children,
|
|
125
|
+
/*#__PURE__*/ jsx(DragOverlay, {
|
|
126
|
+
children: activeTab ? /*#__PURE__*/ jsx("span", {
|
|
127
|
+
style: {
|
|
128
|
+
whiteSpace: 'nowrap'
|
|
129
|
+
},
|
|
130
|
+
children: /*#__PURE__*/ jsx(TabTag, {
|
|
131
|
+
item: activeTab,
|
|
132
|
+
targetKey: targetKey,
|
|
133
|
+
navigate: navigate,
|
|
134
|
+
setItems: setItems
|
|
135
|
+
})
|
|
136
|
+
}) : null
|
|
137
|
+
})
|
|
138
|
+
]
|
|
139
|
+
});
|
|
140
|
+
}, {
|
|
141
|
+
displayName: 'DndProvider'
|
|
142
|
+
});
|
|
143
|
+
const Draggable = (props)=>{
|
|
144
|
+
const { attributes, listeners, setNodeRef } = useDraggable({
|
|
145
|
+
id: props.id,
|
|
146
|
+
data: props.data
|
|
147
|
+
});
|
|
148
|
+
return /*#__PURE__*/ jsx("div", {
|
|
149
|
+
ref: setNodeRef,
|
|
150
|
+
...listeners,
|
|
151
|
+
...attributes,
|
|
152
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
153
|
+
children: props.children
|
|
154
|
+
})
|
|
155
|
+
});
|
|
156
|
+
};
|
|
157
|
+
function Droppable(props) {
|
|
158
|
+
const { isOver, setNodeRef } = useDroppable({
|
|
159
|
+
id: props.id,
|
|
160
|
+
data: props.data
|
|
161
|
+
});
|
|
162
|
+
const style = isOver ? {
|
|
163
|
+
color: 'green'
|
|
164
|
+
} : void 0;
|
|
165
|
+
return /*#__PURE__*/ jsx("div", {
|
|
166
|
+
ref: setNodeRef,
|
|
167
|
+
style: style,
|
|
168
|
+
children: props.children
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
const TabTitle = observer((props)=>{
|
|
172
|
+
const { item, targetKey, navigate, setItems } = props;
|
|
173
|
+
return /*#__PURE__*/ jsx(Droppable, {
|
|
174
|
+
id: item.key,
|
|
175
|
+
data: item,
|
|
176
|
+
children: /*#__PURE__*/ jsx("div", {
|
|
177
|
+
children: /*#__PURE__*/ jsx(Draggable, {
|
|
178
|
+
id: item.key,
|
|
179
|
+
data: item,
|
|
180
|
+
children: /*#__PURE__*/ jsx(TabTag, {
|
|
181
|
+
item: item,
|
|
182
|
+
targetKey: targetKey,
|
|
183
|
+
navigate: navigate,
|
|
184
|
+
setItems: setItems
|
|
185
|
+
})
|
|
186
|
+
})
|
|
187
|
+
})
|
|
188
|
+
});
|
|
189
|
+
}, {
|
|
190
|
+
displayName: 'TabTitle'
|
|
191
|
+
});
|
|
73
192
|
export { TabHeader, Tag };
|
|
@@ -129,6 +129,26 @@ class NumberFieldInterface extends CollectionFieldInterface {
|
|
|
129
129
|
{
|
|
130
130
|
value: '0.00001',
|
|
131
131
|
label: '1.00000'
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
value: '0.000001',
|
|
135
|
+
label: '1.000000'
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
value: '0.0000001',
|
|
139
|
+
label: '1.0000000'
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
value: '0.00000001',
|
|
143
|
+
label: '1.00000000'
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
value: '0.000000001',
|
|
147
|
+
label: '1.000000000'
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
value: '0.0000000001',
|
|
151
|
+
label: '1.0000000000'
|
|
132
152
|
}
|
|
133
153
|
]
|
|
134
154
|
},
|
|
@@ -96,6 +96,26 @@ class PercentFieldInterface extends CollectionFieldInterface {
|
|
|
96
96
|
{
|
|
97
97
|
value: '0.00001',
|
|
98
98
|
label: '1.00000%'
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
value: '0.000001',
|
|
102
|
+
label: '1.000000%'
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
value: '0.0000001',
|
|
106
|
+
label: '1.0000000%'
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
value: '0.00000001',
|
|
110
|
+
label: '1.00000000%'
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
value: '0.000000001',
|
|
114
|
+
label: '1.000000000%'
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
value: '0.0000000001',
|
|
118
|
+
label: '1.0000000000%'
|
|
99
119
|
}
|
|
100
120
|
]
|
|
101
121
|
},
|
|
@@ -7,7 +7,10 @@ import { round } from "mathjs";
|
|
|
7
7
|
function countDecimalPlaces(value) {
|
|
8
8
|
const number = Number(value);
|
|
9
9
|
if (!Number.isFinite(number)) return 0;
|
|
10
|
-
const decimalPart =
|
|
10
|
+
const decimalPart = number.toLocaleString('en-US', {
|
|
11
|
+
useGrouping: false,
|
|
12
|
+
maximumSignificantDigits: 10
|
|
13
|
+
}).split('.')[1];
|
|
11
14
|
return decimalPart ? decimalPart.length : 0;
|
|
12
15
|
}
|
|
13
16
|
const separators = {
|
|
@@ -130,6 +130,26 @@ const SchemaSettingsNumberFormat = function(props) {
|
|
|
130
130
|
{
|
|
131
131
|
value: '0.00001',
|
|
132
132
|
label: '1.00000'
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
value: '0.000001',
|
|
136
|
+
label: '1.000000'
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
value: '0.0000001',
|
|
140
|
+
label: '1.0000000'
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
value: '0.00000001',
|
|
144
|
+
label: '1.00000000'
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
value: '0.000000001',
|
|
148
|
+
label: '1.000000000'
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
value: '0.0000000001',
|
|
152
|
+
label: '1.0000000000'
|
|
133
153
|
}
|
|
134
154
|
]
|
|
135
155
|
},
|
|
@@ -155,7 +175,7 @@ const SchemaSettingsNumberFormat = function(props) {
|
|
|
155
175
|
};
|
|
156
176
|
schema['x-component-props'] = fieldSchema['x-component-props'] || {};
|
|
157
177
|
fieldSchema['x-component-props'] = {
|
|
158
|
-
...fieldSchema['x-component-props']
|
|
178
|
+
...fieldSchema['x-component-props'],
|
|
159
179
|
...data
|
|
160
180
|
};
|
|
161
181
|
schema['x-component-props'] = fieldSchema['x-component-props'];
|
|
@@ -361,7 +361,7 @@ var __webpack_exports__ = {};
|
|
|
361
361
|
'$or'
|
|
362
362
|
].includes(p));
|
|
363
363
|
const fieldPath = filteredParts.join('.');
|
|
364
|
-
const uniqueKey = "".concat(fieldPath
|
|
364
|
+
const uniqueKey = "".concat(fieldPath);
|
|
365
365
|
if (!seen.has(uniqueKey)) {
|
|
366
366
|
seen.add(uniqueKey);
|
|
367
367
|
result[key] = value;
|
|
@@ -38,6 +38,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
38
38
|
});
|
|
39
39
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
40
40
|
const external_react_namespaceObject = require("react");
|
|
41
|
+
const schema_namespaceObject = require("@tachybase/schema");
|
|
42
|
+
const core_namespaceObject = require("@dnd-kit/core");
|
|
41
43
|
const css_namespaceObject = require("@emotion/css");
|
|
42
44
|
const external_antd_namespaceObject = require("antd");
|
|
43
45
|
const external_classnames_namespaceObject = require("classnames");
|
|
@@ -96,19 +98,136 @@ const TabHeader = ()=>{
|
|
|
96
98
|
const { styles } = (0, external_TabHeader_style_js_namespaceObject.useStyles)();
|
|
97
99
|
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
98
100
|
className: styles.tabWrapper,
|
|
99
|
-
children:
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
101
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(DndProvider, {
|
|
102
|
+
targetKey: targetKey,
|
|
103
|
+
navigate: navigate,
|
|
104
|
+
setItems: setItems,
|
|
105
|
+
items: items,
|
|
106
|
+
children: items.map((item)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(TabTitle, {
|
|
107
|
+
item: item,
|
|
108
|
+
targetKey: targetKey,
|
|
109
|
+
navigate: navigate,
|
|
110
|
+
setItems: setItems
|
|
111
|
+
}))
|
|
112
|
+
})
|
|
110
113
|
});
|
|
111
114
|
};
|
|
115
|
+
const TabTag = (props)=>{
|
|
116
|
+
const { item, targetKey, navigate, setItems } = props;
|
|
117
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Tag, {
|
|
118
|
+
active: item.key === targetKey,
|
|
119
|
+
onClick: ()=>{
|
|
120
|
+
navigate(item.key);
|
|
121
|
+
},
|
|
122
|
+
onClose: (e)=>{
|
|
123
|
+
e.stopPropagation();
|
|
124
|
+
setItems((items)=>items.filter((i)=>i.key !== item.key));
|
|
125
|
+
},
|
|
126
|
+
children: item.label
|
|
127
|
+
}, item.key);
|
|
128
|
+
};
|
|
129
|
+
const DndProvider = (0, schema_namespaceObject.observer)((props)=>{
|
|
130
|
+
const { targetKey, navigate, setItems, items } = props;
|
|
131
|
+
const [activeTab, setActiveId] = (0, external_react_namespaceObject.useState)(null);
|
|
132
|
+
const onDragEnd = async (props)=>{
|
|
133
|
+
const { active, over } = props;
|
|
134
|
+
setTimeout(()=>{
|
|
135
|
+
setActiveId(null);
|
|
136
|
+
});
|
|
137
|
+
if (over && over.id !== active.id) {
|
|
138
|
+
const newItems = [
|
|
139
|
+
...items
|
|
140
|
+
];
|
|
141
|
+
const activeIndex = newItems.findIndex((item)=>item.key === active.id);
|
|
142
|
+
const overIndex = newItems.findIndex((item)=>item.key === over.id);
|
|
143
|
+
const item = newItems.splice(activeIndex, 1);
|
|
144
|
+
newItems.splice(overIndex, 0, ...item);
|
|
145
|
+
setItems(newItems);
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
function onDragStart(event) {
|
|
149
|
+
var _event_active;
|
|
150
|
+
setActiveId(null == (_event_active = event.active) ? void 0 : _event_active.data.current);
|
|
151
|
+
}
|
|
152
|
+
const mouseSensor = (0, core_namespaceObject.useSensor)(core_namespaceObject.MouseSensor, {
|
|
153
|
+
activationConstraint: {
|
|
154
|
+
distance: 10
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
const sensors = (0, core_namespaceObject.useSensors)(mouseSensor);
|
|
158
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(core_namespaceObject.DndContext, {
|
|
159
|
+
sensors: sensors,
|
|
160
|
+
onDragEnd: onDragEnd,
|
|
161
|
+
onDragStart: onDragStart,
|
|
162
|
+
children: [
|
|
163
|
+
props.children,
|
|
164
|
+
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(core_namespaceObject.DragOverlay, {
|
|
165
|
+
children: activeTab ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
|
|
166
|
+
style: {
|
|
167
|
+
whiteSpace: 'nowrap'
|
|
168
|
+
},
|
|
169
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(TabTag, {
|
|
170
|
+
item: activeTab,
|
|
171
|
+
targetKey: targetKey,
|
|
172
|
+
navigate: navigate,
|
|
173
|
+
setItems: setItems
|
|
174
|
+
})
|
|
175
|
+
}) : null
|
|
176
|
+
})
|
|
177
|
+
]
|
|
178
|
+
});
|
|
179
|
+
}, {
|
|
180
|
+
displayName: 'DndProvider'
|
|
181
|
+
});
|
|
182
|
+
const Draggable = (props)=>{
|
|
183
|
+
const { attributes, listeners, setNodeRef } = (0, core_namespaceObject.useDraggable)({
|
|
184
|
+
id: props.id,
|
|
185
|
+
data: props.data
|
|
186
|
+
});
|
|
187
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
188
|
+
ref: setNodeRef,
|
|
189
|
+
...listeners,
|
|
190
|
+
...attributes,
|
|
191
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
192
|
+
children: props.children
|
|
193
|
+
})
|
|
194
|
+
});
|
|
195
|
+
};
|
|
196
|
+
function Droppable(props) {
|
|
197
|
+
const { isOver, setNodeRef } = (0, core_namespaceObject.useDroppable)({
|
|
198
|
+
id: props.id,
|
|
199
|
+
data: props.data
|
|
200
|
+
});
|
|
201
|
+
const style = isOver ? {
|
|
202
|
+
color: 'green'
|
|
203
|
+
} : void 0;
|
|
204
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
205
|
+
ref: setNodeRef,
|
|
206
|
+
style: style,
|
|
207
|
+
children: props.children
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
const TabTitle = (0, schema_namespaceObject.observer)((props)=>{
|
|
211
|
+
const { item, targetKey, navigate, setItems } = props;
|
|
212
|
+
return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Droppable, {
|
|
213
|
+
id: item.key,
|
|
214
|
+
data: item,
|
|
215
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
|
|
216
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Draggable, {
|
|
217
|
+
id: item.key,
|
|
218
|
+
data: item,
|
|
219
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(TabTag, {
|
|
220
|
+
item: item,
|
|
221
|
+
targetKey: targetKey,
|
|
222
|
+
navigate: navigate,
|
|
223
|
+
setItems: setItems
|
|
224
|
+
})
|
|
225
|
+
})
|
|
226
|
+
})
|
|
227
|
+
});
|
|
228
|
+
}, {
|
|
229
|
+
displayName: 'TabTitle'
|
|
230
|
+
});
|
|
112
231
|
exports.TabHeader = __webpack_exports__.TabHeader;
|
|
113
232
|
exports.Tag = __webpack_exports__.Tag;
|
|
114
233
|
for(var __webpack_i__ in __webpack_exports__)if (-1 === [
|
|
@@ -157,6 +157,26 @@ class NumberFieldInterface extends CollectionFieldInterface_js_namespaceObject.C
|
|
|
157
157
|
{
|
|
158
158
|
value: '0.00001',
|
|
159
159
|
label: '1.00000'
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
value: '0.000001',
|
|
163
|
+
label: '1.000000'
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
value: '0.0000001',
|
|
167
|
+
label: '1.0000000'
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
value: '0.00000001',
|
|
171
|
+
label: '1.00000000'
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
value: '0.000000001',
|
|
175
|
+
label: '1.000000000'
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
value: '0.0000000001',
|
|
179
|
+
label: '1.0000000000'
|
|
160
180
|
}
|
|
161
181
|
]
|
|
162
182
|
},
|
|
@@ -124,6 +124,26 @@ class PercentFieldInterface extends CollectionFieldInterface_js_namespaceObject.
|
|
|
124
124
|
{
|
|
125
125
|
value: '0.00001',
|
|
126
126
|
label: '1.00000%'
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
value: '0.000001',
|
|
130
|
+
label: '1.000000%'
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
value: '0.0000001',
|
|
134
|
+
label: '1.0000000%'
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
value: '0.00000001',
|
|
138
|
+
label: '1.00000000%'
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
value: '0.000000001',
|
|
142
|
+
label: '1.000000000%'
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
value: '0.0000000001',
|
|
146
|
+
label: '1.0000000000%'
|
|
127
147
|
}
|
|
128
148
|
]
|
|
129
149
|
},
|
|
@@ -39,7 +39,10 @@ const external_mathjs_namespaceObject = require("mathjs");
|
|
|
39
39
|
function countDecimalPlaces(value) {
|
|
40
40
|
const number = Number(value);
|
|
41
41
|
if (!Number.isFinite(number)) return 0;
|
|
42
|
-
const decimalPart =
|
|
42
|
+
const decimalPart = number.toLocaleString('en-US', {
|
|
43
|
+
useGrouping: false,
|
|
44
|
+
maximumSignificantDigits: 10
|
|
45
|
+
}).split('.')[1];
|
|
43
46
|
return decimalPart ? decimalPart.length : 0;
|
|
44
47
|
}
|
|
45
48
|
const separators = {
|
|
@@ -158,6 +158,26 @@ const SchemaSettingsNumberFormat = function(props) {
|
|
|
158
158
|
{
|
|
159
159
|
value: '0.00001',
|
|
160
160
|
label: '1.00000'
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
value: '0.000001',
|
|
164
|
+
label: '1.000000'
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
value: '0.0000001',
|
|
168
|
+
label: '1.0000000'
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
value: '0.00000001',
|
|
172
|
+
label: '1.00000000'
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
value: '0.000000001',
|
|
176
|
+
label: '1.000000000'
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
value: '0.0000000001',
|
|
180
|
+
label: '1.0000000000'
|
|
161
181
|
}
|
|
162
182
|
]
|
|
163
183
|
},
|
|
@@ -183,7 +203,7 @@ const SchemaSettingsNumberFormat = function(props) {
|
|
|
183
203
|
};
|
|
184
204
|
schema['x-component-props'] = fieldSchema['x-component-props'] || {};
|
|
185
205
|
fieldSchema['x-component-props'] = {
|
|
186
|
-
...fieldSchema['x-component-props']
|
|
206
|
+
...fieldSchema['x-component-props'],
|
|
187
207
|
...data
|
|
188
208
|
};
|
|
189
209
|
schema['x-component-props'] = fieldSchema['x-component-props'];
|
package/package.json
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tachybase/client",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.8-alpha.1",
|
|
4
|
+
"homepage": "https://github.com/tegojs/tego-standard#readme",
|
|
5
|
+
"bugs": {
|
|
6
|
+
"url": "https://github.com/tegojs/tego-standard/issues"
|
|
7
|
+
},
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/tegojs/tego-standard",
|
|
11
|
+
"directory": "packages/client"
|
|
12
|
+
},
|
|
4
13
|
"license": "Apache-2.0",
|
|
5
14
|
"main": "lib/index.js",
|
|
6
15
|
"module": "es/index.mjs",
|
|
@@ -21,8 +30,8 @@
|
|
|
21
30
|
"@floating-ui/react": "0.26.28",
|
|
22
31
|
"@js-preview/excel": "^1.7.14",
|
|
23
32
|
"@lottiefiles/dotlottie-react": "^0.9.3",
|
|
24
|
-
"@tachybase/schema": "1.6.
|
|
25
|
-
"@tego/client": "1.6.
|
|
33
|
+
"@tachybase/schema": "1.6.3",
|
|
34
|
+
"@tego/client": "1.6.3",
|
|
26
35
|
"ahooks": "^3.9.0",
|
|
27
36
|
"antd": "5.22.5",
|
|
28
37
|
"antd-style": "3.7.1",
|