@zohodesk/library-platform 1.1.11 → 1.1.12-exp.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/cc/checkbox/Properties.js +2 -1
- package/es/cc/email/Properties.js +8 -0
- package/es/cc/fields/field/Types.js +31 -23
- package/es/cc/highlighted-value/Properties.js +18 -0
- package/es/cc/link/Properties.js +13 -3
- package/es/cc/radio-dropdown/Constants.js +6 -0
- package/es/cc/radio-dropdown/Data.js +1 -0
- package/es/cc/radio-dropdown/Events.js +42 -0
- package/es/cc/radio-dropdown/Properties.js +142 -0
- package/es/cc/radio-dropdown/index.js +4 -0
- package/es/cc/switch/Properties.js +2 -2
- package/es/cc/table-column-filter/Properties.js +9 -0
- package/es/cc/table-list/Properties.js +1 -35
- package/es/cc/tag/Constants.js +6 -0
- package/es/cc/tag/Data.js +14 -0
- package/es/cc/tag/EventHandlers.js +1 -0
- package/es/cc/tag/Events.js +26 -0
- package/es/cc/{tags/model/TagModel.js → tag/Model.js} +6 -2
- package/es/cc/tag/Properties.js +104 -0
- package/es/cc/tag/index.js +6 -0
- package/es/cc/tags/Data.js +0 -6
- package/es/cc/tags/model/index.js +1 -1
- package/es/cc/tags-list-dropdown/Constants.js +5 -0
- package/es/cc/tags-list-dropdown/Data.js +1 -0
- package/es/cc/tags-list-dropdown/Events.js +14 -0
- package/es/cc/tags-list-dropdown/Properties.js +96 -0
- package/es/cc/tags-list-dropdown/index.js +4 -0
- package/es/library/dot/components/form/frameworks/ui/css/Form.module.css +13 -13
- package/es/library/dot/components/form-fields/field/css/FieldItem.module.css +2 -2
- package/es/library/dot/components/section/frameworks/ui/css/Section.module.css +3 -3
- package/es/library/dot/components/table-list/frameworks/ui/css/TableList.module.css +21 -21
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/Row.js +3 -1
- package/es/library/dot/legacy-to-new-arch/breadcrumb/frameworks/ui/css/Breadcrumb.module.css +4 -4
- package/es/library/dot/legacy-to-new-arch/date/frameworks/ui/css/DateView.module.css +1 -1
- package/es/library/dot/legacy-to-new-arch/email/frameworks/ui/EmailView.js +4 -2
- package/es/library/dot/legacy-to-new-arch/highlighted-value/frameworks/ui/HighlightedValueView.js +6 -1
- package/es/library/dot/legacy-to-new-arch/index.js +1 -0
- package/es/library/dot/legacy-to-new-arch/label/frameworks/ui/css/Label.module.css +4 -4
- package/es/library/dot/legacy-to-new-arch/link/frameworks/ui/LinkView.js +4 -2
- package/es/library/dot/legacy-to-new-arch/multi-select/frameworks/ui/css/MultiSelectView.module.css +7 -7
- package/es/library/dot/legacy-to-new-arch/radio-dropdown/frameworks/ui/RadioDropdown.js +12 -0
- package/es/library/dot/legacy-to-new-arch/radio-dropdown/frameworks/ui/RadioDropdownView.js +124 -0
- package/es/library/dot/legacy-to-new-arch/radio-dropdown/frameworks/ui/css/RadioDropdown.module.css +23 -0
- package/es/library/dot/legacy-to-new-arch/select/frameworks/ui/css/Select.module.css +2 -2
- package/es/library/dot/legacy-to-new-arch/table-column-chooser/frameworks/ui/css/TableColumnChooserView.module.css +1 -1
- package/es/library/dot/legacy-to-new-arch/table-column-filter/frameworks/ui/TableColumnFilterView.js +2 -1
- package/es/library/dot/legacy-to-new-arch/table-field-components/checkbox-field/frameworks/ui/CheckboxField.js +12 -2
- package/es/library/dot/legacy-to-new-arch/table-field-components/checkbox-field/frameworks/ui/CheckboxFieldView.js +8 -5
- package/es/library/dot/legacy-to-new-arch/table-field-components/checkbox-field/frameworks/ui/EventHandlersFactory.js +3 -3
- package/es/library/dot/legacy-to-new-arch/table-field-components/email-field/frameworks/ui/EmailField.js +3 -3
- package/es/library/dot/legacy-to-new-arch/table-field-components/email-field/frameworks/ui/EmailFieldView.js +8 -6
- package/es/library/dot/legacy-to-new-arch/table-field-components/highlighted-value-field/frameworks/ui/EventHandlersFactory.js +26 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/highlighted-value-field/frameworks/ui/HighlightedValueField.js +23 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/highlighted-value-field/frameworks/ui/HighlightedValueFieldView.js +24 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/index.js +22 -5
- package/es/library/dot/legacy-to-new-arch/table-field-components/labeled-avatar-field/frameworks/ui/EventHandlersFactory.js +26 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/labeled-avatar-field/frameworks/ui/LabeledAvatarField.js +23 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/labeled-avatar-field/frameworks/ui/LabeledAvatarFieldView.js +22 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/link-field/frameworks/ui/EventHandlersFactory.js +26 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/link-field/frameworks/ui/LinkField.js +23 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/link-field/frameworks/ui/LinkFieldView.js +26 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/lookup-field/frameworks/ui/LookupFieldView.js +1 -1
- package/es/library/dot/legacy-to-new-arch/table-field-components/phone-field/frameworks/ui/PhoneFieldView.js +1 -1
- package/es/library/dot/legacy-to-new-arch/table-field-components/radio-dropdown-field/frameworks/ui/EventHandlersFactory.js +32 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/radio-dropdown-field/frameworks/ui/RadioDropdownField.js +32 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/radio-dropdown-field/frameworks/ui/RadioDropdownFieldView.js +43 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/radio-dropdown-field/frameworks/ui/css/RadioDropdownField.module.css +3 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/switch-field/frameworks/ui/EventHandlersFactory.js +3 -3
- package/es/library/dot/legacy-to-new-arch/table-field-components/switch-field/frameworks/ui/SwitchField.js +14 -4
- package/es/library/dot/legacy-to-new-arch/table-field-components/switch-field/frameworks/ui/SwitchFieldView.js +8 -4
- package/es/library/dot/legacy-to-new-arch/table-field-components/tag-field/frameworks/ui/EventHandlersFactory.js +26 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/tag-field/frameworks/ui/TagField.js +23 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/tag-field/frameworks/ui/TagFieldView.js +34 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/tags-field/frameworks/ui/EventHandlersFactory.js +26 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/tags-field/frameworks/ui/TagsField.js +23 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/tags-field/frameworks/ui/TagsFieldView.js +18 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/tags-list-dropdown-field/frameworks/ui/TagsListDropdownField.js +12 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/tags-list-dropdown-field/frameworks/ui/TagsListDropdownFieldView.js +24 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/text-field/frameworks/ui/EventHandlersFactory.js +26 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/text-field/frameworks/ui/TextField.js +23 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/text-field/frameworks/ui/TextFieldView.js +20 -0
- package/es/library/dot/legacy-to-new-arch/table-field-components/url-field/frameworks/ui/UrlFieldView.js +1 -1
- package/es/library/dot/legacy-to-new-arch/tag/frameworks/ui/Tag.js +11 -0
- package/es/library/dot/legacy-to-new-arch/tag/frameworks/ui/Tag.module.css +8 -0
- package/es/library/dot/legacy-to-new-arch/tag/frameworks/ui/TagView.js +96 -0
- package/es/library/dot/legacy-to-new-arch/tags-list-dropdown/frameworks/ui/TagContractAdapter.js +24 -0
- package/es/library/dot/legacy-to-new-arch/tags-list-dropdown/frameworks/ui/TagsListDropdown.js +12 -0
- package/es/library/dot/legacy-to-new-arch/tags-list-dropdown/frameworks/ui/TagsListDropdownView.js +42 -0
- package/es/library/dot/legacy-to-new-arch/text-area/frameworks/ui/css/TextAreaView.module.css +3 -3
- package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActions/RowActionsRenderer.module.css +5 -5
- package/es/platform/data-source/http-template/getComponentMapping.js +17 -0
- package/es/platform/data-source/index.js +3 -1
- package/es/platform/zfield/applications/usecases/FetchSuccessUseCase.js +33 -0
- package/es/platform/zfield/domain/entities/fields-manager/FieldsManager.js +5 -0
- package/es/platform/zlist/adapters/presenters/TableTranslator.js +15 -2
- package/es/platform/zlist/adapters/presenters/translators/ColumnTranslator.js +48 -52
- package/es/platform/zlist/adapters/presenters/translators/FieldVariations.js +25 -0
- package/es/platform/zlist/adapters/presenters/translators/Row.js +3 -2
- package/es/platform/zlist/adapters/presenters/translators/RowsTranslator.js +3 -1
- package/es/platform/zlist/adapters/presenters/translators/fields/BooleanFieldTranslator.js +87 -12
- package/es/platform/zlist/adapters/presenters/translators/fields/CurrencyFieldTranslator.js +66 -11
- package/es/platform/zlist/adapters/presenters/translators/fields/DateFieldTranslator.js +16 -9
- package/es/platform/zlist/adapters/presenters/translators/fields/DateTimeFieldTranslator.js +16 -9
- package/es/platform/zlist/adapters/presenters/translators/fields/DecimalFieldTranslator.js +16 -9
- package/es/platform/zlist/adapters/presenters/translators/fields/EmailFieldTranslator.js +29 -9
- package/es/platform/zlist/adapters/presenters/translators/fields/FormulaFieldTranslator.js +23 -27
- package/es/platform/zlist/adapters/presenters/translators/fields/LookUpFieldTranslator.js +106 -17
- package/es/platform/zlist/adapters/presenters/translators/fields/MultiLineFieldTranslator.js +16 -9
- package/es/platform/zlist/adapters/presenters/translators/fields/MultiSelectFieldTranslator.js +100 -26
- package/es/platform/zlist/adapters/presenters/translators/fields/NumberFieldTranslator.js +16 -9
- package/es/platform/zlist/adapters/presenters/translators/fields/PercentageFieldTranslator.js +16 -9
- package/es/platform/zlist/adapters/presenters/translators/fields/PhoneFieldTranslator.js +16 -9
- package/es/platform/zlist/adapters/presenters/translators/fields/PickListFieldTranslator.js +167 -26
- package/es/platform/zlist/adapters/presenters/translators/fields/SingleLineFieldTranslator.js +16 -9
- package/es/platform/zlist/adapters/presenters/translators/fields/URLFieldTranslator.js +32 -9
- package/package.json +8 -8
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Tag from "../../../../tag/frameworks/ui/Tag";
|
|
3
|
+
export default function TagFieldView(_ref, ref) {
|
|
4
|
+
let {
|
|
5
|
+
state
|
|
6
|
+
} = _ref;
|
|
7
|
+
const {
|
|
8
|
+
id,
|
|
9
|
+
label,
|
|
10
|
+
color,
|
|
11
|
+
isDisabled,
|
|
12
|
+
iconName,
|
|
13
|
+
imageAltText,
|
|
14
|
+
imageSrc,
|
|
15
|
+
isRemovable,
|
|
16
|
+
cursor,
|
|
17
|
+
size,
|
|
18
|
+
tooltip
|
|
19
|
+
} = state.properties;
|
|
20
|
+
return /*#__PURE__*/React.createElement(Tag, {
|
|
21
|
+
getRef: ref,
|
|
22
|
+
id: id,
|
|
23
|
+
label: label,
|
|
24
|
+
color: color,
|
|
25
|
+
isDisabled: isDisabled,
|
|
26
|
+
iconName: iconName,
|
|
27
|
+
imageAltText: imageAltText,
|
|
28
|
+
imageSrc: imageSrc,
|
|
29
|
+
isRemovable: isRemovable,
|
|
30
|
+
cursor: cursor,
|
|
31
|
+
size: size,
|
|
32
|
+
tooltip: tooltip
|
|
33
|
+
});
|
|
34
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import TagsConstants from "../../../../../../../cc/tags/Constants";
|
|
2
|
+
import FieldConstants from "../../../../../../../cc/fields/field/Constants";
|
|
3
|
+
export class EventHandlersFactory {
|
|
4
|
+
static create() {
|
|
5
|
+
const clickHandler = input => {
|
|
6
|
+
const {
|
|
7
|
+
state,
|
|
8
|
+
dispatch
|
|
9
|
+
} = input;
|
|
10
|
+
const {
|
|
11
|
+
fieldName
|
|
12
|
+
} = state.properties;
|
|
13
|
+
dispatch({
|
|
14
|
+
type: FieldConstants.FIELD_CLICKED,
|
|
15
|
+
payload: {
|
|
16
|
+
fieldName
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
return {
|
|
22
|
+
[TagsConstants.TAG_CLICKED]: clickHandler
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createCustomComponent } from "../../../../../../custom-component";
|
|
2
|
+
import TagsProperties from "../../../../../../../cc/tags/Properties";
|
|
3
|
+
import FieldEvents from "../../../../../../../cc/fields/field/Events";
|
|
4
|
+
import TagsFieldView from "./TagsFieldView";
|
|
5
|
+
import { EventHandlersFactory } from "./EventHandlersFactory";
|
|
6
|
+
const TagsField = createCustomComponent({
|
|
7
|
+
name: 'TagsField',
|
|
8
|
+
View: TagsFieldView,
|
|
9
|
+
properties: { ...TagsProperties,
|
|
10
|
+
fieldName: {
|
|
11
|
+
required: false,
|
|
12
|
+
defaultValue: '',
|
|
13
|
+
typeMetadata: {
|
|
14
|
+
schema: {
|
|
15
|
+
type: 'string'
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
events: FieldEvents,
|
|
21
|
+
eventHandlers: EventHandlersFactory.create()
|
|
22
|
+
});
|
|
23
|
+
export default TagsField;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Tags from "../../../../tags/frameworks/ui/Tags";
|
|
3
|
+
export default function TagsFieldView(_ref, ref) {
|
|
4
|
+
let {
|
|
5
|
+
state
|
|
6
|
+
} = _ref;
|
|
7
|
+
const {
|
|
8
|
+
title,
|
|
9
|
+
tags,
|
|
10
|
+
isWrapped
|
|
11
|
+
} = state.properties;
|
|
12
|
+
return /*#__PURE__*/React.createElement(Tags, {
|
|
13
|
+
getRef: ref,
|
|
14
|
+
title: title,
|
|
15
|
+
tags: tags,
|
|
16
|
+
isWrapped: isWrapped
|
|
17
|
+
});
|
|
18
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createCustomComponent } from "../../../../../../custom-component";
|
|
2
|
+
import TagsListDropdownProperties from "../../../../../../../cc/tags-list-dropdown/Properties";
|
|
3
|
+
import FieldEvents from "../../../../../../../cc/fields/field/Events";
|
|
4
|
+
import TagsListDropdownFieldView from "./TagsListDropdownFieldView";
|
|
5
|
+
const TagsListDropdownField = createCustomComponent({
|
|
6
|
+
name: 'TagsListDropdownField',
|
|
7
|
+
View: TagsListDropdownFieldView,
|
|
8
|
+
properties: TagsListDropdownProperties,
|
|
9
|
+
events: FieldEvents,
|
|
10
|
+
eventHandlers: {}
|
|
11
|
+
});
|
|
12
|
+
export default TagsListDropdownField;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import TagsListDropdown from "../../../../tags-list-dropdown/frameworks/ui/TagsListDropdown";
|
|
3
|
+
export default function TagsListDropdownFieldView(_ref, ref) {
|
|
4
|
+
let {
|
|
5
|
+
state
|
|
6
|
+
} = _ref;
|
|
7
|
+
const {
|
|
8
|
+
tags,
|
|
9
|
+
hasSearch,
|
|
10
|
+
searchPlaceholder,
|
|
11
|
+
text,
|
|
12
|
+
dropdownHeading,
|
|
13
|
+
emptyMessage
|
|
14
|
+
} = state.properties;
|
|
15
|
+
return /*#__PURE__*/React.createElement(TagsListDropdown, {
|
|
16
|
+
getRef: ref,
|
|
17
|
+
tags: tags,
|
|
18
|
+
text: text,
|
|
19
|
+
hasSearch: hasSearch,
|
|
20
|
+
searchPlaceholder: searchPlaceholder,
|
|
21
|
+
dropdownHeading: dropdownHeading,
|
|
22
|
+
emptyMessage: emptyMessage
|
|
23
|
+
});
|
|
24
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import TextConstants from "../../../../../../../cc/text/Constants";
|
|
2
|
+
import FieldConstants from "../../../../../../../cc/fields/field/Constants";
|
|
3
|
+
export class EventHandlersFactory {
|
|
4
|
+
static create() {
|
|
5
|
+
const clickHandler = input => {
|
|
6
|
+
const {
|
|
7
|
+
state,
|
|
8
|
+
dispatch
|
|
9
|
+
} = input;
|
|
10
|
+
const {
|
|
11
|
+
fieldName
|
|
12
|
+
} = state.properties;
|
|
13
|
+
dispatch({
|
|
14
|
+
type: FieldConstants.FIELD_CLICKED,
|
|
15
|
+
payload: {
|
|
16
|
+
fieldName
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
return {
|
|
22
|
+
[TextConstants.TEXT_CLICKED]: clickHandler
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createCustomComponent } from "../../../../../../custom-component";
|
|
2
|
+
import TextProperties from "../../../../../../../cc/text/Properties";
|
|
3
|
+
import FieldEvents from "../../../../../../../cc/fields/field/Events";
|
|
4
|
+
import TextFieldView from "./TextFieldView";
|
|
5
|
+
import { EventHandlersFactory } from "./EventHandlersFactory";
|
|
6
|
+
const TextField = createCustomComponent({
|
|
7
|
+
name: 'TextField',
|
|
8
|
+
View: TextFieldView,
|
|
9
|
+
properties: { ...TextProperties,
|
|
10
|
+
fieldName: {
|
|
11
|
+
required: false,
|
|
12
|
+
defaultValue: '',
|
|
13
|
+
typeMetadata: {
|
|
14
|
+
schema: {
|
|
15
|
+
type: 'string'
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
events: FieldEvents,
|
|
21
|
+
eventHandlers: EventHandlersFactory.create()
|
|
22
|
+
});
|
|
23
|
+
export default TextField;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Text } from "../../../..";
|
|
3
|
+
export default function TextFieldView(_ref, ref) {
|
|
4
|
+
let {
|
|
5
|
+
state
|
|
6
|
+
} = _ref;
|
|
7
|
+
const {
|
|
8
|
+
text,
|
|
9
|
+
weight,
|
|
10
|
+
isDotted,
|
|
11
|
+
tooltip
|
|
12
|
+
} = state.properties;
|
|
13
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
14
|
+
getRef: ref,
|
|
15
|
+
text: text,
|
|
16
|
+
tooltip: tooltip,
|
|
17
|
+
weight: weight,
|
|
18
|
+
isDotted: isDotted
|
|
19
|
+
});
|
|
20
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createCustomComponent } from "../../../../../custom-component";
|
|
2
|
+
import { TagProperties, TagEvents } from "../../../../../../cc/tag";
|
|
3
|
+
import TagView from "./TagView";
|
|
4
|
+
let Tag = createCustomComponent({
|
|
5
|
+
name: "Tag",
|
|
6
|
+
View: TagView,
|
|
7
|
+
properties: TagProperties,
|
|
8
|
+
events: TagEvents,
|
|
9
|
+
eventHandlers: {}
|
|
10
|
+
});
|
|
11
|
+
export default Tag;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TagConstants } from "../../../../../../cc/tag";
|
|
3
|
+
import Tag from '@zohodesk/components/es/Tag/Tag';
|
|
4
|
+
import ColoredTag from '@zohodesk-private/desk-components/es/ColoredTag/ColoredTag'; // @ts-ignore
|
|
5
|
+
|
|
6
|
+
import style from "./Tag.module.css";
|
|
7
|
+
|
|
8
|
+
function TagView(_ref, ref) {
|
|
9
|
+
let {
|
|
10
|
+
state,
|
|
11
|
+
helpers
|
|
12
|
+
} = _ref;
|
|
13
|
+
let {
|
|
14
|
+
dispatch
|
|
15
|
+
} = helpers;
|
|
16
|
+
let {
|
|
17
|
+
id,
|
|
18
|
+
label,
|
|
19
|
+
color,
|
|
20
|
+
isDisabled,
|
|
21
|
+
iconName,
|
|
22
|
+
imageAltText,
|
|
23
|
+
imageSrc,
|
|
24
|
+
isRemovable,
|
|
25
|
+
cursor,
|
|
26
|
+
size,
|
|
27
|
+
tooltip
|
|
28
|
+
} = state.properties;
|
|
29
|
+
|
|
30
|
+
if (!!color) {
|
|
31
|
+
return /*#__PURE__*/React.createElement(ColoredTag, {
|
|
32
|
+
$data_id: id,
|
|
33
|
+
$data_text: label,
|
|
34
|
+
$data_color: color,
|
|
35
|
+
$event_onClick: id => {
|
|
36
|
+
dispatch({
|
|
37
|
+
type: TagConstants.TAG_CLICKED,
|
|
38
|
+
payload: {
|
|
39
|
+
id
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
},
|
|
43
|
+
$event_onRemove: isRemovable ? id => {
|
|
44
|
+
dispatch({
|
|
45
|
+
type: TagConstants.TAG_REMOVED,
|
|
46
|
+
payload: {
|
|
47
|
+
id
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
} : undefined,
|
|
51
|
+
customStyle: {
|
|
52
|
+
chip: cursor && !isDisabled ? style[`cursor_${cursor}`] : ''
|
|
53
|
+
},
|
|
54
|
+
$customProps_tag: {
|
|
55
|
+
getRef: ref,
|
|
56
|
+
disabled: isDisabled,
|
|
57
|
+
size,
|
|
58
|
+
tooltip
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return /*#__PURE__*/React.createElement(Tag, {
|
|
64
|
+
getRef: ref,
|
|
65
|
+
id: id,
|
|
66
|
+
text: label,
|
|
67
|
+
imageURL: imageSrc,
|
|
68
|
+
initial: imageAltText || label,
|
|
69
|
+
hasAvatar: !!imageSrc || !!imageAltText,
|
|
70
|
+
iconName: iconName,
|
|
71
|
+
size: size,
|
|
72
|
+
tooltip: tooltip,
|
|
73
|
+
disabled: isDisabled,
|
|
74
|
+
customClass: {
|
|
75
|
+
customTag: cursor && !isDisabled ? style[`cursor_${cursor}`] : ''
|
|
76
|
+
},
|
|
77
|
+
onSelectTag: id => {
|
|
78
|
+
dispatch({
|
|
79
|
+
type: TagConstants.TAG_CLICKED,
|
|
80
|
+
payload: {
|
|
81
|
+
id
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
},
|
|
85
|
+
onRemove: isRemovable ? id => {
|
|
86
|
+
dispatch({
|
|
87
|
+
type: TagConstants.TAG_REMOVED,
|
|
88
|
+
payload: {
|
|
89
|
+
id
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
} : undefined
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export default TagView;
|
package/es/library/dot/legacy-to-new-arch/tags-list-dropdown/frameworks/ui/TagContractAdapter.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export default function TagContractAdapter(tag) {
|
|
2
|
+
const {
|
|
3
|
+
id,
|
|
4
|
+
label,
|
|
5
|
+
imageSrc,
|
|
6
|
+
imageAltText,
|
|
7
|
+
iconName,
|
|
8
|
+
iconSize,
|
|
9
|
+
disabled,
|
|
10
|
+
tooltip
|
|
11
|
+
} = tag;
|
|
12
|
+
return {
|
|
13
|
+
id,
|
|
14
|
+
text: label,
|
|
15
|
+
name: imageAltText,
|
|
16
|
+
imageUrl: imageSrc,
|
|
17
|
+
iconName,
|
|
18
|
+
iconSize,
|
|
19
|
+
customProps: {
|
|
20
|
+
disabled,
|
|
21
|
+
tooltip
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
}
|
package/es/library/dot/legacy-to-new-arch/tags-list-dropdown/frameworks/ui/TagsListDropdown.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createCustomComponent } from "../../../../../custom-component";
|
|
2
|
+
import TagsListDropdownProperties from "../../../../../../cc/tags-list-dropdown/Properties";
|
|
3
|
+
import TagsListDropdownEvents from "../../../../../../cc/tags-list-dropdown/Events";
|
|
4
|
+
import TagsListDropdownView from "./TagsListDropdownView";
|
|
5
|
+
let TagsListDropdown = createCustomComponent({
|
|
6
|
+
name: "TagsListDropdown",
|
|
7
|
+
View: TagsListDropdownView,
|
|
8
|
+
properties: TagsListDropdownProperties,
|
|
9
|
+
events: TagsListDropdownEvents,
|
|
10
|
+
eventHandlers: {}
|
|
11
|
+
});
|
|
12
|
+
export default TagsListDropdown;
|
package/es/library/dot/legacy-to-new-arch/tags-list-dropdown/frameworks/ui/TagsListDropdownView.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import TagsListDropdown from '@zohodesk-private/desk-components/es/TagsListDropdown/TagsListDropdown';
|
|
3
|
+
import Constants from "../../../../../../cc/tags-list-dropdown/Constants";
|
|
4
|
+
import TagContractAdapter from "./TagContractAdapter";
|
|
5
|
+
|
|
6
|
+
function TagsListDropdownView(_ref, ref) {
|
|
7
|
+
let {
|
|
8
|
+
state,
|
|
9
|
+
helpers
|
|
10
|
+
} = _ref;
|
|
11
|
+
let {
|
|
12
|
+
dispatch
|
|
13
|
+
} = helpers;
|
|
14
|
+
let {
|
|
15
|
+
tags,
|
|
16
|
+
hasSearch,
|
|
17
|
+
searchPlaceholder,
|
|
18
|
+
text,
|
|
19
|
+
dropdownHeading,
|
|
20
|
+
emptyMessage
|
|
21
|
+
} = state.properties;
|
|
22
|
+
let tagsList = tags.map(TagContractAdapter);
|
|
23
|
+
return /*#__PURE__*/React.createElement(TagsListDropdown, {
|
|
24
|
+
getRef: ref,
|
|
25
|
+
listData: tagsList,
|
|
26
|
+
hasSearch: hasSearch,
|
|
27
|
+
searchPlaceholder: searchPlaceholder,
|
|
28
|
+
text: text,
|
|
29
|
+
dropdownHeading: dropdownHeading,
|
|
30
|
+
emptyMessage: emptyMessage,
|
|
31
|
+
onSearch: value => {
|
|
32
|
+
dispatch({
|
|
33
|
+
type: Constants.TAG_LIST_DROPDOWN_SEARCHED,
|
|
34
|
+
payload: {
|
|
35
|
+
value
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export default TagsListDropdownView;
|
package/es/library/dot/legacy-to-new-arch/text-area/frameworks/ui/css/TextAreaView.module.css
CHANGED
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
|
|
5
5
|
.rightPlaceholder {
|
|
6
6
|
position: absolute;
|
|
7
|
-
bottom:
|
|
7
|
+
bottom: var(--zd_size4) ;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
[dir=ltr] .rightPlaceholder {
|
|
11
|
-
right:
|
|
11
|
+
right: var(--zd_size12) ;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
[dir=rtl] .rightPlaceholder {
|
|
15
|
-
left:
|
|
15
|
+
left: var(--zd_size12) ;
|
|
16
16
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
.wrapper {
|
|
2
|
-
max-width: 100%
|
|
2
|
+
max-width: 100%
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
.gap_small {
|
|
6
|
-
gap:
|
|
6
|
+
gap: var(--zd_size4)
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
.gap_xmedium {
|
|
10
|
-
gap:
|
|
10
|
+
gap: var(--zd_size6)
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
.gap_medium {
|
|
14
|
-
gap:
|
|
14
|
+
gap: var(--zd_size8)
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
.gap_large {
|
|
18
|
-
gap:
|
|
18
|
+
gap: var(--zd_size10)
|
|
19
19
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
let getComponentMapping = {
|
|
2
|
+
name: 'getComponentMapping',
|
|
3
|
+
api: '/{{servicePrefix}}/{{orgName}}',
|
|
4
|
+
parameters: `{}`,
|
|
5
|
+
type: 'GET',
|
|
6
|
+
getResponse: async _ref => {
|
|
7
|
+
let {
|
|
8
|
+
params,
|
|
9
|
+
payload,
|
|
10
|
+
headers
|
|
11
|
+
} = _ref;
|
|
12
|
+
return {};
|
|
13
|
+
},
|
|
14
|
+
transformer: res => res,
|
|
15
|
+
properties: {}
|
|
16
|
+
};
|
|
17
|
+
export default getComponentMapping;
|
|
@@ -21,6 +21,7 @@ import fetchLookupFields from "./http-template/fetchLookupFields";
|
|
|
21
21
|
import getClientScripts from "./http-template/getClientScripts";
|
|
22
22
|
import markAsRead from "./http-template/markAsRead";
|
|
23
23
|
import markAsUnRead from "./http-template/markAsUnRead";
|
|
24
|
+
import getComponentMapping from "./http-template/getComponentMapping";
|
|
24
25
|
let dataSource = {
|
|
25
26
|
httpTemplates: {
|
|
26
27
|
[RecordApiActionName.GET_RECORDS]: getRecords,
|
|
@@ -42,7 +43,8 @@ let dataSource = {
|
|
|
42
43
|
[ZFormApiActionName.getLayoutRules]: getLayoutRules,
|
|
43
44
|
[ZFormApiActionName.getDependencyMappings]: getDependencyMappings,
|
|
44
45
|
[ZFormApiActionName.getValidationRules]: getValidationRules,
|
|
45
|
-
[ZFormApiActionName.fetchLookupFields]: fetchLookupFields
|
|
46
|
+
[ZFormApiActionName.fetchLookupFields]: fetchLookupFields,
|
|
47
|
+
getComponentMapping
|
|
46
48
|
}
|
|
47
49
|
};
|
|
48
50
|
export default dataSource; // let ticketsRecordSerice = createRecord(tickets, () => {});
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { DATA_SOURCE_EXECUTE } from "../../../../bc/zdata-source/Constants";
|
|
1
2
|
import AbstractUseCase from "./AbstractUseCase";
|
|
3
|
+
import { DATA_SOURCE_FAILURE, DATA_SOURCE_NO_CONTENT, DATA_SOURCE_SUCCESS } from "../../../../bc/zdata-source/Symbols";
|
|
2
4
|
|
|
3
5
|
class FetchSuccessUseCase extends AbstractUseCase {
|
|
4
6
|
execute(input) {
|
|
@@ -16,6 +18,11 @@ class FetchSuccessUseCase extends AbstractUseCase {
|
|
|
16
18
|
} = metaData;
|
|
17
19
|
const fieldManager = repository.getFieldManager();
|
|
18
20
|
|
|
21
|
+
if (String(apiName) === 'getComponentMapping') {
|
|
22
|
+
fieldManager.setFields(fields, apiName);
|
|
23
|
+
presenter.updateFields(fieldManager.toObject());
|
|
24
|
+
}
|
|
25
|
+
|
|
19
26
|
if (!fieldManager.isFieldFetching(metaData)) {
|
|
20
27
|
return;
|
|
21
28
|
}
|
|
@@ -23,6 +30,32 @@ class FetchSuccessUseCase extends AbstractUseCase {
|
|
|
23
30
|
fieldManager.setFields(fields, apiName);
|
|
24
31
|
fieldManager.stopFetching(apiName);
|
|
25
32
|
presenter.updateFields(fieldManager.toObject());
|
|
33
|
+
dispatch({
|
|
34
|
+
type: DATA_SOURCE_EXECUTE,
|
|
35
|
+
payload: {
|
|
36
|
+
props: {},
|
|
37
|
+
actionName: 'getComponentMapping'
|
|
38
|
+
},
|
|
39
|
+
metaData: {
|
|
40
|
+
actionName: 'getComponentMapping',
|
|
41
|
+
[DATA_SOURCE_SUCCESS]: {
|
|
42
|
+
metaData: {
|
|
43
|
+
apiName: 'getComponentMapping'
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
[DATA_SOURCE_NO_CONTENT]: {
|
|
47
|
+
metaData: {
|
|
48
|
+
apiName: 'getComponentMapping'
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
[DATA_SOURCE_FAILURE]: {
|
|
52
|
+
metaData: {
|
|
53
|
+
apiName: 'getComponentMapping',
|
|
54
|
+
actionName: 'getComponentMapping'
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
});
|
|
26
59
|
dispatch(fieldManager.createSuccessAction(fields, metaData));
|
|
27
60
|
}
|
|
28
61
|
|
|
@@ -5,10 +5,12 @@ import { DATA_SOURCE_FAILURE, DATA_SOURCE_NO_CONTENT, DATA_SOURCE_SUCCESS } from
|
|
|
5
5
|
|
|
6
6
|
class FieldManager {
|
|
7
7
|
constructor(fields, selectedFields, isFieldsFetching, isSelectedFieldsFetching) {
|
|
8
|
+
let componentMapping = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
|
|
8
9
|
this.fields = fields;
|
|
9
10
|
this.selectedFields = selectedFields;
|
|
10
11
|
this.isFieldsFetching = isFieldsFetching;
|
|
11
12
|
this.isSelectedFieldsFetching = isSelectedFieldsFetching;
|
|
13
|
+
this.componentMapping = componentMapping;
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
createSuccessAction(fields, metaData) {
|
|
@@ -98,11 +100,14 @@ class FieldManager {
|
|
|
98
100
|
this.selectedFields = data;
|
|
99
101
|
} else if (apiName === FieldApiName.UPDATE_SELECTED_FIELDS) {
|
|
100
102
|
this.selectedFields = data;
|
|
103
|
+
} else if (apiName === 'getComponentMapping') {
|
|
104
|
+
this.componentMapping = data;
|
|
101
105
|
}
|
|
102
106
|
}
|
|
103
107
|
|
|
104
108
|
toObject() {
|
|
105
109
|
return {
|
|
110
|
+
componentMapping: this.componentMapping,
|
|
106
111
|
fields: this.fields,
|
|
107
112
|
selectedFields: this.selectedFields,
|
|
108
113
|
isFieldsFetching: this.isFieldsFetching,
|
|
@@ -123,9 +123,22 @@ export default class TableTranslator {
|
|
|
123
123
|
const textOverflowData = {
|
|
124
124
|
isEnabled: textOverflowConfig.isEnabled,
|
|
125
125
|
mode: textOverflow.mode
|
|
126
|
-
};
|
|
126
|
+
}; // ComponentMapping support
|
|
127
|
+
|
|
128
|
+
zfield.componentMapping && zfield.componentMapping.length && zfield.componentMapping.forEach(fieldVariation => {
|
|
129
|
+
const {
|
|
130
|
+
fieldName,
|
|
131
|
+
uiType,
|
|
132
|
+
translator
|
|
133
|
+
} = fieldVariation;
|
|
134
|
+
const field = fields.find(f => f.name === fieldName);
|
|
135
|
+
|
|
136
|
+
if (field) {
|
|
137
|
+
field.uiType = uiType;
|
|
138
|
+
}
|
|
139
|
+
});
|
|
127
140
|
const headersTranslator = new HeadersTranslator(fields, headerActions, context, modifiedWidths, sortBy, records, instanceName, moduleName);
|
|
128
|
-
const rowsTranslator = new RowsTranslator(recordsForDisplay, fields, rowActions, context, preferences, fieldComponentMapping, rowActionsUiType, fieldActions, instanceName, textOverflowData, moduleName, nameFieldsConfig, recordReadStatusConfig); // const actionTranslator = new ClientActionsTranslator(clientActions, records, fields, pageContext);
|
|
141
|
+
const rowsTranslator = new RowsTranslator(recordsForDisplay, fields, rowActions, context, preferences, fieldComponentMapping, rowActionsUiType, fieldActions, instanceName, textOverflowData, moduleName, nameFieldsConfig, recordReadStatusConfig, zfield.componentMapping && [...zfield.componentMapping] || []); // const actionTranslator = new ClientActionsTranslator(clientActions, records, fields, pageContext);
|
|
129
142
|
// const translators = [headersTranslator.getTranslator(), rowsTranslator.getTranslator(), actionTranslator.getTranslator()];
|
|
130
143
|
|
|
131
144
|
const translators = [headersTranslator.getTranslator(), rowsTranslator.getTranslator()];
|