Sha256: e2aa2a46f47f6b16735dbdfb58fd3e5254074e7c9c1c74d038d7013d30bdff6d

Contents?: true

Size: 1.92 KB

Versions: 91

Compression:

Stored size: 1.92 KB

Contents

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;
};
/* eslint-disable custom-elements/expose-class-on-global */
import { controller, targets } from '@github/catalyst';
let PrimerMultiInputElement = class PrimerMultiInputElement extends HTMLElement {
    activateField(name) {
        const fieldWithName = this.findField(name);
        if (!fieldWithName)
            return;
        for (const field of this.fields) {
            if (field === fieldWithName)
                continue;
            field.setAttribute('disabled', 'disabled');
            field.setAttribute('hidden', 'hidden');
            field.parentElement?.setAttribute('hidden', 'hidden');
        }
        fieldWithName.removeAttribute('disabled');
        fieldWithName.removeAttribute('hidden');
        fieldWithName.parentElement?.removeAttribute('hidden');
    }
    findField(name) {
        for (const field of this.fields) {
            if (field.getAttribute('data-name') === name) {
                return field;
            }
        }
        return null;
    }
};
__decorate([
    targets
], PrimerMultiInputElement.prototype, "fields", void 0);
PrimerMultiInputElement = __decorate([
    controller
], PrimerMultiInputElement);
export { PrimerMultiInputElement };
if (!window.customElements.get('primer-multi-input')) {
    Object.assign(window, { PrimerMultiInputElement });
    window.customElements.define('primer-multi-input', PrimerMultiInputElement);
}

Version data entries

91 entries across 85 versions & 3 rubygems

Version Path
primer_view_components-0.36.5 app/lib/primer/forms/primer_multi_input.js
openproject-primer_view_components-0.52.2 app/lib/primer/forms/primer_multi_input.js
openproject-primer_view_components-0.52.2 lib/primer/forms/primer_multi_input.js
primer_view_components-0.36.4 app/lib/primer/forms/primer_multi_input.js
openproject-primer_view_components-0.52.1 app/lib/primer/forms/primer_multi_input.js
openproject-primer_view_components-0.52.1 lib/primer/forms/primer_multi_input.js
openproject-primer_view_components-0.52.0 lib/primer/forms/primer_multi_input.js
openproject-primer_view_components-0.52.0 app/lib/primer/forms/primer_multi_input.js
primer_view_components-0.36.3 app/lib/primer/forms/primer_multi_input.js
openproject-primer_view_components-0.51.0 app/lib/primer/forms/primer_multi_input.js
openproject-primer_view_components-0.51.0 lib/primer/forms/primer_multi_input.js
primer_view_components-0.36.2 app/lib/primer/forms/primer_multi_input.js
openproject-primer_view_components-0.50.1 lib/primer/forms/primer_multi_input.js
openproject-primer_view_components-0.50.1 app/lib/primer/forms/primer_multi_input.js
openproject-primer_view_components-0.50.0 lib/primer/forms/primer_multi_input.js
openproject-primer_view_components-0.50.0 app/lib/primer/forms/primer_multi_input.js
primer_view_components-0.36.1 app/lib/primer/forms/primer_multi_input.js
primer_view_components-0.36.0 app/lib/primer/forms/primer_multi_input.js
openproject-primer_view_components-0.49.2 app/lib/primer/forms/primer_multi_input.js
primer_view_components-0.35.2 app/lib/primer/forms/primer_multi_input.js