import * as i2 from '@acorex/components/button';
import { AXButtonModule } from '@acorex/components/button';
import * as i3 from '@acorex/components/form';
import { AXFormModule } from '@acorex/components/form';
import * as i1 from '@acorex/components/select-box';
import { AXSelectBoxModule } from '@acorex/components/select-box';
import * as i4 from '@acorex/components/text-box';
import { AXTextBoxModule } from '@acorex/components/text-box';
import * as i0 from '@angular/core';
import { Input, CUSTOM_ELEMENTS_SCHEMA, Component } from '@angular/core';

class AXMShareDialogComponent {
    constructor() {
        this.selectedUsers = [];
        this.permission = 'view';
        this.message = '';
        this.users = [
            { id: 1, name: 'User 1' },
            { id: 2, name: 'User 2' },
            { id: 3, name: 'User 3' },
        ];
        this.permissions = [
            { value: 'view', text: 'View only' },
            { value: 'edit', text: 'Can edit' },
            { value: 'full', text: 'Full access' },
        ];
    }
    handleUserChange(event) {
        this.selectedUsers = event;
    }
    handlePermissionChange(event) {
        this.permission = event;
    }
    onShare() {
        // The parent component will handle closing
        console.log({
            result: true,
            data: {
                users: this.selectedUsers,
                permission: this.permission,
                message: this.message,
            },
        });
    }
    onCancel() {
        // The parent component will handle closing
        console.log({ result: false });
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMShareDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.4", type: AXMShareDialogComponent, isStandalone: true, selector: "ax-share-dialog", inputs: { node: "node" }, ngImport: i0, template: `
    <div class="ax-p-4 ax-gap-2">
      <ax-form>
        <ax-form-field>
          <ax-label>Share with:</ax-label>
          <ax-select-box
            [(value)]="selectedUsers"
            [dataSource]="users"
            [multiple]="true"
            valueField="id"
            textField="name"
            (onValueChanged)="handleUserChange($event)"
          >
          </ax-select-box>
        </ax-form-field>
        <ax-form-field>
          <ax-label>Permission:</ax-label>
          <ax-select-box
            [(value)]="permission"
            [dataSource]="permissions"
            valueField="value"
            textField="text"
            (onValueChanged)="handlePermissionChange($event)"
          >
          </ax-select-box>
        </ax-form-field>
        <ax-form-field>
          <ax-label>Message (Optional):</ax-label>
          <ax-text-box [(value)]="message" [multiline]="true"></ax-text-box>
        </ax-form-field>
      </ax-form>
      <ax-footer>
        <ax-suffix>
          <ax-button text="Cancel" (onClick)="onCancel()"></ax-button>
          <ax-button text="Share" (onClick)="onShare()"></ax-button>
        </ax-suffix>
      </ax-footer>
    </div>
  `, isInline: true, dependencies: [{ kind: "ngmodule", type: AXSelectBoxModule }, { kind: "component", type: i1.AXSelectBoxComponent, selector: "ax-select-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "minValue", "maxValue", "value", "state", "name", "id", "type", "look", "multiple", "valueField", "textField", "disabledField", "textTemplate", "selectedItems", "isItemTruncated", "showItemTooltip", "itemHeight", "maxVisibleItems", "dataSource", "minRecordsForSearch", "caption", "itemTemplate", "selectedTemplate", "emptyTemplate", "loadingTemplate", "dropdownWidth", "searchBoxAutoFocus"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onOpened", "onClosed", "onItemSelected", "onItemClick"] }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i2.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXFormModule }, { kind: "component", type: i3.AXFormFieldComponent, selector: "ax-form-field", inputs: ["labelMode"] }, { kind: "component", type: i3.AXFormComponent, selector: "ax-form", inputs: ["labelMode", "look", "messageStyle", "updateOn"], outputs: ["onValidate", "updateOnChange"] }, { kind: "ngmodule", type: AXTextBoxModule }, { kind: "component", type: i4.AXTextBoxComponent, selector: "ax-text-box", inputs: ["disabled", "tabIndex", "readonly", "value", "state", "name", "id", "placeholder", "maxLength", "allowNull", "type", "autoComplete", "look", "mask-options", "class"], outputs: ["onBlur", "onFocus", "valueChange", "stateChange", "onValueChanged", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMShareDialogComponent, decorators: [{
            type: Component,
            args: [{
                    selector: 'ax-share-dialog',
                    standalone: true,
                    imports: [AXSelectBoxModule, AXButtonModule, AXFormModule, AXTextBoxModule],
                    schemas: [CUSTOM_ELEMENTS_SCHEMA],
                    template: `
    <div class="ax-p-4 ax-gap-2">
      <ax-form>
        <ax-form-field>
          <ax-label>Share with:</ax-label>
          <ax-select-box
            [(value)]="selectedUsers"
            [dataSource]="users"
            [multiple]="true"
            valueField="id"
            textField="name"
            (onValueChanged)="handleUserChange($event)"
          >
          </ax-select-box>
        </ax-form-field>
        <ax-form-field>
          <ax-label>Permission:</ax-label>
          <ax-select-box
            [(value)]="permission"
            [dataSource]="permissions"
            valueField="value"
            textField="text"
            (onValueChanged)="handlePermissionChange($event)"
          >
          </ax-select-box>
        </ax-form-field>
        <ax-form-field>
          <ax-label>Message (Optional):</ax-label>
          <ax-text-box [(value)]="message" [multiline]="true"></ax-text-box>
        </ax-form-field>
      </ax-form>
      <ax-footer>
        <ax-suffix>
          <ax-button text="Cancel" (onClick)="onCancel()"></ax-button>
          <ax-button text="Share" (onClick)="onShare()"></ax-button>
        </ax-suffix>
      </ax-footer>
    </div>
  `,
                }]
        }], propDecorators: { node: [{
                type: Input
            }] } });

export { AXMShareDialogComponent };
//# sourceMappingURL=acorex-modules-document-management-share-dialog.component-Cie7I04V.mjs.map
