@tachybase/plugin-field-formula 1.3.22 → 1.3.24
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/dist/client/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
(function(n,r){typeof exports=="object"&&typeof module!="undefined"?r(exports,require("@tachybase/client"),require("@tachybase/schema"),require("react/jsx-runtime"),require("react"),require("@tego/client"),require("react-i18next")):typeof define=="function"&&define.amd?define(["exports","@tachybase/client","@tachybase/schema","react/jsx-runtime","react","@tego/client","react-i18next"],r):(n=typeof globalThis!="undefined"?globalThis:n||self,r(n["@tachybase/plugin-field-formula"]={},n["@tachybase/client"],n["@tachybase/schema"],n.jsxRuntime,n.react,n["@tego/client"]))})(this,function(n,r,o,s,N,
|
|
1
|
+
(function(n,r){typeof exports=="object"&&typeof module!="undefined"?r(exports,require("@tachybase/client"),require("@tachybase/schema"),require("react/jsx-runtime"),require("react"),require("@tego/client"),require("lodash"),require("react-i18next")):typeof define=="function"&&define.amd?define(["exports","@tachybase/client","@tachybase/schema","react/jsx-runtime","react","@tego/client","lodash","react-i18next"],r):(n=typeof globalThis!="undefined"?globalThis:n||self,r(n["@tachybase/plugin-field-formula"]={},n["@tachybase/client"],n["@tachybase/schema"],n.jsxRuntime,n.react,n["@tego/client"],n.lodash))})(this,function(n,r,o,s,N,b,F){"use strict";var oe=Object.defineProperty,ae=Object.defineProperties;var se=Object.getOwnPropertyDescriptors;var T=Object.getOwnPropertySymbols;var _=Object.prototype.hasOwnProperty,$=Object.prototype.propertyIsEnumerable;var V=(n,r,o)=>r in n?oe(n,r,{enumerable:!0,configurable:!0,writable:!0,value:o}):n[r]=o,f=(n,r)=>{for(var o in r||(r={}))_.call(r,o)&&V(n,o,r[o]);if(T)for(var o of T(r))$.call(r,o)&&V(n,o,r[o]);return n},y=(n,r)=>ae(n,se(r));var B=(n,r)=>{var o={};for(var s in n)_.call(n,s)&&r.indexOf(s)<0&&(o[s]=n[s]);if(n!=null&&T)for(var s of T(n))r.indexOf(s)<0&&$.call(n,s)&&(o[s]=n[s]);return o};var G=(n,r,o)=>new Promise((s,N)=>{var b=c=>{try{S(o.next(c))}catch(v){N(v)}},F=c=>{try{S(o.throw(c))}catch(v){N(v)}},S=c=>c.done?s(c.value):Promise.resolve(c.value).then(b,F);S((o=o.apply(n,r)).next())});const S=e=>{var C;const{value:t="",supports:u=[],useCurrentFields:a,onChange:i}=e,p=r.useCompile(),{interfaces:d}=r.useCollectionManager_deprecated(),I=((C=a==null?void 0:a())!=null?C:[]).filter(l=>u.includes(l.interface)).map(l=>{var E,x;return{label:p(l.uiSchema.title),value:l.name,children:(x=(E=d[l.interface]).usePathOptions)==null?void 0:x.call(E,l)}});return s.jsx(r.Variable.TextArea,{value:t,onChange:i,scope:I})},c={boolean:Boolean,integer:{boolean(e){return Number(e)},number(e){return e>=0?Math.floor(e):Math.ceil(e)},bigint(e){return Number(e)},string(e){const t=Number.parseInt(e,10);return Number.isNaN(t)||!Number.isFinite(t)?null:t},date(e){const t=e.valueOf();return Number.isNaN(t)?null:t}},bigInt:{boolean(e){return Number(e)},number(e){return Math.floor(e>=0?Math.floor(e):Math.ceil(e))},bigint(e){return Number(e)},string(e){const t=Number.parseInt(e,10);return Number.isNaN(t)||!Number.isFinite(t)?null:t},date(e){const t=e.valueOf();return Number.isNaN(t)?null:t}},double:{boolean(e){return Number(e)},number(e){return e},bigint(e){return Number(e)},string(e){const t=Number.parseFloat(e);return Number.isNaN(t)||!Number.isFinite(t)?null:t},date(e){const t=e.valueOf();return Number.isNaN(t)?null:t}},decimal:{boolean(e){return Number(e)},number(e){return e},bigint(e){return e},date(e){const t=e.valueOf();return Number.isNaN(t)?null:t}},string:{boolean(e){return e.toString()},number(e){return e.toString()},bigint(e){return e.toString()},string(e){return e},date(e){return e.toISOString()}},date:{boolean(e){return null},number(e){const t=new Date(e);return Number.isNaN(t.valueOf())?null:t},bigint(e){const t=new Date(Number(e));return Number.isNaN(t.valueOf())?null:t},string(e){const t=Date.parse(e);return Number.isNaN(t)?null:new Date(t)},date(e){return new Date(e)}}};function v(e,t){if(e==null)return null;let u=typeof e;u=="object"&&e instanceof Date&&(u="date");const a=c[t];if(!a)return null;if(typeof a=="function")return a(e);const i=a[u];return i?i(e):null}const J={boolean:r.Checkbox.ReadPretty,integer:r.InputNumber.ReadPretty,bigInt:r.InputNumber.ReadPretty,double:r.InputNumber.ReadPretty,decimal:r.InputNumber.ReadPretty,date:r.DatePicker.ReadPretty,string:r.Input.ReadPretty};function U(){const e=o.useFieldSchema(),t=r.useCollection_deprecated(),{getCollection:u,getCollectionField:a}=r.useCollectionManager_deprecated(),i=e.name.split(".");let p=t;for(let d=0;d<i.length-1;d++){const g=p.getField(i[d]);p=u(g.target)}return a(`${p.name}.${i[i.length-1]}`)}function z(e,t,u){const a=e[t];return Array.isArray(a)?a[u]:a&&typeof a=="object"?a:e}function H(e){var A,R,w;const O=e,{value:t}=O,u=B(O,["value"]),a=o.useFieldSchema(),{dataType:i,expression:p,engine:d="math.js"}=(A=U())!=null?A:{},[g,I]=N.useState(t),{evaluate:C}=b.evaluators.get(d),l=r.useFormBlockContext(),x=o.useField().path.entire,q=x==null?void 0:x.replace(`.${a.name}`,""),Z=q.split(".")[0],ee=parseInt((R=q.split("."))==null?void 0:R[1]);N.useEffect(()=>{I(t)},[t]),o.useFormEffects(()=>{o.onFormValuesChange(re=>{var k;if(a.name.indexOf(".")>=0||!(l!=null&&l.form)||(k=l.form)!=null&&k.readPretty)return;const ne=o.toJS(z(re.values,Z,ee));let m;try{m=C(p,ne),m=v(m,i)}catch(ie){m=null}m==null&&g==null&&I(m),I(m),m!==t&&e.onChange(m)})});const te=(w=J[i])!=null?w:r.Input;return s.jsx(te,y(f({},u),{value:i==="double"?b.toFixedByStep(g,e.step):g}))}const D=()=>null;D.Expression=S,D.Result=o.connect(H);const h="field-formula",K=[{dependencies:["dataType"],fulfill:{state:{display:'{{["double", "decimal"].includes($deps[0]) ? "visible" : "none"}}'}}}],M=[{dependencies:["dataType"],fulfill:{state:{display:'{{$deps[0] === "date" ? "visible" : "none"}}'}}}],{defaultProps:L,dateTimeProps:P,operators:Q}=r.interfacesProperties,W={"uiSchema.x-component-props.dateFormat":y(f({},F.cloneDeep(P["uiSchema.x-component-props.dateFormat"])),{"x-reactions":M}),"uiSchema.x-component-props.showTime":y(f({},F.cloneDeep(P["uiSchema.x-component-props.showTime"])),{"x-reactions":[...P["uiSchema.x-component-props.showTime"]["x-reactions"],...M]}),"uiSchema.x-component-props.timeFormat":f({},F.cloneDeep(P["uiSchema.x-component-props.timeFormat"]))};class X extends r.CollectionFieldInterface{constructor(){super(...arguments),this.name="formula",this.type="object",this.group="advanced",this.order=1,this.title=`{{t("Formula", { ns: "${h}" })}}`,this.icon="FunctionOutlined",this.description=`{{t("Configure and store the results of calculations between multiple field values in the same record, supporting both Math.js and Excel formula functions.", { ns: "${h}" })}}`,this.sortable=!0,this.default={type:"formula",uiSchema:{type:"string","x-component":"Formula.Result","x-component-props":{stringMode:!0,step:"1"},"x-read-pretty":!0}},this.properties=y(f(y(f({},L),{dataType:{type:"string",title:'{{t("Storage type")}}',"x-decorator":"FormItem","x-component":"Select","x-disabled":"{{ !createOnly }}",enum:[{value:"boolean",label:"Boolean"},{value:"integer",label:"Integer"},{value:"bigInt",label:"Big integer"},{value:"double",label:"Double"},{value:"string",label:"String"},{value:"date",label:"Datetime"}],required:!0,default:"double"},"uiSchema.x-component-props.addonAfter":{type:"string",title:'{{t("Suffix")}}',"x-decorator":"FormItem","x-component":"Input"},"uiSchema.x-component-props.step":{type:"string",title:'{{t("Precision")}}',"x-component":"Select","x-decorator":"FormItem",required:!0,default:"0",enum:[{value:"0",label:"1"},{value:"0.1",label:"1.0"},{value:"0.01",label:"1.00"},{value:"0.001",label:"1.000"},{value:"0.0001",label:"1.0000"},{value:"0.00001",label:"1.00000"}],"x-reactions":K}}),W),{engine:{type:"string",title:`{{t("Calculation engine", { ns: "${h}" })}}`,"x-decorator":"FormItem","x-component":"Radio.Group",enum:Array.from(b.evaluators.getEntities()).reduce((t,[u,a])=>t.concat(f({value:u},a)),[]),required:!0,default:"math.js"},expression:{type:"string",title:`{{t("Expression", { ns: "${h}" })}}`,required:!0,"x-component":"Formula.Expression","x-decorator":"FormItem","x-component-props":{supports:["checkbox","number","percent","integer","number","percent","sequence","input","textarea","email","phone","datetime","createdAt","updatedAt","radioGroup","checkboxGroup","select","multipleSelect"],useCurrentFields:"{{ useCurrentFields }}"},"x-reactions":{dependencies:["engine"],fulfill:{schema:{description:"{{renderExpressionDescription($deps[0])}}"}}},"x-validator"(t,u,{form:a}){const{values:i}=a,{evaluate:p}=b.evaluators.get(i.engine),d=t.trim().replace(/{{\s*([^{}]+)\s*}}/g,"1");try{return p(d),""}catch(g){return r.i18n.t("Expression syntax error",{ns:h})}}}}),this.filterable={operators:Q.string},this.titleUsable=!0}}function Y(e){const t=b.evaluators.get(e);return t!=null&&t.link?s.jsxs(s.Fragment,{children:[s.jsx("span",{className:r.css`
|
|
2
2
|
&:after {
|
|
3
3
|
content: ':';
|
|
4
4
|
}
|
|
5
5
|
& + a {
|
|
6
6
|
margin-left: 0.25em;
|
|
7
7
|
}
|
|
8
|
-
`,children:r.i18n.t("Syntax references",{ns:h})}),s.jsx("a",{href:t.link,target:"_blank",rel:"noreferrer",children:t.label})]}):null}class j extends r.Plugin{load(){return
|
|
8
|
+
`,children:r.i18n.t("Syntax references",{ns:h})}),s.jsx("a",{href:t.link,target:"_blank",rel:"noreferrer",children:t.label})]}):null}class j extends r.Plugin{load(){return G(this,null,function*(){this.app.addComponents({Formula:D}),this.app.addScopes({renderExpressionDescription:Y}),this.app.dataSourceManager.addFieldInterfaces([X])})}}n.FormulaFieldPlugin=j,n.default=j,Object.defineProperties(n,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
@@ -5,6 +5,7 @@ export declare class FormulaFieldInterface extends CollectionFieldInterface {
|
|
|
5
5
|
group: string;
|
|
6
6
|
order: number;
|
|
7
7
|
title: string;
|
|
8
|
+
icon: string;
|
|
8
9
|
description: string;
|
|
9
10
|
sortable: boolean;
|
|
10
11
|
default: {
|
|
@@ -51,521 +52,9 @@ export declare class FormulaFieldInterface extends CollectionFieldInterface {
|
|
|
51
52
|
form: any;
|
|
52
53
|
}): string;
|
|
53
54
|
};
|
|
54
|
-
'uiSchema.x-component-props.dateFormat':
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
fulfill: {
|
|
58
|
-
state: {
|
|
59
|
-
display: string;
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
}[];
|
|
63
|
-
version?: string | (string & {});
|
|
64
|
-
name?: import("@tachybase/schema").SchemaKey | (string & {});
|
|
65
|
-
title?: any;
|
|
66
|
-
description?: any;
|
|
67
|
-
default?: any;
|
|
68
|
-
readOnly?: boolean | (string & {});
|
|
69
|
-
writeOnly?: boolean | (string & {});
|
|
70
|
-
type?: import("@tachybase/schema").SchemaTypes;
|
|
71
|
-
enum?: (string & {}) | import("@tachybase/schema").SchemaEnum<any>;
|
|
72
|
-
const?: any;
|
|
73
|
-
multipleOf?: number | (string & {});
|
|
74
|
-
maximum?: number | (string & {});
|
|
75
|
-
exclusiveMaximum?: number | (string & {});
|
|
76
|
-
minimum?: number | (string & {});
|
|
77
|
-
exclusiveMinimum?: number | (string & {});
|
|
78
|
-
maxLength?: number | (string & {});
|
|
79
|
-
minLength?: number | (string & {});
|
|
80
|
-
pattern?: string | RegExp | (string & {});
|
|
81
|
-
maxItems?: number | (string & {});
|
|
82
|
-
minItems?: number | (string & {});
|
|
83
|
-
uniqueItems?: boolean | (string & {});
|
|
84
|
-
maxProperties?: number | (string & {});
|
|
85
|
-
minProperties?: number | (string & {});
|
|
86
|
-
required?: string | boolean | string[] | (string & {});
|
|
87
|
-
format?: string | (string & {});
|
|
88
|
-
$ref?: string | (string & {});
|
|
89
|
-
$namespace?: string | (string & {});
|
|
90
|
-
definitions?: (string & {}) | import("@tachybase/schema").SchemaProperties<any, any, any, any, any, any, any, any>;
|
|
91
|
-
properties?: (string & {}) | import("@tachybase/schema").SchemaProperties<any, any, any, any, any, any, any, any>;
|
|
92
|
-
items?: (string & {}) | import("@tachybase/schema").SchemaItems<any, any, any, any, any, any, any, any>;
|
|
93
|
-
additionalItems?: (string & {}) | import("@tachybase/schema").Stringify<{
|
|
94
|
-
[key: symbol]: any;
|
|
95
|
-
[key: `x-${string}`]: any;
|
|
96
|
-
[key: `x-${number}`]: any;
|
|
97
|
-
version?: string;
|
|
98
|
-
name?: import("@tachybase/schema").SchemaKey;
|
|
99
|
-
title?: any;
|
|
100
|
-
description?: any;
|
|
101
|
-
default?: any;
|
|
102
|
-
readOnly?: boolean;
|
|
103
|
-
writeOnly?: boolean;
|
|
104
|
-
type?: import("@tachybase/schema").SchemaTypes;
|
|
105
|
-
enum?: import("@tachybase/schema").SchemaEnum<any>;
|
|
106
|
-
const?: any;
|
|
107
|
-
multipleOf?: number;
|
|
108
|
-
maximum?: number;
|
|
109
|
-
exclusiveMaximum?: number;
|
|
110
|
-
minimum?: number;
|
|
111
|
-
exclusiveMinimum?: number;
|
|
112
|
-
maxLength?: number;
|
|
113
|
-
minLength?: number;
|
|
114
|
-
pattern?: string | RegExp;
|
|
115
|
-
maxItems?: number;
|
|
116
|
-
minItems?: number;
|
|
117
|
-
uniqueItems?: boolean;
|
|
118
|
-
maxProperties?: number;
|
|
119
|
-
minProperties?: number;
|
|
120
|
-
required?: string[] | boolean | string;
|
|
121
|
-
format?: string;
|
|
122
|
-
$ref?: string;
|
|
123
|
-
$namespace?: string;
|
|
124
|
-
definitions?: import("@tachybase/schema").SchemaProperties<any, any, any, any, any, any, any, any>;
|
|
125
|
-
properties?: import("@tachybase/schema").SchemaProperties<any, any, any, any, any, any, any, any>;
|
|
126
|
-
items?: import("@tachybase/schema").SchemaItems<any, any, any, any, any, any, any, any>;
|
|
127
|
-
additionalItems?: import("@tachybase/schema").Stringify</*elided*/ any>;
|
|
128
|
-
patternProperties?: import("@tachybase/schema").SchemaProperties<any, any, any, any, any, any, any, any>;
|
|
129
|
-
additionalProperties?: import("@tachybase/schema").Stringify</*elided*/ any>;
|
|
130
|
-
"x-value"?: any;
|
|
131
|
-
"x-index"?: number;
|
|
132
|
-
"x-pattern"?: any;
|
|
133
|
-
"x-display"?: any;
|
|
134
|
-
"x-validator"?: any;
|
|
135
|
-
"x-decorator"?: any;
|
|
136
|
-
"x-decorator-props"?: any;
|
|
137
|
-
"x-component"?: any;
|
|
138
|
-
"x-component-props"?: any;
|
|
139
|
-
"x-reactions"?: import("@tachybase/schema").SchemaReactions<any>;
|
|
140
|
-
"x-content"?: any;
|
|
141
|
-
"x-data"?: any;
|
|
142
|
-
"x-visible"?: boolean;
|
|
143
|
-
"x-hidden"?: boolean;
|
|
144
|
-
"x-disabled"?: boolean;
|
|
145
|
-
"x-editable"?: boolean;
|
|
146
|
-
"x-read-only"?: boolean;
|
|
147
|
-
"x-read-pretty"?: boolean;
|
|
148
|
-
"x-compile-omitted"?: string[];
|
|
149
|
-
}>;
|
|
150
|
-
patternProperties?: (string & {}) | import("@tachybase/schema").SchemaProperties<any, any, any, any, any, any, any, any>;
|
|
151
|
-
additionalProperties?: (string & {}) | import("@tachybase/schema").Stringify<{
|
|
152
|
-
[key: symbol]: any;
|
|
153
|
-
[key: `x-${string}`]: any;
|
|
154
|
-
[key: `x-${number}`]: any;
|
|
155
|
-
version?: string;
|
|
156
|
-
name?: import("@tachybase/schema").SchemaKey;
|
|
157
|
-
title?: any;
|
|
158
|
-
description?: any;
|
|
159
|
-
default?: any;
|
|
160
|
-
readOnly?: boolean;
|
|
161
|
-
writeOnly?: boolean;
|
|
162
|
-
type?: import("@tachybase/schema").SchemaTypes;
|
|
163
|
-
enum?: import("@tachybase/schema").SchemaEnum<any>;
|
|
164
|
-
const?: any;
|
|
165
|
-
multipleOf?: number;
|
|
166
|
-
maximum?: number;
|
|
167
|
-
exclusiveMaximum?: number;
|
|
168
|
-
minimum?: number;
|
|
169
|
-
exclusiveMinimum?: number;
|
|
170
|
-
maxLength?: number;
|
|
171
|
-
minLength?: number;
|
|
172
|
-
pattern?: string | RegExp;
|
|
173
|
-
maxItems?: number;
|
|
174
|
-
minItems?: number;
|
|
175
|
-
uniqueItems?: boolean;
|
|
176
|
-
maxProperties?: number;
|
|
177
|
-
minProperties?: number;
|
|
178
|
-
required?: string[] | boolean | string;
|
|
179
|
-
format?: string;
|
|
180
|
-
$ref?: string;
|
|
181
|
-
$namespace?: string;
|
|
182
|
-
definitions?: import("@tachybase/schema").SchemaProperties<any, any, any, any, any, any, any, any>;
|
|
183
|
-
properties?: import("@tachybase/schema").SchemaProperties<any, any, any, any, any, any, any, any>;
|
|
184
|
-
items?: import("@tachybase/schema").SchemaItems<any, any, any, any, any, any, any, any>;
|
|
185
|
-
additionalItems?: import("@tachybase/schema").Stringify</*elided*/ any>;
|
|
186
|
-
patternProperties?: import("@tachybase/schema").SchemaProperties<any, any, any, any, any, any, any, any>;
|
|
187
|
-
additionalProperties?: import("@tachybase/schema").Stringify</*elided*/ any>;
|
|
188
|
-
"x-value"?: any;
|
|
189
|
-
"x-index"?: number;
|
|
190
|
-
"x-pattern"?: any;
|
|
191
|
-
"x-display"?: any;
|
|
192
|
-
"x-validator"?: any;
|
|
193
|
-
"x-decorator"?: any;
|
|
194
|
-
"x-decorator-props"?: any;
|
|
195
|
-
"x-component"?: any;
|
|
196
|
-
"x-component-props"?: any;
|
|
197
|
-
"x-reactions"?: import("@tachybase/schema").SchemaReactions<any>;
|
|
198
|
-
"x-content"?: any;
|
|
199
|
-
"x-data"?: any;
|
|
200
|
-
"x-visible"?: boolean;
|
|
201
|
-
"x-hidden"?: boolean;
|
|
202
|
-
"x-disabled"?: boolean;
|
|
203
|
-
"x-editable"?: boolean;
|
|
204
|
-
"x-read-only"?: boolean;
|
|
205
|
-
"x-read-pretty"?: boolean;
|
|
206
|
-
"x-compile-omitted"?: string[];
|
|
207
|
-
}>;
|
|
208
|
-
"x-value"?: any;
|
|
209
|
-
"x-index"?: number | (string & {});
|
|
210
|
-
"x-pattern"?: any;
|
|
211
|
-
"x-display"?: any;
|
|
212
|
-
"x-validator"?: any;
|
|
213
|
-
"x-decorator"?: any;
|
|
214
|
-
"x-decorator-props"?: any;
|
|
215
|
-
"x-component"?: any;
|
|
216
|
-
"x-component-props"?: any;
|
|
217
|
-
"x-content"?: any;
|
|
218
|
-
"x-data"?: any;
|
|
219
|
-
"x-visible"?: boolean | (string & {});
|
|
220
|
-
"x-hidden"?: boolean | (string & {});
|
|
221
|
-
"x-disabled"?: boolean | (string & {});
|
|
222
|
-
"x-editable"?: boolean | (string & {});
|
|
223
|
-
"x-read-only"?: boolean | (string & {});
|
|
224
|
-
"x-read-pretty"?: boolean | (string & {});
|
|
225
|
-
"x-compile-omitted"?: string[] | (string & {});
|
|
226
|
-
};
|
|
227
|
-
'uiSchema.x-component-props.showTime': {
|
|
228
|
-
'x-reactions': (string | {
|
|
229
|
-
dependencies: string[];
|
|
230
|
-
fulfill: {
|
|
231
|
-
state: {
|
|
232
|
-
display: string;
|
|
233
|
-
};
|
|
234
|
-
};
|
|
235
|
-
})[];
|
|
236
|
-
version?: string | (string & {});
|
|
237
|
-
name?: import("@tachybase/schema").SchemaKey | (string & {});
|
|
238
|
-
title?: any;
|
|
239
|
-
description?: any;
|
|
240
|
-
default?: any;
|
|
241
|
-
readOnly?: boolean | (string & {});
|
|
242
|
-
writeOnly?: boolean | (string & {});
|
|
243
|
-
type?: import("@tachybase/schema").SchemaTypes;
|
|
244
|
-
enum?: (string & {}) | import("@tachybase/schema").SchemaEnum<any>;
|
|
245
|
-
const?: any;
|
|
246
|
-
multipleOf?: number | (string & {});
|
|
247
|
-
maximum?: number | (string & {});
|
|
248
|
-
exclusiveMaximum?: number | (string & {});
|
|
249
|
-
minimum?: number | (string & {});
|
|
250
|
-
exclusiveMinimum?: number | (string & {});
|
|
251
|
-
maxLength?: number | (string & {});
|
|
252
|
-
minLength?: number | (string & {});
|
|
253
|
-
pattern?: string | RegExp | (string & {});
|
|
254
|
-
maxItems?: number | (string & {});
|
|
255
|
-
minItems?: number | (string & {});
|
|
256
|
-
uniqueItems?: boolean | (string & {});
|
|
257
|
-
maxProperties?: number | (string & {});
|
|
258
|
-
minProperties?: number | (string & {});
|
|
259
|
-
required?: string | boolean | string[] | (string & {});
|
|
260
|
-
format?: string | (string & {});
|
|
261
|
-
$ref?: string | (string & {});
|
|
262
|
-
$namespace?: string | (string & {});
|
|
263
|
-
definitions?: (string & {}) | import("@tachybase/schema").SchemaProperties<any, any, any, any, any, any, any, any>;
|
|
264
|
-
properties?: (string & {}) | import("@tachybase/schema").SchemaProperties<any, any, any, any, any, any, any, any>;
|
|
265
|
-
items?: (string & {}) | import("@tachybase/schema").SchemaItems<any, any, any, any, any, any, any, any>;
|
|
266
|
-
additionalItems?: (string & {}) | import("@tachybase/schema").Stringify<{
|
|
267
|
-
[key: symbol]: any;
|
|
268
|
-
[key: `x-${string}`]: any;
|
|
269
|
-
[key: `x-${number}`]: any;
|
|
270
|
-
version?: string;
|
|
271
|
-
name?: import("@tachybase/schema").SchemaKey;
|
|
272
|
-
title?: any;
|
|
273
|
-
description?: any;
|
|
274
|
-
default?: any;
|
|
275
|
-
readOnly?: boolean;
|
|
276
|
-
writeOnly?: boolean;
|
|
277
|
-
type?: import("@tachybase/schema").SchemaTypes;
|
|
278
|
-
enum?: import("@tachybase/schema").SchemaEnum<any>;
|
|
279
|
-
const?: any;
|
|
280
|
-
multipleOf?: number;
|
|
281
|
-
maximum?: number;
|
|
282
|
-
exclusiveMaximum?: number;
|
|
283
|
-
minimum?: number;
|
|
284
|
-
exclusiveMinimum?: number;
|
|
285
|
-
maxLength?: number;
|
|
286
|
-
minLength?: number;
|
|
287
|
-
pattern?: string | RegExp;
|
|
288
|
-
maxItems?: number;
|
|
289
|
-
minItems?: number;
|
|
290
|
-
uniqueItems?: boolean;
|
|
291
|
-
maxProperties?: number;
|
|
292
|
-
minProperties?: number;
|
|
293
|
-
required?: string[] | boolean | string;
|
|
294
|
-
format?: string;
|
|
295
|
-
$ref?: string;
|
|
296
|
-
$namespace?: string;
|
|
297
|
-
definitions?: import("@tachybase/schema").SchemaProperties<any, any, any, any, any, any, any, any>;
|
|
298
|
-
properties?: import("@tachybase/schema").SchemaProperties<any, any, any, any, any, any, any, any>;
|
|
299
|
-
items?: import("@tachybase/schema").SchemaItems<any, any, any, any, any, any, any, any>;
|
|
300
|
-
additionalItems?: import("@tachybase/schema").Stringify</*elided*/ any>;
|
|
301
|
-
patternProperties?: import("@tachybase/schema").SchemaProperties<any, any, any, any, any, any, any, any>;
|
|
302
|
-
additionalProperties?: import("@tachybase/schema").Stringify</*elided*/ any>;
|
|
303
|
-
"x-value"?: any;
|
|
304
|
-
"x-index"?: number;
|
|
305
|
-
"x-pattern"?: any;
|
|
306
|
-
"x-display"?: any;
|
|
307
|
-
"x-validator"?: any;
|
|
308
|
-
"x-decorator"?: any;
|
|
309
|
-
"x-decorator-props"?: any;
|
|
310
|
-
"x-component"?: any;
|
|
311
|
-
"x-component-props"?: any;
|
|
312
|
-
"x-reactions"?: import("@tachybase/schema").SchemaReactions<any>;
|
|
313
|
-
"x-content"?: any;
|
|
314
|
-
"x-data"?: any;
|
|
315
|
-
"x-visible"?: boolean;
|
|
316
|
-
"x-hidden"?: boolean;
|
|
317
|
-
"x-disabled"?: boolean;
|
|
318
|
-
"x-editable"?: boolean;
|
|
319
|
-
"x-read-only"?: boolean;
|
|
320
|
-
"x-read-pretty"?: boolean;
|
|
321
|
-
"x-compile-omitted"?: string[];
|
|
322
|
-
}>;
|
|
323
|
-
patternProperties?: (string & {}) | import("@tachybase/schema").SchemaProperties<any, any, any, any, any, any, any, any>;
|
|
324
|
-
additionalProperties?: (string & {}) | import("@tachybase/schema").Stringify<{
|
|
325
|
-
[key: symbol]: any;
|
|
326
|
-
[key: `x-${string}`]: any;
|
|
327
|
-
[key: `x-${number}`]: any;
|
|
328
|
-
version?: string;
|
|
329
|
-
name?: import("@tachybase/schema").SchemaKey;
|
|
330
|
-
title?: any;
|
|
331
|
-
description?: any;
|
|
332
|
-
default?: any;
|
|
333
|
-
readOnly?: boolean;
|
|
334
|
-
writeOnly?: boolean;
|
|
335
|
-
type?: import("@tachybase/schema").SchemaTypes;
|
|
336
|
-
enum?: import("@tachybase/schema").SchemaEnum<any>;
|
|
337
|
-
const?: any;
|
|
338
|
-
multipleOf?: number;
|
|
339
|
-
maximum?: number;
|
|
340
|
-
exclusiveMaximum?: number;
|
|
341
|
-
minimum?: number;
|
|
342
|
-
exclusiveMinimum?: number;
|
|
343
|
-
maxLength?: number;
|
|
344
|
-
minLength?: number;
|
|
345
|
-
pattern?: string | RegExp;
|
|
346
|
-
maxItems?: number;
|
|
347
|
-
minItems?: number;
|
|
348
|
-
uniqueItems?: boolean;
|
|
349
|
-
maxProperties?: number;
|
|
350
|
-
minProperties?: number;
|
|
351
|
-
required?: string[] | boolean | string;
|
|
352
|
-
format?: string;
|
|
353
|
-
$ref?: string;
|
|
354
|
-
$namespace?: string;
|
|
355
|
-
definitions?: import("@tachybase/schema").SchemaProperties<any, any, any, any, any, any, any, any>;
|
|
356
|
-
properties?: import("@tachybase/schema").SchemaProperties<any, any, any, any, any, any, any, any>;
|
|
357
|
-
items?: import("@tachybase/schema").SchemaItems<any, any, any, any, any, any, any, any>;
|
|
358
|
-
additionalItems?: import("@tachybase/schema").Stringify</*elided*/ any>;
|
|
359
|
-
patternProperties?: import("@tachybase/schema").SchemaProperties<any, any, any, any, any, any, any, any>;
|
|
360
|
-
additionalProperties?: import("@tachybase/schema").Stringify</*elided*/ any>;
|
|
361
|
-
"x-value"?: any;
|
|
362
|
-
"x-index"?: number;
|
|
363
|
-
"x-pattern"?: any;
|
|
364
|
-
"x-display"?: any;
|
|
365
|
-
"x-validator"?: any;
|
|
366
|
-
"x-decorator"?: any;
|
|
367
|
-
"x-decorator-props"?: any;
|
|
368
|
-
"x-component"?: any;
|
|
369
|
-
"x-component-props"?: any;
|
|
370
|
-
"x-reactions"?: import("@tachybase/schema").SchemaReactions<any>;
|
|
371
|
-
"x-content"?: any;
|
|
372
|
-
"x-data"?: any;
|
|
373
|
-
"x-visible"?: boolean;
|
|
374
|
-
"x-hidden"?: boolean;
|
|
375
|
-
"x-disabled"?: boolean;
|
|
376
|
-
"x-editable"?: boolean;
|
|
377
|
-
"x-read-only"?: boolean;
|
|
378
|
-
"x-read-pretty"?: boolean;
|
|
379
|
-
"x-compile-omitted"?: string[];
|
|
380
|
-
}>;
|
|
381
|
-
"x-value"?: any;
|
|
382
|
-
"x-index"?: number | (string & {});
|
|
383
|
-
"x-pattern"?: any;
|
|
384
|
-
"x-display"?: any;
|
|
385
|
-
"x-validator"?: any;
|
|
386
|
-
"x-decorator"?: any;
|
|
387
|
-
"x-decorator-props"?: any;
|
|
388
|
-
"x-component"?: any;
|
|
389
|
-
"x-component-props"?: any;
|
|
390
|
-
"x-content"?: any;
|
|
391
|
-
"x-data"?: any;
|
|
392
|
-
"x-visible"?: boolean | (string & {});
|
|
393
|
-
"x-hidden"?: boolean | (string & {});
|
|
394
|
-
"x-disabled"?: boolean | (string & {});
|
|
395
|
-
"x-editable"?: boolean | (string & {});
|
|
396
|
-
"x-read-only"?: boolean | (string & {});
|
|
397
|
-
"x-read-pretty"?: boolean | (string & {});
|
|
398
|
-
"x-compile-omitted"?: string[] | (string & {});
|
|
399
|
-
};
|
|
400
|
-
'uiSchema.x-component-props.timeFormat': {
|
|
401
|
-
[x: symbol]: any;
|
|
402
|
-
[x: `x-${string}`]: any;
|
|
403
|
-
[x: `x-${number}`]: any;
|
|
404
|
-
version?: string | (string & {});
|
|
405
|
-
name?: import("@tachybase/schema").SchemaKey | (string & {});
|
|
406
|
-
title?: any;
|
|
407
|
-
description?: any;
|
|
408
|
-
default?: any;
|
|
409
|
-
readOnly?: boolean | (string & {});
|
|
410
|
-
writeOnly?: boolean | (string & {});
|
|
411
|
-
type?: import("@tachybase/schema").SchemaTypes;
|
|
412
|
-
enum?: (string & {}) | import("@tachybase/schema").SchemaEnum<any>;
|
|
413
|
-
const?: any;
|
|
414
|
-
multipleOf?: number | (string & {});
|
|
415
|
-
maximum?: number | (string & {});
|
|
416
|
-
exclusiveMaximum?: number | (string & {});
|
|
417
|
-
minimum?: number | (string & {});
|
|
418
|
-
exclusiveMinimum?: number | (string & {});
|
|
419
|
-
maxLength?: number | (string & {});
|
|
420
|
-
minLength?: number | (string & {});
|
|
421
|
-
pattern?: string | RegExp | (string & {});
|
|
422
|
-
maxItems?: number | (string & {});
|
|
423
|
-
minItems?: number | (string & {});
|
|
424
|
-
uniqueItems?: boolean | (string & {});
|
|
425
|
-
maxProperties?: number | (string & {});
|
|
426
|
-
minProperties?: number | (string & {});
|
|
427
|
-
required?: string | boolean | string[] | (string & {});
|
|
428
|
-
format?: string | (string & {});
|
|
429
|
-
$ref?: string | (string & {});
|
|
430
|
-
$namespace?: string | (string & {});
|
|
431
|
-
definitions?: (string & {}) | import("@tachybase/schema").SchemaProperties<any, any, any, any, any, any, any, any>;
|
|
432
|
-
properties?: (string & {}) | import("@tachybase/schema").SchemaProperties<any, any, any, any, any, any, any, any>;
|
|
433
|
-
items?: (string & {}) | import("@tachybase/schema").SchemaItems<any, any, any, any, any, any, any, any>;
|
|
434
|
-
additionalItems?: (string & {}) | import("@tachybase/schema").Stringify<{
|
|
435
|
-
[key: symbol]: any;
|
|
436
|
-
[key: `x-${string}`]: any;
|
|
437
|
-
[key: `x-${number}`]: any;
|
|
438
|
-
version?: string;
|
|
439
|
-
name?: import("@tachybase/schema").SchemaKey;
|
|
440
|
-
title?: any;
|
|
441
|
-
description?: any;
|
|
442
|
-
default?: any;
|
|
443
|
-
readOnly?: boolean;
|
|
444
|
-
writeOnly?: boolean;
|
|
445
|
-
type?: import("@tachybase/schema").SchemaTypes;
|
|
446
|
-
enum?: import("@tachybase/schema").SchemaEnum<any>;
|
|
447
|
-
const?: any;
|
|
448
|
-
multipleOf?: number;
|
|
449
|
-
maximum?: number;
|
|
450
|
-
exclusiveMaximum?: number;
|
|
451
|
-
minimum?: number;
|
|
452
|
-
exclusiveMinimum?: number;
|
|
453
|
-
maxLength?: number;
|
|
454
|
-
minLength?: number;
|
|
455
|
-
pattern?: string | RegExp;
|
|
456
|
-
maxItems?: number;
|
|
457
|
-
minItems?: number;
|
|
458
|
-
uniqueItems?: boolean;
|
|
459
|
-
maxProperties?: number;
|
|
460
|
-
minProperties?: number;
|
|
461
|
-
required?: string[] | boolean | string;
|
|
462
|
-
format?: string;
|
|
463
|
-
$ref?: string;
|
|
464
|
-
$namespace?: string;
|
|
465
|
-
definitions?: import("@tachybase/schema").SchemaProperties<any, any, any, any, any, any, any, any>;
|
|
466
|
-
properties?: import("@tachybase/schema").SchemaProperties<any, any, any, any, any, any, any, any>;
|
|
467
|
-
items?: import("@tachybase/schema").SchemaItems<any, any, any, any, any, any, any, any>;
|
|
468
|
-
additionalItems?: import("@tachybase/schema").Stringify</*elided*/ any>;
|
|
469
|
-
patternProperties?: import("@tachybase/schema").SchemaProperties<any, any, any, any, any, any, any, any>;
|
|
470
|
-
additionalProperties?: import("@tachybase/schema").Stringify</*elided*/ any>;
|
|
471
|
-
"x-value"?: any;
|
|
472
|
-
"x-index"?: number;
|
|
473
|
-
"x-pattern"?: any;
|
|
474
|
-
"x-display"?: any;
|
|
475
|
-
"x-validator"?: any;
|
|
476
|
-
"x-decorator"?: any;
|
|
477
|
-
"x-decorator-props"?: any;
|
|
478
|
-
"x-component"?: any;
|
|
479
|
-
"x-component-props"?: any;
|
|
480
|
-
"x-reactions"?: import("@tachybase/schema").SchemaReactions<any>;
|
|
481
|
-
"x-content"?: any;
|
|
482
|
-
"x-data"?: any;
|
|
483
|
-
"x-visible"?: boolean;
|
|
484
|
-
"x-hidden"?: boolean;
|
|
485
|
-
"x-disabled"?: boolean;
|
|
486
|
-
"x-editable"?: boolean;
|
|
487
|
-
"x-read-only"?: boolean;
|
|
488
|
-
"x-read-pretty"?: boolean;
|
|
489
|
-
"x-compile-omitted"?: string[];
|
|
490
|
-
}>;
|
|
491
|
-
patternProperties?: (string & {}) | import("@tachybase/schema").SchemaProperties<any, any, any, any, any, any, any, any>;
|
|
492
|
-
additionalProperties?: (string & {}) | import("@tachybase/schema").Stringify<{
|
|
493
|
-
[key: symbol]: any;
|
|
494
|
-
[key: `x-${string}`]: any;
|
|
495
|
-
[key: `x-${number}`]: any;
|
|
496
|
-
version?: string;
|
|
497
|
-
name?: import("@tachybase/schema").SchemaKey;
|
|
498
|
-
title?: any;
|
|
499
|
-
description?: any;
|
|
500
|
-
default?: any;
|
|
501
|
-
readOnly?: boolean;
|
|
502
|
-
writeOnly?: boolean;
|
|
503
|
-
type?: import("@tachybase/schema").SchemaTypes;
|
|
504
|
-
enum?: import("@tachybase/schema").SchemaEnum<any>;
|
|
505
|
-
const?: any;
|
|
506
|
-
multipleOf?: number;
|
|
507
|
-
maximum?: number;
|
|
508
|
-
exclusiveMaximum?: number;
|
|
509
|
-
minimum?: number;
|
|
510
|
-
exclusiveMinimum?: number;
|
|
511
|
-
maxLength?: number;
|
|
512
|
-
minLength?: number;
|
|
513
|
-
pattern?: string | RegExp;
|
|
514
|
-
maxItems?: number;
|
|
515
|
-
minItems?: number;
|
|
516
|
-
uniqueItems?: boolean;
|
|
517
|
-
maxProperties?: number;
|
|
518
|
-
minProperties?: number;
|
|
519
|
-
required?: string[] | boolean | string;
|
|
520
|
-
format?: string;
|
|
521
|
-
$ref?: string;
|
|
522
|
-
$namespace?: string;
|
|
523
|
-
definitions?: import("@tachybase/schema").SchemaProperties<any, any, any, any, any, any, any, any>;
|
|
524
|
-
properties?: import("@tachybase/schema").SchemaProperties<any, any, any, any, any, any, any, any>;
|
|
525
|
-
items?: import("@tachybase/schema").SchemaItems<any, any, any, any, any, any, any, any>;
|
|
526
|
-
additionalItems?: import("@tachybase/schema").Stringify</*elided*/ any>;
|
|
527
|
-
patternProperties?: import("@tachybase/schema").SchemaProperties<any, any, any, any, any, any, any, any>;
|
|
528
|
-
additionalProperties?: import("@tachybase/schema").Stringify</*elided*/ any>;
|
|
529
|
-
"x-value"?: any;
|
|
530
|
-
"x-index"?: number;
|
|
531
|
-
"x-pattern"?: any;
|
|
532
|
-
"x-display"?: any;
|
|
533
|
-
"x-validator"?: any;
|
|
534
|
-
"x-decorator"?: any;
|
|
535
|
-
"x-decorator-props"?: any;
|
|
536
|
-
"x-component"?: any;
|
|
537
|
-
"x-component-props"?: any;
|
|
538
|
-
"x-reactions"?: import("@tachybase/schema").SchemaReactions<any>;
|
|
539
|
-
"x-content"?: any;
|
|
540
|
-
"x-data"?: any;
|
|
541
|
-
"x-visible"?: boolean;
|
|
542
|
-
"x-hidden"?: boolean;
|
|
543
|
-
"x-disabled"?: boolean;
|
|
544
|
-
"x-editable"?: boolean;
|
|
545
|
-
"x-read-only"?: boolean;
|
|
546
|
-
"x-read-pretty"?: boolean;
|
|
547
|
-
"x-compile-omitted"?: string[];
|
|
548
|
-
}>;
|
|
549
|
-
"x-value"?: any;
|
|
550
|
-
"x-index"?: number | (string & {});
|
|
551
|
-
"x-pattern"?: any;
|
|
552
|
-
"x-display"?: any;
|
|
553
|
-
"x-validator"?: any;
|
|
554
|
-
"x-decorator"?: any;
|
|
555
|
-
"x-decorator-props"?: any;
|
|
556
|
-
"x-component"?: any;
|
|
557
|
-
"x-component-props"?: any;
|
|
558
|
-
"x-reactions"?: (string & {}) | import("@tachybase/schema").SchemaReactions<any>;
|
|
559
|
-
"x-content"?: any;
|
|
560
|
-
"x-data"?: any;
|
|
561
|
-
"x-visible"?: boolean | (string & {});
|
|
562
|
-
"x-hidden"?: boolean | (string & {});
|
|
563
|
-
"x-disabled"?: boolean | (string & {});
|
|
564
|
-
"x-editable"?: boolean | (string & {});
|
|
565
|
-
"x-read-only"?: boolean | (string & {});
|
|
566
|
-
"x-read-pretty"?: boolean | (string & {});
|
|
567
|
-
"x-compile-omitted"?: string[] | (string & {});
|
|
568
|
-
};
|
|
55
|
+
'uiSchema.x-component-props.dateFormat': any;
|
|
56
|
+
'uiSchema.x-component-props.showTime': any;
|
|
57
|
+
'uiSchema.x-component-props.timeFormat': any;
|
|
569
58
|
dataType: {
|
|
570
59
|
type: string;
|
|
571
60
|
title: string;
|
package/dist/externalVersion.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
"@tachybase/client": "1.3.
|
|
2
|
+
"@tachybase/client": "1.3.24",
|
|
3
3
|
"react": "18.3.1",
|
|
4
|
-
"@tego/client": "1.3.
|
|
5
|
-
"@tego/server": "1.3.
|
|
4
|
+
"@tego/client": "1.3.49",
|
|
5
|
+
"@tego/server": "1.3.49",
|
|
6
|
+
"lodash": "4.17.21",
|
|
6
7
|
"react-i18next": "15.2.0",
|
|
7
|
-
"@tachybase/schema": "1.3.
|
|
8
|
+
"@tachybase/schema": "1.3.49"
|
|
8
9
|
};
|
package/package.json
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tachybase/plugin-field-formula",
|
|
3
3
|
"displayName": "Field: Formula",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.24",
|
|
5
5
|
"description": "Configure and store the results of calculations between multiple field values in the same record, supporting both Math.js and Excel formula functions.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"Collection fields"
|
|
8
8
|
],
|
|
9
9
|
"license": "Apache-2.0",
|
|
10
10
|
"main": "./dist/server/index.js",
|
|
11
|
-
"dependencies": {},
|
|
12
11
|
"devDependencies": {
|
|
13
|
-
"@tachybase/schema": "^1.3.
|
|
14
|
-
"@tachybase/test": "^1.3.
|
|
15
|
-
"@tego/client": "^1.3.
|
|
16
|
-
"@tego/server": "^1.3.
|
|
12
|
+
"@tachybase/schema": "^1.3.49",
|
|
13
|
+
"@tachybase/test": "^1.3.49",
|
|
14
|
+
"@tego/client": "^1.3.49",
|
|
15
|
+
"@tego/server": "^1.3.49",
|
|
16
|
+
"dayjs": "^1.11.13",
|
|
17
|
+
"lodash": "^4.17.21",
|
|
17
18
|
"react": "18.3.1",
|
|
18
19
|
"react-i18next": "15.2.0",
|
|
19
|
-
"@tachybase/client": "1.3.
|
|
20
|
+
"@tachybase/client": "1.3.24"
|
|
20
21
|
},
|
|
21
22
|
"description.zh-CN": "可以配置并存储同一条记录的多字段值之间的计算结果,支持 Math.js 和 Excel formula functions 两种引擎",
|
|
22
|
-
"displayName.zh-CN": "数据表字段:公式"
|
|
23
|
-
"scripts": {}
|
|
23
|
+
"displayName.zh-CN": "数据表字段:公式"
|
|
24
24
|
}
|