poi-plugin-kai-planner 1.0.16 → 1.0.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "poi-plugin-kai-planner",
3
- "version": "1.0.16",
3
+ "version": "1.0.17",
4
4
  "main": "index.js",
5
5
  "author": "aulu",
6
6
  "contributors": ["aulu"],
@@ -18,12 +18,12 @@ function CreatePlanFormV2({
18
18
  targetInputValue,
19
19
  startInputValue,
20
20
  selectedTargetText,
21
- selectedStartText,
21
+ selectedStartTexts,
22
22
  onPatchCreate,
23
23
  onSelectTarget,
24
24
  onSelectStart,
25
25
  onClearTarget,
26
- onClearStart,
26
+ onRemoveStart,
27
27
  onSubmit,
28
28
  onCancel,
29
29
  themeTokens,
@@ -140,18 +140,21 @@ function CreatePlanFormV2({
140
140
  themeTokens: theme,
141
141
  onSelect: (value, option) => onSelectStart(value, option),
142
142
  }),
143
- selectedStartText
144
- ? React.createElement(
145
- "button",
146
- {
147
- type: "button",
148
- onClick: () => onClearStart && onClearStart(),
149
- style: chipStyle,
150
- title: "点击清空已选起点装备",
151
- },
152
- `已选:${selectedStartText} ×`
143
+ ...(Array.isArray(selectedStartTexts)
144
+ ? selectedStartTexts.map((row) =>
145
+ React.createElement(
146
+ "button",
147
+ {
148
+ key: `selected-start-${row.apiId}`,
149
+ type: "button",
150
+ onClick: () => onRemoveStart && onRemoveStart(row.apiId),
151
+ style: chipStyle,
152
+ title: "点击移除已选起点装备",
153
+ },
154
+ `已选:${row.text} ×`
155
+ )
153
156
  )
154
- : null
157
+ : [])
155
158
  ),
156
159
  React.createElement(
157
160
  "div",