@nocobase/app 2.1.0-alpha.16 → 2.1.0-alpha.17
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/client-v2/src/.plugins/index.ts +14 -3
- package/client-v2/src/.plugins/packageMap.json +129 -0
- package/client-v2/src/.plugins/packages/nocobase_example_plugin_acl_allow.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_example_plugin_acl_middleware.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_example_plugin_action_group.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_example_plugin_block_custom_resource.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_example_plugin_block_filter_collection.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_example_plugin_block_timeline.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_example_plugin_collection_block.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_example_plugin_custom_details_block.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_example_plugin_custom_form_block.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_example_plugin_custom_table_block.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_example_plugin_custom_table_block_action_group.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_example_plugin_custom_table_block_field.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_example_plugin_custom_table_block_resource.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_example_plugin_data_block.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_example_plugin_field_simple.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_example_plugin_nested_action.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_example_plugin_nested_block.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_example_plugin_simple_action.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_example_plugin_simple_block.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_example_plugin_simple_popup_action.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_acl.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_action_bulk_edit.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_action_bulk_update.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_action_custom_request.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_action_duplicate.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_action_export.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_action_import.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_action_print.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_ai.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_ai_gigachat.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_api_doc.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_api_keys.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_async_task_manager.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_audit_logs.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_auth.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_auth_sms.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_backup_restore.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_block_grid_card.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_block_iframe.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_block_list.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_block_markdown.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_block_multi_step_form.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_block_template.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_block_tree.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_block_workbench.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_calendar.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_charts.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_client.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_collection_fdw.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_collection_sql.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_collection_tree.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_comments.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_custom_variables.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_data_source_main.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_data_source_manager.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_data_visualization.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_data_visualization_echarts.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_departments.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_disable_pm_add.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_embed.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_environment_variables.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_error_handler.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_field_attachment_url.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_field_china_region.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_field_code.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_field_formula.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_field_m2m_array.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_field_markdown_vditor.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_field_sequence.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_field_sort.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_file_manager.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_file_previewer_office.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_flow_engine.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_form_drafts.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_gantt.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_graph_collection_manager.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_hello.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_idp_oauth.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_kanban.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_license.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_locale_tester.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_localization.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_logger.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_map.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_mcp_server.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_mobile.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_mobile_client.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_mock_collections.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_multi_app_manager.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_multi_app_share_collection.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_multi_keyword_filter.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_notification_email.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_notification_in_app_message.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_notification_manager.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_notifications.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_public_forms.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_snapshot_field.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_system_settings.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_text_copy.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_theme_editor.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_ui_schema_storage.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_ui_templates.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_user_data_sync.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_users.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_verification.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_workflow.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_workflow_action_trigger.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_workflow_aggregate.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_workflow_cc.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_workflow_custom_action_trigger.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_workflow_date_calculation.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_workflow_delay.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_workflow_dynamic_calculation.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_workflow_javascript.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_workflow_json_query.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_workflow_json_variable_mapping.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_workflow_loop.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_workflow_mailer.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_workflow_manual.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_workflow_notification.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_workflow_parallel.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_workflow_request.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_workflow_request_interceptor.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_workflow_response_message.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_workflow_sql.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_workflow_test.ts +1 -0
- package/client-v2/src/.plugins/packages/nocobase_plugin_workflow_variable.ts +1 -0
- package/dist/client/assets/{index-8e933cba.js → index-27c2e9bc.js} +84 -84
- package/dist/client/assets/{vendor-misc-4fd76bfe.js → vendor-misc-5f2d5dc4.js} +6 -6
- package/dist/client/index.html +1 -1
- package/dist/client/index.html.tpl +1 -1
- package/package.json +7 -6
- package/dist/client/v2/assets/1020-0212416d.js +0 -2
- package/dist/client/v2/assets/1020-0212416d.js.LICENSE.txt +0 -7
- package/dist/client/v2/assets/1222-49e8dadb.css +0 -1
- package/dist/client/v2/assets/1222-c8810ac8.js +0 -2
- package/dist/client/v2/assets/1222-c8810ac8.js.LICENSE.txt +0 -9
- package/dist/client/v2/assets/1310-21e5c8a8.js +0 -59
- package/dist/client/v2/assets/1331-9092cf22.js +0 -1
- package/dist/client/v2/assets/1425-a2b446a6.js +0 -42
- package/dist/client/v2/assets/1507-a673a0c0.js +0 -7
- package/dist/client/v2/assets/158-6a033567.js +0 -23
- package/dist/client/v2/assets/1676-5db7433e.js +0 -9
- package/dist/client/v2/assets/1725-6f5b8d53.js +0 -83
- package/dist/client/v2/assets/1786-8969223a.js +0 -16
- package/dist/client/v2/assets/1951-f63bc4b3.js +0 -55
- package/dist/client/v2/assets/2017-b35f125d.js +0 -26
- package/dist/client/v2/assets/212-59d29e60.js +0 -18
- package/dist/client/v2/assets/2131-a150fed4.js +0 -1
- package/dist/client/v2/assets/22-9d12a303.js +0 -1
- package/dist/client/v2/assets/2203-9aa79271.js +0 -4
- package/dist/client/v2/assets/2335-1d33c3cf.js +0 -22
- package/dist/client/v2/assets/2555-dee484a1.js +0 -31
- package/dist/client/v2/assets/2702-8d5ab2a8.js +0 -5
- package/dist/client/v2/assets/2710-93d67bf0.js +0 -36
- package/dist/client/v2/assets/2726-f6cc5db9.js +0 -23
- package/dist/client/v2/assets/2861-48106fd8.js +0 -3
- package/dist/client/v2/assets/2898-2a7d5793.js +0 -17
- package/dist/client/v2/assets/2958-5a85effa.js +0 -27
- package/dist/client/v2/assets/3018-fc630932.js +0 -3
- package/dist/client/v2/assets/3117-3d38bb4d.js +0 -33
- package/dist/client/v2/assets/3279-1f24fe26.js +0 -1
- package/dist/client/v2/assets/338-2f192edd.js +0 -3
- package/dist/client/v2/assets/3475-c42974e1.js +0 -1
- package/dist/client/v2/assets/3660-27f9c6c5.js +0 -6
- package/dist/client/v2/assets/3662-135bbea1.js +0 -28
- package/dist/client/v2/assets/3690-4a8bdf43.js +0 -12
- package/dist/client/v2/assets/3727-b74fc29b.js +0 -44
- package/dist/client/v2/assets/3916-ba5b43b5.js +0 -6
- package/dist/client/v2/assets/3937-af967d62.js +0 -3
- package/dist/client/v2/assets/3989-e72345bb.js +0 -27
- package/dist/client/v2/assets/4222-29a8147d.js +0 -5
- package/dist/client/v2/assets/4313-9687f912.js +0 -28
- package/dist/client/v2/assets/5064-93d8e29e.js +0 -10
- package/dist/client/v2/assets/5501-a3b5b97f.js +0 -17
- package/dist/client/v2/assets/5721-f00ddbf2.js +0 -18
- package/dist/client/v2/assets/5759-d5b1d946.js +0 -47
- package/dist/client/v2/assets/5761-8ab1974d.js +0 -28
- package/dist/client/v2/assets/6064-1517304e.js +0 -2
- package/dist/client/v2/assets/6064-1517304e.js.LICENSE.txt +0 -236
- package/dist/client/v2/assets/6269-35e90156.js +0 -1
- package/dist/client/v2/assets/6373-9d047c6b.js +0 -13
- package/dist/client/v2/assets/6437-2f91d29a.js +0 -12
- package/dist/client/v2/assets/6581-51c928bf.js +0 -21
- package/dist/client/v2/assets/6738-eb09fa59.js +0 -20
- package/dist/client/v2/assets/700-5f166286.js +0 -15
- package/dist/client/v2/assets/7021-01608dc5.js +0 -45
- package/dist/client/v2/assets/7201-8e6e91a3.js +0 -14
- package/dist/client/v2/assets/7211-b8c71ed2.js +0 -9
- package/dist/client/v2/assets/7492-5c593f52.js +0 -5
- package/dist/client/v2/assets/754-41b763b9.js +0 -17
- package/dist/client/v2/assets/7761-637067c6.js +0 -123
- package/dist/client/v2/assets/7876-673cbc3c.js +0 -6
- package/dist/client/v2/assets/7946-09b77e08.js +0 -13
- package/dist/client/v2/assets/7959-ab57fce2.js +0 -40
- package/dist/client/v2/assets/8138-704104a5.js +0 -24
- package/dist/client/v2/assets/8262-7a324b59.js +0 -9
- package/dist/client/v2/assets/8434-79232eec.js +0 -25
- package/dist/client/v2/assets/8438-9d210970.js +0 -37
- package/dist/client/v2/assets/8562-215edc37.js +0 -17
- package/dist/client/v2/assets/9811-52d18c3d.js +0 -1
- package/dist/client/v2/assets/9827-d1f02095.js +0 -9
- package/dist/client/v2/assets/9836-288424d8.js +0 -22
- package/dist/client/v2/assets/index-e2c0ebd2.js +0 -261
- package/dist/client/v2/assets/index-e2c0ebd2.js.LICENSE.txt +0 -1
- package/dist/client/v2/assets/runtime-6f58b646.js +0 -1
- package/dist/client/v2/assets/vendor-antd-05d1c710.js +0 -451
- package/dist/client/v2/assets/vendor-antd-ecosystem-1ffc870c.js +0 -2
- package/dist/client/v2/assets/vendor-antd-ecosystem-1ffc870c.js.LICENSE.txt +0 -1
- package/dist/client/v2/assets/vendor-antd-icons-db04cf76.js +0 -2
- package/dist/client/v2/assets/vendor-antd-icons-db04cf76.js.LICENSE.txt +0 -1621
- package/dist/client/v2/assets/vendor-lodash-831bd1b8.js +0 -2
- package/dist/client/v2/assets/vendor-lodash-831bd1b8.js.LICENSE.txt +0 -8
- package/dist/client/v2/assets/vendor-moment-84b317dc.js +0 -2
- package/dist/client/v2/assets/vendor-moment-84b317dc.js.LICENSE.txt +0 -631
- package/dist/client/v2/assets/vendor-ses-b7bccbcd.js +0 -23
- package/dist/client/v2/browser-checker.js +0 -186
- package/dist/client/v2/favicon/favicon.ico +0 -0
- package/dist/client/v2/file-placeholder/ai-200-200.png +0 -0
- package/dist/client/v2/file-placeholder/audio-200-200.png +0 -0
- package/dist/client/v2/file-placeholder/docx-200-200.png +0 -0
- package/dist/client/v2/file-placeholder/eps-200-200.png +0 -0
- package/dist/client/v2/file-placeholder/gif-200-200.png +0 -0
- package/dist/client/v2/file-placeholder/jpeg-200-200.png +0 -0
- package/dist/client/v2/file-placeholder/pdf-200-200.png +0 -0
- package/dist/client/v2/file-placeholder/png-200-200.png +0 -0
- package/dist/client/v2/file-placeholder/pptx-200-200.png +0 -0
- package/dist/client/v2/file-placeholder/psd-200-200.png +0 -0
- package/dist/client/v2/file-placeholder/svg-200-200.png +0 -0
- package/dist/client/v2/file-placeholder/unknown-200-200.png +0 -0
- package/dist/client/v2/file-placeholder/video-200-200.png +0 -0
- package/dist/client/v2/file-placeholder/xlsx-200-200.png +0 -0
- package/dist/client/v2/file-placeholder/zip-200-200.png +0 -0
- package/dist/client/v2/global.css +0 -63
- package/dist/client/v2/index.html +0 -19
- package/dist/client/v2/nocobase.png +0 -0
- package/dist/client/v2/robots.txt +0 -2
- /package/dist/client/assets/{index-8e933cba.js.LICENSE.txt → index-27c2e9bc.js.LICENSE.txt} +0 -0
- /package/dist/client/assets/{vendor-misc-4fd76bfe.js.LICENSE.txt → vendor-misc-5f2d5dc4.js.LICENSE.txt} +0 -0
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export const __rspack_esm_id="338";export const __rspack_esm_ids=["338"];export const __webpack_modules__={65897(e,r,o){o.r(r),o.d(r,{JSRecordActionRunJSContext:()=>c});var t=o(29007);class c extends t.uk{}c.define({label:"JSRecordAction RunJS context",properties:{record:`Current record data object (read-only).
|
|
2
|
-
Contains all field values of the record associated with this action.`,filterByTk:`Primary key or filter key of the current record (read-only).
|
|
3
|
-
Used to identify the specific record in database operations.`}}),c.define({label:"JS 记录动作 RunJS 上下文",properties:{record:"当前记录(只读)",filterByTk:"主键/过滤键(只读)"}},{locale:"zh-CN"})}};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const __rspack_esm_id="3475";export const __rspack_esm_ids=["3475"];export const __webpack_modules__={99502(e,t,a){a.r(t),a.d(t,{JSEditableFieldRunJSContext:()=>i});var n=a(29007);class i extends n.uk{}i.define({label:"JSEditableField RunJS context",properties:{element:{description:"ElementProxy instance providing a safe DOM container for field rendering. In editable mode this container is typically a <span> element.",detail:"ElementProxy"},value:{description:"Current field value (read-only snapshot). In editable scenarios, prefer ctx.getValue()/ctx.setValue(v) for two-way binding.",detail:"any",examples:["const v = ctx.getValue?.() ?? ctx.value;",'ctx.setValue?.("new value");']},record:{description:"Current record data object (read-only). Available in forms that are bound to a record.",detail:"Record<string, any>"},form:{description:'Ant Design Form instance for reading/writing other fields. Example: ctx.form.getFieldValue("name")',detail:"FormInstance"},formValues:{description:"Snapshot of current form values (object). Prefer ctx.form.getFieldsValue() when you need the latest values.",detail:"Record<string, any>"},namePath:{description:"Field namePath in the form (array). Useful for advanced Form operations.",detail:"Array<string | number>"},disabled:"Whether the field is disabled (boolean).",readOnly:"Whether the field is read-only (boolean)."},methods:{getValue:{description:"Get current field value (recommended for editable custom fields).",detail:"() => any",completion:{insertText:"ctx.getValue?.()"}},setValue:{description:"Set current field value (two-way binding with the form).",detail:"(value: any) => void",completion:{insertText:"ctx.setValue?.(value)"},examples:["ctx.setValue?.(e.target.value);"]}}}),i.define({label:"JS 可编辑字段 RunJS 上下文",properties:{element:{description:"ElementProxy,字段渲染的安全容器(通常为 <span> 容器)。",detail:"ElementProxy"},value:{description:"字段当前值(只读快照)。可编辑场景建议使用 ctx.getValue()/ctx.setValue(v) 做双向绑定。",detail:"any",examples:["const v = ctx.getValue?.() ?? ctx.value;",'ctx.setValue?.("新值");']},record:{description:"当前记录对象(只读;表单绑定记录时可用)。",detail:"Record<string, any>"},form:{description:"Ant Design Form 实例,可读写其它字段。",detail:"FormInstance"},formValues:{description:"当前表单值快照(对象)。需要最新值可用 ctx.form.getFieldsValue()。",detail:"Record<string, any>"},namePath:{description:"字段在表单中的 namePath(数组)。",detail:"Array<string | number>"},disabled:"是否禁用(boolean)",readOnly:"是否只读(boolean)"},methods:{getValue:{description:"获取字段当前值(可编辑字段推荐使用)。",detail:"() => any",completion:{insertText:"ctx.getValue?.()"}},setValue:{description:"设置字段当前值(与表单双向绑定)。",detail:"(value: any) => void",completion:{insertText:"ctx.setValue?.(value)"},examples:["ctx.setValue?.(e.target.value);"]}}},{locale:"zh-CN"})}};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export const __rspack_esm_id="3660";export const __rspack_esm_ids=["3660"];export const __webpack_modules__={79271(e,t,n){n.r(t),n.d(t,{JSBlockRunJSContext:()=>a});var r=n(29007);class a extends r.uk{}a.define({label:"RunJS context",properties:{element:{description:`ElementProxy instance providing a safe DOM container.
|
|
2
|
-
Supports innerHTML, append, and other DOM manipulation methods.
|
|
3
|
-
Use this to render content in the JS block.`,detail:"ElementProxy",properties:{innerHTML:"Set or read the HTML content of the container element."}},record:`Current record data object (read-only).
|
|
4
|
-
Available when the JS block is within a data block or detail view context.`,value:"Current value of the field or component, if available in the current context.",React:"React library",antd:"Ant Design library"},methods:{onRefReady:`Wait for container DOM element to be ready before executing callback.
|
|
5
|
-
Parameters: (ref: React.RefObject, callback: (element: HTMLElement) => void, timeout?: number) => void
|
|
6
|
-
Example: ctx.onRefReady(ctx.ref, (el) => { el.innerHTML = "Ready!" })`,requireAsync:"Load external library: `const lib = await ctx.requireAsync(url)`",importAsync:"Dynamically import an ESM module by URL: `const mod = await ctx.importAsync(url)`.\nNote: if the module has only a default export, ctx.importAsync returns that default value directly (no `.default`)."}}),a.define({label:"RunJS 上下文",properties:{element:{description:"ElementProxy,安全的 DOM 容器,支持 innerHTML/append 等",detail:"ElementProxy",properties:{innerHTML:"读取或设置容器的 HTML 内容"}},record:"当前记录(只读,用于数据区块/详情等场景)",value:"当前值(若存在)",React:"React 库",antd:"Ant Design 库"},methods:{onRefReady:"容器 ref 就绪回调:\n```js\nctx.onRefReady(ctx.ref, el => { /* ... */ })\n```",requireAsync:"加载外部库:`const lib = await ctx.requireAsync(url)`",importAsync:"按 URL 动态导入 ESM 模块:`const mod = await ctx.importAsync(url)`。\n注意:当模块只有 default 一个导出时,ctx.importAsync 会直接返回 default 值(无需再写 `.default`)。"}},{locale:"zh-CN"})}};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export const __rspack_esm_id="3662";export const __rspack_esm_ids=["3662"];export const __webpack_modules__={32221(e,t,r){r.r(t),r.d(t,{JSItemRunJSContext:()=>n});var o=r(29007);class n extends o.uk{}n.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.`,formValues:{description:"Snapshot of current form values (object). Available in form contexts (CreateForm/EditForm).",detail:"Record<string, any>",examples:["const { name, status } = ctx.formValues || {};"]}},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`}}),n.define({label:"JS 表单项 RunJS 上下文",properties:{element:"ElementProxy,表单项渲染容器,支持 innerHTML/append 等 DOM 操作",resource:"当前资源(只读)",record:"当前记录(只读)",formValues:{description:"当前表单值快照(对象)。仅表单相关上下文可用(Create/Edit Form)。",detail:"Record<string, any>",examples:["const { name, status } = ctx.formValues || {};"]}},methods:{onRefReady:"容器就绪后执行回调。参数:(ref, callback, timeout?)"}},{locale:"zh-CN"})},44637(e,t,r){r.r(t),r.d(t,{default:()=>o});let o={contexts:[r(32221).JSItemRunJSContext],prefix:"sn-link-required",label:"Set required",description:"Toggle required rule for another field within linkage",locales:{"zh-CN":{label:"设置必填",description:"在联动脚本中控制字段是否必填"}},content:`
|
|
6
|
-
const targetFieldUid = 'FIELD_UID_OR_NAME';
|
|
7
|
-
const required = true;
|
|
8
|
-
|
|
9
|
-
const items = ctx.model?.subModels?.grid?.subModels?.items;
|
|
10
|
-
const candidates = Array.isArray(items)
|
|
11
|
-
? items
|
|
12
|
-
: Array.from(items?.values?.() || items || []);
|
|
13
|
-
const fieldModel =
|
|
14
|
-
candidates.find((item) => item?.uid === targetFieldUid) ||
|
|
15
|
-
candidates.find((item) => item?.props?.name === targetFieldUid);
|
|
16
|
-
|
|
17
|
-
if (!fieldModel) {
|
|
18
|
-
ctx.message?.warning?.(ctx.t('Field {{name}} not found', { name: targetFieldUid }));
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
fieldModel.setProps({ required });
|
|
23
|
-
ctx.message?.success?.(
|
|
24
|
-
ctx.t(required ? 'Set field {{name}} as required' : 'Field {{name}} is optional', {
|
|
25
|
-
name: fieldModel?.props?.label || targetFieldUid,
|
|
26
|
-
}),
|
|
27
|
-
);
|
|
28
|
-
`}}};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export const __rspack_esm_id="3690";export const __rspack_esm_ids=["3690"];export const __webpack_modules__={64700(e,t,o){o.r(t),o.d(t,{JSCollectionActionRunJSContext:()=>c});var s=o(29007);class c extends s.uk{}c.define({label:"JSCollectionAction RunJS context",properties:{resource:`Collection resource instance providing access to selected rows, pagination, and data operations.
|
|
2
|
-
Use ctx.resource.selectedRows to get selected records.
|
|
3
|
-
Use ctx.resource.pagination for page info.`}}),c.define({label:"JS 集合动作 RunJS 上下文",properties:{resource:"列表资源(包含选中行/分页信息等)"}},{locale:"zh-CN"})},92625(e,t,o){o.r(t),o.d(t,{default:()=>s});let s={contexts:[o(64700).JSCollectionActionRunJSContext],prefix:"sn-act-destroy-selected",label:"Destroy selected rows",description:"Delete selected rows via resource.destroySelectedRows()",locales:{"zh-CN":{label:"删除选中行",description:"通过 resource.destroySelectedRows() 删除选中行"}},content:`
|
|
4
|
-
const rows = ctx.resource?.getSelectedRows?.() || [];
|
|
5
|
-
if (!rows.length) {
|
|
6
|
-
ctx.message.warning(ctx.t('Please select data'));
|
|
7
|
-
return;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
await ctx.resource.destroySelectedRows();
|
|
11
|
-
ctx.message.success(ctx.t('Deleted {{count}} rows', { count: rows.length }));
|
|
12
|
-
`}}};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
export const __rspack_esm_id="3727";export const __rspack_esm_ids=["3727"];export const __webpack_modules__={79271(e,t,r){r.r(t),r.d(t,{JSBlockRunJSContext:()=>a});var n=r(29007);class a extends n.uk{}a.define({label:"RunJS context",properties:{element:{description:`ElementProxy instance providing a safe DOM container.
|
|
2
|
-
Supports innerHTML, append, and other DOM manipulation methods.
|
|
3
|
-
Use this to render content in the JS block.`,detail:"ElementProxy",properties:{innerHTML:"Set or read the HTML content of the container element."}},record:`Current record data object (read-only).
|
|
4
|
-
Available when the JS block is within a data block or detail view context.`,value:"Current value of the field or component, if available in the current context.",React:"React library",antd:"Ant Design library"},methods:{onRefReady:`Wait for container DOM element to be ready before executing callback.
|
|
5
|
-
Parameters: (ref: React.RefObject, callback: (element: HTMLElement) => void, timeout?: number) => void
|
|
6
|
-
Example: ctx.onRefReady(ctx.ref, (el) => { el.innerHTML = "Ready!" })`,requireAsync:"Load external library: `const lib = await ctx.requireAsync(url)`",importAsync:"Dynamically import an ESM module by URL: `const mod = await ctx.importAsync(url)`.\nNote: if the module has only a default export, ctx.importAsync returns that default value directly (no `.default`)."}}),a.define({label:"RunJS 上下文",properties:{element:{description:"ElementProxy,安全的 DOM 容器,支持 innerHTML/append 等",detail:"ElementProxy",properties:{innerHTML:"读取或设置容器的 HTML 内容"}},record:"当前记录(只读,用于数据区块/详情等场景)",value:"当前值(若存在)",React:"React 库",antd:"Ant Design 库"},methods:{onRefReady:"容器 ref 就绪回调:\n```js\nctx.onRefReady(ctx.ref, el => { /* ... */ })\n```",requireAsync:"加载外部库:`const lib = await ctx.requireAsync(url)`",importAsync:"按 URL 动态导入 ESM 模块:`const mod = await ctx.importAsync(url)`。\n注意:当模块只有 default 一个导出时,ctx.importAsync 会直接返回 default 值(无需再写 `.default`)。"}},{locale:"zh-CN"})},80626(e,t,r){r.r(t),r.d(t,{default:()=>n});let n={contexts:[r(79271).JSBlockRunJSContext],prefix:"sn-jsb-timeline",label:"Render timeline from records",description:"Display records as a timeline using Ant Design Timeline",locales:{"zh-CN":{label:"渲染时间轴",description:"使用 Ant Design 时间轴组件显示记录历史"}},content:`
|
|
7
|
-
const { Timeline, Card } = ctx.libs.antd;
|
|
8
|
-
|
|
9
|
-
const res = await ctx.request({
|
|
10
|
-
url: 'users:list',
|
|
11
|
-
method: 'get',
|
|
12
|
-
params: {
|
|
13
|
-
pageSize: 20,
|
|
14
|
-
sort: ['-createdAt'],
|
|
15
|
-
},
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
const records = res?.data?.data || [];
|
|
19
|
-
|
|
20
|
-
if (!records.length) {
|
|
21
|
-
ctx.render('<div style="padding:16px;color:#999;">' + ctx.t('No data') + '</div>');
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
ctx.render(
|
|
26
|
-
<Card title={ctx.t('Activity Timeline')} bordered>
|
|
27
|
-
<Timeline mode="left">
|
|
28
|
-
{records.map((record) => (
|
|
29
|
-
<Timeline.Item
|
|
30
|
-
key={record.id}
|
|
31
|
-
label={record.createdAt ? new Date(record.createdAt).toLocaleString() : ''}
|
|
32
|
-
>
|
|
33
|
-
<div>
|
|
34
|
-
<strong>{record.nickname || record.username || ctx.t('Unnamed user')}</strong>
|
|
35
|
-
{record.email ? (
|
|
36
|
-
<div style={{ color: '#999', fontSize: '12px', marginTop: '4px' }}>{record.email}</div>
|
|
37
|
-
) : null}
|
|
38
|
-
</div>
|
|
39
|
-
</Timeline.Item>
|
|
40
|
-
))}
|
|
41
|
-
</Timeline>
|
|
42
|
-
</Card>
|
|
43
|
-
);
|
|
44
|
-
`}}};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export const __rspack_esm_id="3916";export const __rspack_esm_ids=["3916"];export const __webpack_modules__={25831(e,o,r){r.r(o),r.d(o,{FormJSFieldItemRunJSContext:()=>a});var t=r(29007);class a extends t.uk{}a.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.`,formValues:{description:"Snapshot of current form values (object). Available in form contexts (CreateForm/EditForm).",detail:"Record<string, any>",examples:["const { name, status } = ctx.formValues || {};"]}},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" })`}}),a.define({label:"表单 JS 字段项 RunJS 上下文",properties:{element:"ElementProxy,表单字段容器",value:"字段值(展示模式为只读;受控场景用 setProps 修改)",record:"当前记录(只读)",formValues:{description:"当前表单值快照(对象)。仅表单相关上下文可用(Create/Edit Form)。",detail:"Record<string, any>",examples:["const { name, status } = ctx.formValues || {};"]}},methods:{onRefReady:"容器就绪回调",setProps:"设置表单项属性:`setProps(fieldModel, { value })`(由联动/表单上下文提供)"}},{locale:"zh-CN"})}};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export const __rspack_esm_id="3937";export const __rspack_esm_ids=["3937"];export const __webpack_modules__={75432(s,e,c){c.r(e),c.d(e,{default:()=>t});let t={contexts:["*"],prefix:"sn-msg",label:"Message success",description:"Show a success toast message",locales:{"zh-CN":{label:"成功消息提示",description:"显示一条成功提示消息"}},content:`
|
|
2
|
-
ctx.message.success(ctx.t('Operation succeeded'));
|
|
3
|
-
`}}};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export const __rspack_esm_id="3989";export const __rspack_esm_ids=["3989"];export const __webpack_modules__={32221(e,t,a){a.r(t),a.d(t,{JSItemRunJSContext:()=>o});var r=a(29007);class o extends r.uk{}o.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.`,formValues:{description:"Snapshot of current form values (object). Available in form contexts (CreateForm/EditForm).",detail:"Record<string, any>",examples:["const { name, status } = ctx.formValues || {};"]}},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`}}),o.define({label:"JS 表单项 RunJS 上下文",properties:{element:"ElementProxy,表单项渲染容器,支持 innerHTML/append 等 DOM 操作",resource:"当前资源(只读)",record:"当前记录(只读)",formValues:{description:"当前表单值快照(对象)。仅表单相关上下文可用(Create/Edit Form)。",detail:"Record<string, any>",examples:["const { name, status } = ctx.formValues || {};"]}},methods:{onRefReady:"容器就绪后执行回调。参数:(ref, callback, timeout?)"}},{locale:"zh-CN"})},35876(e,t,a){a.r(t),a.d(t,{default:()=>r});let r={contexts:[a(32221).JSItemRunJSContext],prefix:"sn-link-set",label:"Set field value",description:"Programmatically update another field in linkage scripts",locales:{"zh-CN":{label:"设置字段值",description:"在联动脚本中为其他字段设置值"}},content:`
|
|
6
|
-
// Update another field in the same form/block
|
|
7
|
-
const targetFieldUid = 'FIELD_UID_OR_NAME';
|
|
8
|
-
const nextValue = ctx.record?.status ?? ctx.t('Updated value');
|
|
9
|
-
|
|
10
|
-
const items = ctx.model?.subModels?.grid?.subModels?.items;
|
|
11
|
-
const candidates = Array.isArray(items)
|
|
12
|
-
? items
|
|
13
|
-
: Array.from(items?.values?.() || items || []);
|
|
14
|
-
const fieldModel =
|
|
15
|
-
candidates.find((item) => item?.uid === targetFieldUid) ||
|
|
16
|
-
candidates.find((item) => item?.props?.name === targetFieldUid);
|
|
17
|
-
|
|
18
|
-
if (!fieldModel) {
|
|
19
|
-
ctx.message?.warning?.(ctx.t('Field {{name}} not found', { name: targetFieldUid }));
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
fieldModel.setProps({ value: nextValue });
|
|
24
|
-
ctx.message?.success?.(
|
|
25
|
-
ctx.t('Updated field {{name}}', { name: fieldModel?.props?.label || targetFieldUid }),
|
|
26
|
-
);
|
|
27
|
-
`}}};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export const __rspack_esm_id="4222";export const __rspack_esm_ids=["4222"];export const __webpack_modules__={25789(e,a,s){s.r(a),s.d(a,{default:()=>o});let o={contexts:["*"],prefix:"sn-require",label:"Load AMD module",description:"Dynamically load an AMD/RequireJS module by URL",locales:{"zh-CN":{label:"加载 AMD 模块",description:"通过 RequireJS 按 URL 动态加载 AMD 模块"}},content:`
|
|
2
|
-
// Load an external library (AMD/RequireJS)
|
|
3
|
-
const dayjs = await ctx.requireAsync('dayjs@1/dayjs.min.js');
|
|
4
|
-
console.log('dayjs loaded:', dayjs?.default || dayjs);
|
|
5
|
-
`}}};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export const __rspack_esm_id="4313";export const __rspack_esm_ids=["4313"];export const __webpack_modules__={32221(e,t,r){r.r(t),r.d(t,{JSItemRunJSContext:()=>n});var a=r(29007);class n extends a.uk{}n.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.`,formValues:{description:"Snapshot of current form values (object). Available in form contexts (CreateForm/EditForm).",detail:"Record<string, any>",examples:["const { name, status } = ctx.formValues || {};"]}},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`}}),n.define({label:"JS 表单项 RunJS 上下文",properties:{element:"ElementProxy,表单项渲染容器,支持 innerHTML/append 等 DOM 操作",resource:"当前资源(只读)",record:"当前记录(只读)",formValues:{description:"当前表单值快照(对象)。仅表单相关上下文可用(Create/Edit Form)。",detail:"Record<string, any>",examples:["const { name, status } = ctx.formValues || {};"]}},methods:{onRefReady:"容器就绪后执行回调。参数:(ref, callback, timeout?)"}},{locale:"zh-CN"})},66656(e,t,r){r.r(t),r.d(t,{default:()=>a});let a={contexts:[r(32221).JSItemRunJSContext],prefix:"sn-link-disable",label:"Set disabled",description:"Enable or disable another field in linkage scripts",locales:{"zh-CN":{label:"设置禁用",description:"在联动脚本中启用或禁用字段"}},content:`
|
|
6
|
-
const targetFieldUid = 'FIELD_UID_OR_NAME';
|
|
7
|
-
const disabled = true;
|
|
8
|
-
|
|
9
|
-
const items = ctx.model?.subModels?.grid?.subModels?.items;
|
|
10
|
-
const candidates = Array.isArray(items)
|
|
11
|
-
? items
|
|
12
|
-
: Array.from(items?.values?.() || items || []);
|
|
13
|
-
const fieldModel =
|
|
14
|
-
candidates.find((item) => item?.uid === targetFieldUid) ||
|
|
15
|
-
candidates.find((item) => item?.props?.name === targetFieldUid);
|
|
16
|
-
|
|
17
|
-
if (!fieldModel) {
|
|
18
|
-
ctx.message?.warning?.(ctx.t('Field {{name}} not found', { name: targetFieldUid }));
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
fieldModel.setProps({ disabled });
|
|
23
|
-
ctx.message?.success?.(
|
|
24
|
-
ctx.t(disabled ? 'Disabled field {{name}}' : 'Enabled field {{name}}', {
|
|
25
|
-
name: fieldModel?.props?.label || targetFieldUid,
|
|
26
|
-
}),
|
|
27
|
-
);
|
|
28
|
-
`}}};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export const __rspack_esm_id="5064";export const __rspack_esm_ids=["5064"];export const __webpack_modules__={64700(e,t,o){o.r(t),o.d(t,{JSCollectionActionRunJSContext:()=>c});var s=o(29007);class c extends s.uk{}c.define({label:"JSCollectionAction RunJS context",properties:{resource:`Collection resource instance providing access to selected rows, pagination, and data operations.
|
|
2
|
-
Use ctx.resource.selectedRows to get selected records.
|
|
3
|
-
Use ctx.resource.pagination for page info.`}}),c.define({label:"JS 集合动作 RunJS 上下文",properties:{resource:"列表资源(包含选中行/分页信息等)"}},{locale:"zh-CN"})},35803(e,t,o){o.r(t),o.d(t,{default:()=>s});let s={contexts:[o(64700).JSCollectionActionRunJSContext],prefix:"sn-act-selected-count",label:"Selected count",description:"Show number of selected rows in list action",locales:{"zh-CN":{label:"选中数量",description:"提示当前选中行的数量"}},content:`
|
|
4
|
-
const rows = ctx.resource?.getSelectedRows?.() || [];
|
|
5
|
-
if (!rows.length) {
|
|
6
|
-
ctx.message.warning(ctx.t('Please select data'));
|
|
7
|
-
} else {
|
|
8
|
-
ctx.message.success(ctx.t('Selected {{count}} rows', { count: rows.length }));
|
|
9
|
-
}
|
|
10
|
-
`}}};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export const __rspack_esm_id="5501";export const __rspack_esm_ids=["5501"];export const __webpack_modules__={79271(e,t,n){n.r(t),n.d(t,{JSBlockRunJSContext:()=>a});var r=n(29007);class a extends r.uk{}a.define({label:"RunJS context",properties:{element:{description:`ElementProxy instance providing a safe DOM container.
|
|
2
|
-
Supports innerHTML, append, and other DOM manipulation methods.
|
|
3
|
-
Use this to render content in the JS block.`,detail:"ElementProxy",properties:{innerHTML:"Set or read the HTML content of the container element."}},record:`Current record data object (read-only).
|
|
4
|
-
Available when the JS block is within a data block or detail view context.`,value:"Current value of the field or component, if available in the current context.",React:"React library",antd:"Ant Design library"},methods:{onRefReady:`Wait for container DOM element to be ready before executing callback.
|
|
5
|
-
Parameters: (ref: React.RefObject, callback: (element: HTMLElement) => void, timeout?: number) => void
|
|
6
|
-
Example: ctx.onRefReady(ctx.ref, (el) => { el.innerHTML = "Ready!" })`,requireAsync:"Load external library: `const lib = await ctx.requireAsync(url)`",importAsync:"Dynamically import an ESM module by URL: `const mod = await ctx.importAsync(url)`.\nNote: if the module has only a default export, ctx.importAsync returns that default value directly (no `.default`)."}}),a.define({label:"RunJS 上下文",properties:{element:{description:"ElementProxy,安全的 DOM 容器,支持 innerHTML/append 等",detail:"ElementProxy",properties:{innerHTML:"读取或设置容器的 HTML 内容"}},record:"当前记录(只读,用于数据区块/详情等场景)",value:"当前值(若存在)",React:"React 库",antd:"Ant Design 库"},methods:{onRefReady:"容器 ref 就绪回调:\n```js\nctx.onRefReady(ctx.ref, el => { /* ... */ })\n```",requireAsync:"加载外部库:`const lib = await ctx.requireAsync(url)`",importAsync:"按 URL 动态导入 ESM 模块:`const mod = await ctx.importAsync(url)`。\n注意:当模块只有 default 一个导出时,ctx.importAsync 会直接返回 default 值(无需再写 `.default`)。"}},{locale:"zh-CN"})},71868(e,t,n){n.r(t),n.d(t,{default:()=>r});let r={contexts:[n(79271).JSBlockRunJSContext],prefix:"sn-jsb-react",label:"Render React",description:"Render a React element inside the block container",locales:{"zh-CN":{label:"渲染 React",description:"在区块容器中渲染 React 组件"}},content:`
|
|
7
|
-
// Render a React element into the current container
|
|
8
|
-
const { Button } = ctx.libs.antd;
|
|
9
|
-
|
|
10
|
-
ctx.render(
|
|
11
|
-
<div style={{ padding: 12 }}>
|
|
12
|
-
<Button type="primary" onClick={() => ctx.message.success(ctx.t('Clicked!'))}>
|
|
13
|
-
{ctx.t('Click')}
|
|
14
|
-
</Button>
|
|
15
|
-
</div>
|
|
16
|
-
);
|
|
17
|
-
`}}};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export const __rspack_esm_id="5721";export const __rspack_esm_ids=["5721"];export const __webpack_modules__={79271(e,t,n){n.r(t),n.d(t,{JSBlockRunJSContext:()=>a});var r=n(29007);class a extends r.uk{}a.define({label:"RunJS context",properties:{element:{description:`ElementProxy instance providing a safe DOM container.
|
|
2
|
-
Supports innerHTML, append, and other DOM manipulation methods.
|
|
3
|
-
Use this to render content in the JS block.`,detail:"ElementProxy",properties:{innerHTML:"Set or read the HTML content of the container element."}},record:`Current record data object (read-only).
|
|
4
|
-
Available when the JS block is within a data block or detail view context.`,value:"Current value of the field or component, if available in the current context.",React:"React library",antd:"Ant Design library"},methods:{onRefReady:`Wait for container DOM element to be ready before executing callback.
|
|
5
|
-
Parameters: (ref: React.RefObject, callback: (element: HTMLElement) => void, timeout?: number) => void
|
|
6
|
-
Example: ctx.onRefReady(ctx.ref, (el) => { el.innerHTML = "Ready!" })`,requireAsync:"Load external library: `const lib = await ctx.requireAsync(url)`",importAsync:"Dynamically import an ESM module by URL: `const mod = await ctx.importAsync(url)`.\nNote: if the module has only a default export, ctx.importAsync returns that default value directly (no `.default`)."}}),a.define({label:"RunJS 上下文",properties:{element:{description:"ElementProxy,安全的 DOM 容器,支持 innerHTML/append 等",detail:"ElementProxy",properties:{innerHTML:"读取或设置容器的 HTML 内容"}},record:"当前记录(只读,用于数据区块/详情等场景)",value:"当前值(若存在)",React:"React 库",antd:"Ant Design 库"},methods:{onRefReady:"容器 ref 就绪回调:\n```js\nctx.onRefReady(ctx.ref, el => { /* ... */ })\n```",requireAsync:"加载外部库:`const lib = await ctx.requireAsync(url)`",importAsync:"按 URL 动态导入 ESM 模块:`const mod = await ctx.importAsync(url)`。\n注意:当模块只有 default 一个导出时,ctx.importAsync 会直接返回 default 值(无需再写 `.default`)。"}},{locale:"zh-CN"})},91296(e,t,n){n.r(t),n.d(t,{default:()=>r});let r={contexts:[n(79271).JSBlockRunJSContext],prefix:"sn-react-jsx",label:"Render React (JSX)",description:"Render a simple React component using JSX syntax",locales:{"zh-CN":{label:"渲染 React(JSX)",description:"使用 JSX 语法渲染一个简单的 React 组件"}},content:`
|
|
7
|
-
// Render a React component with JSX
|
|
8
|
-
const { React } = ctx.libs;
|
|
9
|
-
|
|
10
|
-
const App = () => (
|
|
11
|
-
<div style={{ padding: 12 }}>
|
|
12
|
-
<h3 style={{ margin: 0, color: '#1890ff' }}>Hello JSX</h3>
|
|
13
|
-
<div style={{ color: '#555' }}>This block is rendered by JSX.</div>
|
|
14
|
-
</div>
|
|
15
|
-
);
|
|
16
|
-
|
|
17
|
-
ctx.render(<App />);
|
|
18
|
-
`}}};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
export const __rspack_esm_id="5759";export const __rspack_esm_ids=["5759"];export const __webpack_modules__={25831(e,t,r){r.r(t),r.d(t,{FormJSFieldItemRunJSContext:()=>n});var o=r(29007);class n extends o.uk{}n.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.`,formValues:{description:"Snapshot of current form values (object). Available in form contexts (CreateForm/EditForm).",detail:"Record<string, any>",examples:["const { name, status } = ctx.formValues || {};"]}},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" })`}}),n.define({label:"表单 JS 字段项 RunJS 上下文",properties:{element:"ElementProxy,表单字段容器",value:"字段值(展示模式为只读;受控场景用 setProps 修改)",record:"当前记录(只读)",formValues:{description:"当前表单值快照(对象)。仅表单相关上下文可用(Create/Edit Form)。",detail:"Record<string, any>",examples:["const { name, status } = ctx.formValues || {};"]}},methods:{onRefReady:"容器就绪回调",setProps:"设置表单项属性:`setProps(fieldModel, { value })`(由联动/表单上下文提供)"}},{locale:"zh-CN"})},98542(e,t,r){r.r(t),r.d(t,{JSFieldRunJSContext:()=>n});var o=r(29007);class n extends o.uk{}n.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 })`}}),n.define({label:"JS 字段 RunJS 上下文",properties:{element:"ElementProxy,字段渲染容器,支持 innerHTML/append 等 DOM 操作",value:"字段当前值(只读)",record:"当前记录对象(只读,包含父记录全部字段值)",collection:"集合定义元数据(只读,描述字段所属集合的 Schema)"},methods:{onRefReady:"在字段容器 DOM 就绪后执行回调。参数:(ref, callback, timeout?);示例:ctx.onRefReady(ctx.ref, el => { el.innerHTML = ctx.value })"}},{locale:"zh-CN"})},73330(e,t,r){r.r(t),r.d(t,{default:()=>a});var o=r(98542),n=r(25831);let a={contexts:[o.JSFieldRunJSContext,n.FormJSFieldItemRunJSContext],prefix:"sn-jsf-percent",label:"Display number field as percentage bar",description:"Render numeric values as a percentage progress bar",locales:{"zh-CN":{label:"将数字字段显示为百分比进度条",description:"将数字格式化为百分比并显示进度条"}},content:`
|
|
13
|
-
const value = Number(ctx.value ?? 0);
|
|
14
|
-
|
|
15
|
-
if (!Number.isFinite(value)) {
|
|
16
|
-
ctx.render('-');
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// Ensure value is between 0 and 100
|
|
21
|
-
const percent = Math.max(0, Math.min(100, value));
|
|
22
|
-
|
|
23
|
-
// Color based on value
|
|
24
|
-
const getColor = (val) => {
|
|
25
|
-
if (val >= 80) return '#52c41a';
|
|
26
|
-
if (val >= 50) return '#faad14';
|
|
27
|
-
return '#f5222d';
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
const color = getColor(percent);
|
|
31
|
-
|
|
32
|
-
ctx.render(\`
|
|
33
|
-
<div style="display: flex; align-items: center; gap: 8px;">
|
|
34
|
-
<div style="flex: 1; height: 8px; background: #f0f0f0; border-radius: 4px; overflow: hidden;">
|
|
35
|
-
<div style="
|
|
36
|
-
width: \${percent}%;
|
|
37
|
-
height: 100%;
|
|
38
|
-
background: \${color};
|
|
39
|
-
transition: width 0.3s ease;
|
|
40
|
-
"></div>
|
|
41
|
-
</div>
|
|
42
|
-
<span style="color: \${color}; font-weight: 500; min-width: 45px; text-align: right;">
|
|
43
|
-
\${percent.toFixed(1)}%
|
|
44
|
-
</span>
|
|
45
|
-
</div>
|
|
46
|
-
\`);
|
|
47
|
-
`}}};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export const __rspack_esm_id="5761";export const __rspack_esm_ids=["5761"];export const __webpack_modules__={32221(e,t,r){r.r(t),r.d(t,{JSItemRunJSContext:()=>i});var o=r(29007);class i extends o.uk{}i.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.`,formValues:{description:"Snapshot of current form values (object). Available in form contexts (CreateForm/EditForm).",detail:"Record<string, any>",examples:["const { name, status } = ctx.formValues || {};"]}},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`}}),i.define({label:"JS 表单项 RunJS 上下文",properties:{element:"ElementProxy,表单项渲染容器,支持 innerHTML/append 等 DOM 操作",resource:"当前资源(只读)",record:"当前记录(只读)",formValues:{description:"当前表单值快照(对象)。仅表单相关上下文可用(Create/Edit Form)。",detail:"Record<string, any>",examples:["const { name, status } = ctx.formValues || {};"]}},methods:{onRefReady:"容器就绪后执行回调。参数:(ref, callback, timeout?)"}},{locale:"zh-CN"})},30008(e,t,r){r.r(t),r.d(t,{default:()=>o});let o={contexts:[r(32221).JSItemRunJSContext],prefix:"sn-link-visibility",label:"Toggle visible",description:"Show or hide another field within linkage scripts",locales:{"zh-CN":{label:"切换可见性",description:"在联动脚本中设置字段显示或隐藏"}},content:`
|
|
6
|
-
const targetFieldUid = 'FIELD_UID_OR_NAME';
|
|
7
|
-
const shouldHide = true;
|
|
8
|
-
|
|
9
|
-
const items = ctx.model?.subModels?.grid?.subModels?.items;
|
|
10
|
-
const candidates = Array.isArray(items)
|
|
11
|
-
? items
|
|
12
|
-
: Array.from(items?.values?.() || items || []);
|
|
13
|
-
const fieldModel =
|
|
14
|
-
candidates.find((item) => item?.uid === targetFieldUid) ||
|
|
15
|
-
candidates.find((item) => item?.props?.name === targetFieldUid);
|
|
16
|
-
|
|
17
|
-
if (!fieldModel) {
|
|
18
|
-
ctx.message?.warning?.(ctx.t('Field {{name}} not found', { name: targetFieldUid }));
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
fieldModel.setProps({ hiddenModel: shouldHide });
|
|
23
|
-
ctx.message?.success?.(
|
|
24
|
-
ctx.t(shouldHide ? 'Hidden field {{name}}' : 'Shown field {{name}}', {
|
|
25
|
-
name: fieldModel?.props?.label || targetFieldUid,
|
|
26
|
-
}),
|
|
27
|
-
);
|
|
28
|
-
`}}};
|