marquee-selection 0.0.11 → 0.0.12

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 CHANGED
@@ -92,7 +92,7 @@ options(主要项):
92
92
  - allowIntersectionSelection?: boolean 默认 true。若为 false,则只禁止“部分交叉”关系:即新集合与已有集合间存在交集且双方都还有各自独有的元素。
93
93
  - allowContainmentSelection?: boolean 默认 true。仅当 allowIntersectionSelection=false 时生效;true 表示仍允许“包含/被包含”关系(A 是 B 的子集或父集),false 表示包含也禁止,仅保留完全不相交或完全相等两种情况。
94
94
  - allowUnionSelection?: boolean 默认 true。若为 false,则当已存在选择/组时,禁止新增元素(并集)。
95
- - toolbarButtons?: { label; title?; className?; onClick?(ctx) }[] 追加自定义工具栏按钮
95
+ - toolbarButtons?: { label; title?; className?; onClick?(ctx) }[] 追加自定义工具栏按钮(ctx.label/ctx.title 为可写属性,可在同步或异步回调中赋值以实时更新按钮展示)
96
96
 
97
97
  controller:
98
98
 
@@ -156,6 +156,7 @@ groupNesting 说明:依据组外接矩形完全包含关系,给每个组选
156
156
  - ctx.controller 控制器实例
157
157
  - ctx.getSnapshot() 获取最新快照
158
158
  - ctx.refresh() 触发重绘覆盖层并广播 onSelectionEnd
159
+ - ctx.label / ctx.title 支持在回调中赋值(含异步场景),立即刷新按钮文本与 title;ctx.buttonEl 可用于附加自定义 DOM
159
160
  - 示例:
160
161
 
161
162
  ```ts
package/dist/index.d.ts CHANGED
@@ -163,6 +163,9 @@ type MarqueeSelectionOptions = {
163
163
  anchorRect?: DOMRect;
164
164
  anchorEl?: HTMLElement;
165
165
  overlayEl?: HTMLElement;
166
+ label?: string;
167
+ title?: string;
168
+ buttonEl: HTMLButtonElement;
166
169
  }) => void;
167
170
  }>;
168
171
  };