@openbkn/workshop 0.2.2-rc.5 → 0.2.2-rc.6
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/README.md +79 -8
- package/component.d.ts +10 -0
- package/dist/ActionConfirm-DJ91X3ml.js +236 -0
- package/dist/ActionFailure-ZgPt_3B-.js +37 -0
- package/dist/AgentChat-CRYai8ge.js +1062 -0
- package/dist/AppFormModal-D73ucaHK.js +4282 -0
- package/dist/AppListPage-D87piiOw.js +1364 -0
- package/dist/AskDrawer-BUMYsRnt.js +38 -0
- package/dist/ComputedView-CgYrDbx1.js +3221 -0
- package/dist/ConclusionApply-sjGfoEBY.js +153 -0
- package/dist/CypherEditor-lus6FA5L.js +485 -0
- package/dist/LandingList-6JI6864C.js +230 -0
- package/dist/MenuUnfoldOutlined-Cdg24l2h.js +27 -0
- package/dist/ModelTrial-ClHFGTpQ.js +359 -0
- package/dist/PageRenderer-DBd_g6mN.js +85480 -0
- package/dist/README-DjRyTQSR.js +76 -0
- package/dist/ScenarioApply-DtW_hh47.js +590 -0
- package/dist/SimulateForm-C-i08Jjd.js +153 -0
- package/dist/Subgraph-CnrkH9AN.js +32586 -0
- package/dist/WorkshopLabPage-DiVXQL9e.js +11364 -0
- package/dist/WorkshopRunPage-6hjRUf64.js +253 -0
- package/dist/abnfDiagram-WEYOIA3C-beRNhN3c.js +87 -0
- package/dist/action-type-tool.service-B2B74fKC.js +1060 -0
- package/dist/actionButton-DA5CNEzx.js +94 -0
- package/dist/actionButton.en-US-qjeqA7hs.js +94 -0
- package/dist/agentChat-EoDznd58.js +116 -0
- package/dist/agentChat.en-US-B6-pFd9Y.js +116 -0
- package/dist/alertList-DqditwM8.js +84 -0
- package/dist/alertList.en-US-BAXAgltP.js +84 -0
- package/dist/architectureDiagram-ZHVYKT53-DY2l1qxx.js +4779 -0
- package/dist/asOfSlider-QPvHWUMV.js +83 -0
- package/dist/asOfSlider.en-US-BI4jVfSn.js +83 -0
- package/dist/bkn-agent-execution.service-DVh-SHyl.js +205 -0
- package/dist/blockDiagram-RJAE7QA3-DR0mjN2h.js +1435 -0
- package/dist/c4Diagram-XDPPPE54-DH5zsGug.js +1518 -0
- package/dist/channel-B034hcOF.js +5 -0
- package/dist/china-C6m7zXIv.js +9 -0
- package/dist/chunk-2E7WHVMD-Ba3svxgx.js +664 -0
- package/dist/chunk-2Q5K7J3B-rT4eU6_y.js +15 -0
- package/dist/chunk-4EMNKR2T-C1kQZYHK.js +262 -0
- package/dist/chunk-55XCU76K-dcpLOktb.js +68 -0
- package/dist/chunk-5VM5RSS4-BdpQuzmO.js +19 -0
- package/dist/chunk-JWPE2WC7-CDBrSjU7.js +8 -0
- package/dist/chunk-VQ5W62QI-BiVKc40w.js +19 -0
- package/dist/chunk-XXDRQBXY-CPYrcdVW.js +8 -0
- package/dist/chunk-ZCHMQSOR-BG8OLpvb.js +451 -0
- package/dist/classDiagram-v2-4MYWR3UA-DqbpQpwI.js +1564 -0
- package/dist/component.d-DFoMKuUv.js +179 -0
- package/dist/cose-bilkent-JH36ORCC-CdXk4sPf.js +2609 -0
- package/dist/customComponents-DasaZ6pq.js +4 -0
- package/dist/customComponents.en-US-CkabuCXg.js +79 -0
- package/dist/customParseFormat-C0uLEpdq.js +182 -0
- package/dist/cynefin-EF2NZ3EQ-D7MVnMHu.js +21746 -0
- package/dist/cynefinDiagram-WF24UDRP-BYT_KpDL.js +299 -0
- package/dist/cytoscape.esm-BCV9V6aO.js +18760 -0
- package/dist/d3-scale-DA8IHmf0.js +1841 -0
- package/dist/dagre-NK4GIZVX-l-ghPdM8.js +2154 -0
- package/dist/dateRange-BbkLMg8L.js +79 -0
- package/dist/dateRange.en-US-CV12Q02G.js +79 -0
- package/dist/dayjs.min-DZ-YV8Mv.js +284 -0
- package/dist/diagram-CBK3MWTC-Bt3HiwvA.js +542 -0
- package/dist/diagram-I5XIIV2D-DcbqfBjx.js +150 -0
- package/dist/diagram-ODIL2UCW-9PC1n3n5.js +346 -0
- package/dist/diagram-PFBEJUXE-DGhr2kc7.js +478 -0
- package/dist/diagram-RJA3I4VV-DwzpOjZ_.js +219 -0
- package/dist/diagram-TYUNFSNR-B3Bd3TDU.js +2583 -0
- package/dist/dropdownFilter-DOi_8-ZT.js +76 -0
- package/dist/dropdownFilter.en-US-BiXpvXtF.js +76 -0
- package/dist/ebnfDiagram-V4P3TTPT-E5NN2oKc.js +109 -0
- package/dist/elk-QONTBCTQ-dFjcujl_.js +49170 -0
- package/dist/erDiagram-KYQIGQAA-BMrasBzB.js +1061 -0
- package/dist/eventList-CnsAwfDS.js +115 -0
- package/dist/eventList.en-US-Cof3rCLq.js +115 -0
- package/dist/eventReport-XS-HegnH.js +76 -0
- package/dist/eventReport.en-US-DTx4vzWT.js +76 -0
- package/dist/flowDiagram-IUGLLWBU-BGIBH0q0.js +1769 -0
- package/dist/ganttChart-DEeSvTJA.js +77 -0
- package/dist/ganttChart.en-US-SwRKrnoD.js +77 -0
- package/dist/ganttDiagram-R7GPNTJY-C0tb1Lpp.js +1741 -0
- package/dist/generateCypher-Ch9_lQa6.js +399 -0
- package/dist/gitGraphDiagram-PDYL7XHY-DBqcOa-c.js +815 -0
- package/dist/graph-CKJmgLki.js +1541 -0
- package/dist/index-BA-GzCXt.js +441 -0
- package/dist/infoDiagram-MVDRKAX5-Bwuki4JA.js +24 -0
- package/dist/ishikawaDiagram-HPEHV2GE-Dz4d6ygx.js +622 -0
- package/dist/journeyDiagram-BOSHW7O7-C99m34Bb.js +834 -0
- package/dist/kanban-definition-FNSA4HC5-mdqjODsT.js +724 -0
- package/dist/katex-BsrBVQKd.js +11314 -0
- package/dist/manifest-BjV1PJ6u.js +41 -0
- package/dist/mermaid.core-yQghUlIz.js +17642 -0
- package/dist/metricCards-CSb-_cT2.js +104 -0
- package/dist/metricCards.en-US-BLLhRsQU.js +104 -0
- package/dist/mindmap-definition-6OY57UG3-BZhO2wX4.js +834 -0
- package/dist/modelTrial-Bvb-RhGt.js +137 -0
- package/dist/modelTrial.en-US-DYcuor-G.js +137 -0
- package/dist/models-DekiCOuZ.js +6 -0
- package/dist/object-metric-numeric-vs3BeDkH.js +42 -0
- package/dist/object-metric.service-flZgBMRX.js +233 -0
- package/dist/objectDetail-SQUbp4Py.js +117 -0
- package/dist/objectDetail.en-US-DW3mlONM.js +117 -0
- package/dist/objectList-D99wPtJH.js +97 -0
- package/dist/objectList.en-US-PBBNyVLW.js +97 -0
- package/dist/objectTable-0jsFFMN3.js +127 -0
- package/dist/objectTable.en-US-yWEs8qc_.js +127 -0
- package/dist/pegDiagram-ECIUJNBX-BDa5RfZt.js +95 -0
- package/dist/pieDiagram-GNMPY74T-DNVtzXPv.js +165 -0
- package/dist/pivotTable-CHmQw18-.js +102 -0
- package/dist/pivotTable.en-US-B4uv4P08.js +102 -0
- package/dist/prompt-DYrjlEFr.js +373 -0
- package/dist/quadrantDiagram-D57K4MC3-vK0f2OvQ.js +1023 -0
- package/dist/railroadDiagram-Y72NRBL7-j6ZrTmRp.js +77 -0
- package/dist/regionMap-Cme-JyV_.js +128 -0
- package/dist/regionMap.en-US-Bwr2_p32.js +128 -0
- package/dist/requirementDiagram-EQYSW5RA-DgfEyljA.js +886 -0
- package/dist/sankeyDiagram-SY24JHO5-CImx-IX0.js +1160 -0
- package/dist/scenarioBar-BV43p7n-.js +122 -0
- package/dist/scenarioBar.en-US-5KqMQ2Bg.js +122 -0
- package/dist/scheduleGantt-CTYO-zYP.js +180 -0
- package/dist/scheduleGantt.en-US-hE7mvVUW.js +180 -0
- package/dist/searchBox-Ca7w0f_6.js +67 -0
- package/dist/searchBox.en-US-ArS_XBvB.js +67 -0
- package/dist/segmentedFilter-MhjVcWo0.js +80 -0
- package/dist/segmentedFilter.en-US-BxNrQO5T.js +80 -0
- package/dist/sequenceDiagram-BLEHNHQU-nWmjd1ci.js +2969 -0
- package/dist/sizeCapture-INFHLROL-D3jlbt7h.js +46 -0
- package/dist/stageChain-BxBafwjD.js +74 -0
- package/dist/stageChain.en-US-CP0G27n8.js +74 -0
- package/dist/stateDiagram-v2-A6IESKWZ-DG1ZetEu.js +1514 -0
- package/dist/subgraph-7n4SwliR.js +71 -0
- package/dist/subgraph.en-US-BNvY18IW.js +71 -0
- package/dist/swimlanes-B3ENRKFQ-cCmJE8AU.js +4991 -0
- package/dist/swimlanesDiagram-AYQRV4AK-CtuhyguU.js +14 -0
- package/dist/taskInbox-DGWYeI2b.js +118 -0
- package/dist/taskInbox.en-US-B-OzDmVl.js +118 -0
- package/dist/text-BqSVQKS6.js +78 -0
- package/dist/text.en-US-BhAxy_LE.js +78 -0
- package/dist/timeline-definition-JXYKGLGB-Cc-INsOv.js +1057 -0
- package/dist/trendChart-BjEeRS5_.js +135 -0
- package/dist/trendChart.en-US-BBGqWUKM.js +135 -0
- package/dist/useLabData-Df-jEHKs.js +20470 -0
- package/dist/usecaseDiagram-WPOLBNNX-r8wVjopm.js +7920 -0
- package/dist/vennDiagram-Q3Y3IDCW-BZiOcgrj.js +1579 -0
- package/dist/wardleyDiagram-IVAIDKWA-16jd07C_.js +675 -0
- package/dist/workshop-app-DnHNjBqy.js +86038 -0
- package/dist/workshop-app.css +1 -0
- package/dist/workshop-app.js +4 -0
- package/dist/world-Djau1JyJ.js +9 -0
- package/dist/xychartDiagram-4URNHDU4-C8DwWQNh.js +1460 -0
- package/dist-cli/workshop.js +340 -217
- package/example/host.js +109 -0
- package/example/index.html +93 -0
- package/example/server.mjs +237 -0
- package/index.d.ts +48 -0
- package/lib/validate.js +47 -1
- package/package.json +17 -5
- package/runtime/frame-runtime.js +13 -1
- package/workshop-component.js +32 -12
- package/workshop.js +2 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
const n = `# 搜索框(searchBox)
|
|
2
|
+
|
|
3
|
+
输入关键词,页面上跟随它的组件只显示在文本列里包含这个词的对象。用来按名称、编号快速找到对象。
|
|
4
|
+
|
|
5
|
+
## 适用与不适用
|
|
6
|
+
|
|
7
|
+
- 适用:按名称、编号、描述这类文字找对象。
|
|
8
|
+
- 不适用:
|
|
9
|
+
- 按某个字段的取值精确选:用下拉筛选(\`dropdownFilter\`)或分段筛选(\`segmentedFilter\`)。
|
|
10
|
+
- 按日期筛:用日期区间(\`dateRange\`)。
|
|
11
|
+
- 在知识网络里做语义检索:用 Agent 对话(\`agentChat\`)。
|
|
12
|
+
|
|
13
|
+
## 本体契约
|
|
14
|
+
|
|
15
|
+
| 角色 | 对象类要求 | 必要的属性 | 关系 | 必填 |
|
|
16
|
+
| --- | --- | --- | --- | --- |
|
|
17
|
+
| 被搜索的对象 | 页面数据源对应的对象类 | 一个或多个文本属性(“搜索的列”) | 无 | 是 |
|
|
18
|
+
|
|
19
|
+
组件自己不读数据,只写一个搜索筛选;“搜索的列”决定新加入页面的组件默认在哪些列里查找。默认取标识属性,再加最多 2 个其他文本列。
|
|
20
|
+
|
|
21
|
+
## 组件内置的判断
|
|
22
|
+
|
|
23
|
+
- 不区分大小写,匹配“包含”,不是“开头”;先去掉输入两端的空格。
|
|
24
|
+
- 一个对象的任一搜索列包含关键词即保留。
|
|
25
|
+
- 输入为空时不筛选;每次输入都立即更新,没有延迟。
|
|
26
|
+
- 有清除按钮。
|
|
27
|
+
|
|
28
|
+
## 扩展点
|
|
29
|
+
|
|
30
|
+
无。组件只做文本包含匹配,不调用工具,也不做同义词或语义检索。
|
|
31
|
+
|
|
32
|
+
## 交互与联动
|
|
33
|
+
|
|
34
|
+
- **写入**:输入内容写入搜索变量。
|
|
35
|
+
- **读取**:不跟随任何筛选,也不读数据源。
|
|
36
|
+
- **谁会跟着变**:勾选了这个筛选的组件。同类对象的新组件会默认跟随,并在搜索框配置的文本列里查找;不同类对象的组件要在它们的“联动”页勾选并指定自己的文本列。
|
|
37
|
+
|
|
38
|
+
## 场景配方
|
|
39
|
+
|
|
40
|
+
### 工单按编号或名称查找
|
|
41
|
+
|
|
42
|
+
| 角色 | 对应 |
|
|
43
|
+
| --- | --- |
|
|
44
|
+
| 被搜索的对象 | 工单(搜索的列:工单编号、名称) |
|
|
45
|
+
|
|
46
|
+
**知识网络中要有:** 工单的编号与名称文本属性。
|
|
47
|
+
|
|
48
|
+
**检查项:** 输入编号的一部分,对象表只剩匹配的工单;清空后全部恢复。
|
|
49
|
+
|
|
50
|
+
## 给 AI 的指引
|
|
51
|
+
|
|
52
|
+
1. 先问用户:要按哪些文字找(编号、名称、描述)?页面上哪些组件要跟着搜?
|
|
53
|
+
2. 页面里要有一个搜索类型的变量,“写入”选它。
|
|
54
|
+
3. “搜索的列”只选文本类型的属性。编号是数字时,先确认它能按文本匹配。
|
|
55
|
+
4. 常见错误:
|
|
56
|
+
- 搜索的列选得太多:结果里混入无关对象。只选用户会输入的那几列。
|
|
57
|
+
- 其他组件没勾选这个筛选,或没指定文本列:输入后页面不变。
|
|
58
|
+
- 想要“按意思找”:搜索框不做语义检索,改用 Agent 对话。
|
|
59
|
+
|
|
60
|
+
## 限制
|
|
61
|
+
|
|
62
|
+
- 只做文字包含匹配,不支持多个词、拼音或模糊匹配。
|
|
63
|
+
- 只在已读入的数据里查找;对象类数据源最多读 5000 行,Cypher 数据源最多 10000 行(查询没写 LIMIT 时 1000 行)。
|
|
64
|
+
`;
|
|
65
|
+
export {
|
|
66
|
+
n as default
|
|
67
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
const e = `# Search box (searchBox)
|
|
2
|
+
|
|
3
|
+
Type a keyword, and the components that follow it show only the objects whose text columns contain it. Use it to find objects quickly by name or number.
|
|
4
|
+
|
|
5
|
+
## When to use it and when not
|
|
6
|
+
|
|
7
|
+
- Use it to find objects by text such as a name, number or description.
|
|
8
|
+
- Do not use it:
|
|
9
|
+
- To pick exactly by the value of a field: use the dropdown filter (\`dropdownFilter\`) or the segmented filter (\`segmentedFilter\`).
|
|
10
|
+
- To filter by date: use the date range (\`dateRange\`).
|
|
11
|
+
- To search the knowledge network by meaning: use the Agent chat (\`agentChat\`).
|
|
12
|
+
|
|
13
|
+
## Ontology contract
|
|
14
|
+
|
|
15
|
+
| Role | Object type requirement | Required properties | Relations | Required |
|
|
16
|
+
| --- | --- | --- | --- | --- |
|
|
17
|
+
| Searched object | The object type of the page's data source | One or more text properties (the "columns to search") | None | Yes |
|
|
18
|
+
|
|
19
|
+
The component reads no data itself. It only writes a search filter; the "columns to search" decide which columns new components on the page search by default. The default is the identifier property plus up to 2 other text columns.
|
|
20
|
+
|
|
21
|
+
## Built-in checks
|
|
22
|
+
|
|
23
|
+
- Not case sensitive; it matches "contains", not "starts with"; spaces at both ends of the input are trimmed.
|
|
24
|
+
- An object stays when any of the search columns contains the keyword.
|
|
25
|
+
- An empty input filters nothing; every keystroke updates at once, with no delay.
|
|
26
|
+
- A clear button is provided.
|
|
27
|
+
|
|
28
|
+
## Extension points
|
|
29
|
+
|
|
30
|
+
None. The component only does text containment; it calls no tool and does no synonym or semantic search.
|
|
31
|
+
|
|
32
|
+
## Interaction and links
|
|
33
|
+
|
|
34
|
+
- **Writes**: the typed text to the search variable.
|
|
35
|
+
- **Reads**: it follows no filter and reads no data source.
|
|
36
|
+
- **What changes with it**: the components that follow this filter. New components on the same kind of object follow it by default and search the text columns set in the search box; components on other kinds of objects must tick it on their link tab and name their own text columns.
|
|
37
|
+
|
|
38
|
+
## Recipes
|
|
39
|
+
|
|
40
|
+
### Find work orders by number or name
|
|
41
|
+
|
|
42
|
+
| Role | Maps to |
|
|
43
|
+
| --- | --- |
|
|
44
|
+
| Searched object | Work order (columns to search: work order number, name) |
|
|
45
|
+
|
|
46
|
+
**Needed in the knowledge network:** text properties for the work order's number and name.
|
|
47
|
+
|
|
48
|
+
**Checks:** typing part of a number leaves only the matching work orders in the object table; clearing restores them all.
|
|
49
|
+
|
|
50
|
+
## Guidance for AI
|
|
51
|
+
|
|
52
|
+
1. Ask the user first: which text to search by (number, name, description) and which components should follow the search.
|
|
53
|
+
2. The page needs a variable of the search kind, and the component's "write" setting points to it.
|
|
54
|
+
3. Choose only text properties for "columns to search". When the number is numeric, first confirm that it can be matched as text.
|
|
55
|
+
4. Common mistakes:
|
|
56
|
+
- Too many columns to search: unrelated objects show up. Choose only the columns users will type.
|
|
57
|
+
- Other components do not tick this filter, or have no text columns named: typing changes nothing.
|
|
58
|
+
- Wanting to search by meaning: the search box does no semantic search; use the Agent chat.
|
|
59
|
+
|
|
60
|
+
## Limits
|
|
61
|
+
|
|
62
|
+
- Text containment only; no multiple words, pinyin or fuzzy matching.
|
|
63
|
+
- It searches only the rows already read; an object type data source reads at most 5000 rows and a Cypher data source 10,000 (1,000 when its query sets no LIMIT).
|
|
64
|
+
`;
|
|
65
|
+
export {
|
|
66
|
+
e as default
|
|
67
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
const n = `# 分段筛选(segmentedFilter)
|
|
2
|
+
|
|
3
|
+
一排带数量的按钮,按一个字段的取值分段,点一下页面只看这一类。用来在“全部 / 进行中 / 已超期”这类少数几类之间快速切换。
|
|
4
|
+
|
|
5
|
+
## 适用与不适用
|
|
6
|
+
|
|
7
|
+
- 适用:字段的取值是少数几类(状态、等级、类别),要一眼看到每类有多少,并一键切换。一个按钮可以包含几个取值,例如“风险”包含“高”和“中”。
|
|
8
|
+
- 不适用:
|
|
9
|
+
- 取值很多(城市、客户、球队):用下拉筛选(\`dropdownFilter\`)。
|
|
10
|
+
- 要自由输入关键词:用搜索框(\`searchBox\`)。
|
|
11
|
+
- 要同时多选几类:用下拉筛选(\`dropdownFilter\`,打开“允许多选”);分段筛选一次只选一个按钮。
|
|
12
|
+
- 要点数字看明细:用指标卡组(\`metricCards\`)。
|
|
13
|
+
|
|
14
|
+
## 本体契约
|
|
15
|
+
|
|
16
|
+
| 角色 | 对象类要求 | 必要的属性 | 关系 | 必填 |
|
|
17
|
+
| --- | --- | --- | --- | --- |
|
|
18
|
+
| 被分段的对象 | 页面数据源对应的对象类 | 一个取值有限的字段(含进度状态、判断状态这类计算列) | 无 | 是 |
|
|
19
|
+
|
|
20
|
+
## 组件内置的判断
|
|
21
|
+
|
|
22
|
+
- 每个按钮的数量是该按钮包含的取值在数据中的对象数,按组件跟随的其他筛选与基准日期统计,“显示数量”关闭时不显示。
|
|
23
|
+
- 没有填取值的按钮代表“全部”,点它清空筛选。
|
|
24
|
+
- 当前筛选的取值与某个按钮的取值完全相同时,该按钮显示为选中。
|
|
25
|
+
- 默认选项:一个“全部”,加上字段每个取值各一个按钮;取值和色调来自进度状态或判断状态。
|
|
26
|
+
|
|
27
|
+
## 扩展点
|
|
28
|
+
|
|
29
|
+
无。分段由配置的取值决定;行业判断(例如“风险等级”)写成对象的逻辑属性或计算列,再用这个字段分段。
|
|
30
|
+
|
|
31
|
+
## 交互与联动
|
|
32
|
+
|
|
33
|
+
- **写入**:点击按钮,把该按钮的取值写入取值筛选变量;点“全部”按钮清空。
|
|
34
|
+
- **读取**:跟随“联动”页勾选的筛选,统计数量时只算留下的对象。组件自己写的筛选默认不跟随。
|
|
35
|
+
- **谁会跟着变**:同一类对象的其他组件新加入页面时,若这个筛选所按的字段它也有,会默认跟随;不同类对象的组件要自己勾选。
|
|
36
|
+
|
|
37
|
+
## 场景配方
|
|
38
|
+
|
|
39
|
+
### 工单状态切换
|
|
40
|
+
|
|
41
|
+
| 角色 | 对应 |
|
|
42
|
+
| --- | --- |
|
|
43
|
+
| 被分段的对象 | 维修工单(字段:进度状态) |
|
|
44
|
+
|
|
45
|
+
**知识网络中要有:** 工单状态属性,或页面数据源上的进度状态列。
|
|
46
|
+
|
|
47
|
+
**做法:** 按钮“全部”“进行中”“已超期”;“已超期”按钮可以同时包含“超期”和“严重超期”两个取值。
|
|
48
|
+
|
|
49
|
+
**检查项:** 点“已超期”,对象表只剩这类工单,按钮数量与表格一致;点“全部”恢复。
|
|
50
|
+
|
|
51
|
+
### 风险等级
|
|
52
|
+
|
|
53
|
+
| 角色 | 对应 |
|
|
54
|
+
| --- | --- |
|
|
55
|
+
| 被分段的对象 | 供应商(字段:风险等级,逻辑属性) |
|
|
56
|
+
|
|
57
|
+
**知识网络中要有:** 供应商的“风险等级”逻辑属性,由知识网络给出高、中、低。
|
|
58
|
+
|
|
59
|
+
**检查项:** 按钮“高风险”点击后,列表只剩高风险供应商。
|
|
60
|
+
|
|
61
|
+
## 给 AI 的指引
|
|
62
|
+
|
|
63
|
+
1. 先问用户:按哪个字段分段?分成哪几类?是否每类要列出,还是合并成几个按钮?
|
|
64
|
+
2. 页面里要有一个取值类型的变量,“写入”选它。
|
|
65
|
+
3. 字段取值太多时(超过按钮上限 6 个),改用下拉筛选,不要硬拆。
|
|
66
|
+
4. 常见错误:
|
|
67
|
+
- 选项里没有“全部”:用户点了就无法回到全部。保留一个不填取值的按钮。
|
|
68
|
+
- 取值写成显示名而不是数据里的取值:按钮不会选中,数量为 0。
|
|
69
|
+
- 其他组件没有跟随这个筛选:点击后页面不变。去它们的“联动”页勾选。
|
|
70
|
+
- 想多选几类:一个按钮包含多个取值,或改用下拉筛选。
|
|
71
|
+
|
|
72
|
+
## 限制
|
|
73
|
+
|
|
74
|
+
- 选项 2 到 6 个。
|
|
75
|
+
- 一次只选一个按钮。
|
|
76
|
+
- 数量按已读入的数据统计;对象类数据源最多读 5000 行,Cypher 数据源最多 10000 行(查询没写 LIMIT 时 1000 行)。
|
|
77
|
+
`;
|
|
78
|
+
export {
|
|
79
|
+
n as default
|
|
80
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
const e = `# Segmented filter (segmentedFilter)
|
|
2
|
+
|
|
3
|
+
A row of buttons with counts, splitting by the value of one field; one click and the page shows only that group. Use it to switch quickly between a few groups such as all, in progress and overdue.
|
|
4
|
+
|
|
5
|
+
## When to use it and when not
|
|
6
|
+
|
|
7
|
+
- Use it when a field has a few values (status, grade, category), you want the count of each at a glance, and want to switch with one click. One button can hold several values, for example "risk" holding both high and medium.
|
|
8
|
+
- Do not use it:
|
|
9
|
+
- When the field has many values (cities, customers, teams): use the dropdown filter (\`dropdownFilter\`).
|
|
10
|
+
- To type a keyword freely: use the search box (\`searchBox\`).
|
|
11
|
+
- To pick several groups at once: use the dropdown filter (\`dropdownFilter\`, with "allow multiple" on); a segmented filter selects one button at a time.
|
|
12
|
+
- To click a number and see details: use the metric cards (\`metricCards\`).
|
|
13
|
+
|
|
14
|
+
## Ontology contract
|
|
15
|
+
|
|
16
|
+
| Role | Object type requirement | Required properties | Relations | Required |
|
|
17
|
+
| --- | --- | --- | --- | --- |
|
|
18
|
+
| Segmented object | The object type of the page's data source | One field with a limited set of values (including computed columns such as progress state or judged state) | None | Yes |
|
|
19
|
+
|
|
20
|
+
## Built-in checks
|
|
21
|
+
|
|
22
|
+
- Each button's count is the number of objects whose value is among the values it holds, counted under the other filters the component follows and the base date; it is hidden when "show counts" is off.
|
|
23
|
+
- A button with no values means "all", and clicking it clears the filter.
|
|
24
|
+
- A button shows as selected when the current filter holds exactly its values.
|
|
25
|
+
- Default options: one "all" button plus one button per value of the field; values and tones come from the progress state or judged state.
|
|
26
|
+
|
|
27
|
+
## Extension points
|
|
28
|
+
|
|
29
|
+
None. The segments come from the configured values. Industry judgments (such as a risk grade) are written as a logic property or computed column on the object, and the filter segments by that field.
|
|
30
|
+
|
|
31
|
+
## Interaction and links
|
|
32
|
+
|
|
33
|
+
- **Writes**: clicking a button writes its values to the value filter variable; the "all" button clears it.
|
|
34
|
+
- **Reads**: it follows the filters ticked on its link tab, and counts only the objects left. It does not follow the filter it writes by default.
|
|
35
|
+
- **What changes with it**: when a component on the same kind of object is added to the page later, it follows this filter by default if it has the field the filter is on; components on other kinds of objects must tick it themselves.
|
|
36
|
+
|
|
37
|
+
## Recipes
|
|
38
|
+
|
|
39
|
+
### Work order status switch
|
|
40
|
+
|
|
41
|
+
| Role | Maps to |
|
|
42
|
+
| --- | --- |
|
|
43
|
+
| Segmented object | Repair work order (field: progress state) |
|
|
44
|
+
|
|
45
|
+
**Needed in the knowledge network:** a status property on the work order, or a progress state column on the page's data source.
|
|
46
|
+
|
|
47
|
+
**How:** buttons "all", "in progress" and "overdue"; "overdue" can hold both the "overdue" and "seriously overdue" values.
|
|
48
|
+
|
|
49
|
+
**Checks:** click "overdue" and the object table keeps only those work orders, with counts matching the table; click "all" to restore.
|
|
50
|
+
|
|
51
|
+
### Risk grade
|
|
52
|
+
|
|
53
|
+
| Role | Maps to |
|
|
54
|
+
| --- | --- |
|
|
55
|
+
| Segmented object | Supplier (field: risk grade, a logic property) |
|
|
56
|
+
|
|
57
|
+
**Needed in the knowledge network:** a "risk grade" logic property on the supplier that returns high, medium or low.
|
|
58
|
+
|
|
59
|
+
**Checks:** clicking "high risk" leaves only high-risk suppliers in the list.
|
|
60
|
+
|
|
61
|
+
## Guidance for AI
|
|
62
|
+
|
|
63
|
+
1. Ask the user first: which field to split by, into which groups, and whether to list each value or merge some into one button.
|
|
64
|
+
2. The page needs a variable of the value kind, and the component's "write" setting points to it.
|
|
65
|
+
3. When the field has too many values (more than the 6-button limit), use the dropdown filter instead of forcing a split.
|
|
66
|
+
4. Common mistakes:
|
|
67
|
+
- No "all" option: once clicked, the user cannot go back to everything. Keep one button with no values.
|
|
68
|
+
- Values written as display names instead of the values in the data: the button never shows as selected and the count is 0.
|
|
69
|
+
- Other components do not follow the filter: clicking changes nothing. Tick it on their link tab.
|
|
70
|
+
- Wanting several groups at once: let one button hold several values, or use the dropdown filter.
|
|
71
|
+
|
|
72
|
+
## Limits
|
|
73
|
+
|
|
74
|
+
- 2 to 6 options.
|
|
75
|
+
- One button selected at a time.
|
|
76
|
+
- Counts come from the rows already read; an object type data source reads at most 5000 rows and a Cypher data source 10,000 (1,000 when its query sets no LIMIT).
|
|
77
|
+
`;
|
|
78
|
+
export {
|
|
79
|
+
e as default
|
|
80
|
+
};
|