From e7b64bcc6f9aa72d30966aae8ad85d5de5f4e965 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Thu, 18 Apr 2024 19:24:07 +0300 Subject: [PATCH] jsdocs --- client/src/views/fields/array.js | 40 +++++++++++++++++++++++++++ client/src/views/fields/enum.js | 1 + client/src/views/fields/multi-enum.js | 39 +++++++++++++++++++++++++- 3 files changed, 79 insertions(+), 1 deletion(-) diff --git a/client/src/views/fields/array.js b/client/src/views/fields/array.js index 1b81c1278b..a8e813d93d 100644 --- a/client/src/views/fields/array.js +++ b/client/src/views/fields/array.js @@ -34,9 +34,49 @@ import MultiSelect from 'ui/multi-select'; /** * An array field. + * + * @extends BaseFieldView */ class ArrayFieldView extends BaseFieldView { + /** + * @typedef {Object} module:views/fields/array~options + * @property { + * module:views/fields/array~params & + * module:views/fields/base~params & + * Record + * } [params] Parameters. + */ + + /** + * @typedef {Object} module:views/fields/array~params + * @property {number} [maxLength] A max length. + * @property {string} [translation] A translation string. E.g. `Global.scopeNames`. + * @property {string[]} [options] Select options. + * @property {boolean} [required] Required. + * @property {boolean} [displayAsLabel] Display as label. + * @property {string|'state'} [labelType] A label type. + * @property {boolean} [noEmptyString] No empty string. + * @property {string} [optionsReference] A reference to options. E.g. `Account.industry`. + * @property {string} [optionsPath] An options metadata path. + * @property {boolean} [isSorted] To sort options. + * @property {Object.} [translatedOptions] Option translations. + * @property {Object.} [style] A style map. + * @property {number} [maxCount] A max number of items. + * @property {boolean} [allowCustomOptions] Allow custom options. + * @property {string} [pattern] A regular expression pattern. + */ + + /** + * @param { + * module:views/fields/array~options & + * module:views/fields/base~options + * } options Options. + */ + constructor(options) { + super(options); + } + type = 'array' listTemplate = 'fields/array/list' diff --git a/client/src/views/fields/enum.js b/client/src/views/fields/enum.js index cebc6126a5..60cc7e2072 100644 --- a/client/src/views/fields/enum.js +++ b/client/src/views/fields/enum.js @@ -54,6 +54,7 @@ class EnumFieldView extends BaseFieldView { * @property {boolean} [required] Required. * @property {string} [translation] A translation string. E.g. `Global.scopeNames`. * @property {boolean} [displayAsLabel] Display as label. + * @property {string|'state'} [labelType] A label type. * @property {'regular'|'state'} [labelType] A label type. * @property {string} [optionsReference] A reference to options. E.g. `Account.industry`. * @property {string} [optionsPath] An options metadata path. diff --git a/client/src/views/fields/multi-enum.js b/client/src/views/fields/multi-enum.js index c9462d4fc2..d40716f88d 100644 --- a/client/src/views/fields/multi-enum.js +++ b/client/src/views/fields/multi-enum.js @@ -26,7 +26,7 @@ * these Appropriate Legal Notices must retain the display of the "EspoCRM" word. ************************************************************************/ -/** @module views/fields/multi-enum */ +/** @module views/fields/multi-enumeration */ import ArrayFieldView from 'views/fields/array'; import RegExpPattern from 'helpers/reg-exp-pattern'; @@ -37,6 +37,43 @@ import MultiSelect from 'ui/multi-select'; */ class MultiEnumFieldView extends ArrayFieldView { + /** + * @typedef {Object} module:views/fields/multi-enumeration~options + * @property { + * module:views/fields/multi-enumeration~params & + * module:views/fields/base~params & + * Record + * } [params] Parameters. + */ + + /** + * @typedef {Object} module:views/fields/multi-enumeration~params + * @property {number} [maxLength] A max length. + * @property {string} [translation] A translation string. E.g. `Global.scopeNames`. + * @property {string[]} [options] Select options. + * @property {boolean} [required] Required. + * @property {boolean} [displayAsLabel] Display as label. + * @property {string|'state'} [labelType] A label type. + * @property {string} [optionsReference] A reference to options. E.g. `Account.industry`. + * @property {string} [optionsPath] An options metadata path. + * @property {boolean} [isSorted] To sort options. + * @property {Object.} [translatedOptions] Option translations. + * @property {Object.} [style] A style map. + * @property {number} [maxCount] A max number of items. + * @property {boolean} [allowCustomOptions] Allow custom options. + * @property {string} [pattern] A regular expression pattern. + */ + + /** + * @param { + * module:views/fields/multi-enumeration~options & + * module:views/fields/base~options + * } options Options. + */ + constructor(options) { + super(options); + } + type = 'multiEnum' listTemplate = 'fields/array/list'