import type { CSSResultArray, PropertyDeclarations, TemplateResult } from 'lit-element'; import { InternalEditableControl } from '../../../../internal/InternalEditableControl/InternalEditableControl'; import { BooleanSelector } from '@foxy.io/sdk/core'; /** * Lets an admin choose which scopes an invitation grants, offering only what the granting * user already holds. * * Bound to the invitation's `scope` string through `infer="scope"`. The server is the real * enforcement boundary; this control exists so the UI * never offers a grant that would be rejected. * * @element foxy-internal-user-invitation-form-scope-control */ export declare class InternalUserInvitationFormScopeControl extends InternalEditableControl { static get properties(): PropertyDeclarations; static get styles(): CSSResultArray; /** Space-separated scope of the user creating or editing the invitation. */ granterScope: string | null; /** * Set when the admin picks `Custom` explicitly. Needed because an empty scope parses to a * `null` preset, so without this the radio would snap back to nothing selected the moment * `Custom` was chosen but before any row was set. */ private __customSelected; /** * Cached outcome of `__hasUnreachableGrant` from the most recently completed `renderControl()` * pass. Read by `updated()` below -- see its doc comment for why the lock needs to land on * `this.readonly` itself rather than staying a `renderControl()`-local variable. */ private __isLocked; renderControl(): TemplateResult; /** * Reflects a lock onto the real `readonly` property (in addition to whatever `updated()` * itself, e.g. `renderControl()`'s own `?readonly=` bindings, already did with the local * variable) once the initial render has committed. * * This exists because each row is now a nested `foxy-internal-select-control`. * `ConfigurableMixin` makes every such control infer its own `readonly` from the nearest * ancestor that has one (this control), by reading `this.readonly` directly during an async * walk (`InferrableMixin.inferFromElement`'s `key in element` check) -- not from whatever a * template attribute happened to bind on the row. That walk re-runs on every one of this * control's own updates (`InferrableMixin.updated()` calls `inferPropertiesInDescendants()` * unconditionally), so a row bound only via `?readonly=${this.readonly || isLocked}` in * `renderControl()` is overwritten back to whatever `this.readonly` was moments later -- * confirmed empirically by a probe test, see this task's report. Setting `this.readonly` * itself is what the row's own inference actually reads, so this is not a workaround so much * as the property meaning what it says: locked really does mean the whole control, including * everything nested inside it, is readonly. * * Assigning inside `updated()` rather than `renderControl()`/`render()` matters too: mutating * a reactive property mid-render is what triggers lit's "scheduled an update... during * update" warning (and the `does not warn on a fresh empty-scope render` test would catch * it); `updated()` is the lifecycle hook lit itself documents for deriving follow-up state * from a completed render, and setting a property there does not warn. * * Never resets `this.readonly` back to `false` on its own -- the externally-imposed half * (e.g. the form's own `readonlycontrols` selector matching `scope`) is owned entirely by * `ConfigurableMixin`'s own inheritance, which keeps re-asserting its own value on every * update independently of this method. */ updated(changes: Map): void; get readonlySelector(): BooleanSelector; /** * `true` when the invitation already holds something this granter could not themselves * grant: the current preset isn't among the ones offered, a collection's current level * isn't grantable at that level, or a collection currently has a resend grant the granter * cannot extend. Reuses `canGrantLevel` / `canGrantResend` rather than reimplementing * grantability -- see `renderControl` for why this forces the whole control readonly. */ private __hasUnreachableGrant; /** * Renders one collection's level picker as a self-contained `foxy-internal-select-control` * in `summary-item` layout: a native `