// #region Imports
import { nothing } from 'lit';
import { directive, Directive } from 'lit/directive.js';
// #endregion
/**
 * A directive for dynamic data binding within templates.
 *
 * @public
 */
class BindDataDirective extends Directive {
    // #region Methods
    render(data) {
        return nothing; // Rendering is handled in the update phase
    }
    update(part, [data]) {
        const element = part.options?.host;
        Object.entries(data).forEach(([key, value]) => {
            element.querySelectorAll(`[data-bind="${key}"]`).forEach((bindElement) => {
                bindElement.textContent = value;
            });
        });
    }
}
export const bindData = directive(BindDataDirective);
//# sourceMappingURL=TemplateBindDataDirective.js.map