@lowdefy/docs-content 0.0.0-experimental-20260710073520
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/LICENSE +201 -0
- package/README.md +20 -0
- package/content/actions/callapi.md +66 -0
- package/content/actions/callmethod.md +41 -0
- package/content/actions/copytoclipboard.md +32 -0
- package/content/actions/displaymessage.md +53 -0
- package/content/actions/downloadcsv.md +89 -0
- package/content/actions/fetch.md +50 -0
- package/content/actions/geolocationcurrentposition.md +56 -0
- package/content/actions/link.md +104 -0
- package/content/actions/login.md +85 -0
- package/content/actions/logout.md +56 -0
- package/content/actions/pdfmake.md +304 -0
- package/content/actions/request.md +67 -0
- package/content/actions/reset.md +27 -0
- package/content/actions/resetvalidation.md +85 -0
- package/content/actions/scrollto.md +85 -0
- package/content/actions/setdarkmode.md +62 -0
- package/content/actions/setfocus.md +33 -0
- package/content/actions/setglobal.md +63 -0
- package/content/actions/setlocale.md +69 -0
- package/content/actions/setstate.md +70 -0
- package/content/actions/throw.md +72 -0
- package/content/actions/validate.md +87 -0
- package/content/actions/wait.md +24 -0
- package/content/agents/agent-endpoint-tools.md +190 -0
- package/content/agents/agent-mcp-tools.md +124 -0
- package/content/agents/agent-multi-agent.md +136 -0
- package/content/agents/agent-properties.md +174 -0
- package/content/agents/agent-server-hooks.md +336 -0
- package/content/agents/agentchat.md +515 -0
- package/content/agents/agentconversations.md +148 -0
- package/content/concepts/ai-agent-docs.md +190 -0
- package/content/concepts/cli.md +213 -0
- package/content/concepts/connections-and-requests.md +7 -0
- package/content/concepts/custom-html.md +3 -0
- package/content/concepts/custom-styling.md +161 -0
- package/content/concepts/events-and-actions.md +271 -0
- package/content/concepts/hosting-files.md +18 -0
- package/content/concepts/i18n.md +320 -0
- package/content/concepts/keyboard-shortcuts.md +218 -0
- package/content/concepts/layout-overview.md +478 -0
- package/content/concepts/lists.md +144 -0
- package/content/concepts/logger.md +43 -0
- package/content/concepts/lowdefy-schema.md +365 -0
- package/content/concepts/menus.md +144 -0
- package/content/concepts/module-authoring.md +564 -0
- package/content/concepts/modules.md +338 -0
- package/content/concepts/operators.md +45 -0
- package/content/concepts/overview.md +19 -0
- package/content/concepts/references-and-templates.md +207 -0
- package/content/concepts/secrets.md +24 -0
- package/content/concepts/selectors.md +143 -0
- package/content/connections/amazonredshift.md +176 -0
- package/content/connections/anthropic.md +232 -0
- package/content/connections/awss3.md +313 -0
- package/content/connections/azureblobstorage.md +133 -0
- package/content/connections/elasticsearch.md +371 -0
- package/content/connections/google.md +228 -0
- package/content/connections/googlecloudstorage.md +139 -0
- package/content/connections/googlesheet.md +313 -0
- package/content/connections/knex.md +206 -0
- package/content/connections/mariadb.md +177 -0
- package/content/connections/mcp.md +134 -0
- package/content/connections/mongodb.md +739 -0
- package/content/connections/mssql.md +191 -0
- package/content/connections/mysql.md +192 -0
- package/content/connections/openai-connection.md +228 -0
- package/content/connections/postgresql.md +200 -0
- package/content/connections/redis.md +116 -0
- package/content/connections/sendgridmail.md +94 -0
- package/content/connections/smtp.md +149 -0
- package/content/connections/sqlite.md +187 -0
- package/content/connections/stripe.md +115 -0
- package/content/container-blocks/affix.md +413 -0
- package/content/container-blocks/alert.md +937 -0
- package/content/container-blocks/badge.md +1222 -0
- package/content/container-blocks/box.md +1453 -0
- package/content/container-blocks/card.md +1200 -0
- package/content/container-blocks/carousel.md +2247 -0
- package/content/container-blocks/collapse.md +1335 -0
- package/content/container-blocks/configprovider.md +1070 -0
- package/content/container-blocks/confirmmodal.md +1159 -0
- package/content/container-blocks/content.md +597 -0
- package/content/container-blocks/descriptions.md +870 -0
- package/content/container-blocks/drawer.md +1379 -0
- package/content/container-blocks/dropdownmenu.md +643 -0
- package/content/container-blocks/flex.md +1510 -0
- package/content/container-blocks/footer.md +380 -0
- package/content/container-blocks/googlemaps.md +546 -0
- package/content/container-blocks/googlemapsheatmap.md +607 -0
- package/content/container-blocks/googlemapsscript.md +61 -0
- package/content/container-blocks/header.md +302 -0
- package/content/container-blocks/label.md +739 -0
- package/content/container-blocks/layout.md +604 -0
- package/content/container-blocks/masonry.md +1090 -0
- package/content/container-blocks/mobilemenu.md +1244 -0
- package/content/container-blocks/modal.md +1180 -0
- package/content/container-blocks/pageheadermenu.md +614 -0
- package/content/container-blocks/pagesidebarlayout.md +438 -0
- package/content/container-blocks/pagesidermenu.md +651 -0
- package/content/container-blocks/popover.md +1421 -0
- package/content/container-blocks/result.md +972 -0
- package/content/container-blocks/sider.md +1064 -0
- package/content/container-blocks/span.md +747 -0
- package/content/container-blocks/spinner.md +267 -0
- package/content/container-blocks/splitter.md +1735 -0
- package/content/container-blocks/tabs.md +1718 -0
- package/content/container-blocks/tooltip.md +1274 -0
- package/content/container-blocks/watermark.md +515 -0
- package/content/controls/for.md +103 -0
- package/content/controls/if.md +107 -0
- package/content/controls/log.md +50 -0
- package/content/controls/parallel.md +71 -0
- package/content/controls/parallel_for.md +36 -0
- package/content/controls/reject.md +56 -0
- package/content/controls/return.md +66 -0
- package/content/controls/set_state.md +98 -0
- package/content/controls/switch.md +90 -0
- package/content/controls/throw.md +79 -0
- package/content/controls/try.md +88 -0
- package/content/deployment/docker.md +149 -0
- package/content/deployment/node-server.md +27 -0
- package/content/deployment/vercel.md +101 -0
- package/content/display-blocks/aggrid.md +1459 -0
- package/content/display-blocks/anchor.md +336 -0
- package/content/display-blocks/avatar.md +1154 -0
- package/content/display-blocks/breadcrumb.md +517 -0
- package/content/display-blocks/button.md +758 -0
- package/content/display-blocks/calendar.md +156 -0
- package/content/display-blocks/dangeroushtml.md +314 -0
- package/content/display-blocks/dangerousmarkdown.md +423 -0
- package/content/display-blocks/diffgit.md +44 -0
- package/content/display-blocks/difflist.md +225 -0
- package/content/display-blocks/diffsidebyside.md +56 -0
- package/content/display-blocks/difftimeline.md +94 -0
- package/content/display-blocks/divider.md +406 -0
- package/content/display-blocks/download.md +60 -0
- package/content/display-blocks/dropdownbutton.md +661 -0
- package/content/display-blocks/echart.md +418 -0
- package/content/display-blocks/floatbutton.md +545 -0
- package/content/display-blocks/html.md +311 -0
- package/content/display-blocks/icon.md +717 -0
- package/content/display-blocks/img.md +479 -0
- package/content/display-blocks/markdown.md +520 -0
- package/content/display-blocks/markdownwithcode.md +730 -0
- package/content/display-blocks/menu.md +1123 -0
- package/content/display-blocks/message.md +941 -0
- package/content/display-blocks/notification.md +1410 -0
- package/content/display-blocks/paragraph.md +643 -0
- package/content/display-blocks/progress.md +818 -0
- package/content/display-blocks/qrcode.md +519 -0
- package/content/display-blocks/s3download.md +240 -0
- package/content/display-blocks/search.md +360 -0
- package/content/display-blocks/skeleton.md +272 -0
- package/content/display-blocks/skeletonavatar.md +222 -0
- package/content/display-blocks/skeletonbutton.md +245 -0
- package/content/display-blocks/skeletoninput.md +223 -0
- package/content/display-blocks/skeletonparagraph.md +201 -0
- package/content/display-blocks/statistic.md +485 -0
- package/content/display-blocks/steps.md +585 -0
- package/content/display-blocks/tag.md +620 -0
- package/content/display-blocks/title.md +654 -0
- package/content/display-blocks/tour.md +2359 -0
- package/content/input-blocks/autocomplete.md +786 -0
- package/content/input-blocks/buttonselector.md +964 -0
- package/content/input-blocks/checkboxselector.md +765 -0
- package/content/input-blocks/checkboxswitch.md +497 -0
- package/content/input-blocks/colorselector.md +884 -0
- package/content/input-blocks/daterangeselector.md +777 -0
- package/content/input-blocks/dateselector.md +693 -0
- package/content/input-blocks/datetimeselector.md +791 -0
- package/content/input-blocks/inputgallery.md +528 -0
- package/content/input-blocks/monthselector.md +717 -0
- package/content/input-blocks/multipleselector.md +1337 -0
- package/content/input-blocks/numberinput.md +855 -0
- package/content/input-blocks/pagination.md +679 -0
- package/content/input-blocks/paragraphinput.md +1664 -0
- package/content/input-blocks/passwordinput.md +480 -0
- package/content/input-blocks/phonenumberinput.md +688 -0
- package/content/input-blocks/radioselector.md +820 -0
- package/content/input-blocks/ratingslider.md +684 -0
- package/content/input-blocks/s3uploadbutton.md +384 -0
- package/content/input-blocks/s3uploaddragger.md +305 -0
- package/content/input-blocks/s3uploadphoto.md +288 -0
- package/content/input-blocks/segmentedselector.md +782 -0
- package/content/input-blocks/selector.md +1162 -0
- package/content/input-blocks/switch.md +552 -0
- package/content/input-blocks/textarea.md +714 -0
- package/content/input-blocks/textinput.md +639 -0
- package/content/input-blocks/tiptapinput.md +226 -0
- package/content/input-blocks/tiptapmentioninput.md +471 -0
- package/content/input-blocks/titleinput.md +1094 -0
- package/content/input-blocks/treeinput.md +144 -0
- package/content/input-blocks/treemultipleselector.md +162 -0
- package/content/input-blocks/treeselector.md +185 -0
- package/content/input-blocks/upload.md +149 -0
- package/content/input-blocks/uploaddragger.md +85 -0
- package/content/input-blocks/uploadphoto.md +84 -0
- package/content/input-blocks/weekselector.md +630 -0
- package/content/list-blocks/controlledlist.md +498 -0
- package/content/list-blocks/list.md +529 -0
- package/content/list-blocks/listselector.md +301 -0
- package/content/list-blocks/masonrylist.md +230 -0
- package/content/migration/upgrade-guide.md +106 -0
- package/content/migration/v4-to-v5.md +589 -0
- package/content/migration/v5-to-v6.md +36 -0
- package/content/operators/_actions.md +58 -0
- package/content/operators/_and.md +76 -0
- package/content/operators/_api.md +254 -0
- package/content/operators/_app.md +114 -0
- package/content/operators/_args.md +65 -0
- package/content/operators/_array.md +331 -0
- package/content/operators/_base64.md +49 -0
- package/content/operators/_boolean.md +33 -0
- package/content/operators/_build.md +166 -0
- package/content/operators/_change_case.md +357 -0
- package/content/operators/_date.md +415 -0
- package/content/operators/_dayjs.md +128 -0
- package/content/operators/_diff.md +61 -0
- package/content/operators/_divide.md +32 -0
- package/content/operators/_eq.md +52 -0
- package/content/operators/_event.md +86 -0
- package/content/operators/_function.md +52 -0
- package/content/operators/_get.md +92 -0
- package/content/operators/_global.md +86 -0
- package/content/operators/_gt.md +50 -0
- package/content/operators/_gte.md +50 -0
- package/content/operators/_hash.md +112 -0
- package/content/operators/_if.md +30 -0
- package/content/operators/_if_none.md +47 -0
- package/content/operators/_index.md +48 -0
- package/content/operators/_input.md +86 -0
- package/content/operators/_intl.md +135 -0
- package/content/operators/_item.md +166 -0
- package/content/operators/_js.md +113 -0
- package/content/operators/_json.md +120 -0
- package/content/operators/_jsonata.md +152 -0
- package/content/operators/_locale.md +65 -0
- package/content/operators/_location.md +40 -0
- package/content/operators/_log.md +22 -0
- package/content/operators/_lt.md +50 -0
- package/content/operators/_lte.md +50 -0
- package/content/operators/_math.md +407 -0
- package/content/operators/_media.md +83 -0
- package/content/operators/_menu.md +62 -0
- package/content/operators/_module.md +340 -0
- package/content/operators/_mql.md +95 -0
- package/content/operators/_ne.md +62 -0
- package/content/operators/_not.md +33 -0
- package/content/operators/_number.md +159 -0
- package/content/operators/_nunjucks.md +117 -0
- package/content/operators/_object.md +253 -0
- package/content/operators/_operator.md +33 -0
- package/content/operators/_or.md +67 -0
- package/content/operators/_product.md +45 -0
- package/content/operators/_random.md +90 -0
- package/content/operators/_ref.md +80 -0
- package/content/operators/_regex.md +69 -0
- package/content/operators/_request.md +35 -0
- package/content/operators/_request_details.md +29 -0
- package/content/operators/_secret.md +56 -0
- package/content/operators/_state.md +134 -0
- package/content/operators/_step.md +98 -0
- package/content/operators/_string.md +327 -0
- package/content/operators/_subtract.md +24 -0
- package/content/operators/_sum.md +45 -0
- package/content/operators/_switch.md +37 -0
- package/content/operators/_t.md +96 -0
- package/content/operators/_theme.md +65 -0
- package/content/operators/_type.md +78 -0
- package/content/operators/_uri.md +49 -0
- package/content/operators/_url_query.md +92 -0
- package/content/operators/_user.md +154 -0
- package/content/operators/_uuid.md +118 -0
- package/content/operators/_var.md +88 -0
- package/content/operators/_yaml.md +96 -0
- package/content/other/introduction.md +39 -0
- package/content/other/next-auth-providers.md +3 -0
- package/content/other/updatesession.md +26 -0
- package/content/plugins/plugins-actions.md +80 -0
- package/content/plugins/plugins-connections.md +98 -0
- package/content/plugins/plugins-dev.md +138 -0
- package/content/plugins/plugins-introduction.md +29 -0
- package/content/plugins/plugins-operators.md +71 -0
- package/content/testing/e2e-auth.md +108 -0
- package/content/testing/e2e-configuration.md +107 -0
- package/content/testing/e2e-getting-started.md +96 -0
- package/content/testing/e2e-introduction.md +53 -0
- package/content/testing/e2e-mocking.md +155 -0
- package/content/testing/e2e-writing-tests.md +214 -0
- package/content/tutorial/tutorial-actions-operators.md +222 -0
- package/content/tutorial/tutorial-add-blocks.md +86 -0
- package/content/tutorial/tutorial-create-page.md +57 -0
- package/content/tutorial/tutorial-display-data-page.md +181 -0
- package/content/tutorial/tutorial-next-steps.md +53 -0
- package/content/tutorial/tutorial-requests-sql.md +22 -0
- package/content/tutorial/tutorial-start.md +71 -0
- package/content/user-authentication/auth-providers.md +15 -0
- package/content/user-authentication/login-and-logout.md +122 -0
- package/content/user-authentication/users-introduction.md +31 -0
- package/index.json +2281 -0
- package/package.json +34 -0
- package/scripts/extractAgentDocs.js +130 -0
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
# TreeInput
|
|
2
|
+
|
|
3
|
+
Inline tree with nested options and checkboxes. (Renamed from `TreeSelector`.)
|
|
4
|
+
|
|
5
|
+
```yaml
|
|
6
|
+
- id: tree_basic
|
|
7
|
+
type: TreeInput
|
|
8
|
+
properties:
|
|
9
|
+
primaryKey: id
|
|
10
|
+
parentKey: parentId
|
|
11
|
+
valueKey: id
|
|
12
|
+
html: "{{ item.label }}"
|
|
13
|
+
defaultExpandAll: true
|
|
14
|
+
data:
|
|
15
|
+
- id: 1
|
|
16
|
+
label: Engineering
|
|
17
|
+
- id: 2
|
|
18
|
+
label: Frontend
|
|
19
|
+
parentId: 1
|
|
20
|
+
- id: 3
|
|
21
|
+
label: Backend
|
|
22
|
+
parentId: 1
|
|
23
|
+
- id: 4
|
|
24
|
+
label: Operations
|
|
25
|
+
- id: 5
|
|
26
|
+
label: SRE
|
|
27
|
+
parentId: 4
|
|
28
|
+
events:
|
|
29
|
+
onChange:
|
|
30
|
+
- id: capture
|
|
31
|
+
type: SetState
|
|
32
|
+
params:
|
|
33
|
+
dept:
|
|
34
|
+
_event: value
|
|
35
|
+
- id: tree_basic_display
|
|
36
|
+
type: Paragraph
|
|
37
|
+
properties:
|
|
38
|
+
content:
|
|
39
|
+
_nunjucks:
|
|
40
|
+
template: 'Selected: {{ dept if dept != null else "—" }}'
|
|
41
|
+
on:
|
|
42
|
+
_state: true
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
```yaml
|
|
46
|
+
- id: tree_line
|
|
47
|
+
type: TreeInput
|
|
48
|
+
properties:
|
|
49
|
+
showLine: true
|
|
50
|
+
checkable: true
|
|
51
|
+
primaryKey: id
|
|
52
|
+
parentKey: parentId
|
|
53
|
+
valueKey: id
|
|
54
|
+
html: "{{ item.label }}"
|
|
55
|
+
defaultExpandAll: true
|
|
56
|
+
data:
|
|
57
|
+
- id: 1
|
|
58
|
+
label: Fruits
|
|
59
|
+
- id: 2
|
|
60
|
+
label: Apple
|
|
61
|
+
parentId: 1
|
|
62
|
+
- id: 3
|
|
63
|
+
label: Banana
|
|
64
|
+
parentId: 1
|
|
65
|
+
- id: 4
|
|
66
|
+
label: Vegetables
|
|
67
|
+
- id: 5
|
|
68
|
+
label: Carrot
|
|
69
|
+
parentId: 4
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
```yaml
|
|
73
|
+
- id: tree_options
|
|
74
|
+
type: TreeInput
|
|
75
|
+
properties:
|
|
76
|
+
primaryKey: value
|
|
77
|
+
parentKey: parent
|
|
78
|
+
defaultExpandAll: true
|
|
79
|
+
options:
|
|
80
|
+
- value: eng
|
|
81
|
+
label: Engineering
|
|
82
|
+
- value: fe
|
|
83
|
+
label: Frontend
|
|
84
|
+
parent: eng
|
|
85
|
+
- value: be
|
|
86
|
+
label: Backend
|
|
87
|
+
parent: eng
|
|
88
|
+
- value: ops
|
|
89
|
+
label: Operations
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
| Property | Type | Default | Description |
|
|
93
|
+
| --- | --- | --- | --- |
|
|
94
|
+
| `data` | array | - | Alternative to `options`: an array of raw rows. Each row is rendered to a label with the `html` template, and `valueKey` selects which field becomes the value. Use this to drive a selector directly from data without building label/value pairs in your request. |
|
|
95
|
+
| `html` | string | - | Nunjucks template that renders each option label when using `data`. The context exposes `item` (the current row) and `index` (the zero-based row index). Ignored when `options` is used. |
|
|
96
|
+
| `valueKey` | string | - | Field used as the selected value. With `options` it names the value field (defaults to "value"). With `data` it names the field stored when an option is selected; omit it to store the whole row. Supports dotted paths (e.g. "user.id"). |
|
|
97
|
+
| `primaryKey` | string | - | Field used to match the current value (e.g. set with SetState) back to an option for highlighting. Defaults to `valueKey`. Set this when the stored value is the whole row but a single field (e.g. "id") uniquely identifies it. In the tree selectors it also serves as each node’s id, referenced by `parentKey`. Supports dotted paths. |
|
|
98
|
+
| `parentKey` | string | - | Tree selectors only: names each row’s parent id. Build a flat `data`/`options` array where each row has a `primaryKey` (its own id) and a `parentKey` whose value equals the parent row’s `primaryKey`. Rows whose `parentKey` is empty or points at no row become tree roots. Supports dotted paths. |
|
|
99
|
+
| `options` | array | `[]` | Options can either be an array of primitive values, on an array of label, value pairs - supports html. |
|
|
100
|
+
| `options.$.label` | string | - | Value label shown to user - supports html. |
|
|
101
|
+
| `options.$.value` | string \| number \| boolean | - | Option value. |
|
|
102
|
+
| `options.$.disabled` | boolean | `false` | Disable the option if true. |
|
|
103
|
+
| `options.$.style` | object | - | Css style to apply to the option. |
|
|
104
|
+
| `options.$.color` | string | - | Color applied to this option when it is selected. Falls back to the block-level color when not set. |
|
|
105
|
+
| `disabled` | boolean | `false` | Disable the block if true. |
|
|
106
|
+
| `checkable` | boolean | `false` | Show checkboxes on the tree nodes. |
|
|
107
|
+
| `showLine` | boolean | `false` | Show a connecting line if true. |
|
|
108
|
+
| `selectable` | boolean | `true` | Selectable if true. |
|
|
109
|
+
| `defaultExpandAll` | boolean | `false` | Expand all tree nodes by default. |
|
|
110
|
+
| `theme` | object | - | Antd design token overrides for this block. See [antd design tokens](https://ant.design/components/overview#design-token). See [Ant Design tree-select tokens](https://ant.design/components/tree-select#design-token). |
|
|
111
|
+
| `theme.nodeSelectedBg` | string | - | Background color of selected tree node. |
|
|
112
|
+
| `theme.nodeHoverBg` | string | - | Background color of hovered tree node. |
|
|
113
|
+
| `theme.titleHeight` | number | `24` | Height of tree node title. |
|
|
114
|
+
| `theme.clearBg` | string | - | Background color of clear button. |
|
|
115
|
+
| `theme.selectorBg` | string | - | Background color of the selector. |
|
|
116
|
+
| `theme.hoverBorderColor` | string | - | Border color when hovered. |
|
|
117
|
+
| `theme.activeBorderColor` | string | - | Border color when active/focused. |
|
|
118
|
+
| `theme.activeOutlineColor` | string | - | Outline color when active/focused. |
|
|
119
|
+
| `theme.optionSelectedBg` | string | - | Background of selected option. |
|
|
120
|
+
| `theme.optionSelectedColor` | string | - | Text color of selected option. |
|
|
121
|
+
| `theme.optionSelectedFontWeight` | string | - | Font weight of selected option. |
|
|
122
|
+
| `theme.optionActiveBg` | string | - | Background of active (hovered) option. |
|
|
123
|
+
| `theme.optionFontSize` | number | `14` | Font size of options. |
|
|
124
|
+
| `theme.optionHeight` | number | `32` | Height of each option. |
|
|
125
|
+
| `theme.optionLineHeight` | string | - | Line height of options. |
|
|
126
|
+
| `theme.optionPadding` | string | - | Padding of options. |
|
|
127
|
+
| `theme.multipleSelectorBgDisabled` | string | - | Background when disabled in multiple mode. |
|
|
128
|
+
| `theme.multipleItemBg` | string | - | Background of tag items in multiple mode. |
|
|
129
|
+
| `theme.multipleItemBorderColor` | string | - | Border color of tag items. |
|
|
130
|
+
| `theme.multipleItemHeight` | number | `24` | Height of tag items. |
|
|
131
|
+
| `theme.multipleItemHeightSM` | number | `16` | Height of tag items (small). |
|
|
132
|
+
| `theme.multipleItemHeightLG` | number | `32` | Height of tag items (large). |
|
|
133
|
+
| `theme.zIndexPopup` | number | `1050` | z-index of the dropdown. |
|
|
134
|
+
|
|
135
|
+
| Event | Event Data | Description |
|
|
136
|
+
| --- | --- | --- |
|
|
137
|
+
| `onChange` | `{ value }` | Trigger action when selection is changed. |
|
|
138
|
+
|
|
139
|
+
| Key | Target |
|
|
140
|
+
| --- | --- |
|
|
141
|
+
| `/block` | Outer block wrapper (always available). |
|
|
142
|
+
| `/element` | The TreeInput element. |
|
|
143
|
+
|
|
144
|
+
No slots defined.
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# TreeMultipleSelector
|
|
2
|
+
|
|
3
|
+
Searchable multiple-select tree dropdown (tags or checkboxes). Driven by flat `data`/`options` with `primaryKey`/`parentKey` for hierarchy.
|
|
4
|
+
|
|
5
|
+
```yaml
|
|
6
|
+
- id: basic_tree_multiple
|
|
7
|
+
type: TreeMultipleSelector
|
|
8
|
+
properties:
|
|
9
|
+
title: Categories
|
|
10
|
+
primaryKey: id
|
|
11
|
+
parentKey: parentId
|
|
12
|
+
valueKey: id
|
|
13
|
+
html: "{{ item.label }}"
|
|
14
|
+
treeDefaultExpandAll: true
|
|
15
|
+
data:
|
|
16
|
+
- id: 1
|
|
17
|
+
label: Electronics
|
|
18
|
+
- id: 2
|
|
19
|
+
label: Phones
|
|
20
|
+
parentId: 1
|
|
21
|
+
- id: 3
|
|
22
|
+
label: Laptops
|
|
23
|
+
parentId: 1
|
|
24
|
+
- id: 4
|
|
25
|
+
label: Clothing
|
|
26
|
+
- id: 5
|
|
27
|
+
label: Shirts
|
|
28
|
+
parentId: 4
|
|
29
|
+
- id: 6
|
|
30
|
+
label: Shoes
|
|
31
|
+
parentId: 4
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
```yaml
|
|
35
|
+
- id: checkable_tree_multiple
|
|
36
|
+
type: TreeMultipleSelector
|
|
37
|
+
properties:
|
|
38
|
+
title: Permissions
|
|
39
|
+
checkable: true
|
|
40
|
+
showCheckedStrategy: SHOW_CHILD
|
|
41
|
+
primaryKey: id
|
|
42
|
+
parentKey: parentId
|
|
43
|
+
valueKey: id
|
|
44
|
+
html: "{{ item.label }}"
|
|
45
|
+
treeDefaultExpandAll: true
|
|
46
|
+
data:
|
|
47
|
+
- id: 1
|
|
48
|
+
label: Read
|
|
49
|
+
- id: 2
|
|
50
|
+
label: Write
|
|
51
|
+
- id: 3
|
|
52
|
+
label: Create
|
|
53
|
+
parentId: 2
|
|
54
|
+
- id: 4
|
|
55
|
+
label: Update
|
|
56
|
+
parentId: 2
|
|
57
|
+
- id: 5
|
|
58
|
+
label: Admin
|
|
59
|
+
events:
|
|
60
|
+
onChange:
|
|
61
|
+
- id: capture
|
|
62
|
+
type: SetState
|
|
63
|
+
params:
|
|
64
|
+
perms:
|
|
65
|
+
_event: value
|
|
66
|
+
- id: checkable_tree_display
|
|
67
|
+
type: Paragraph
|
|
68
|
+
properties:
|
|
69
|
+
content:
|
|
70
|
+
_nunjucks:
|
|
71
|
+
template: "Selected: {{ perms }}"
|
|
72
|
+
on:
|
|
73
|
+
_state: true
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
| Property | Type | Default | Description |
|
|
77
|
+
| --- | --- | --- | --- |
|
|
78
|
+
| `data` | array | - | Alternative to `options`: an array of raw rows. Each row is rendered to a label with the `html` template, and `valueKey` selects which field becomes the value. Use this to drive a selector directly from data without building label/value pairs in your request. |
|
|
79
|
+
| `html` | string | - | Nunjucks template that renders each option label when using `data`. The context exposes `item` (the current row) and `index` (the zero-based row index). Ignored when `options` is used. |
|
|
80
|
+
| `valueKey` | string | - | Field used as the selected value. With `options` it names the value field (defaults to "value"). With `data` it names the field stored when an option is selected; omit it to store the whole row. Supports dotted paths (e.g. "user.id"). |
|
|
81
|
+
| `primaryKey` | string | - | Field used to match the current value (e.g. set with SetState) back to an option for highlighting. Defaults to `valueKey`. Set this when the stored value is the whole row but a single field (e.g. "id") uniquely identifies it. In the tree selectors it also serves as each node’s id, referenced by `parentKey`. Supports dotted paths. |
|
|
82
|
+
| `parentKey` | string | - | Tree selectors only: names each row’s parent id. Build a flat `data`/`options` array where each row has a `primaryKey` (its own id) and a `parentKey` whose value equals the parent row’s `primaryKey`. Rows whose `parentKey` is empty or points at no row become tree roots. Supports dotted paths. |
|
|
83
|
+
| `options` | array | `[]` | Options can either be an array of primitive values, on an array of label, value pairs - supports html. |
|
|
84
|
+
| `options.$.label` | string | - | Value label shown to user - supports html. |
|
|
85
|
+
| `options.$.value` | string \| number \| boolean | - | Option value. |
|
|
86
|
+
| `options.$.disabled` | boolean | `false` | Disable the option if true. |
|
|
87
|
+
| `options.$.style` | object | - | Css style to apply to the option. |
|
|
88
|
+
| `options.$.color` | string | - | Color applied to this option when it is selected. Falls back to the block-level color when not set. |
|
|
89
|
+
| `label` | object | - | Label properties. |
|
|
90
|
+
| `label.align` | string | `"left"` | Align label left or right when inline. Enum: `left`, `right`. |
|
|
91
|
+
| `label.colon` | boolean | `true` | Append label with colon. |
|
|
92
|
+
| `label.extra` | string | - | Extra text to display beneath the content - supports html. |
|
|
93
|
+
| `label.title` | string | - | Label title - supports html. |
|
|
94
|
+
| `label.tooltip` | string \| object | - | Help tooltip shown via an icon beside the label. A string sets the tooltip text (supports html), or an object to also customize the icon and color. Use the block's onTooltipClick event to respond to clicks on the icon. |
|
|
95
|
+
| `label.tooltip.title` | string | - | Tooltip text shown on hover - supports html. |
|
|
96
|
+
| `label.tooltip.icon` | string | `"AiOutlineQuestionCircle"` | Name of the icon to show beside the label. |
|
|
97
|
+
| `label.tooltip.color` | string | - | Color of the tooltip icon. |
|
|
98
|
+
| `label.span` | number | - | Label inline span. |
|
|
99
|
+
| `label.disabled` | boolean | `false` | Hide input label. |
|
|
100
|
+
| `label.hasFeedback` | boolean | `true` | Display feedback extra from validation, this does not disable validation. |
|
|
101
|
+
| `label.inline` | boolean | `false` | Render input and label inline. |
|
|
102
|
+
| `disabled` | boolean | `false` | Disable the block if true. |
|
|
103
|
+
| `autoFocus` | boolean | `false` | Autofocus to the block on page load. |
|
|
104
|
+
| `allowClear` | boolean | `true` | Allow the user to clear their input. |
|
|
105
|
+
| `bordered` | boolean | `true` | Whether or not the input has a border style. Deprecated, use variant instead. |
|
|
106
|
+
| `variant` | string | - | Input visual variant. When set, takes precedence over bordered. Enum: `outlined`, `filled`, `borderless`. |
|
|
107
|
+
| `size` | string | `"default"` | Size of the block. Enum: `small`, `default`, `large`. |
|
|
108
|
+
| `title` | string | - | Title to describe the input component, if no title is specified the block id is displayed - supports html. |
|
|
109
|
+
| `placeholder` | string | `"Select items"` | Placeholder text inside the block before user types input. |
|
|
110
|
+
| `showSearch` | boolean | `true` | Make the tree searchable. |
|
|
111
|
+
| `treeDefaultExpandAll` | boolean | `false` | Expand all tree nodes by default. |
|
|
112
|
+
| `checkable` | boolean | `false` | Show checkboxes on the tree nodes instead of selectable tags. |
|
|
113
|
+
| `showCheckedStrategy` | string | `"SHOW_CHILD"` | How checked nodes are shown when `checkable` is true: SHOW_ALL (all checked), SHOW_PARENT (parent only), SHOW_CHILD (leaf children only). Enum: `SHOW_ALL`, `SHOW_PARENT`, `SHOW_CHILD`. |
|
|
114
|
+
| `maxTagCount` | number | - | Maximum number of selected tags shown before collapsing into a count. |
|
|
115
|
+
| `notFoundContent` | string | `"Not found"` | Content shown when no nodes match the search. |
|
|
116
|
+
| `suffixIcon` | string \| object | `"AiOutlineDown"` | Dropdown suffix icon. |
|
|
117
|
+
| `clearIcon` | string \| object | `"AiOutlineCloseCircle"` | Clear icon. |
|
|
118
|
+
| `theme` | object | - | Antd design token overrides for this block. See [antd design tokens](https://ant.design/components/overview#design-token). See [Ant Design tree-select tokens](https://ant.design/components/tree-select#design-token). |
|
|
119
|
+
| `theme.nodeSelectedBg` | string | - | Background color of selected tree node. |
|
|
120
|
+
| `theme.nodeHoverBg` | string | - | Background color of hovered tree node. |
|
|
121
|
+
| `theme.titleHeight` | number | `24` | Height of tree node title. |
|
|
122
|
+
| `theme.clearBg` | string | - | Background color of clear button. |
|
|
123
|
+
| `theme.selectorBg` | string | - | Background color of the selector. |
|
|
124
|
+
| `theme.hoverBorderColor` | string | - | Border color when hovered. |
|
|
125
|
+
| `theme.activeBorderColor` | string | - | Border color when active/focused. |
|
|
126
|
+
| `theme.activeOutlineColor` | string | - | Outline color when active/focused. |
|
|
127
|
+
| `theme.optionSelectedBg` | string | - | Background of selected option. |
|
|
128
|
+
| `theme.optionSelectedColor` | string | - | Text color of selected option. |
|
|
129
|
+
| `theme.optionSelectedFontWeight` | string | - | Font weight of selected option. |
|
|
130
|
+
| `theme.optionActiveBg` | string | - | Background of active (hovered) option. |
|
|
131
|
+
| `theme.optionFontSize` | number | `14` | Font size of options. |
|
|
132
|
+
| `theme.optionHeight` | number | `32` | Height of each option. |
|
|
133
|
+
| `theme.optionLineHeight` | string | - | Line height of options. |
|
|
134
|
+
| `theme.optionPadding` | string | - | Padding of options. |
|
|
135
|
+
| `theme.multipleSelectorBgDisabled` | string | - | Background when disabled in multiple mode. |
|
|
136
|
+
| `theme.multipleItemBg` | string | - | Background of tag items in multiple mode. |
|
|
137
|
+
| `theme.multipleItemBorderColor` | string | - | Border color of tag items. |
|
|
138
|
+
| `theme.multipleItemHeight` | number | `24` | Height of tag items. |
|
|
139
|
+
| `theme.multipleItemHeightSM` | number | `16` | Height of tag items (small). |
|
|
140
|
+
| `theme.multipleItemHeightLG` | number | `32` | Height of tag items (large). |
|
|
141
|
+
| `theme.zIndexPopup` | number | `1050` | z-index of the dropdown. |
|
|
142
|
+
|
|
143
|
+
| Event | Event Data | Description |
|
|
144
|
+
| --- | --- | --- |
|
|
145
|
+
| `onBlur` | \- | Trigger action when the selector loses focus. |
|
|
146
|
+
| `onChange` | `{ value }` | Trigger action when selection is changed. |
|
|
147
|
+
| `onFocus` | \- | Trigger action when the selector gains focus. |
|
|
148
|
+
| `onClear` | \- | Trigger action when the selector is cleared. |
|
|
149
|
+
| `onSearch` | `{ value }` | Trigger action when the search input changes. |
|
|
150
|
+
| `onTooltipClick` | \- | Trigger actions when the tooltip icon is clicked. |
|
|
151
|
+
|
|
152
|
+
| Key | Target |
|
|
153
|
+
| --- | --- |
|
|
154
|
+
| `/block` | Outer block wrapper (always available). |
|
|
155
|
+
| `/element` | The TreeMultipleSelector element. |
|
|
156
|
+
| `/label` | The TreeMultipleSelector label. |
|
|
157
|
+
| `/extra` | The TreeMultipleSelector extra content. |
|
|
158
|
+
| `/feedback` | The TreeMultipleSelector validation feedback. |
|
|
159
|
+
| `/suffixIcon` | The suffix icon in the TreeMultipleSelector. |
|
|
160
|
+
| `/clearIcon` | The clear icon in the TreeMultipleSelector. |
|
|
161
|
+
|
|
162
|
+
No slots defined.
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
# TreeSelector
|
|
2
|
+
|
|
3
|
+
Searchable single-select tree dropdown. Driven by flat `data`/`options` with `primaryKey`/`parentKey` for hierarchy.
|
|
4
|
+
|
|
5
|
+
```yaml
|
|
6
|
+
- id: basic_tree_selector
|
|
7
|
+
type: TreeSelector
|
|
8
|
+
properties:
|
|
9
|
+
title: Category
|
|
10
|
+
primaryKey: id
|
|
11
|
+
parentKey: parentId
|
|
12
|
+
valueKey: id
|
|
13
|
+
html: "{{ item.label }}"
|
|
14
|
+
treeDefaultExpandAll: true
|
|
15
|
+
data:
|
|
16
|
+
- id: 1
|
|
17
|
+
label: Electronics
|
|
18
|
+
- id: 2
|
|
19
|
+
label: Phones
|
|
20
|
+
parentId: 1
|
|
21
|
+
- id: 3
|
|
22
|
+
label: Laptops
|
|
23
|
+
parentId: 1
|
|
24
|
+
- id: 4
|
|
25
|
+
label: Clothing
|
|
26
|
+
- id: 5
|
|
27
|
+
label: Shirts
|
|
28
|
+
parentId: 4
|
|
29
|
+
- id: 6
|
|
30
|
+
label: Shoes
|
|
31
|
+
parentId: 4
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
```yaml
|
|
35
|
+
- id: value_tree_selector
|
|
36
|
+
type: TreeSelector
|
|
37
|
+
properties:
|
|
38
|
+
title: Region
|
|
39
|
+
placeholder: Pick a region...
|
|
40
|
+
primaryKey: id
|
|
41
|
+
parentKey: parentId
|
|
42
|
+
valueKey: code
|
|
43
|
+
html: "{{ item.label }}"
|
|
44
|
+
treeDefaultExpandAll: true
|
|
45
|
+
data:
|
|
46
|
+
- id: 1
|
|
47
|
+
label: Europe
|
|
48
|
+
code: eu
|
|
49
|
+
- id: 2
|
|
50
|
+
label: Germany
|
|
51
|
+
code: de
|
|
52
|
+
parentId: 1
|
|
53
|
+
- id: 3
|
|
54
|
+
label: France
|
|
55
|
+
code: fr
|
|
56
|
+
parentId: 1
|
|
57
|
+
- id: 4
|
|
58
|
+
label: Americas
|
|
59
|
+
code: am
|
|
60
|
+
- id: 5
|
|
61
|
+
label: United States
|
|
62
|
+
code: us
|
|
63
|
+
parentId: 4
|
|
64
|
+
events:
|
|
65
|
+
onChange:
|
|
66
|
+
- id: capture
|
|
67
|
+
type: SetState
|
|
68
|
+
params:
|
|
69
|
+
region:
|
|
70
|
+
_event: value
|
|
71
|
+
- id: value_tree_display
|
|
72
|
+
type: Paragraph
|
|
73
|
+
properties:
|
|
74
|
+
content:
|
|
75
|
+
_nunjucks:
|
|
76
|
+
template: 'Selected code: {{ region if region != null else "—" }}'
|
|
77
|
+
on:
|
|
78
|
+
_state: true
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
```yaml
|
|
82
|
+
- id: options_tree_selector
|
|
83
|
+
type: TreeSelector
|
|
84
|
+
properties:
|
|
85
|
+
title: Department
|
|
86
|
+
primaryKey: value
|
|
87
|
+
parentKey: parent
|
|
88
|
+
treeDefaultExpandAll: true
|
|
89
|
+
options:
|
|
90
|
+
- value: eng
|
|
91
|
+
label: Engineering
|
|
92
|
+
- value: fe
|
|
93
|
+
label: Frontend
|
|
94
|
+
parent: eng
|
|
95
|
+
- value: be
|
|
96
|
+
label: Backend
|
|
97
|
+
parent: eng
|
|
98
|
+
- value: ops
|
|
99
|
+
label: Operations
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
| Property | Type | Default | Description |
|
|
103
|
+
| --- | --- | --- | --- |
|
|
104
|
+
| `data` | array | - | Alternative to `options`: an array of raw rows. Each row is rendered to a label with the `html` template, and `valueKey` selects which field becomes the value. Use this to drive a selector directly from data without building label/value pairs in your request. |
|
|
105
|
+
| `html` | string | - | Nunjucks template that renders each option label when using `data`. The context exposes `item` (the current row) and `index` (the zero-based row index). Ignored when `options` is used. |
|
|
106
|
+
| `valueKey` | string | - | Field used as the selected value. With `options` it names the value field (defaults to "value"). With `data` it names the field stored when an option is selected; omit it to store the whole row. Supports dotted paths (e.g. "user.id"). |
|
|
107
|
+
| `primaryKey` | string | - | Field used to match the current value (e.g. set with SetState) back to an option for highlighting. Defaults to `valueKey`. Set this when the stored value is the whole row but a single field (e.g. "id") uniquely identifies it. In the tree selectors it also serves as each node’s id, referenced by `parentKey`. Supports dotted paths. |
|
|
108
|
+
| `parentKey` | string | - | Tree selectors only: names each row’s parent id. Build a flat `data`/`options` array where each row has a `primaryKey` (its own id) and a `parentKey` whose value equals the parent row’s `primaryKey`. Rows whose `parentKey` is empty or points at no row become tree roots. Supports dotted paths. |
|
|
109
|
+
| `options` | array | `[]` | Options can either be an array of primitive values, on an array of label, value pairs - supports html. |
|
|
110
|
+
| `options.$.label` | string | - | Value label shown to user - supports html. |
|
|
111
|
+
| `options.$.value` | string \| number \| boolean | - | Option value. |
|
|
112
|
+
| `options.$.disabled` | boolean | `false` | Disable the option if true. |
|
|
113
|
+
| `options.$.style` | object | - | Css style to apply to the option. |
|
|
114
|
+
| `options.$.color` | string | - | Color applied to this option when it is selected. Falls back to the block-level color when not set. |
|
|
115
|
+
| `label` | object | - | Label properties. |
|
|
116
|
+
| `label.align` | string | `"left"` | Align label left or right when inline. Enum: `left`, `right`. |
|
|
117
|
+
| `label.colon` | boolean | `true` | Append label with colon. |
|
|
118
|
+
| `label.extra` | string | - | Extra text to display beneath the content - supports html. |
|
|
119
|
+
| `label.title` | string | - | Label title - supports html. |
|
|
120
|
+
| `label.tooltip` | string \| object | - | Help tooltip shown via an icon beside the label. A string sets the tooltip text (supports html), or an object to also customize the icon and color. Use the block's onTooltipClick event to respond to clicks on the icon. |
|
|
121
|
+
| `label.tooltip.title` | string | - | Tooltip text shown on hover - supports html. |
|
|
122
|
+
| `label.tooltip.icon` | string | `"AiOutlineQuestionCircle"` | Name of the icon to show beside the label. |
|
|
123
|
+
| `label.tooltip.color` | string | - | Color of the tooltip icon. |
|
|
124
|
+
| `label.span` | number | - | Label inline span. |
|
|
125
|
+
| `label.disabled` | boolean | `false` | Hide input label. |
|
|
126
|
+
| `label.hasFeedback` | boolean | `true` | Display feedback extra from validation, this does not disable validation. |
|
|
127
|
+
| `label.inline` | boolean | `false` | Render input and label inline. |
|
|
128
|
+
| `disabled` | boolean | `false` | Disable the block if true. |
|
|
129
|
+
| `autoFocus` | boolean | `false` | Autofocus to the block on page load. |
|
|
130
|
+
| `allowClear` | boolean | `true` | Allow the user to clear their input. |
|
|
131
|
+
| `bordered` | boolean | `true` | Whether or not the input has a border style. Deprecated, use variant instead. |
|
|
132
|
+
| `variant` | string | - | Input visual variant. When set, takes precedence over bordered. Enum: `outlined`, `filled`, `borderless`. |
|
|
133
|
+
| `size` | string | `"default"` | Size of the block. Enum: `small`, `default`, `large`. |
|
|
134
|
+
| `title` | string | - | Title to describe the input component, if no title is specified the block id is displayed - supports html. |
|
|
135
|
+
| `placeholder` | string | `"Select item"` | Placeholder text inside the block before user types input. |
|
|
136
|
+
| `showSearch` | boolean | `true` | Make the tree searchable. |
|
|
137
|
+
| `treeDefaultExpandAll` | boolean | `false` | Expand all tree nodes by default. |
|
|
138
|
+
| `notFoundContent` | string | `"Not found"` | Content shown when no nodes match the search. |
|
|
139
|
+
| `suffixIcon` | string \| object | `"AiOutlineDown"` | Dropdown suffix icon. |
|
|
140
|
+
| `clearIcon` | string \| object | `"AiOutlineCloseCircle"` | Clear icon. |
|
|
141
|
+
| `theme` | object | - | Antd design token overrides for this block. See [antd design tokens](https://ant.design/components/overview#design-token). See [Ant Design tree-select tokens](https://ant.design/components/tree-select#design-token). |
|
|
142
|
+
| `theme.nodeSelectedBg` | string | - | Background color of selected tree node. |
|
|
143
|
+
| `theme.nodeHoverBg` | string | - | Background color of hovered tree node. |
|
|
144
|
+
| `theme.titleHeight` | number | `24` | Height of tree node title. |
|
|
145
|
+
| `theme.clearBg` | string | - | Background color of clear button. |
|
|
146
|
+
| `theme.selectorBg` | string | - | Background color of the selector. |
|
|
147
|
+
| `theme.hoverBorderColor` | string | - | Border color when hovered. |
|
|
148
|
+
| `theme.activeBorderColor` | string | - | Border color when active/focused. |
|
|
149
|
+
| `theme.activeOutlineColor` | string | - | Outline color when active/focused. |
|
|
150
|
+
| `theme.optionSelectedBg` | string | - | Background of selected option. |
|
|
151
|
+
| `theme.optionSelectedColor` | string | - | Text color of selected option. |
|
|
152
|
+
| `theme.optionSelectedFontWeight` | string | - | Font weight of selected option. |
|
|
153
|
+
| `theme.optionActiveBg` | string | - | Background of active (hovered) option. |
|
|
154
|
+
| `theme.optionFontSize` | number | `14` | Font size of options. |
|
|
155
|
+
| `theme.optionHeight` | number | `32` | Height of each option. |
|
|
156
|
+
| `theme.optionLineHeight` | string | - | Line height of options. |
|
|
157
|
+
| `theme.optionPadding` | string | - | Padding of options. |
|
|
158
|
+
| `theme.multipleSelectorBgDisabled` | string | - | Background when disabled in multiple mode. |
|
|
159
|
+
| `theme.multipleItemBg` | string | - | Background of tag items in multiple mode. |
|
|
160
|
+
| `theme.multipleItemBorderColor` | string | - | Border color of tag items. |
|
|
161
|
+
| `theme.multipleItemHeight` | number | `24` | Height of tag items. |
|
|
162
|
+
| `theme.multipleItemHeightSM` | number | `16` | Height of tag items (small). |
|
|
163
|
+
| `theme.multipleItemHeightLG` | number | `32` | Height of tag items (large). |
|
|
164
|
+
| `theme.zIndexPopup` | number | `1050` | z-index of the dropdown. |
|
|
165
|
+
|
|
166
|
+
| Event | Event Data | Description |
|
|
167
|
+
| --- | --- | --- |
|
|
168
|
+
| `onBlur` | \- | Trigger action when the selector loses focus. |
|
|
169
|
+
| `onChange` | `{ value }` | Trigger action when selection is changed. |
|
|
170
|
+
| `onFocus` | \- | Trigger action when the selector gains focus. |
|
|
171
|
+
| `onClear` | \- | Trigger action when the selector is cleared. |
|
|
172
|
+
| `onSearch` | `{ value }` | Trigger action when the search input changes. |
|
|
173
|
+
| `onTooltipClick` | \- | Trigger actions when the tooltip icon is clicked. |
|
|
174
|
+
|
|
175
|
+
| Key | Target |
|
|
176
|
+
| --- | --- |
|
|
177
|
+
| `/block` | Outer block wrapper (always available). |
|
|
178
|
+
| `/element` | The TreeSelector element. |
|
|
179
|
+
| `/label` | The TreeSelector label. |
|
|
180
|
+
| `/extra` | The TreeSelector extra content. |
|
|
181
|
+
| `/feedback` | The TreeSelector validation feedback. |
|
|
182
|
+
| `/suffixIcon` | The suffix icon in the TreeSelector. |
|
|
183
|
+
| `/clearIcon` | The clear icon in the TreeSelector. |
|
|
184
|
+
|
|
185
|
+
No slots defined.
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# Upload
|
|
2
|
+
|
|
3
|
+
Upload files to any storage provider with a button trigger — AWS S3 (and S3-compatible services like Cloudflare R2 and MinIO), Google Cloud Storage, or Azure Blob Storage. The block calls an upload-policy request by id (`uploadPolicyRequestId`) and uploads the file directly from the browser to the provider. Set `emitFileContent: true` to instead emit the file as `{ name, size, type, content }` (base64) for server-side storage through an API endpoint routine. Supports file type filtering, upload limits, and custom button styling.
|
|
4
|
+
|
|
5
|
+
> The Upload block requires an upload-policy request (AwsS3PresignedPostPolicy, GcsSignedPostPolicy, or AzureBlobUploadSas) referenced by uploadPolicyRequestId, unless emitFileContent is true. The examples on this page demonstrate UI configuration only — uploads will not function without a configured storage connection.
|
|
6
|
+
|
|
7
|
+
```yaml
|
|
8
|
+
- id: basic_default
|
|
9
|
+
type: Upload
|
|
10
|
+
properties:
|
|
11
|
+
uploadPolicyRequestId: upload_policy_request
|
|
12
|
+
- id: basic_custom_title
|
|
13
|
+
type: Upload
|
|
14
|
+
properties:
|
|
15
|
+
uploadPolicyRequestId: upload_policy_request
|
|
16
|
+
button:
|
|
17
|
+
icon: UploadOutlined
|
|
18
|
+
title: Choose File
|
|
19
|
+
type: default
|
|
20
|
+
- id: basic_custom_icon
|
|
21
|
+
type: Upload
|
|
22
|
+
properties:
|
|
23
|
+
uploadPolicyRequestId: upload_policy_request
|
|
24
|
+
button:
|
|
25
|
+
icon: AiOutlineCloudUpload
|
|
26
|
+
title: Upload to Cloud
|
|
27
|
+
type: default
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
```yaml
|
|
31
|
+
- id: accept_images
|
|
32
|
+
type: Upload
|
|
33
|
+
properties:
|
|
34
|
+
uploadPolicyRequestId: upload_policy_request
|
|
35
|
+
accept: image/*
|
|
36
|
+
button:
|
|
37
|
+
icon: AiOutlinePicture
|
|
38
|
+
title: Upload Image
|
|
39
|
+
type: default
|
|
40
|
+
- id: accept_pdf
|
|
41
|
+
type: Upload
|
|
42
|
+
properties:
|
|
43
|
+
uploadPolicyRequestId: upload_policy_request
|
|
44
|
+
accept: .pdf
|
|
45
|
+
button:
|
|
46
|
+
icon: AiOutlineFilePdf
|
|
47
|
+
title: Upload PDF
|
|
48
|
+
type: default
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
```yaml
|
|
52
|
+
- id: limit_single
|
|
53
|
+
type: Upload
|
|
54
|
+
properties:
|
|
55
|
+
uploadPolicyRequestId: upload_policy_request
|
|
56
|
+
singleFile: true
|
|
57
|
+
button:
|
|
58
|
+
icon: UploadOutlined
|
|
59
|
+
title: Upload Single File
|
|
60
|
+
type: default
|
|
61
|
+
- id: limit_max_three
|
|
62
|
+
type: Upload
|
|
63
|
+
properties:
|
|
64
|
+
uploadPolicyRequestId: upload_policy_request
|
|
65
|
+
maxCount: 3
|
|
66
|
+
button:
|
|
67
|
+
icon: UploadOutlined
|
|
68
|
+
title: Upload (Max 3)
|
|
69
|
+
type: default
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
```yaml
|
|
73
|
+
- id: emit_file_content
|
|
74
|
+
type: Upload
|
|
75
|
+
properties:
|
|
76
|
+
emitFileContent: true
|
|
77
|
+
singleFile: true
|
|
78
|
+
button:
|
|
79
|
+
icon: UploadOutlined
|
|
80
|
+
title: Attach File
|
|
81
|
+
type: default
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
```yaml
|
|
85
|
+
- id: disabled_default
|
|
86
|
+
type: Upload
|
|
87
|
+
properties:
|
|
88
|
+
uploadPolicyRequestId: upload_policy_request
|
|
89
|
+
disabled: true
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
```yaml
|
|
93
|
+
- id: label_default
|
|
94
|
+
type: Upload
|
|
95
|
+
properties:
|
|
96
|
+
title: Upload Attachment
|
|
97
|
+
uploadPolicyRequestId: upload_policy_request
|
|
98
|
+
- id: label_extra
|
|
99
|
+
type: Upload
|
|
100
|
+
properties:
|
|
101
|
+
title: Upload Document
|
|
102
|
+
uploadPolicyRequestId: upload_policy_request
|
|
103
|
+
label:
|
|
104
|
+
extra: Accepted formats are PDF, DOCX, and PNG. Max size 10MB.
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
| Property | Type | Default | Description |
|
|
108
|
+
| --- | --- | --- | --- |
|
|
109
|
+
| `accept` | string | - | File types accepted by the input. See html file type input accept property at https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept. |
|
|
110
|
+
| `button` | object | `{"icon":"UploadOutlined","title":"Upload","type":"default"}` | Button block properties. See [Button](/Button) for all properties. |
|
|
111
|
+
| `button.title` | string | - | Button title text. |
|
|
112
|
+
| `button.icon` | string \| object | - | Button icon name or Icon block properties. |
|
|
113
|
+
| `button.type` | string | `"default"` | Button type. Enum: `default`, `primary`, `dashed`, `text`, `link`. |
|
|
114
|
+
| `button.danger` | boolean | `false` | Set button style to danger. |
|
|
115
|
+
| `button.disabled` | boolean | `false` | Disable the button. |
|
|
116
|
+
| `button.size` | string | `"default"` | Button size. Enum: `small`, `default`, `large`. |
|
|
117
|
+
| `disabled` | boolean | - | Disable the file input. |
|
|
118
|
+
| `emitFileContent` | boolean | `false` | Instead of uploading, read the file and emit { name, size, type, content } — content a base64 string — as the block value and onChange event. Use with a CallAPI action to store the file with a server-side write request (e.g. AwsS3PutObject). Replaces uploadPolicyRequestId. |
|
|
119
|
+
| `maxCount` | number | - | Maximum number of files that can be uploaded. |
|
|
120
|
+
| `uploadPolicyRequestId` | string | - | Id of an upload-policy request (e.g. AwsS3PresignedPostPolicy, GcsSignedPostPolicy, AzureBlobUploadSas) that defines to which storage bucket and how the file should be uploaded. Required unless emitFileContent is true. |
|
|
121
|
+
| `showUploadList` | boolean | `true` | Whether to show default upload list. |
|
|
122
|
+
| `singleFile` | boolean | `false` | Only allow a single file to be uploaded. Only one file can be selected in the prompt. |
|
|
123
|
+
| `theme` | object | - | Antd design token overrides for this block. See [antd design tokens](https://ant.design/components/upload#design-token). See [Ant Design upload tokens](https://ant.design/components/upload#design-token). |
|
|
124
|
+
| `theme.actionsColor` | string | - | Color of action icons (download, preview, remove). |
|
|
125
|
+
| `theme.pictureCardSize` | number | - | Size of list items in card type (affects both picture-card and picture-circle). |
|
|
126
|
+
| `theme.controlItemBgHover` | string | - | Background color of file item on hover. |
|
|
127
|
+
| `theme.colorIcon` | string | - | Color of file icons. |
|
|
128
|
+
| `theme.fontSize` | number | - | Font size of file name text. |
|
|
129
|
+
| `theme.borderRadiusSM` | number | - | Border radius of file list items. |
|
|
130
|
+
|
|
131
|
+
| Event | Event Data | Description |
|
|
132
|
+
| --- | --- | --- |
|
|
133
|
+
| `onBeforeUpload` | `{ file }` | Triggered before a file is uploaded. If an action throws, the upload is cancelled. |
|
|
134
|
+
| `onChange` | \- | Triggered when the upload state is changing. With emitFileContent, triggered once the file content has been read, with the block value ({ file, fileList }) as the event, where file includes the base64 content. |
|
|
135
|
+
| `onProgress` | `{ file, fileList }` | Triggered when the upload state is in progress. |
|
|
136
|
+
| `onSuccess` | `{ file, fileList }` | Triggered when the upload state is done uploading. |
|
|
137
|
+
| `onRemove` | `{ file, fileList }` | Triggered when the upload has been removed. |
|
|
138
|
+
| `onError` | `{ file, fileList }` | Triggered when the upload has failed. |
|
|
139
|
+
| `onClick` | \- | Triggered when the upload button is clicked. |
|
|
140
|
+
|
|
141
|
+
| Key | Target |
|
|
142
|
+
| --- | --- |
|
|
143
|
+
| `/block` | Outer block wrapper (always available). |
|
|
144
|
+
| `/element` | The outer block wrapper around the upload button and list. |
|
|
145
|
+
| `/trigger` | The antd upload trigger (.ant-upload-select) that wraps the button. |
|
|
146
|
+
| `/list` | The uploaded file list container. |
|
|
147
|
+
| `/item` | Each uploaded file row in the list. |
|
|
148
|
+
|
|
149
|
+
No slots defined.
|