UNPKG

@open-formulieren/formio-builder

Version:

An opinionated Formio webform builder for Open Forms

11 lines (10 loc) 1.2 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const jsx_runtime_1 = require("react/jsx-runtime"); const react_intl_1 = require("react-intl"); const CharCount = ({ value, maxLength }) => { const hasMaxLength = maxLength !== undefined; const msg = hasMaxLength ? ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: 'CZ4Fby', defaultMessage: [{ type: 1, value: "length" }, { type: 0, value: " " }, { type: 6, value: "length", options: { one: { value: [{ type: 0, value: "character remaining" }] }, other: { value: [{ type: 0, value: "characters remaining" }] } }, offset: 0, pluralType: "cardinal" }], values: { length: maxLength - value.length } })) : ((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: '5dp5j+', defaultMessage: [{ type: 1, value: "length" }, { type: 0, value: " " }, { type: 6, value: "length", options: { one: { value: [{ type: 0, value: "character" }] }, other: { value: [{ type: 0, value: "characters" }] } }, offset: 0, pluralType: "cardinal" }], values: { length: value.length } })); return (0, jsx_runtime_1.jsx)("span", Object.assign({ className: "text-muted" }, { children: msg })); }; exports.default = CharCount;