@contember/bindx-repeater 0.1.22 → 0.1.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.
- package/dist/components/BlockRepeater.d.ts +1 -2
- package/dist/components/BlockRepeater.d.ts.map +1 -1
- package/dist/components/Repeater.d.ts +1 -2
- package/dist/components/Repeater.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/components/BlockRepeater.tsx +4 -7
- package/src/components/Repeater.tsx +7 -5
|
@@ -39,8 +39,7 @@ import type { BlockRepeaterProps } from '../types.js';
|
|
|
39
39
|
* ```
|
|
40
40
|
*/
|
|
41
41
|
export declare function BlockRepeater<TEntity extends object = object, TSelected = TEntity, TBrand extends AnyBrand = AnyBrand, TEntityName extends string = string, TSchema extends Record<string, object> = Record<string, object>, TBlockNames extends string = string>({ field, discriminationField, sortableBy, blocks, children, }: BlockRepeaterProps<TEntity, TSelected, TBrand, TEntityName, TSchema, TBlockNames>): ReactElement;
|
|
42
|
-
declare const
|
|
42
|
+
export declare const BlockRepeaterWithMeta: typeof BlockRepeater & SelectionProvider & {
|
|
43
43
|
[BINDX_COMPONENT]: true;
|
|
44
44
|
};
|
|
45
|
-
export { blockRepeaterWithSelection as BlockRepeaterWithMeta };
|
|
46
45
|
//# sourceMappingURL=BlockRepeater.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BlockRepeater.d.ts","sourceRoot":"","sources":["../../src/components/BlockRepeater.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAW,KAAK,YAAY,EAAkB,MAAM,OAAO,CAAA;AACzE,OAAO,KAAK,EAGX,QAAQ,EAIR,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EAAyC,eAAe,EAAa,KAAK,iBAAiB,EAAwB,MAAM,wBAAwB,CAAA;AACxJ,OAAO,KAAK,EACX,kBAAkB,EAMlB,MAAM,aAAa,CAAA;AAMpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA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AAE,kBAAkB,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,CAAC,GAAG,YAAY,CAgIlG;AAqGD,eAAO,MAAM,qBAAqB;uBAhGkE,IAAI;CAgGjC,CAAA"}
|
|
@@ -31,8 +31,7 @@ import type { RepeaterProps } from '../types.js';
|
|
|
31
31
|
* ```
|
|
32
32
|
*/
|
|
33
33
|
export declare function Repeater<TEntity extends object = object, TSelected = TEntity, TBrand extends AnyBrand = AnyBrand, TEntityName extends string = string, TSchema extends Record<string, object> = Record<string, object>>({ field, sortableBy, children, }: RepeaterProps<TEntity, TSelected, TBrand, TEntityName, TSchema>): ReactElement;
|
|
34
|
-
declare const
|
|
34
|
+
export declare const RepeaterWithMeta: typeof Repeater & SelectionProvider & {
|
|
35
35
|
[BINDX_COMPONENT]: true;
|
|
36
36
|
};
|
|
37
|
-
export { repeaterWithSelection as RepeaterWithMeta };
|
|
38
37
|
//# sourceMappingURL=Repeater.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Repeater.d.ts","sourceRoot":"","sources":["../../src/components/Repeater.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAW,KAAK,YAAY,EAAkB,MAAM,OAAO,CAAA;AACzE,OAAO,KAAK,EAGX,QAAQ,EAGR,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EAAyC,eAAe,EAAa,KAAK,iBAAiB,EAAc,MAAM,wBAAwB,CAAA;AAC9I,OAAO,KAAK,EACX,aAAa,EAMb,MAAM,aAAa,CAAA;AAMpB;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,QAAQ,CACvB,OAAO,SAAS,MAAM,GAAG,MAAM,EAC/B,SAAS,GAAG,OAAO,EACnB,MAAM,SAAS,QAAQ,GAAG,QAAQ,EAClC,WAAW,SAAS,MAAM,GAAG,MAAM,EACnC,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9D,EACD,KAAK,EACL,UAAU,EACV,QAAQ,GACR,EAAE,aAAa,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC,GAAG,YAAY,CAwHhF;
|
|
1
|
+
{"version":3,"file":"Repeater.d.ts","sourceRoot":"","sources":["../../src/components/Repeater.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAW,KAAK,YAAY,EAAkB,MAAM,OAAO,CAAA;AACzE,OAAO,KAAK,EAGX,QAAQ,EAGR,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EAAyC,eAAe,EAAa,KAAK,iBAAiB,EAAc,MAAM,wBAAwB,CAAA;AAC9I,OAAO,KAAK,EACX,aAAa,EAMb,MAAM,aAAa,CAAA;AAMpB;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,QAAQ,CACvB,OAAO,SAAS,MAAM,GAAG,MAAM,EAC/B,SAAS,GAAG,OAAO,EACnB,MAAM,SAAS,QAAQ,GAAG,QAAQ,EAClC,WAAW,SAAS,MAAM,GAAG,MAAM,EACnC,OAAO,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9D,EACD,KAAK,EACL,UAAU,EACV,QAAQ,GACR,EAAE,aAAa,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC,GAAG,YAAY,CAwHhF;AAoFD,eAAO,MAAM,gBAAgB;uBAjF6D,IAAI;CAiFjC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contember/bindx-repeater",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.23",
|
|
4
4
|
"description": "Repeater components for has-many list management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
"react": ">=18.0.0"
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@contember/bindx": "0.1.
|
|
19
|
-
"@contember/bindx-react": "0.1.
|
|
18
|
+
"@contember/bindx": "0.1.23",
|
|
19
|
+
"@contember/bindx-react": "0.1.23"
|
|
20
20
|
},
|
|
21
21
|
"files": [
|
|
22
22
|
"dist",
|
|
@@ -201,11 +201,11 @@ export function BlockRepeater<
|
|
|
201
201
|
return <>{children(items, methods)}</>
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
-
//
|
|
205
|
-
//
|
|
206
|
-
// (Vite dep optimizer marks module-level side effects for DCE).
|
|
204
|
+
// Factory wraps getSelection assignment to avoid module-level side effects
|
|
205
|
+
// which Vite dep optimizer (Rolldown with moduleSideEffects: false) would strip.
|
|
207
206
|
function createBlockRepeaterWithSelection() {
|
|
208
207
|
const component = BlockRepeater as typeof BlockRepeater & SelectionProvider & { [BINDX_COMPONENT]: true }
|
|
208
|
+
component[BINDX_COMPONENT] = true
|
|
209
209
|
|
|
210
210
|
component.getSelection = (
|
|
211
211
|
props: BlockRepeaterProps<unknown>,
|
|
@@ -297,10 +297,7 @@ function createBlockRepeaterWithSelection() {
|
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
299
|
|
|
300
|
-
component[BINDX_COMPONENT] = true
|
|
301
300
|
return component
|
|
302
301
|
}
|
|
303
302
|
|
|
304
|
-
const
|
|
305
|
-
|
|
306
|
-
export { blockRepeaterWithSelection as BlockRepeaterWithMeta }
|
|
303
|
+
export const BlockRepeaterWithMeta = createBlockRepeaterWithSelection()
|
|
@@ -181,10 +181,11 @@ export function Repeater<
|
|
|
181
181
|
return <>{children(items, methods)}</>
|
|
182
182
|
}
|
|
183
183
|
|
|
184
|
-
|
|
185
|
-
const
|
|
184
|
+
function createRepeaterWithSelection() {
|
|
185
|
+
const component = Repeater as typeof Repeater & SelectionProvider & { [BINDX_COMPONENT]: true }
|
|
186
|
+
component[BINDX_COMPONENT] = true
|
|
186
187
|
|
|
187
|
-
|
|
188
|
+
component.getSelection = (
|
|
188
189
|
props: RepeaterProps<unknown>,
|
|
189
190
|
collectNested: (children: ReactNode) => SelectionMeta,
|
|
190
191
|
): SelectionFieldMeta | null => {
|
|
@@ -259,6 +260,7 @@ repeaterWithSelection.getSelection = (
|
|
|
259
260
|
}
|
|
260
261
|
}
|
|
261
262
|
|
|
262
|
-
|
|
263
|
+
return component
|
|
264
|
+
}
|
|
263
265
|
|
|
264
|
-
export
|
|
266
|
+
export const RepeaterWithMeta = createRepeaterWithSelection()
|