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 NumberGroupView = class NumberGroupView extends BaseGroup {
    constructor() {
        super(...arguments);
        this._click = () => {
            if (this.readonly) {
                return;
            }
            popMenu(this, {
                options: {
                    input: {
                        initValue: this.value ? `${this.value * 10}` : '',
                        onComplete: text => {
                            const num = Number.parseFloat(text);
                            if (Number.isNaN(num)) {
                                return;
                            }
                            this.updateValue?.(num);
                        },
                    },
                    items: [],
                },
            });
        };
    }
    render() {
        if (this.value == null) {
            return html ` <div>Ungroups</div>`;
        }
        if (this.value >= 10) {
            return html ` <div
        @click="${this._click}"
        class="data-view-group-title-number-view"
      >
        >= 100
      </div>`;
        }
        return html ` <div
      @click="${this._click}"
      class="data-view-group-title-number-view"
    >
      ${this.value * 10} - ${this.value * 10 + 9}
    </div>`;
    }
};
NumberGroupView.styles = css `
    .data-view-group-title-number-view {
      border-radius: 8px;
      padding: 4px 8px;
      width: max-content;
      cursor: pointer;
    }

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