This commit is contained in:
Yuri Kuznetsov
2024-04-18 19:24:07 +03:00
parent 3df7349d2b
commit e7b64bcc6f
3 changed files with 79 additions and 1 deletions
+40
View File
@@ -34,9 +34,49 @@ import MultiSelect from 'ui/multi-select';
/**
* An array field.
*
* @extends BaseFieldView<module:views/fields/array~params>
*/
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.<string, string>} [translatedOptions] Option translations.
* @property {Object.<string, 'warning'|'danger'|'success'|'info'|'primary'>} [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'
+1
View File
@@ -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.
+38 -1
View File
@@ -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.<string, string>} [translatedOptions] Option translations.
* @property {Object.<string, 'warning'|'danger'|'success'|'info'|'primary'>} [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'