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';
import { AXDateTimePickerModule } from '@acorex/components/datetime-picker';

class AXMLinkDialogComponent {
    constructor() {
        this.linkType = 'view';
        this.expirationDate = null;
        this.permission = 'view';
        this.generatedLink = '';
        this.linkTypes = [
            { value: 'view', text: 'View Only Link' },
            { value: 'edit', text: 'Edit Link' },
            { value: 'download', text: 'Download Link' },
        ];
        this.permissions = [
            { value: 'view', text: 'View only' },
            { value: 'edit', text: 'Can edit' },
            { value: 'full', text: 'Full access' },
        ];
    }
    handleLinkTypeChange(event) {
        this.linkType = event;
    }
    handlePermissionChange(event) {
        this.permission = event;
    }
    copyLink() {
        if (this.generatedLink) {
            navigator.clipboard.writeText(this.generatedLink);
        }
    }
    onGenerate() {
        // Here we would typically make an API call to generate the link
        this.generatedLink = `https://example.com/share/${this.node.id}?type=${this.linkType}&permission=${this.permission}`;
        console.log({
            result: true,
            data: {
                linkType: this.linkType,
                permission: this.permission,
                expirationDate: this.expirationDate,
                link: this.generatedLink,
            },
        });
    }
    onCancel() {
        console.log({ result: false });
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMLinkDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.4", type: AXMLinkDialogComponent, isStandalone: true, selector: "ax-link-dialog", inputs: { node: "node" }, ngImport: i0, template: "<div class=\"ax-p-4 ax-gap-2\">\n  <ax-form>\n    <ax-form-field>\n      <ax-label>Link Type:</ax-label>\n      <ax-select-box\n        [(value)]=\"linkType\"\n        [dataSource]=\"linkTypes\"\n        valueField=\"value\"\n        textField=\"text\"\n        (onValueChanged)=\"handleLinkTypeChange($event)\"\n        >\n      </ax-select-box>\n    </ax-form-field>\n    <ax-form-field>\n      <ax-label>Expiration:</ax-label>\n      <ax-date-picker [(value)]=\"expirationDate\"></ax-date-picker>\n    </ax-form-field>\n    <ax-form-field>\n      <ax-label>Permission:</ax-label>\n      <ax-select-box\n        [(value)]=\"permission\"\n        [dataSource]=\"permissions\"\n        valueField=\"value\"\n        textField=\"text\"\n        (onValueChanged)=\"handlePermissionChange($event)\"\n        >\n      </ax-select-box>\n    </ax-form-field>\n    @if (generatedLink) {\n      <ax-form-field>\n        <ax-label>Generated Link:</ax-label>\n        <ax-text-box [(value)]=\"generatedLink\" [readonly]=\"true\">\n          <ax-suffix>\n            <ax-button text=\"Copy\" size=\"small\" (onClick)=\"copyLink()\"></ax-button>\n          </ax-suffix>\n        </ax-text-box>\n      </ax-form-field>\n    }\n  </ax-form>\n  <ax-footer>\n    <ax-suffix>\n      <ax-button text=\"Cancel\" (onClick)=\"onCancel()\"></ax-button>\n      <ax-button text=\"Generate Link\" (onClick)=\"onGenerate()\"></ax-button>\n    </ax-suffix>\n  </ax-footer>\n</div>\n", 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"] }, { kind: "ngmodule", type: AXDateTimePickerModule }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXMLinkDialogComponent, decorators: [{
            type: Component,
            args: [{ selector: 'ax-link-dialog', standalone: true, imports: [AXSelectBoxModule, AXButtonModule, AXFormModule, AXTextBoxModule, AXDateTimePickerModule], schemas: [CUSTOM_ELEMENTS_SCHEMA], template: "<div class=\"ax-p-4 ax-gap-2\">\n  <ax-form>\n    <ax-form-field>\n      <ax-label>Link Type:</ax-label>\n      <ax-select-box\n        [(value)]=\"linkType\"\n        [dataSource]=\"linkTypes\"\n        valueField=\"value\"\n        textField=\"text\"\n        (onValueChanged)=\"handleLinkTypeChange($event)\"\n        >\n      </ax-select-box>\n    </ax-form-field>\n    <ax-form-field>\n      <ax-label>Expiration:</ax-label>\n      <ax-date-picker [(value)]=\"expirationDate\"></ax-date-picker>\n    </ax-form-field>\n    <ax-form-field>\n      <ax-label>Permission:</ax-label>\n      <ax-select-box\n        [(value)]=\"permission\"\n        [dataSource]=\"permissions\"\n        valueField=\"value\"\n        textField=\"text\"\n        (onValueChanged)=\"handlePermissionChange($event)\"\n        >\n      </ax-select-box>\n    </ax-form-field>\n    @if (generatedLink) {\n      <ax-form-field>\n        <ax-label>Generated Link:</ax-label>\n        <ax-text-box [(value)]=\"generatedLink\" [readonly]=\"true\">\n          <ax-suffix>\n            <ax-button text=\"Copy\" size=\"small\" (onClick)=\"copyLink()\"></ax-button>\n          </ax-suffix>\n        </ax-text-box>\n      </ax-form-field>\n    }\n  </ax-form>\n  <ax-footer>\n    <ax-suffix>\n      <ax-button text=\"Cancel\" (onClick)=\"onCancel()\"></ax-button>\n      <ax-button text=\"Generate Link\" (onClick)=\"onGenerate()\"></ax-button>\n    </ax-suffix>\n  </ax-footer>\n</div>\n" }]
        }], propDecorators: { node: [{
                type: Input
            }] } });

export { AXMLinkDialogComponent };
//# sourceMappingURL=acorex-modules-document-management-link-dialog.component-Gc-Cwsq-.mjs.map
