@furo/open-models 1.20.0 → 1.20.2

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.
@@ -2110,6 +2110,13 @@
2110
2110
  "type": {
2111
2111
  "text": "(error: unknown) => void | undefined"
2112
2112
  }
2113
+ },
2114
+ {
2115
+ "kind": "field",
2116
+ "name": "onRawJsonResponse",
2117
+ "type": {
2118
+ "text": "(json: JSONObject) => void | undefined"
2119
+ }
2113
2120
  }
2114
2121
  ]
2115
2122
  }
@@ -2618,6 +2625,21 @@
2618
2625
  }
2619
2626
  ]
2620
2627
  },
2628
+ {
2629
+ "kind": "javascript-module",
2630
+ "path": "dist/web-components/furo-type-renderer.js",
2631
+ "declarations": [],
2632
+ "exports": [
2633
+ {
2634
+ "kind": "custom-element-definition",
2635
+ "name": "furo-type-renderer",
2636
+ "declaration": {
2637
+ "name": "TypeRenderer",
2638
+ "module": "/src/web-components/impl/TypeRenderer/TypeRenderer"
2639
+ }
2640
+ }
2641
+ ]
2642
+ },
2621
2643
  {
2622
2644
  "kind": "javascript-module",
2623
2645
  "path": "dist/proxies/ARRAY.js",
@@ -7306,6 +7328,290 @@
7306
7328
  }
7307
7329
  ]
7308
7330
  },
7331
+ {
7332
+ "kind": "javascript-module",
7333
+ "path": "dist/decorators/DefaultServiceEventHandlers.js",
7334
+ "declarations": [
7335
+ {
7336
+ "kind": "function",
7337
+ "name": "DefaultServiceEventHandlers",
7338
+ "parameters": [
7339
+ {
7340
+ "name": "dispatch",
7341
+ "type": {
7342
+ "text": "DispatchFn"
7343
+ },
7344
+ "description": "Function to dispatch events (typically bound to the service's dispatchEvent)"
7345
+ },
7346
+ {
7347
+ "name": "options",
7348
+ "default": "{}",
7349
+ "type": {
7350
+ "text": "DefaultServiceEventHandlersOptions"
7351
+ },
7352
+ "description": "Optional configuration"
7353
+ }
7354
+ ],
7355
+ "description": "### DefaultServiceEventHandlers\n\nCreates default service handlers that dispatch standard events.\nUse this to reduce boilerplate when setting up service handlers.\n\nThe `onResponse` handler is intentionally NOT included - you must provide your own\nimplementation since response handling is typically service-specific.\n\nUsage:\n```typescript\nclass MyEntityService extends EventTarget {\n private dispatch = createDispatch(this);\n\n setupHandlers() {\n this.service.Get.setHandlers({\n ...DefaultServiceEventHandlers(this.dispatch),\n onResponse: (response, serverResponse) => {\n // Your custom response handling\n this.entity.fromLiteral(response.entity);\n this.dispatch(\"response-received\", { response, serverResponse });\n },\n });\n }\n}\n```\n\nWith loading check:\n```typescript\nthis.service.Get.setHandlers({\n ...DefaultServiceEventHandlers(this.dispatch, {\n isLoading: () => this.service.Get.isLoading || this.service.Update.isLoading,\n }),\n onResponse: (response, serverResponse) => { ... },\n});\n```",
7356
+ "return": {
7357
+ "type": {
7358
+ "text": ""
7359
+ }
7360
+ }
7361
+ },
7362
+ {
7363
+ "kind": "function",
7364
+ "name": "CreateDispatch",
7365
+ "return": {
7366
+ "type": {
7367
+ "text": ""
7368
+ }
7369
+ },
7370
+ "parameters": [
7371
+ {
7372
+ "name": "target",
7373
+ "type": {
7374
+ "text": "EventTarget"
7375
+ },
7376
+ "description": "The EventTarget to dispatch events on"
7377
+ }
7378
+ ],
7379
+ "description": "### createDispatch\n\nHelper to create a typed dispatch function for an EventTarget.\n\nUsage:\n```typescript\nclass MyService extends EventTarget {\n private dispatch = createDispatch(this);\n\n doSomething() {\n this.dispatch(\"busy-changed\", { busy: true });\n }\n}\n```"
7380
+ }
7381
+ ],
7382
+ "exports": [
7383
+ {
7384
+ "kind": "js",
7385
+ "name": "DefaultServiceEventHandlers",
7386
+ "declaration": {
7387
+ "name": "DefaultServiceEventHandlers",
7388
+ "module": "src/decorators/DefaultServiceEventHandlers.ts"
7389
+ }
7390
+ },
7391
+ {
7392
+ "kind": "js",
7393
+ "name": "CreateDispatch",
7394
+ "declaration": {
7395
+ "name": "CreateDispatch",
7396
+ "module": "src/decorators/DefaultServiceEventHandlers.ts"
7397
+ }
7398
+ }
7399
+ ]
7400
+ },
7401
+ {
7402
+ "kind": "javascript-module",
7403
+ "path": "dist/decorators/EntityServiceTypes.js",
7404
+ "declarations": [],
7405
+ "exports": []
7406
+ },
7407
+ {
7408
+ "kind": "javascript-module",
7409
+ "path": "dist/decorators/FieldBindings.js",
7410
+ "declarations": [
7411
+ {
7412
+ "kind": "variable",
7413
+ "name": "fieldBindings",
7414
+ "type": {
7415
+ "text": "object"
7416
+ },
7417
+ "default": "{ /** * Decorator for the `model` property. * * Handles: * - Binding/unbinding when model changes * - Resolving reader/writer functions based on model type * - Calling reader on model value changes * - Providing `writeToModel()` method */ model() { return function modelDecorator(target: object, propertyKey: string) { const ctor = target.constructor as typeof ReactiveElement; // Patch lifecycle patchLifecycle(ctor); // Add writeToModel helper method if (!Object.prototype.hasOwnProperty.call(target, \"writeToModel\")) { Object.defineProperty(target, \"writeToModel\", { value: function writeToModel(this: LitElement & Record<symbol, (() => void) | undefined>) { const writeFn = this[MODEL_WRITE_FN]; if (writeFn) { try { writeFn(); } catch (e) { console.error(\"Failed to write to model:\", e); } } }, writable: false, enumerable: false, configurable: true, }); } // Create getter/setter for the model property Object.defineProperty(target, propertyKey, { get(this: LitElement & Record<symbol, FieldNodeLike | undefined>): FieldNodeLike | undefined { return this[CURRENT_MODEL]; }, set(this: LitElement & BindableComponent & Record<symbol, FieldNodeLike | (() => void) | undefined>, value: FieldNodeLike | undefined) { const oldModel = this[CURRENT_MODEL] as FieldNodeLike | undefined; if (value === oldModel) return; // Unbind from old model if (oldModel) { unbindFromModel(this, oldModel); } // Store new model this[CURRENT_MODEL] = value; // Resolve reader/writer functions based on type if (value) { const typeName = value.__meta?.typeName ?? \"primitives.STRING\"; // Resolve reader // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- runtime data may not match types (REST API input) const reader = this.modelReaders?.get(typeName); if (reader) { this[MODEL_READ_FN] = reader.bind(this); } else { // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- runtime data may not match types (REST API input) console.warn(`No modelReader for type \"${typeName}\". Available: ${[...(this.modelReaders?.keys() ?? [])].join(\", \")}`); this[MODEL_READ_FN] = undefined; } // Resolve writer // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- runtime data may not match types (REST API input) const writer = this.modelWriters?.get(typeName); if (writer) { this[MODEL_WRITE_FN] = writer.bind(this); } else { // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- runtime data may not match types (REST API input) console.warn(`No modelWriter for type \"${typeName}\". Available: ${[...(this.modelWriters?.keys() ?? [])].join(\", \")}`); this[MODEL_WRITE_FN] = undefined; } } else { this[MODEL_READ_FN] = undefined; this[MODEL_WRITE_FN] = undefined; } // Bind to new model (if connected) if (value && this.isConnected) { bindToModel(this, value); } // Trigger Lit update this.requestUpdate(); }, enumerable: true, configurable: true, }); }; }, /** * Binds a method to an event on the model. * When the event fires, the method is called with the event detail. * * @param eventType - The event type to listen for */ onEvent(eventType: ModelEventType) { return function onEventDecorator(target: object, propertyKey: string, descriptor: PropertyDescriptor) { // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment const originalMethod = descriptor.value; const ctor = target.constructor as typeof ReactiveElement; let events = (ctor as unknown as Record<symbol, FieldEventMeta[]>)[FIELD_EVENTS]; // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- runtime data may not match types (REST API input) if (!events) { events = []; (ctor as unknown as Record<symbol, FieldEventMeta[]>)[FIELD_EVENTS] = events; } // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment events.push({ propertyKey, eventType, method: originalMethod }); patchLifecycle(ctor); }; }, /** * Decorator that marks a method to be called once after a new model is assigned and bound. * * Useful for one-time setup like setting a11y attributes, placeholders, or constraints * based on the model's type. * * @example * ```typescript * @fieldBindings.onInit() * protected init() { * this.accessibleName = this.model?.__label ?? \"Toggle\"; * } * ``` */ onInit() { return function onInitDecorator(target: object, propertyKey: string, descriptor: PropertyDescriptor) { // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment const originalMethod = descriptor.value; const ctor = target.constructor as typeof ReactiveElement; // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type let inits = (ctor as unknown as Record<symbol, { propertyKey: string; method: Function }[]>)[FIELD_INIT_METHODS]; // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- runtime data may not match types (REST API input) if (!inits) { inits = []; // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type (ctor as unknown as Record<symbol, { propertyKey: string; method: Function }[]>)[FIELD_INIT_METHODS] = inits; } // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment inits.push({ propertyKey, method: originalMethod }); patchLifecycle(ctor); }; }, }",
7418
+ "description": "### fieldBindings\n\nDecorators for creating reusable components that bind to FieldNode models.\n\nThe component provides `modelReaders` and `modelWriters` maps keyed by\n`__meta.typeName`. The decorator handles:\n- Binding/unbinding on model change\n- Calling the correct reader when model value changes\n- Providing `writeToModel()` method that calls the correct writer"
7419
+ }
7420
+ ],
7421
+ "exports": [
7422
+ {
7423
+ "kind": "js",
7424
+ "name": "fieldBindings",
7425
+ "declaration": {
7426
+ "name": "fieldBindings",
7427
+ "module": "src/decorators/FieldBindings.ts"
7428
+ }
7429
+ }
7430
+ ]
7431
+ },
7432
+ {
7433
+ "kind": "javascript-module",
7434
+ "path": "dist/decorators/ModelDecorators.js",
7435
+ "declarations": [
7436
+ {
7437
+ "kind": "function",
7438
+ "name": "ModelBindings",
7439
+ "parameters": [
7440
+ {
7441
+ "name": "model",
7442
+ "type": {
7443
+ "text": "FieldNodeLike"
7444
+ },
7445
+ "description": "The FieldNode model to bind to"
7446
+ }
7447
+ ],
7448
+ "description": "### ModelBindings Factory\n\nCreates type-safe decorators bound to a specific FieldNode model.\nUse this to bind component properties and methods to model events.\n\nUsage:\n```typescript\nimport { ModelBindings } from \"@x/furo/open-models/ModelDecorators\";\nimport { CubeEntityModel } from \"./CubeEntityModel\";\n\nconst cubeModel = ModelBindings(CubeEntityModel.model);\n\nclass MyComponent extends LitElement {\n // Triggers re-render on any model update",
7449
+ "return": {
7450
+ "type": {
7451
+ "text": ""
7452
+ }
7453
+ }
7454
+ }
7455
+ ],
7456
+ "exports": [
7457
+ {
7458
+ "kind": "js",
7459
+ "name": "ModelBindings",
7460
+ "declaration": {
7461
+ "name": "ModelBindings",
7462
+ "module": "src/decorators/ModelDecorators.ts"
7463
+ }
7464
+ }
7465
+ ]
7466
+ },
7467
+ {
7468
+ "kind": "javascript-module",
7469
+ "path": "dist/decorators/SchemaBuilder.js",
7470
+ "declarations": [
7471
+ {
7472
+ "kind": "class",
7473
+ "description": "",
7474
+ "name": "SchemaBuilder",
7475
+ "members": [
7476
+ {
7477
+ "kind": "method",
7478
+ "name": "generate",
7479
+ "privacy": "public",
7480
+ "static": true,
7481
+ "return": {
7482
+ "type": {
7483
+ "text": "JSONSchema7"
7484
+ }
7485
+ },
7486
+ "parameters": [
7487
+ {
7488
+ "name": "model",
7489
+ "type": {
7490
+ "text": "FieldNode"
7491
+ }
7492
+ }
7493
+ ]
7494
+ },
7495
+ {
7496
+ "kind": "method",
7497
+ "name": "getProps",
7498
+ "privacy": "private",
7499
+ "static": true,
7500
+ "return": {
7501
+ "type": {
7502
+ "text": "Record<string, JSONSchema7Definition>"
7503
+ }
7504
+ },
7505
+ "parameters": [
7506
+ {
7507
+ "name": "model",
7508
+ "type": {
7509
+ "text": "FieldNode"
7510
+ }
7511
+ }
7512
+ ]
7513
+ },
7514
+ {
7515
+ "kind": "method",
7516
+ "name": "getRequiredFields",
7517
+ "privacy": "private",
7518
+ "static": true,
7519
+ "return": {
7520
+ "type": {
7521
+ "text": "string[]"
7522
+ }
7523
+ },
7524
+ "parameters": [
7525
+ {
7526
+ "name": "descriptors",
7527
+ "type": {
7528
+ "text": "FieldDescriptor[]"
7529
+ }
7530
+ }
7531
+ ]
7532
+ },
7533
+ {
7534
+ "kind": "method",
7535
+ "name": "getConstraints",
7536
+ "privacy": "private",
7537
+ "static": true,
7538
+ "parameters": [
7539
+ {
7540
+ "name": "constraints",
7541
+ "type": {
7542
+ "text": "FieldConstraints | undefined"
7543
+ }
7544
+ }
7545
+ ]
7546
+ },
7547
+ {
7548
+ "kind": "method",
7549
+ "name": "createFieldNodeFromSchema",
7550
+ "privacy": "public",
7551
+ "static": true,
7552
+ "return": {
7553
+ "type": {
7554
+ "text": "FieldNode"
7555
+ }
7556
+ },
7557
+ "parameters": [
7558
+ {
7559
+ "name": "schema",
7560
+ "type": {
7561
+ "text": "FieldNodeSchema"
7562
+ }
7563
+ }
7564
+ ]
7565
+ }
7566
+ ]
7567
+ }
7568
+ ],
7569
+ "exports": [
7570
+ {
7571
+ "kind": "js",
7572
+ "name": "SchemaBuilder",
7573
+ "declaration": {
7574
+ "name": "SchemaBuilder",
7575
+ "module": "src/decorators/SchemaBuilder.ts"
7576
+ }
7577
+ }
7578
+ ]
7579
+ },
7580
+ {
7581
+ "kind": "javascript-module",
7582
+ "path": "dist/decorators/ServiceDecorators.js",
7583
+ "declarations": [
7584
+ {
7585
+ "kind": "function",
7586
+ "name": "ServiceBindings",
7587
+ "parameters": [
7588
+ {
7589
+ "name": "service",
7590
+ "type": {
7591
+ "text": "EventTarget"
7592
+ },
7593
+ "description": "The EventTarget service to bind to"
7594
+ }
7595
+ ],
7596
+ "description": "### ServiceBindings Factory\n\nCreates type-safe decorators bound to a specific service instance.\nUse this to bind component properties and methods to service events.\n\nThe factory is generic and works with any `EventTarget`.\nEvent types and their detail payloads are type-checked at compile time\nvia the `TEventMap` type parameter.\n\nUsage:\n```typescript\nimport { cubeEntityService } from \"./CubeEntityService\";\nimport { ServiceBindings } from \"./ServiceDecorators\";\n\nconst cube = ServiceBindings(cubeEntityService);\n\nclass MyComponent extends LitElement {\n // Property binding - type-safe event name, auto-extracts from detail",
7597
+ "return": {
7598
+ "type": {
7599
+ "text": ""
7600
+ }
7601
+ }
7602
+ }
7603
+ ],
7604
+ "exports": [
7605
+ {
7606
+ "kind": "js",
7607
+ "name": "ServiceBindings",
7608
+ "declaration": {
7609
+ "name": "ServiceBindings",
7610
+ "module": "src/decorators/ServiceDecorators.ts"
7611
+ }
7612
+ }
7613
+ ]
7614
+ },
7309
7615
  {
7310
7616
  "kind": "javascript-module",
7311
7617
  "path": "dist/primitives/BOOLEAN.js",
@@ -22498,305 +22804,6 @@
22498
22804
  }
22499
22805
  ]
22500
22806
  },
22501
- {
22502
- "kind": "javascript-module",
22503
- "path": "dist/decorators/DefaultServiceEventHandlers.js",
22504
- "declarations": [
22505
- {
22506
- "kind": "function",
22507
- "name": "DefaultServiceEventHandlers",
22508
- "parameters": [
22509
- {
22510
- "name": "dispatch",
22511
- "type": {
22512
- "text": "DispatchFn"
22513
- },
22514
- "description": "Function to dispatch events (typically bound to the service's dispatchEvent)"
22515
- },
22516
- {
22517
- "name": "options",
22518
- "default": "{}",
22519
- "type": {
22520
- "text": "DefaultServiceEventHandlersOptions"
22521
- },
22522
- "description": "Optional configuration"
22523
- }
22524
- ],
22525
- "description": "### DefaultServiceEventHandlers\n\nCreates default service handlers that dispatch standard events.\nUse this to reduce boilerplate when setting up service handlers.\n\nThe `onResponse` handler is intentionally NOT included - you must provide your own\nimplementation since response handling is typically service-specific.\n\nUsage:\n```typescript\nclass MyEntityService extends EventTarget {\n private dispatch = createDispatch(this);\n\n setupHandlers() {\n this.service.Get.setHandlers({\n ...DefaultServiceEventHandlers(this.dispatch),\n onResponse: (response, serverResponse) => {\n // Your custom response handling\n this.entity.fromLiteral(response.entity);\n this.dispatch(\"response-received\", { response, serverResponse });\n },\n });\n }\n}\n```\n\nWith loading check:\n```typescript\nthis.service.Get.setHandlers({\n ...DefaultServiceEventHandlers(this.dispatch, {\n isLoading: () => this.service.Get.isLoading || this.service.Update.isLoading,\n }),\n onResponse: (response, serverResponse) => { ... },\n});\n```",
22526
- "return": {
22527
- "type": {
22528
- "text": ""
22529
- }
22530
- }
22531
- },
22532
- {
22533
- "kind": "function",
22534
- "name": "CreateDispatch",
22535
- "return": {
22536
- "type": {
22537
- "text": ""
22538
- }
22539
- },
22540
- "parameters": [
22541
- {
22542
- "name": "target",
22543
- "type": {
22544
- "text": "EventTarget"
22545
- },
22546
- "description": "The EventTarget to dispatch events on"
22547
- }
22548
- ],
22549
- "description": "### createDispatch\n\nHelper to create a typed dispatch function for an EventTarget.\n\nUsage:\n```typescript\nclass MyService extends EventTarget {\n private dispatch = createDispatch(this);\n\n doSomething() {\n this.dispatch(\"busy-changed\", { busy: true });\n }\n}\n```"
22550
- }
22551
- ],
22552
- "exports": [
22553
- {
22554
- "kind": "js",
22555
- "name": "DefaultServiceEventHandlers",
22556
- "declaration": {
22557
- "name": "DefaultServiceEventHandlers",
22558
- "module": "src/decorators/DefaultServiceEventHandlers.ts"
22559
- }
22560
- },
22561
- {
22562
- "kind": "js",
22563
- "name": "CreateDispatch",
22564
- "declaration": {
22565
- "name": "CreateDispatch",
22566
- "module": "src/decorators/DefaultServiceEventHandlers.ts"
22567
- }
22568
- }
22569
- ]
22570
- },
22571
- {
22572
- "kind": "javascript-module",
22573
- "path": "dist/decorators/EntityServiceTypes.js",
22574
- "declarations": [],
22575
- "exports": []
22576
- },
22577
- {
22578
- "kind": "javascript-module",
22579
- "path": "dist/decorators/FieldBindings.js",
22580
- "declarations": [
22581
- {
22582
- "kind": "variable",
22583
- "name": "fieldBindings",
22584
- "type": {
22585
- "text": "object"
22586
- },
22587
- "default": "{ /** * Decorator for the `model` property. * * Handles: * - Binding/unbinding when model changes * - Resolving reader/writer functions based on model type * - Calling reader on model value changes * - Providing `writeToModel()` method */ model() { return function modelDecorator(target: object, propertyKey: string) { const ctor = target.constructor as typeof ReactiveElement; // Patch lifecycle patchLifecycle(ctor); // Add writeToModel helper method if (!Object.prototype.hasOwnProperty.call(target, \"writeToModel\")) { Object.defineProperty(target, \"writeToModel\", { value: function writeToModel(this: LitElement & Record<symbol, (() => void) | undefined>) { const writeFn = this[MODEL_WRITE_FN]; if (writeFn) { try { writeFn(); } catch (e) { console.error(\"Failed to write to model:\", e); } } }, writable: false, enumerable: false, configurable: true, }); } // Create getter/setter for the model property Object.defineProperty(target, propertyKey, { get(this: LitElement & Record<symbol, FieldNodeLike | undefined>): FieldNodeLike | undefined { return this[CURRENT_MODEL]; }, set(this: LitElement & BindableComponent & Record<symbol, FieldNodeLike | (() => void) | undefined>, value: FieldNodeLike | undefined) { const oldModel = this[CURRENT_MODEL] as FieldNodeLike | undefined; if (value === oldModel) return; // Unbind from old model if (oldModel) { unbindFromModel(this, oldModel); } // Store new model this[CURRENT_MODEL] = value; // Resolve reader/writer functions based on type if (value) { const typeName = value.__meta?.typeName ?? \"primitives.STRING\"; // Resolve reader // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- runtime data may not match types (REST API input) const reader = this.modelReaders?.get(typeName); if (reader) { this[MODEL_READ_FN] = reader.bind(this); } else { // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- runtime data may not match types (REST API input) console.warn(`No modelReader for type \"${typeName}\". Available: ${[...(this.modelReaders?.keys() ?? [])].join(\", \")}`); this[MODEL_READ_FN] = undefined; } // Resolve writer // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- runtime data may not match types (REST API input) const writer = this.modelWriters?.get(typeName); if (writer) { this[MODEL_WRITE_FN] = writer.bind(this); } else { // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- runtime data may not match types (REST API input) console.warn(`No modelWriter for type \"${typeName}\". Available: ${[...(this.modelWriters?.keys() ?? [])].join(\", \")}`); this[MODEL_WRITE_FN] = undefined; } } else { this[MODEL_READ_FN] = undefined; this[MODEL_WRITE_FN] = undefined; } // Bind to new model (if connected) if (value && this.isConnected) { bindToModel(this, value); } // Trigger Lit update this.requestUpdate(); }, enumerable: true, configurable: true, }); }; }, /** * Binds a method to an event on the model. * When the event fires, the method is called with the event detail. * * @param eventType - The event type to listen for */ onEvent(eventType: ModelEventType) { return function onEventDecorator(target: object, propertyKey: string, descriptor: PropertyDescriptor) { // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment const originalMethod = descriptor.value; const ctor = target.constructor as typeof ReactiveElement; let events = (ctor as unknown as Record<symbol, FieldEventMeta[]>)[FIELD_EVENTS]; // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- runtime data may not match types (REST API input) if (!events) { events = []; (ctor as unknown as Record<symbol, FieldEventMeta[]>)[FIELD_EVENTS] = events; } // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment events.push({ propertyKey, eventType, method: originalMethod }); patchLifecycle(ctor); }; }, /** * Decorator that marks a method to be called once after a new model is assigned and bound. * * Useful for one-time setup like setting a11y attributes, placeholders, or constraints * based on the model's type. * * @example * ```typescript * @fieldBindings.onInit() * protected init() { * this.accessibleName = this.model?.__label ?? \"Toggle\"; * } * ``` */ onInit() { return function onInitDecorator(target: object, propertyKey: string, descriptor: PropertyDescriptor) { // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment const originalMethod = descriptor.value; const ctor = target.constructor as typeof ReactiveElement; // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type let inits = (ctor as unknown as Record<symbol, { propertyKey: string; method: Function }[]>)[FIELD_INIT_METHODS]; // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- runtime data may not match types (REST API input) if (!inits) { inits = []; // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type (ctor as unknown as Record<symbol, { propertyKey: string; method: Function }[]>)[FIELD_INIT_METHODS] = inits; } // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment inits.push({ propertyKey, method: originalMethod }); patchLifecycle(ctor); }; }, }",
22588
- "description": "### fieldBindings\n\nDecorators for creating reusable components that bind to FieldNode models.\n\nThe component provides `modelReaders` and `modelWriters` maps keyed by\n`__meta.typeName`. The decorator handles:\n- Binding/unbinding on model change\n- Calling the correct reader when model value changes\n- Providing `writeToModel()` method that calls the correct writer"
22589
- }
22590
- ],
22591
- "exports": [
22592
- {
22593
- "kind": "js",
22594
- "name": "fieldBindings",
22595
- "declaration": {
22596
- "name": "fieldBindings",
22597
- "module": "src/decorators/FieldBindings.ts"
22598
- }
22599
- }
22600
- ]
22601
- },
22602
- {
22603
- "kind": "javascript-module",
22604
- "path": "dist/decorators/ModelDecorators.js",
22605
- "declarations": [
22606
- {
22607
- "kind": "function",
22608
- "name": "ModelBindings",
22609
- "parameters": [
22610
- {
22611
- "name": "model",
22612
- "type": {
22613
- "text": "FieldNodeLike"
22614
- },
22615
- "description": "The FieldNode model to bind to"
22616
- }
22617
- ],
22618
- "description": "### ModelBindings Factory\n\nCreates type-safe decorators bound to a specific FieldNode model.\nUse this to bind component properties and methods to model events.\n\nUsage:\n```typescript\nimport { ModelBindings } from \"@x/furo/open-models/ModelDecorators\";\nimport { CubeEntityModel } from \"./CubeEntityModel\";\n\nconst cubeModel = ModelBindings(CubeEntityModel.model);\n\nclass MyComponent extends LitElement {\n // Triggers re-render on any model update",
22619
- "return": {
22620
- "type": {
22621
- "text": ""
22622
- }
22623
- }
22624
- }
22625
- ],
22626
- "exports": [
22627
- {
22628
- "kind": "js",
22629
- "name": "ModelBindings",
22630
- "declaration": {
22631
- "name": "ModelBindings",
22632
- "module": "src/decorators/ModelDecorators.ts"
22633
- }
22634
- }
22635
- ]
22636
- },
22637
- {
22638
- "kind": "javascript-module",
22639
- "path": "dist/decorators/SchemaBuilder.js",
22640
- "declarations": [
22641
- {
22642
- "kind": "class",
22643
- "description": "",
22644
- "name": "SchemaBuilder",
22645
- "members": [
22646
- {
22647
- "kind": "method",
22648
- "name": "generate",
22649
- "privacy": "public",
22650
- "static": true,
22651
- "return": {
22652
- "type": {
22653
- "text": "JSONSchema7"
22654
- }
22655
- },
22656
- "parameters": [
22657
- {
22658
- "name": "model",
22659
- "type": {
22660
- "text": "FieldNode"
22661
- }
22662
- }
22663
- ]
22664
- },
22665
- {
22666
- "kind": "method",
22667
- "name": "getProps",
22668
- "privacy": "private",
22669
- "static": true,
22670
- "return": {
22671
- "type": {
22672
- "text": "Record<string, JSONSchema7Definition>"
22673
- }
22674
- },
22675
- "parameters": [
22676
- {
22677
- "name": "model",
22678
- "type": {
22679
- "text": "FieldNode"
22680
- }
22681
- }
22682
- ]
22683
- },
22684
- {
22685
- "kind": "method",
22686
- "name": "getRequiredFields",
22687
- "privacy": "private",
22688
- "static": true,
22689
- "return": {
22690
- "type": {
22691
- "text": "string[]"
22692
- }
22693
- },
22694
- "parameters": [
22695
- {
22696
- "name": "descriptors",
22697
- "type": {
22698
- "text": "FieldDescriptor[]"
22699
- }
22700
- }
22701
- ]
22702
- },
22703
- {
22704
- "kind": "method",
22705
- "name": "getConstraints",
22706
- "privacy": "private",
22707
- "static": true,
22708
- "parameters": [
22709
- {
22710
- "name": "constraints",
22711
- "type": {
22712
- "text": "FieldConstraints | undefined"
22713
- }
22714
- }
22715
- ]
22716
- },
22717
- {
22718
- "kind": "method",
22719
- "name": "createFieldNodeFromSchema",
22720
- "privacy": "public",
22721
- "static": true,
22722
- "return": {
22723
- "type": {
22724
- "text": "FieldNode"
22725
- }
22726
- },
22727
- "parameters": [
22728
- {
22729
- "name": "schema",
22730
- "type": {
22731
- "text": "FieldNodeSchema"
22732
- }
22733
- }
22734
- ]
22735
- }
22736
- ]
22737
- }
22738
- ],
22739
- "exports": [
22740
- {
22741
- "kind": "js",
22742
- "name": "SchemaBuilder",
22743
- "declaration": {
22744
- "name": "SchemaBuilder",
22745
- "module": "src/decorators/SchemaBuilder.ts"
22746
- }
22747
- }
22748
- ]
22749
- },
22750
- {
22751
- "kind": "javascript-module",
22752
- "path": "dist/decorators/ServiceDecorators.js",
22753
- "declarations": [
22754
- {
22755
- "kind": "function",
22756
- "name": "ServiceBindings",
22757
- "parameters": [
22758
- {
22759
- "name": "service",
22760
- "type": {
22761
- "text": "EventTarget"
22762
- },
22763
- "description": "The EventTarget service to bind to"
22764
- }
22765
- ],
22766
- "description": "### ServiceBindings Factory\n\nCreates type-safe decorators bound to a specific service instance.\nUse this to bind component properties and methods to service events.\n\nThe factory is generic and works with any `EventTarget`.\nEvent types and their detail payloads are type-checked at compile time\nvia the `TEventMap` type parameter.\n\nUsage:\n```typescript\nimport { cubeEntityService } from \"./CubeEntityService\";\nimport { ServiceBindings } from \"./ServiceDecorators\";\n\nconst cube = ServiceBindings(cubeEntityService);\n\nclass MyComponent extends LitElement {\n // Property binding - type-safe event name, auto-extracts from detail",
22767
- "return": {
22768
- "type": {
22769
- "text": ""
22770
- }
22771
- }
22772
- }
22773
- ],
22774
- "exports": [
22775
- {
22776
- "kind": "js",
22777
- "name": "ServiceBindings",
22778
- "declaration": {
22779
- "name": "ServiceBindings",
22780
- "module": "src/decorators/ServiceDecorators.ts"
22781
- }
22782
- }
22783
- ]
22784
- },
22785
- {
22786
- "kind": "javascript-module",
22787
- "path": "dist/web-components/furo-type-renderer.js",
22788
- "declarations": [],
22789
- "exports": [
22790
- {
22791
- "kind": "custom-element-definition",
22792
- "name": "furo-type-renderer",
22793
- "declaration": {
22794
- "name": "TypeRenderer",
22795
- "module": "/src/web-components/impl/TypeRenderer/TypeRenderer"
22796
- }
22797
- }
22798
- ]
22799
- },
22800
22807
  {
22801
22808
  "kind": "javascript-module",
22802
22809
  "path": "dist/well_known/ANY.js",
@@ -26622,7 +26629,7 @@
26622
26629
  "kind": "field",
26623
26630
  "name": "value",
26624
26631
  "type": {
26625
- "text": "number"
26632
+ "text": "number | null"
26626
26633
  }
26627
26634
  },
26628
26635
  {
@@ -26632,7 +26639,7 @@
26632
26639
  "text": "number | null"
26633
26640
  },
26634
26641
  "privacy": "public",
26635
- "default": "0"
26642
+ "default": "null"
26636
26643
  },
26637
26644
  {
26638
26645
  "kind": "method",
@@ -31690,7 +31697,7 @@
31690
31697
  "kind": "field",
31691
31698
  "name": "value",
31692
31699
  "type": {
31693
- "text": "number"
31700
+ "text": "number | null"
31694
31701
  }
31695
31702
  },
31696
31703
  {
@@ -31700,7 +31707,7 @@
31700
31707
  "text": "number | null"
31701
31708
  },
31702
31709
  "privacy": "public",
31703
- "default": "0"
31710
+ "default": "null"
31704
31711
  },
31705
31712
  {
31706
31713
  "kind": "method",
@@ -32957,7 +32964,7 @@
32957
32964
  "kind": "field",
32958
32965
  "name": "value",
32959
32966
  "type": {
32960
- "text": "number"
32967
+ "text": "number | null"
32961
32968
  }
32962
32969
  },
32963
32970
  {
@@ -32967,7 +32974,7 @@
32967
32974
  "text": "number | null"
32968
32975
  },
32969
32976
  "privacy": "public",
32970
- "default": "0"
32977
+ "default": "null"
32971
32978
  },
32972
32979
  {
32973
32980
  "kind": "method",
@@ -34224,7 +34231,7 @@
34224
34231
  "kind": "field",
34225
34232
  "name": "value",
34226
34233
  "type": {
34227
- "text": "bigint"
34234
+ "text": "bigint | null"
34228
34235
  }
34229
34236
  },
34230
34237
  {
@@ -34234,7 +34241,7 @@
34234
34241
  "text": "bigint | null"
34235
34242
  },
34236
34243
  "privacy": "public",
34237
- "default": "0n"
34244
+ "default": "null"
34238
34245
  },
34239
34246
  {
34240
34247
  "kind": "method",
@@ -40559,7 +40566,7 @@
40559
40566
  "kind": "field",
40560
40567
  "name": "value",
40561
40568
  "type": {
40562
- "text": "number"
40569
+ "text": "number | null"
40563
40570
  }
40564
40571
  },
40565
40572
  {
@@ -40569,7 +40576,7 @@
40569
40576
  "text": "number | null"
40570
40577
  },
40571
40578
  "privacy": "public",
40572
- "default": "0"
40579
+ "default": "null"
40573
40580
  },
40574
40581
  {
40575
40582
  "kind": "method",
@@ -41826,7 +41833,7 @@
41826
41833
  "kind": "field",
41827
41834
  "name": "value",
41828
41835
  "type": {
41829
- "text": "number"
41836
+ "text": "number | null"
41830
41837
  }
41831
41838
  },
41832
41839
  {
@@ -41836,7 +41843,7 @@
41836
41843
  "text": "number | null"
41837
41844
  },
41838
41845
  "privacy": "public",
41839
- "default": "0"
41846
+ "default": "null"
41840
41847
  },
41841
41848
  {
41842
41849
  "kind": "method",