hyperscript-rxjs 1.3.21 → 1.3.23

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.
@@ -958,18 +958,22 @@ export declare function meter(...childNodes: any[]): HyperscriptExtensions<HTMLM
958
958
  /**
959
959
  * 创建一个支持多选功能的 <select> 元素,并绑定选项的选中状态。必须手动添加控件更新BehaviorSubject的事件。
960
960
  *
961
- * @param {{oninput?: (e:Event)=>void, onchange?: (e:Event)=>void, [key: string]: any}} props - 配置对象,包含 <select> 元素的属性。
962
- * @param {...HTMLOptionElement} options - 一个或多个 <option> 元素,必须是 HTMLOptionElement 类型。
961
+ * @param {MultiselectProps} props - 配置对象,包含 <select> 元素的属性。
962
+ * @param {...HTMLOptionElement[]} options - 一个或多个 <option> 元素,必须是 HTMLOptionElement 类型。
963
963
  * 每个选项需要包含一个 `selected` 属性,该属性是一个 BehaviorSubject ,用于绑定选中状态。
964
964
  * @returns {HyperscriptSelectElement} - 创建的 <select> 元素。
965
965
  * @throws {Error} 如果 `props` 不是对象,或者 `options` 中的选项未正确定义 `selected` 属性。
966
966
  *
967
967
  */
968
- export declare function multiselect(props: {
968
+ export declare function multiselect(props: MultiselectProps, ...options: HTMLOptionElement[]): HyperscriptSelectElement;
969
+
970
+ export declare function multiselect(props: MultiselectProps, options: HTMLOptionElement[]): HyperscriptSelectElement;
971
+
972
+ export declare type MultiselectProps = {
969
973
  oninput?: (e: Event) => void;
970
974
  onchange?: (e: Event) => void;
971
975
  [key: string]: any;
972
- }, ...options: HTMLOptionElement[]): HyperscriptSelectElement;
976
+ }
973
977
 
974
978
  export declare function nav(props: {
975
979
  [_: string]: any;
@@ -1140,7 +1144,7 @@ export declare function parsePropName(props: string, obj: Record<string, any>):
1140
1144
  * @throws {Error} 当输入不包含任何BehaviorSubject或结构不符合预期时抛出错误
1141
1145
  */
1142
1146
  export declare function pickBehaviorSubject(model: Record<string | number, any> & {
1143
- pickeys?: string[];
1147
+ pickeys?: () => string[];
1144
1148
  }): Record<string | number, any>;
1145
1149
 
1146
1150
  export declare function pipe(initialValue: any, ...fns: ((arg: any) => any)[]): any;
@@ -1271,16 +1275,20 @@ export declare function section(...childNodes: any[]): HyperscriptExtensions<HTM
1271
1275
  /**
1272
1276
  * 创建一个支持 RxJS 数据绑定的 <select> 元素。仅单选选择框。
1273
1277
  *
1274
- * @param {{ selectedIndex?: BehaviorSubject<number>, value?: BehaviorSubject<string>, [key: string]: any }} props - 配置对象,包含 <select> 元素的属性。
1275
- * @param {...HTMLOptionElement} options - 一个或多个 <option> 元素,必须是 HTMLOptionElement 类型。
1278
+ * @param { SelectProps } props - 配置对象,包含 <select> 元素的属性。
1279
+ * @param {...HTMLOptionElement []} options - 一个或多个 <option> 元素,必须是 HTMLOptionElement 类型。
1276
1280
  * @returns {HyperscriptSelectElement} - 创建的 <select> 元素。
1277
1281
  * @throws {Error} 如果 `props` 不是对象,或者 `selectedIndex` 或 `value` 不是 BehaviorSubject。
1278
1282
  */
1279
- export declare function select(props: {
1283
+ export declare function select(props: SelectProps, ...options: HTMLOptionElement[]): HyperscriptSelectElement;
1284
+
1285
+ export declare function select(props: SelectProps, options: HTMLOptionElement[]): HyperscriptSelectElement;
1286
+
1287
+ export declare type SelectProps = {
1280
1288
  selectedIndex?: BehaviorSubject<number>;
1281
1289
  value?: BehaviorSubject<string>;
1282
1290
  [key: string]: any;
1283
- }, ...options: HTMLOptionElement[]): HyperscriptSelectElement;
1291
+ }
1284
1292
 
1285
1293
  /**
1286
1294
  *
@@ -3265,7 +3265,7 @@ function fragment(...childNodes) {
3265
3265
  * 创建一个支持多选功能的 <select> 元素,并绑定选项的选中状态。必须手动添加控件更新BehaviorSubject的事件。
3266
3266
  *
3267
3267
  * @param {{oninput?: (e:Event)=>void, onchange?: (e:Event)=>void, [key: string]: any}} props - 配置对象,包含 <select> 元素的属性。
3268
- * @param {...HTMLOptionElement} options - 一个或多个 <option> 元素,必须是 HTMLOptionElement 类型。
3268
+ * @param {...HTMLOptionElement[]} options - 一个或多个 <option> 元素,必须是 HTMLOptionElement 类型。
3269
3269
  * 每个选项需要包含一个 `selected` 属性,该属性是一个 BehaviorSubject ,用于绑定选中状态。
3270
3270
  * @returns {HyperscriptSelectElement} - 创建的 <select> 元素。
3271
3271
  * @throws {Error} 如果 `props` 不是对象,或者 `options` 中的选项未正确定义 `selected` 属性。
@@ -3421,7 +3421,6 @@ function radio_radio(props) {
3421
3421
  // import { attachSubscriptionToNode } from '../nodes/attachSubscriptionToNode';
3422
3422
 
3423
3423
  /**
3424
- * @internal
3425
3424
  * @typedef {import("./HyperscriptExtensions.d.ts").HyperscriptSelectElement} HyperscriptSelectElement
3426
3425
  */
3427
3426
 
@@ -3429,7 +3428,7 @@ function radio_radio(props) {
3429
3428
  * 创建一个支持 RxJS 数据绑定的 <select> 元素。仅单选选择框。
3430
3429
  *
3431
3430
  * @param {{ selectedIndex?: BehaviorSubject<number>, value?: BehaviorSubject<string>, [key: string]: any }} props - 配置对象,包含 <select> 元素的属性。
3432
- * @param {...HTMLOptionElement} options - 一个或多个 <option> 元素,必须是 HTMLOptionElement 类型。
3431
+ * @param {...HTMLOptionElement[]} options - 一个或多个 <option> 元素,必须是 HTMLOptionElement 类型。
3433
3432
  * @returns {HyperscriptSelectElement} - 创建的 <select> 元素。
3434
3433
  * @throws {Error} 如果 `props` 不是对象,或者 `selectedIndex` 或 `value` 不是 BehaviorSubject。
3435
3434
  */
package/package.json CHANGED
@@ -12,7 +12,7 @@
12
12
  "@microsoft/api-extractor": "7.52.8",
13
13
  "babel-jest": "30.0.2",
14
14
  "cross-env": "7.0.3",
15
- "jest": "30.0.2",
15
+ "jest": "30.0.3",
16
16
  "jest-environment-jsdom": "30.0.2",
17
17
  "jsdom": "26.1.0",
18
18
  "typescript": "5.8.3",
@@ -30,7 +30,6 @@
30
30
  "name": "hyperscript-rxjs",
31
31
  "description": "A js UI library that uses rxjs to handle dom directly.",
32
32
  "author": "cuishengli<34696643@qq.com>",
33
- "version": "1.3.21",
34
33
  "keywords": [
35
34
  "ui",
36
35
  "rxjs",
@@ -46,6 +45,7 @@
46
45
  "type": "module",
47
46
  "sideEffects": false,
48
47
  "license": "LGPL-3.0-or-later",
48
+ "version": "1.3.23",
49
49
  "files": [
50
50
  "dist",
51
51
  "README.md"