@nocobase/app 2.0.0-beta.20 → 2.0.0-beta.22
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/1161.7f32c8ad.async.js +40 -0
- package/dist/client/1442.fd65d046.async.js +5 -0
- package/dist/client/{1595.f3d71f31.async.js → 1595.4ba8b880.async.js} +2 -2
- package/dist/client/{1883.9a059d9c.async.js → 1883.b3a67ecd.async.js} +2 -2
- package/dist/client/{1905.b546fd90.async.js → 1905.817fe450.async.js} +3 -3
- package/dist/client/{2097.682e266e.async.js → 2097.469d41dd.async.js} +2 -2
- package/dist/client/{2380.8298c573.async.js → 2380.04c234b2.async.js} +1 -1
- package/dist/client/{2775.39407a48.async.js → 2775.3b131ed6.async.js} +5 -5
- package/dist/client/{2936.c875b061.async.js → 2936.745e500f.async.js} +4 -4
- package/dist/client/{3357.b82bd041.async.js → 3357.0dc001fc.async.js} +4 -4
- package/dist/client/341.01fc2262.async.js +28 -0
- package/dist/client/{3451.3c01f5ab.async.js → 3451.883e4b24.async.js} +3 -3
- package/dist/client/3781.16f1bb74.async.js +1 -0
- package/dist/client/{4327.a4b050e3.async.js → 4327.017d9dd5.async.js} +5 -5
- package/dist/client/{4351.57614a08.async.js → 4351.934f807d.async.js} +4 -4
- package/dist/client/{4356.c4b269d3.async.js → 4356.a3863dfa.async.js} +2 -2
- package/dist/client/{4750.bf97ff2e.async.js → 4750.0863f7b1.async.js} +2 -2
- package/dist/client/{4926.3d530cd7.async.js → 4926.5145490f.async.js} +5 -5
- package/dist/client/5501.7bed1ac8.async.js +23 -0
- package/dist/client/5662.3071d144.async.js +26 -0
- package/dist/client/6021.b3ab345b.async.js +22 -0
- package/dist/client/{645.fc351075.async.js → 645.c50250c0.async.js} +2 -2
- package/dist/client/6534.87203710.async.js +33 -0
- package/dist/client/{6747.b91a9f29.async.js → 6747.6cd202fc.async.js} +6 -6
- package/dist/client/{6920.a8417eba.async.js → 6920.e9b2edd5.async.js} +3 -3
- package/dist/client/{703.1a5ec139.async.js → 703.ee1a1177.async.js} +2 -2
- package/dist/client/7087.e5b68989.async.js +6 -0
- package/dist/client/{7483.9b86876d.async.js → 7483.48e5c2c9.async.js} +2 -2
- package/dist/client/{7764.00328ea3.async.js → 7764.f7b626cb.async.js} +1 -1
- package/dist/client/{8408.731c795f.async.js → 8408.a613a1b7.async.js} +2 -2
- package/dist/client/{8805.3ba17917.async.js → 8805.58c92f65.async.js} +3 -3
- package/dist/client/{9042.8b5abb9d.async.js → 9042.35fa27dc.async.js} +4 -4
- package/dist/client/{935.c46b3064.async.js → 935.63a37ee3.async.js} +4 -4
- package/dist/client/{95.4ac502e9.async.js → 95.cf18a56e.async.js} +2 -2
- package/dist/client/9844.acade9ed.async.js +37 -0
- package/dist/client/index.html +1 -1
- package/dist/client/index.html.tpl +1 -1
- package/dist/client/p__index.e8f56d15.async.js +2605 -0
- package/dist/client/{umi.eadf9b7e.js → umi.1b77d758.js} +1 -1
- package/package.json +6 -6
- package/dist/client/1161.cfb9aa6a.async.js +0 -40
- package/dist/client/1442.1692e030.async.js +0 -5
- package/dist/client/341.3c086bf4.async.js +0 -28
- package/dist/client/5501.d2a75c24.async.js +0 -23
- package/dist/client/5662.1729c315.async.js +0 -26
- package/dist/client/6021.d883e164.async.js +0 -22
- package/dist/client/6534.8552e64c.async.js +0 -33
- package/dist/client/7087.af51c764.async.js +0 -6
- package/dist/client/9844.02aff90e.async.js +0 -37
- package/dist/client/p__index.a5ec8c6e.async.js +0 -2601
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunknocobase=self.webpackChunknocobase||[]).push([[5662,1442],{41442:function(a,n,e){e.r(n),e.d(n,{JSItemRunJSContext:function(){return t}});var _=e(72004),s=e.n(_),r=e(12444),l=e.n(r),d=e(31996),i=e.n(d),m=e(26037),u=e.n(m),c=e(67946),t=function(b){i()(o,b);var h=u()(o);function o(){return l()(this,o),h.apply(this,arguments)}return s()(o)}(c.Uo);t.define({label:"JSItem RunJS context",properties:{element:`ElementProxy instance providing a safe DOM container for form item rendering.
|
|
2
|
-
Supports innerHTML, append, and other DOM manipulation methods.`,resource:`Current resource instance (read-only).
|
|
3
|
-
Provides access to the data resource associated with the current form context.`,record:`Current record data object (read-only).
|
|
4
|
-
Contains all field values of the parent record.`},methods:{onRefReady:`Wait for form item container DOM element to be ready before executing callback.
|
|
5
|
-
Parameters: (ref: React.RefObject, callback: (element: HTMLElement) => void, timeout?: number) => void`}}),t.define({label:"JS \u8868\u5355\u9879 RunJS \u4E0A\u4E0B\u6587",properties:{element:"ElementProxy\uFF0C\u8868\u5355\u9879\u6E32\u67D3\u5BB9\u5668\uFF0C\u652F\u6301 innerHTML/append \u7B49 DOM \u64CD\u4F5C",resource:"\u5F53\u524D\u8D44\u6E90\uFF08\u53EA\u8BFB\uFF09",record:"\u5F53\u524D\u8BB0\u5F55\uFF08\u53EA\u8BFB\uFF09"},methods:{onRefReady:"\u5BB9\u5668\u5C31\u7EEA\u540E\u6267\u884C\u56DE\u8C03\u3002\u53C2\u6570\uFF1A(ref, callback, timeout?)"}},{locale:"zh-CN"})},75662:function(a,n,e){e.r(n);var _=e(41442),s={contexts:[_.JSItemRunJSContext],prefix:"sn-link-show-hide",label:"Show/hide fields based on condition",description:"Toggle multiple fields visibility based on a condition",locales:{"zh-CN":{label:"\u6761\u4EF6\u663E\u793A/\u9690\u85CF\u5B57\u6BB5",description:"\u6839\u636E\u6761\u4EF6\u6279\u91CF\u663E\u793A\u6216\u9690\u85CF\u591A\u4E2A\u5B57\u6BB5"}},content:`
|
|
6
|
-
// Show payment fields only when paymentMethod is 'online'
|
|
7
|
-
const paymentMethod = ctx.record?.paymentMethod;
|
|
8
|
-
const showPaymentFields = paymentMethod === 'online';
|
|
9
|
-
|
|
10
|
-
const items = ctx.model?.subModels?.grid?.subModels?.items;
|
|
11
|
-
const candidates = Array.isArray(items) ? items : Array.from(items?.values?.() || items || []);
|
|
12
|
-
|
|
13
|
-
// Fields to toggle
|
|
14
|
-
const fieldNames = ['creditCard', 'expiryDate', 'cvv'];
|
|
15
|
-
|
|
16
|
-
fieldNames.forEach((fieldName) => {
|
|
17
|
-
const field = candidates.find((item) => item?.props?.name === fieldName);
|
|
18
|
-
if (field) {
|
|
19
|
-
field.setProps({
|
|
20
|
-
display: showPaymentFields ? 'visible' : 'hidden',
|
|
21
|
-
// Also clear values when hiding
|
|
22
|
-
value: showPaymentFields ? field.props.value : undefined,
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
`};n.default=s}}]);
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunknocobase=self.webpackChunknocobase||[]).push([[6021,1442],{41442:function(s,n,e){e.r(n),e.d(n,{JSItemRunJSContext:function(){return r}});var t=e(72004),_=e.n(t),a=e(12444),l=e.n(a),u=e(31996),i=e.n(u),d=e(26037),m=e.n(d),c=e(67946),r=function(b){i()(o,b);var p=m()(o);function o(){return l()(this,o),p.apply(this,arguments)}return _()(o)}(c.Uo);r.define({label:"JSItem RunJS context",properties:{element:`ElementProxy instance providing a safe DOM container for form item rendering.
|
|
2
|
-
Supports innerHTML, append, and other DOM manipulation methods.`,resource:`Current resource instance (read-only).
|
|
3
|
-
Provides access to the data resource associated with the current form context.`,record:`Current record data object (read-only).
|
|
4
|
-
Contains all field values of the parent record.`},methods:{onRefReady:`Wait for form item container DOM element to be ready before executing callback.
|
|
5
|
-
Parameters: (ref: React.RefObject, callback: (element: HTMLElement) => void, timeout?: number) => void`}}),r.define({label:"JS \u8868\u5355\u9879 RunJS \u4E0A\u4E0B\u6587",properties:{element:"ElementProxy\uFF0C\u8868\u5355\u9879\u6E32\u67D3\u5BB9\u5668\uFF0C\u652F\u6301 innerHTML/append \u7B49 DOM \u64CD\u4F5C",resource:"\u5F53\u524D\u8D44\u6E90\uFF08\u53EA\u8BFB\uFF09",record:"\u5F53\u524D\u8BB0\u5F55\uFF08\u53EA\u8BFB\uFF09"},methods:{onRefReady:"\u5BB9\u5668\u5C31\u7EEA\u540E\u6267\u884C\u56DE\u8C03\u3002\u53C2\u6570\uFF1A(ref, callback, timeout?)"}},{locale:"zh-CN"})},96021:function(s,n,e){e.r(n);var t=e(41442),_={contexts:[t.JSItemRunJSContext],prefix:"sn-link-calc",label:"Calculate total price (quantity \xD7 price)",description:"Automatically calculate total when quantity or unit price changes",locales:{"zh-CN":{label:"\u8BA1\u7B97\u603B\u4EF7\uFF08\u6570\u91CF \xD7 \u5355\u4EF7\uFF09",description:"\u5F53\u6570\u91CF\u6216\u5355\u4EF7\u53D8\u5316\u65F6\u81EA\u52A8\u8BA1\u7B97\u603B\u4EF7"}},content:`
|
|
6
|
-
// Get quantity and unit price from current record
|
|
7
|
-
const quantity = Number(ctx.record?.quantity) || 0;
|
|
8
|
-
const unitPrice = Number(ctx.record?.unitPrice) || 0;
|
|
9
|
-
const total = quantity * unitPrice;
|
|
10
|
-
|
|
11
|
-
// Find and update the 'totalPrice' field
|
|
12
|
-
const items = ctx.model?.subModels?.grid?.subModels?.items;
|
|
13
|
-
const candidates = Array.isArray(items) ? items : Array.from(items?.values?.() || items || []);
|
|
14
|
-
|
|
15
|
-
const totalField = candidates.find((item) => item?.props?.name === 'totalPrice');
|
|
16
|
-
|
|
17
|
-
if (totalField) {
|
|
18
|
-
totalField.setProps({ value: total.toFixed(2) });
|
|
19
|
-
} else {
|
|
20
|
-
console.warn('[Form snippet] totalPrice field not found');
|
|
21
|
-
}
|
|
22
|
-
`};n.default=_}}]);
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunknocobase=self.webpackChunknocobase||[]).push([[6534,1442],{41442:function(r,n,e){e.r(n),e.d(n,{JSItemRunJSContext:function(){return t}});var s=e(72004),_=e.n(s),a=e(12444),l=e.n(a),i=e(31996),d=e.n(i),m=e(26037),u=e.n(m),c=e(67946),t=function(b){d()(o,b);var p=u()(o);function o(){return l()(this,o),p.apply(this,arguments)}return _()(o)}(c.Uo);t.define({label:"JSItem RunJS context",properties:{element:`ElementProxy instance providing a safe DOM container for form item rendering.
|
|
2
|
-
Supports innerHTML, append, and other DOM manipulation methods.`,resource:`Current resource instance (read-only).
|
|
3
|
-
Provides access to the data resource associated with the current form context.`,record:`Current record data object (read-only).
|
|
4
|
-
Contains all field values of the parent record.`},methods:{onRefReady:`Wait for form item container DOM element to be ready before executing callback.
|
|
5
|
-
Parameters: (ref: React.RefObject, callback: (element: HTMLElement) => void, timeout?: number) => void`}}),t.define({label:"JS \u8868\u5355\u9879 RunJS \u4E0A\u4E0B\u6587",properties:{element:"ElementProxy\uFF0C\u8868\u5355\u9879\u6E32\u67D3\u5BB9\u5668\uFF0C\u652F\u6301 innerHTML/append \u7B49 DOM \u64CD\u4F5C",resource:"\u5F53\u524D\u8D44\u6E90\uFF08\u53EA\u8BFB\uFF09",record:"\u5F53\u524D\u8BB0\u5F55\uFF08\u53EA\u8BFB\uFF09"},methods:{onRefReady:"\u5BB9\u5668\u5C31\u7EEA\u540E\u6267\u884C\u56DE\u8C03\u3002\u53C2\u6570\uFF1A(ref, callback, timeout?)"}},{locale:"zh-CN"})},76534:function(r,n,e){e.r(n);var s=e(41442),_={contexts:[s.JSItemRunJSContext],prefix:"sn-link-copy",label:"Copy value from another field",description:"Copy value from one field to another when checkbox is checked",locales:{"zh-CN":{label:"\u590D\u5236\u5B57\u6BB5\u503C",description:"\u52FE\u9009\u590D\u9009\u6846\u65F6\uFF0C\u5C06\u4E00\u4E2A\u5B57\u6BB5\u7684\u503C\u590D\u5236\u5230\u53E6\u4E00\u4E2A\u5B57\u6BB5"}},content:`
|
|
6
|
-
// When 'sameAsAbove' is checked, copy billing address to shipping address
|
|
7
|
-
const sameAsAbove = ctx.record?.sameAsAbove;
|
|
8
|
-
|
|
9
|
-
if (!sameAsAbove) {
|
|
10
|
-
return;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const items = ctx.model?.subModels?.grid?.subModels?.items;
|
|
14
|
-
const candidates = Array.isArray(items) ? items : Array.from(items?.values?.() || items || []);
|
|
15
|
-
|
|
16
|
-
// Source and target field mappings
|
|
17
|
-
const fieldMappings = [
|
|
18
|
-
{ from: 'billingAddress', to: 'shippingAddress' },
|
|
19
|
-
{ from: 'billingCity', to: 'shippingCity' },
|
|
20
|
-
{ from: 'billingZipCode', to: 'shippingZipCode' },
|
|
21
|
-
];
|
|
22
|
-
|
|
23
|
-
fieldMappings.forEach(({ from, to }) => {
|
|
24
|
-
const sourceValue = ctx.record?.[from];
|
|
25
|
-
const targetField = candidates.find((item) => item?.props?.name === to);
|
|
26
|
-
|
|
27
|
-
if (targetField) {
|
|
28
|
-
targetField.setProps({ value: sourceValue });
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
ctx.message?.success?.(ctx.t('Address copied successfully'));
|
|
33
|
-
`};n.default=_}}]);
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunknocobase=self.webpackChunknocobase||[]).push([[7087],{67087:function(p,n,e){e.r(n),e.d(n,{FormJSFieldItemRunJSContext:function(){return o}});var s=e(72004),r=e.n(s),l=e(12444),a=e.n(l),t=e(31996),d=e.n(t),m=e(26037),u=e.n(m),i=e(67946),o=function(b){d()(_,b);var c=u()(_);function _(){return a()(this,_),c.apply(this,arguments)}return r()(_)}(i.Uo);o.define({label:"FormJSFieldItem RunJS context",properties:{element:`ElementProxy instance providing a safe DOM container for form field rendering.
|
|
2
|
-
Supports innerHTML, append, and other DOM manipulation methods.`,value:"Current field value (read-only in display mode; in controlled scenarios, use setProps to modify).",record:`Current record data object (read-only).
|
|
3
|
-
Contains all field values of the parent record.`},methods:{onRefReady:`Wait for form field container DOM element to be ready before executing callback.
|
|
4
|
-
Parameters: (ref: React.RefObject, callback: (element: HTMLElement) => void, timeout?: number) => void`,setProps:`Set form field properties programmatically.
|
|
5
|
-
Parameters: (fieldModel: any, props: { value?: any, disabled?: boolean, visible?: boolean }) => void
|
|
6
|
-
Example: ctx.setProps(fieldModel, { value: "new value" })`}}),o.define({label:"\u8868\u5355 JS \u5B57\u6BB5\u9879 RunJS \u4E0A\u4E0B\u6587",properties:{element:"ElementProxy\uFF0C\u8868\u5355\u5B57\u6BB5\u5BB9\u5668",value:"\u5B57\u6BB5\u503C\uFF08\u5C55\u793A\u6A21\u5F0F\u4E3A\u53EA\u8BFB\uFF1B\u53D7\u63A7\u573A\u666F\u7528 setProps \u4FEE\u6539\uFF09",record:"\u5F53\u524D\u8BB0\u5F55\uFF08\u53EA\u8BFB\uFF09"},methods:{onRefReady:"\u5BB9\u5668\u5C31\u7EEA\u56DE\u8C03",setProps:"\u8BBE\u7F6E\u8868\u5355\u9879\u5C5E\u6027\uFF1A`setProps(fieldModel, { value })`\uFF08\u7531\u8054\u52A8/\u8868\u5355\u4E0A\u4E0B\u6587\u63D0\u4F9B\uFF09"}},{locale:"zh-CN"})}}]);
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunknocobase=self.webpackChunknocobase||[]).push([[9844,113,4727,7087],{67087:function(p,o,e){e.r(o),e.d(o,{FormJSFieldItemRunJSContext:function(){return _}});var r=e(72004),t=e.n(r),l=e(12444),s=e.n(l),a=e(31996),u=e.n(a),d=e(26037),i=e.n(d),m=e(67946),_=function(c){u()(n,c);var b=i()(n);function n(){return s()(this,n),b.apply(this,arguments)}return t()(n)}(m.Uo);_.define({label:"FormJSFieldItem RunJS context",properties:{element:`ElementProxy instance providing a safe DOM container for form field rendering.
|
|
2
|
-
Supports innerHTML, append, and other DOM manipulation methods.`,value:"Current field value (read-only in display mode; in controlled scenarios, use setProps to modify).",record:`Current record data object (read-only).
|
|
3
|
-
Contains all field values of the parent record.`},methods:{onRefReady:`Wait for form field container DOM element to be ready before executing callback.
|
|
4
|
-
Parameters: (ref: React.RefObject, callback: (element: HTMLElement) => void, timeout?: number) => void`,setProps:`Set form field properties programmatically.
|
|
5
|
-
Parameters: (fieldModel: any, props: { value?: any, disabled?: boolean, visible?: boolean }) => void
|
|
6
|
-
Example: ctx.setProps(fieldModel, { value: "new value" })`}}),_.define({label:"\u8868\u5355 JS \u5B57\u6BB5\u9879 RunJS \u4E0A\u4E0B\u6587",properties:{element:"ElementProxy\uFF0C\u8868\u5355\u5B57\u6BB5\u5BB9\u5668",value:"\u5B57\u6BB5\u503C\uFF08\u5C55\u793A\u6A21\u5F0F\u4E3A\u53EA\u8BFB\uFF1B\u53D7\u63A7\u573A\u666F\u7528 setProps \u4FEE\u6539\uFF09",record:"\u5F53\u524D\u8BB0\u5F55\uFF08\u53EA\u8BFB\uFF09"},methods:{onRefReady:"\u5BB9\u5668\u5C31\u7EEA\u56DE\u8C03",setProps:"\u8BBE\u7F6E\u8868\u5355\u9879\u5C5E\u6027\uFF1A`setProps(fieldModel, { value })`\uFF08\u7531\u8054\u52A8/\u8868\u5355\u4E0A\u4E0B\u6587\u63D0\u4F9B\uFF09"}},{locale:"zh-CN"})},64727:function(p,o,e){e.r(o),e.d(o,{JSColumnRunJSContext:function(){return _}});var r=e(72004),t=e.n(r),l=e(12444),s=e.n(l),a=e(31996),u=e.n(a),d=e(26037),i=e.n(d),m=e(67946),_=function(c){u()(n,c);var b=i()(n);function n(){return s()(this,n),b.apply(this,arguments)}return t()(n)}(m.Uo);_.define({label:"JSColumn RunJS context",properties:{element:"ElementProxy instance providing a safe DOM container for the current table cell. Supports innerHTML/append and basic DOM APIs.",record:"Current row record object (read-only).",recordIndex:"Index of the current row in the page (0-based).",collection:"Collection definition metadata (read-only).",viewer:"View controller providing dialog/drawer/embed helpers for interactions initiated from the cell (e.g., open details).",React:"React library",antd:"Ant Design library"},methods:{onRefReady:"Wait for cell DOM element to be ready before executing callback. Parameters: (ref, callback, timeout?) => void",requireAsync:"Load external library by URL: `const lib = await ctx.requireAsync(url)`",importAsync:"Dynamically import ESM module by URL: `const mod = await ctx.importAsync(url)`"}}),_.define({label:"JS \u5217 RunJS \u4E0A\u4E0B\u6587",properties:{element:"ElementProxy\uFF0C\u8868\u683C\u5355\u5143\u683C\u7684\u5B89\u5168 DOM \u5BB9\u5668\uFF0C\u652F\u6301 innerHTML/append \u7B49",record:"\u5F53\u524D\u884C\u8BB0\u5F55\u5BF9\u8C61\uFF08\u53EA\u8BFB\uFF09",recordIndex:"\u5F53\u524D\u884C\u7D22\u5F15\uFF08\u4ECE 0 \u5F00\u59CB\uFF09",collection:"\u96C6\u5408\u5B9A\u4E49\u5143\u6570\u636E\uFF08\u53EA\u8BFB\uFF09",viewer:"\u89C6\u56FE\u63A7\u5236\u5668\uFF0C\u53EF\u7528\u4E8E\u5728\u5355\u5143\u683C\u4E2D\u89E6\u53D1\u62BD\u5C49/\u5BF9\u8BDD\u6846/\u5185\u5D4C\u7B49\u4EA4\u4E92",React:"React \u5E93",antd:"Ant Design \u5E93"},methods:{onRefReady:"\u7B49\u5F85\u5355\u5143\u683C DOM \u5C31\u7EEA\u540E\u6267\u884C\u56DE\u8C03\u3002\u53C2\u6570\uFF1A(ref, callback, timeout?)",requireAsync:"\u6309 URL \u5F02\u6B65\u52A0\u8F7D\u5916\u90E8\u5E93\uFF1A`const lib = await ctx.requireAsync(url)`",importAsync:"\u6309 URL \u52A8\u6001\u5BFC\u5165 ESM \u6A21\u5757\uFF1A`const mod = await ctx.importAsync(url)`"}},{locale:"zh-CN"})},40113:function(p,o,e){e.r(o),e.d(o,{JSFieldRunJSContext:function(){return _}});var r=e(72004),t=e.n(r),l=e(12444),s=e.n(l),a=e(31996),u=e.n(a),d=e(26037),i=e.n(d),m=e(67946),_=function(c){u()(n,c);var b=i()(n);function n(){return s()(this,n),b.apply(this,arguments)}return t()(n)}(m.Uo);_.define({label:"JSField RunJS context",properties:{element:`ElementProxy instance providing a safe DOM container for field rendering.
|
|
7
|
-
Supports innerHTML, append, and other DOM manipulation methods.`,value:`Current value of the field (read-only).
|
|
8
|
-
Contains the data value stored in this field.`,record:`Current record data object (read-only).
|
|
9
|
-
Contains all field values of the parent record.`,collection:`Collection definition metadata (read-only).
|
|
10
|
-
Provides schema information about the collection this field belongs to.`},methods:{onRefReady:`Wait for field container DOM element to be ready before executing callback.
|
|
11
|
-
Parameters: (ref: React.RefObject, callback: (element: HTMLElement) => void, timeout?: number) => void
|
|
12
|
-
Example: ctx.onRefReady(ctx.ref, (el) => { el.innerHTML = ctx.value })`}}),_.define({label:"JS \u5B57\u6BB5 RunJS \u4E0A\u4E0B\u6587",properties:{element:"ElementProxy\uFF0C\u5B57\u6BB5\u6E32\u67D3\u5BB9\u5668\uFF0C\u652F\u6301 innerHTML/append \u7B49 DOM \u64CD\u4F5C",value:"\u5B57\u6BB5\u5F53\u524D\u503C\uFF08\u53EA\u8BFB\uFF09",record:"\u5F53\u524D\u8BB0\u5F55\u5BF9\u8C61\uFF08\u53EA\u8BFB\uFF0C\u5305\u542B\u7236\u8BB0\u5F55\u5168\u90E8\u5B57\u6BB5\u503C\uFF09",collection:"\u96C6\u5408\u5B9A\u4E49\u5143\u6570\u636E\uFF08\u53EA\u8BFB\uFF0C\u63CF\u8FF0\u5B57\u6BB5\u6240\u5C5E\u96C6\u5408\u7684 Schema\uFF09"},methods:{onRefReady:"\u5728\u5B57\u6BB5\u5BB9\u5668 DOM \u5C31\u7EEA\u540E\u6267\u884C\u56DE\u8C03\u3002\u53C2\u6570\uFF1A(ref, callback, timeout?)\uFF1B\u793A\u4F8B\uFF1Actx.onRefReady(ctx.ref, el => { el.innerHTML = ctx.value })"}},{locale:"zh-CN"})},69844:function(p,o,e){e.r(o);var r=e(40113),t=e(67087),l=e(64727),s={contexts:[r.JSFieldRunJSContext,t.FormJSFieldItemRunJSContext,l.JSColumnRunJSContext],scenes:["detail","table"],prefix:"sn-jsf-status-tag",label:"Display status field as colored tag",description:"Display status values using colored tags",locales:{"zh-CN":{label:"\u5C06\u72B6\u6001\u5B57\u6BB5\u663E\u793A\u4E3A\u5F69\u8272\u6807\u7B7E",description:"\u6839\u636E\u72B6\u6001\u503C\u663E\u793A\u4E0D\u540C\u989C\u8272\u7684\u6807\u7B7E"}},content:`
|
|
13
|
-
const statusColors = {
|
|
14
|
-
active: 'green',
|
|
15
|
-
pending: 'orange',
|
|
16
|
-
inactive: 'gray',
|
|
17
|
-
error: 'red',
|
|
18
|
-
success: 'blue',
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
const status = String(ctx.value || 'unknown');
|
|
22
|
-
const color = statusColors[status] || 'default';
|
|
23
|
-
|
|
24
|
-
ctx.element.innerHTML = \`
|
|
25
|
-
<span style="
|
|
26
|
-
display: inline-block;
|
|
27
|
-
padding: 2px 8px;
|
|
28
|
-
border-radius: 4px;
|
|
29
|
-
font-size: 12px;
|
|
30
|
-
background-color: var(--\${color}-1, #f0f0f0);
|
|
31
|
-
color: var(--\${color}-6, #333);
|
|
32
|
-
border: 1px solid var(--\${color}-3, #d9d9d9);
|
|
33
|
-
">
|
|
34
|
-
\${ctx.t(status)}
|
|
35
|
-
</span>
|
|
36
|
-
\`;
|
|
37
|
-
`};o.default=s}}]);
|