"use strict";
/*!
 * Copyright (c) Microsoft Corporation and contributors. All rights reserved.
 * Licensed under the MIT License.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.required = exports.requiredFieldChangeHandler = exports.requiredFieldEditor = void 0;
const index_js_1 = require("../../core/index.js");
const fieldKindIdentifiers_js_1 = require("../fieldKindIdentifiers.js");
const index_js_2 = require("../modular-schema/index.js");
const optionalField_js_1 = require("./optionalField.js");
exports.requiredFieldEditor = {
    ...optionalField_js_1.optionalFieldEditor,
    set: (ids) => optionalField_js_1.optionalFieldEditor.set(false, ids),
};
exports.requiredFieldChangeHandler = {
    ...optionalField_js_1.optionalChangeHandler,
    editor: exports.requiredFieldEditor,
};
/**
 * Exactly one item.
 */
exports.required = new index_js_2.FlexFieldKind(fieldKindIdentifiers_js_1.requiredIdentifier, index_js_1.Multiplicity.Single, {
    changeHandler: exports.requiredFieldChangeHandler,
    allowMonotonicUpgradeFrom: new Set([fieldKindIdentifiers_js_1.identifierFieldIdentifier]),
});
//# sourceMappingURL=requiredField.js.map