|
|
|
|
@ -267,7 +267,8 @@ conectados por `ActiveUix`:
|
|
|
|
|
```ts
|
|
|
|
|
import { dialogMorfo } from '../../../morfo/components/dialog';
|
|
|
|
|
|
|
|
|
|
this.runtime = Soma.require().runtime(dialogMorfo, sources);
|
|
|
|
|
this.soma = Soma.require();
|
|
|
|
|
this.runtime = this.soma.runtime(dialogMorfo, sources);
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Cuando un provider necesita un selector DOM, puede usar `createAttrs(morfo)`
|
|
|
|
|
@ -424,7 +425,7 @@ autorizados por el contrato.
|
|
|
|
|
```ts
|
|
|
|
|
import { context, type WithRefOpts } from '../provider';
|
|
|
|
|
import { Soma } from '../core/soma.svelte';
|
|
|
|
|
import type { SomaRuntimePart } from '../runtime.svelte';
|
|
|
|
|
import type { SomaRuntime, SomaRuntimePart } from '../runtime.svelte';
|
|
|
|
|
import { accordionMorfo } from '$uix/morfo/components/accordion';
|
|
|
|
|
|
|
|
|
|
export class AccordionProvider {
|
|
|
|
|
@ -437,6 +438,8 @@ export class AccordionProvider {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
readonly opts: AccordionOpts;
|
|
|
|
|
readonly soma: Soma;
|
|
|
|
|
readonly runtime: SomaRuntime;
|
|
|
|
|
readonly runtimePart: SomaRuntimePart;
|
|
|
|
|
|
|
|
|
|
static create(opts: AccordionOpts) {
|
|
|
|
|
@ -445,7 +448,9 @@ export class AccordionProvider {
|
|
|
|
|
|
|
|
|
|
private constructor(opts: AccordionOpts) {
|
|
|
|
|
this.opts = opts;
|
|
|
|
|
this.runtimePart = Soma.require().runtime(accordionMorfo, {}).part('provider', {
|
|
|
|
|
this.soma = Soma.require();
|
|
|
|
|
this.runtime = this.soma.runtime(accordionMorfo, {});
|
|
|
|
|
this.runtimePart = this.runtime.part('provider', {
|
|
|
|
|
id: opts.id,
|
|
|
|
|
ref: opts.ref,
|
|
|
|
|
owner: this,
|
|
|
|
|
@ -495,7 +500,9 @@ renderizados, deja `syncAttrs` sin activar para evitar doble autoridad DOM.
|
|
|
|
|
## 8. Sistema de attrs
|
|
|
|
|
|
|
|
|
|
```ts
|
|
|
|
|
import { createAttrs } from '$uix/morfo';
|
|
|
|
|
import { accordionMorfo } from '$uix/morfo/components/accordion';
|
|
|
|
|
|
|
|
|
|
const attrs = createAttrs(accordionMorfo);
|
|
|
|
|
|
|
|
|
|
attrs.provider; // "data-accordion"
|
|
|
|
|
@ -866,6 +873,8 @@ export class AccordionProvider {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
readonly opts: AccordionOpts;
|
|
|
|
|
readonly soma: Soma;
|
|
|
|
|
readonly runtime: SomaRuntime;
|
|
|
|
|
readonly runtimePart: SomaRuntimePart;
|
|
|
|
|
|
|
|
|
|
static create(opts: AccordionOpts) {
|
|
|
|
|
@ -874,7 +883,9 @@ export class AccordionProvider {
|
|
|
|
|
|
|
|
|
|
private constructor(opts: AccordionOpts) {
|
|
|
|
|
this.opts = opts;
|
|
|
|
|
this.runtimePart = Soma.require().runtime(accordionMorfo, {}).part('provider', {
|
|
|
|
|
this.soma = Soma.require();
|
|
|
|
|
this.runtime = this.soma.runtime(accordionMorfo, {});
|
|
|
|
|
this.runtimePart = this.runtime.part('provider', {
|
|
|
|
|
id: opts.id,
|
|
|
|
|
ref: opts.ref,
|
|
|
|
|
owner: this,
|
|
|
|
|
|