@peculiar/fortify-webcomponents
Version:
Web-components for creating CSR or Certificate and viewing certificates list using Fortify
42 lines (41 loc) • 2.37 kB
JavaScript
/*!
* © Peculiar Ventures https://peculiarventures.com/ - BSD 3-Clause License
*/
/**
* @license
* Copyright (c) Peculiar Ventures, LLC.
*
* This source code is licensed under the BSD 3-Clause license found in the
* LICENSE file in the root directory of this source tree.
*/
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s)
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
import { h, } from "@stencil/core";
import { ESignatureAlgorithm, EHashAlgorithm, } from "@peculiar/fortify-client-core";
import { Typography } from "@peculiar/certificates-viewer";
import { getString } from "../../utils/l10n";
import { FortifySelect } from "./fortify-select";
import { FortifyCheckbox } from "./fortify-checkbox";
export const EnrollmentFormPublicKey = (props) => {
const { formPolicy } = props, other = __rest(props, ["formPolicy"]);
const renderFields = () => Object.keys(formPolicy).map((keyName) => {
const field = formPolicy[keyName];
const options = keyName === 'signatureAlgorithm' ? ESignatureAlgorithm : EHashAlgorithm;
return (h(FortifySelect, { name: keyName, label: field.label || getString(`enrollment.label.${keyName}`), options: Object.entries(options).map((option) => ({
value: option[1],
name: option[1],
})), required: field.required, defaultValue: field.defaultValue, readOnly: field.readOnly }));
});
return (h("div", Object.assign({}, other), renderFields(), h("div", null), h("div", { class: "mt_2" }, h(Typography, { variant: "c2", color: "gray-10" }, getString('enrollment.title.usage')), h("div", { class: "enrollment_form_group_fields_usage mt_4" }, h(FortifyCheckbox, { label: getString('enrollment.label.sign'), name: "sign", defaultChecked: true, readOnly: true }), h(FortifyCheckbox, { label: getString('enrollment.label.verify'), name: "verify", defaultChecked: true, readOnly: true })))));
};
//# sourceMappingURL=enrollment-form-public-key.js.map