var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
import { css, html } from 'lit';
import { customElement } from 'lit/decorators.js';
import { popMenu } from '../../../../_common/components/menu/index.js';
import { BaseGroup } from './base.js';
let StringGroupView = class StringGroupView extends BaseGroup {
    constructor() {
        super(...arguments);
        this._click = () => {
            if (this.readonly) {
                return;
            }
            popMenu(this, {
                options: {
                    input: {
                        initValue: this.value ?? '',
                        onComplete: text => {
                            this.updateValue?.(text);
                        },
                    },
                    items: [],
                },
            });
        };
    }
    render() {
        if (!this.value) {
            return html ` <div>Ungroups</div>`;
        }
        return html ` <div
      @click="${this._click}"
      class="data-view-group-title-string-view"
    >
      ${this.value}
    </div>`;
    }
};
StringGroupView.styles = css `
    .data-view-group-title-string-view {
      border-radius: 8px;
      padding: 4px 8px;
      width: max-content;
      cursor: pointer;
    }

    .data-view-group-title-string-view:hover {
      background-color: var(--affine-hover-color);
    }
  `;
StringGroupView = __decorate([
    customElement('data-view-group-title-string-view')
], StringGroupView);
export { StringGroupView };
//# sourceMappingURL=string-group.js.map