@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
package/es/library/dot/legacy-to-new-arch/table-column-filter/frameworks/ui/TableColumnFilterView.js
CHANGED
|
@@ -22,6 +22,7 @@ function TableColumnFilterView(_ref, ref) {
|
|
|
22
22
|
heading,
|
|
23
23
|
hasSearch,
|
|
24
24
|
searchPlaceholder,
|
|
25
|
+
hasClearButton,
|
|
25
26
|
clearFilterLabel,
|
|
26
27
|
optionTagLabel,
|
|
27
28
|
taggedOption
|
|
@@ -86,7 +87,7 @@ function TableColumnFilterView(_ref, ref) {
|
|
|
86
87
|
options,
|
|
87
88
|
hasSearch,
|
|
88
89
|
searchPlaceholder,
|
|
89
|
-
hasClearButton
|
|
90
|
+
hasClearButton,
|
|
90
91
|
isClearButtonDisabled: !isFiltered,
|
|
91
92
|
clearFilterLabel,
|
|
92
93
|
optionTagLabel,
|
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
import { createCustomComponent } from "../../../../../../custom-component";
|
|
2
|
-
import
|
|
2
|
+
import CheckboxProperties from "../../../../../../../cc/checkbox/Properties";
|
|
3
3
|
import BooleanEvents from "../../../../../../../cc/fields/boolean/Events";
|
|
4
4
|
import CheckboxFieldView from "./CheckboxFieldView";
|
|
5
5
|
import { EventHandlersFactory } from "./EventHandlersFactory";
|
|
6
6
|
const CheckboxField = createCustomComponent({
|
|
7
7
|
name: 'CheckboxField',
|
|
8
8
|
View: CheckboxFieldView,
|
|
9
|
-
properties:
|
|
9
|
+
properties: { ...CheckboxProperties,
|
|
10
|
+
fieldName: {
|
|
11
|
+
required: false,
|
|
12
|
+
defaultValue: '',
|
|
13
|
+
typeMetadata: {
|
|
14
|
+
schema: {
|
|
15
|
+
type: 'string'
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
10
20
|
events: BooleanEvents,
|
|
11
21
|
eventHandlers: EventHandlersFactory.create()
|
|
12
22
|
});
|
|
@@ -5,14 +5,17 @@ export default function CheckboxFieldView(_ref, ref) {
|
|
|
5
5
|
state
|
|
6
6
|
} = _ref;
|
|
7
7
|
const {
|
|
8
|
-
|
|
8
|
+
checked,
|
|
9
|
+
disabled,
|
|
10
|
+
readonly,
|
|
11
|
+
tooltip
|
|
9
12
|
} = state.properties;
|
|
10
13
|
return /*#__PURE__*/React.createElement(Checkbox, {
|
|
11
14
|
getRef: ref,
|
|
12
|
-
checked:
|
|
13
|
-
disabled:
|
|
14
|
-
readonly:
|
|
15
|
+
checked: checked,
|
|
16
|
+
disabled: disabled,
|
|
17
|
+
readonly: readonly,
|
|
15
18
|
label: "",
|
|
16
|
-
tooltip:
|
|
19
|
+
tooltip: tooltip
|
|
17
20
|
});
|
|
18
21
|
}
|
|
@@ -8,10 +8,10 @@ export class EventHandlersFactory {
|
|
|
8
8
|
dispatch
|
|
9
9
|
} = input;
|
|
10
10
|
const {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
fieldName,
|
|
12
|
+
checked
|
|
13
13
|
} = state.properties;
|
|
14
|
-
const toggledValue = !
|
|
14
|
+
const toggledValue = !checked;
|
|
15
15
|
dispatch({
|
|
16
16
|
type: FieldConstants.FIELD_CHANGED,
|
|
17
17
|
payload: {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { createCustomComponent } from "../../../../../../custom-component";
|
|
2
|
-
import EmailProperties from "../../../../../../../cc/
|
|
3
|
-
import
|
|
2
|
+
import EmailProperties from "../../../../../../../cc/email/Properties";
|
|
3
|
+
import FieldEvents from "../../../../../../../cc/fields/field/Events";
|
|
4
4
|
import { EmailFieldView } from "./EmailFieldView";
|
|
5
5
|
const EmailField = createCustomComponent({
|
|
6
6
|
name: 'EmailField',
|
|
7
7
|
View: EmailFieldView,
|
|
8
8
|
properties: EmailProperties,
|
|
9
|
-
events:
|
|
9
|
+
events: FieldEvents,
|
|
10
10
|
eventHandlers: {}
|
|
11
11
|
});
|
|
12
12
|
export default EmailField;
|
|
@@ -5,14 +5,16 @@ export function EmailFieldView(_ref, ref) {
|
|
|
5
5
|
state
|
|
6
6
|
} = _ref;
|
|
7
7
|
const {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
email,
|
|
9
|
+
isDotted,
|
|
10
|
+
weight,
|
|
11
|
+
tooltip
|
|
11
12
|
} = state.properties;
|
|
12
13
|
return /*#__PURE__*/React.createElement(Email, {
|
|
13
14
|
getRef: ref,
|
|
14
|
-
email:
|
|
15
|
-
isDotted:
|
|
16
|
-
weight:
|
|
15
|
+
email: email,
|
|
16
|
+
isDotted: isDotted,
|
|
17
|
+
weight: weight,
|
|
18
|
+
tooltip: tooltip
|
|
17
19
|
});
|
|
18
20
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import HighlightedValueConstants from "../../../../../../../cc/highlighted-value/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
|
+
[HighlightedValueConstants.HIGHLIGHTED_VALUE_CLICKED]: clickHandler
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createCustomComponent } from "../../../../../../custom-component";
|
|
2
|
+
import HighlightedValueProperties from "../../../../../../../cc/highlighted-value/Properties";
|
|
3
|
+
import FieldEvents from "../../../../../../../cc/fields/field/Events";
|
|
4
|
+
import HighlightedValueFieldView from "./HighlightedValueFieldView";
|
|
5
|
+
import { EventHandlersFactory } from "./EventHandlersFactory";
|
|
6
|
+
const HighlightedValueField = createCustomComponent({
|
|
7
|
+
name: 'HighlightedValueField',
|
|
8
|
+
View: HighlightedValueFieldView,
|
|
9
|
+
properties: { ...HighlightedValueProperties,
|
|
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 HighlightedValueField;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import HighlightedValue from "../../../../highlighted-value/frameworks/ui/HighlightedValue";
|
|
3
|
+
export default function HighlightedValueFieldView(_ref, ref) {
|
|
4
|
+
let {
|
|
5
|
+
state
|
|
6
|
+
} = _ref;
|
|
7
|
+
const {
|
|
8
|
+
text,
|
|
9
|
+
color,
|
|
10
|
+
tooltip,
|
|
11
|
+
weight,
|
|
12
|
+
isDotted,
|
|
13
|
+
cursor
|
|
14
|
+
} = state.properties;
|
|
15
|
+
return /*#__PURE__*/React.createElement(HighlightedValue, {
|
|
16
|
+
getRef: ref,
|
|
17
|
+
text: text,
|
|
18
|
+
color: color,
|
|
19
|
+
tooltip: tooltip,
|
|
20
|
+
cursor: cursor,
|
|
21
|
+
weight: weight,
|
|
22
|
+
isDotted: isDotted
|
|
23
|
+
});
|
|
24
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import FieldTypes from "../../../../cc/fields/field/Types";
|
|
2
2
|
import PrimaryField from "./primary-field/frameworks/ui/PrimaryField";
|
|
3
3
|
import CheckboxField from "./checkbox-field/frameworks/ui/CheckboxField";
|
|
4
|
-
import SwitchField from "./switch-field/frameworks/ui/SwitchField";
|
|
5
4
|
import SingleLineField from "./singleline-field/frameworks/ui/SingleLineField";
|
|
6
5
|
import EmailField from "./email-field/frameworks/ui/EmailField";
|
|
7
6
|
import UrlField from "./url-field/frameworks/ui/UrlField";
|
|
@@ -17,11 +16,18 @@ import DateTimeField from "./datetime-field/frameworks/ui/DateTimeField";
|
|
|
17
16
|
import NumberField from "./number-field/frameworks/ui/NumberField";
|
|
18
17
|
import DecimalField from "./decimal-field/frameworks/ui/DecimalField";
|
|
19
18
|
import MultiSelectField from "./multiselect-field/frameworks/ui/MultiSelectField";
|
|
19
|
+
import TextField from "./text-field/frameworks/ui/TextField";
|
|
20
|
+
import SwitchField from "./switch-field/frameworks/ui/SwitchField";
|
|
21
|
+
import LinkField from "./link-field/frameworks/ui/LinkField";
|
|
22
|
+
import TagField from "./tag-field/frameworks/ui/TagField";
|
|
23
|
+
import TagsField from "./tags-field/frameworks/ui/TagsField";
|
|
24
|
+
import TagsListDropdownField from "./tags-list-dropdown-field/frameworks/ui/TagsListDropdownField";
|
|
25
|
+
import RadioDropdownField from "./radio-dropdown-field/frameworks/ui/RadioDropdownField";
|
|
26
|
+
import LabeledAvatarField from "./labeled-avatar-field/frameworks/ui/LabeledAvatarField";
|
|
27
|
+
import HighlightedValueField from "./highlighted-value-field/frameworks/ui/HighlightedValueField";
|
|
20
28
|
const FieldComponents = {
|
|
29
|
+
// Default Field Variants
|
|
21
30
|
[FieldTypes.PrimaryField]: PrimaryField,
|
|
22
|
-
[FieldTypes.CheckboxField]: CheckboxField,
|
|
23
|
-
[FieldTypes.SwitchField]: SwitchField,
|
|
24
|
-
// TODO: Need to register SwitchField
|
|
25
31
|
[FieldTypes.SingleLineField]: SingleLineField,
|
|
26
32
|
[FieldTypes.EmailField]: EmailField,
|
|
27
33
|
[FieldTypes.URLField]: UrlField,
|
|
@@ -36,6 +42,17 @@ const FieldComponents = {
|
|
|
36
42
|
[FieldTypes.DateTimeField]: DateTimeField,
|
|
37
43
|
[FieldTypes.NumberField]: NumberField,
|
|
38
44
|
[FieldTypes.DecimalField]: DecimalField,
|
|
39
|
-
[FieldTypes.MultiSelectField]: MultiSelectField
|
|
45
|
+
[FieldTypes.MultiSelectField]: MultiSelectField,
|
|
46
|
+
// Custom Field Variants
|
|
47
|
+
[FieldTypes.TextField]: TextField,
|
|
48
|
+
[FieldTypes.CheckboxField]: CheckboxField,
|
|
49
|
+
[FieldTypes.SwitchField]: SwitchField,
|
|
50
|
+
[FieldTypes.LinkField]: LinkField,
|
|
51
|
+
[FieldTypes.TagField]: TagField,
|
|
52
|
+
[FieldTypes.TagsField]: TagsField,
|
|
53
|
+
[FieldTypes.TagsListDropdownField]: TagsListDropdownField,
|
|
54
|
+
[FieldTypes.RadioDropdownField]: RadioDropdownField,
|
|
55
|
+
[FieldTypes.LabeledAvatarField]: LabeledAvatarField,
|
|
56
|
+
[FieldTypes.HighlightedValueField]: HighlightedValueField
|
|
40
57
|
};
|
|
41
58
|
export default FieldComponents;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import AvatarConstants from "../../../../../../../cc/avatar/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
|
+
[AvatarConstants.AVATAR_CLICKED]: clickHandler
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createCustomComponent } from "../../../../../../custom-component";
|
|
2
|
+
import AvatarProperties from "../../../../../../../cc/avatar/Properties";
|
|
3
|
+
import FieldEvents from "../../../../../../../cc/fields/field/Events";
|
|
4
|
+
import LabeledAvatarFieldView from "./LabeledAvatarFieldView";
|
|
5
|
+
import { EventHandlersFactory } from "./EventHandlersFactory";
|
|
6
|
+
const LabeledAvatarField = createCustomComponent({
|
|
7
|
+
name: 'LabeledAvatarField',
|
|
8
|
+
View: LabeledAvatarFieldView,
|
|
9
|
+
properties: { ...AvatarProperties,
|
|
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 LabeledAvatarField;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Avatar } from "../../../..";
|
|
3
|
+
export default function LabeledAvatarFieldView(_ref, ref) {
|
|
4
|
+
let {
|
|
5
|
+
state
|
|
6
|
+
} = _ref;
|
|
7
|
+
const {
|
|
8
|
+
name,
|
|
9
|
+
imageSrc,
|
|
10
|
+
size,
|
|
11
|
+
label,
|
|
12
|
+
tooltip
|
|
13
|
+
} = state.properties;
|
|
14
|
+
return /*#__PURE__*/React.createElement(Avatar, {
|
|
15
|
+
getRef: ref,
|
|
16
|
+
name: name,
|
|
17
|
+
imageSrc: imageSrc,
|
|
18
|
+
size: size,
|
|
19
|
+
label: label,
|
|
20
|
+
tooltip: tooltip
|
|
21
|
+
});
|
|
22
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import LinkConstants from "../../../../../../../cc/link/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
|
+
[LinkConstants.LINK_CLICKED]: clickHandler
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createCustomComponent } from "../../../../../../custom-component";
|
|
2
|
+
import LinkProperties from "../../../../../../../cc/link/Properties";
|
|
3
|
+
import FieldEvents from "../../../../../../../cc/fields/field/Events";
|
|
4
|
+
import LinkFieldView from "./LinkFieldView";
|
|
5
|
+
import { EventHandlersFactory } from "./EventHandlersFactory";
|
|
6
|
+
const LinkField = createCustomComponent({
|
|
7
|
+
name: 'LinkField',
|
|
8
|
+
View: LinkFieldView,
|
|
9
|
+
properties: { ...LinkProperties,
|
|
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 LinkField;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Link from "../../../../link/frameworks/ui/Link";
|
|
3
|
+
export default function LinkFieldView(_ref, ref) {
|
|
4
|
+
let {
|
|
5
|
+
state
|
|
6
|
+
} = _ref;
|
|
7
|
+
let {
|
|
8
|
+
text,
|
|
9
|
+
variant,
|
|
10
|
+
isDotted,
|
|
11
|
+
weight,
|
|
12
|
+
href,
|
|
13
|
+
tooltip,
|
|
14
|
+
opensNewTab
|
|
15
|
+
} = state.properties;
|
|
16
|
+
return /*#__PURE__*/React.createElement(Link, {
|
|
17
|
+
getRef: ref,
|
|
18
|
+
text: text,
|
|
19
|
+
variant: variant,
|
|
20
|
+
href: href,
|
|
21
|
+
isDotted: isDotted,
|
|
22
|
+
weight: weight,
|
|
23
|
+
tooltip: tooltip,
|
|
24
|
+
opensNewTab: opensNewTab
|
|
25
|
+
});
|
|
26
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import RadioDropdownConstants from "../../../../../../../cc/radio-dropdown/Constants";
|
|
2
|
+
import FieldConstants from "../../../../../../../cc/fields/field/Constants";
|
|
3
|
+
export class EventHandlersFactory {
|
|
4
|
+
static create() {
|
|
5
|
+
const changeHandler = input => {
|
|
6
|
+
const {
|
|
7
|
+
state,
|
|
8
|
+
dispatch,
|
|
9
|
+
action
|
|
10
|
+
} = input;
|
|
11
|
+
const {
|
|
12
|
+
fieldName,
|
|
13
|
+
fieldType
|
|
14
|
+
} = state.properties;
|
|
15
|
+
const {
|
|
16
|
+
id
|
|
17
|
+
} = action.payload;
|
|
18
|
+
dispatch({
|
|
19
|
+
type: FieldConstants.FIELD_CHANGED,
|
|
20
|
+
payload: {
|
|
21
|
+
fieldName,
|
|
22
|
+
value: fieldType === 'Boolean' ? id === 'true' : id
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
return {
|
|
28
|
+
[RadioDropdownConstants.RADIO_DROPDOWN_VALUE_CHANGED]: changeHandler
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createCustomComponent } from "../../../../../../custom-component";
|
|
2
|
+
import RadioDropdownProperties from "../../../../../../../cc/radio-dropdown/Properties";
|
|
3
|
+
import FieldEvents from "../../../../../../../cc/fields/field/Events";
|
|
4
|
+
import RadioDropdownFieldView from "./RadioDropdownFieldView";
|
|
5
|
+
import { EventHandlersFactory } from "./EventHandlersFactory";
|
|
6
|
+
const RadioDropdownField = createCustomComponent({
|
|
7
|
+
name: 'RadioDropdownField',
|
|
8
|
+
View: RadioDropdownFieldView,
|
|
9
|
+
properties: { ...RadioDropdownProperties,
|
|
10
|
+
fieldType: {
|
|
11
|
+
required: false,
|
|
12
|
+
defaultValue: 'Picklist',
|
|
13
|
+
typeMetadata: {
|
|
14
|
+
schema: {
|
|
15
|
+
type: 'string'
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
fieldName: {
|
|
20
|
+
required: false,
|
|
21
|
+
defaultValue: '',
|
|
22
|
+
typeMetadata: {
|
|
23
|
+
schema: {
|
|
24
|
+
type: 'string'
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
events: FieldEvents,
|
|
30
|
+
eventHandlers: EventHandlersFactory.create()
|
|
31
|
+
});
|
|
32
|
+
export default RadioDropdownField;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Flex from '@zohodesk/layout/es/Flex/Flex';
|
|
3
|
+
import RadioDropdown from "../../../../radio-dropdown/frameworks/ui/RadioDropdown"; // @ts-ignore
|
|
4
|
+
|
|
5
|
+
import style from "./css/RadioDropdownField.module.css";
|
|
6
|
+
export default function RadioDropdownFieldView(_ref, ref) {
|
|
7
|
+
let {
|
|
8
|
+
state
|
|
9
|
+
} = _ref;
|
|
10
|
+
const {
|
|
11
|
+
options,
|
|
12
|
+
color,
|
|
13
|
+
isDotted,
|
|
14
|
+
weight,
|
|
15
|
+
selectedId,
|
|
16
|
+
selectedValue,
|
|
17
|
+
dropdownHeading,
|
|
18
|
+
hasSearch,
|
|
19
|
+
searchPlaceholder,
|
|
20
|
+
emptyStateTitle,
|
|
21
|
+
isDisabled,
|
|
22
|
+
isReadOnly
|
|
23
|
+
} = state.properties;
|
|
24
|
+
return /*#__PURE__*/React.createElement(Flex, {
|
|
25
|
+
$ui_displayMode: "flex",
|
|
26
|
+
$ui_className: color === 'none' ? style.wrapper : ''
|
|
27
|
+
}, /*#__PURE__*/React.createElement(RadioDropdown, {
|
|
28
|
+
getRef: ref,
|
|
29
|
+
hoverVariant: "border",
|
|
30
|
+
options: options,
|
|
31
|
+
selectedId: selectedId,
|
|
32
|
+
selectedValue: selectedValue,
|
|
33
|
+
color: color,
|
|
34
|
+
isDotted: isDotted,
|
|
35
|
+
weight: weight,
|
|
36
|
+
dropdownHeading: dropdownHeading,
|
|
37
|
+
hasSearch: hasSearch,
|
|
38
|
+
searchPlaceholder: searchPlaceholder,
|
|
39
|
+
emptyStateTitle: emptyStateTitle,
|
|
40
|
+
isDisabled: isDisabled,
|
|
41
|
+
isReadOnly: isReadOnly
|
|
42
|
+
}));
|
|
43
|
+
}
|
|
@@ -8,10 +8,10 @@ export class EventHandlersFactory {
|
|
|
8
8
|
dispatch
|
|
9
9
|
} = input;
|
|
10
10
|
const {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
fieldName,
|
|
12
|
+
checked
|
|
13
13
|
} = state.properties;
|
|
14
|
-
const toggledValue = !
|
|
14
|
+
const toggledValue = !checked;
|
|
15
15
|
dispatch({
|
|
16
16
|
type: FieldConstants.FIELD_CHANGED,
|
|
17
17
|
payload: {
|
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
import { createCustomComponent } from "../../../../../../custom-component";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import SwitchProperties from "../../../../../../../cc/switch/Properties";
|
|
3
|
+
import BooleanFieldEvents from "../../../../../../../cc/fields/boolean/Events";
|
|
4
4
|
import SwitchFieldView from "./SwitchFieldView";
|
|
5
5
|
import { EventHandlersFactory } from "./EventHandlersFactory";
|
|
6
6
|
const SwitchField = createCustomComponent({
|
|
7
7
|
name: 'SwitchField',
|
|
8
8
|
View: SwitchFieldView,
|
|
9
|
-
properties:
|
|
10
|
-
|
|
9
|
+
properties: { ...SwitchProperties,
|
|
10
|
+
fieldName: {
|
|
11
|
+
required: false,
|
|
12
|
+
defaultValue: '',
|
|
13
|
+
typeMetadata: {
|
|
14
|
+
schema: {
|
|
15
|
+
type: 'string'
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
events: BooleanFieldEvents,
|
|
11
21
|
eventHandlers: EventHandlersFactory.create()
|
|
12
22
|
});
|
|
13
23
|
export default SwitchField;
|
|
@@ -5,12 +5,16 @@ export default function SwitchFieldView(_ref, ref) {
|
|
|
5
5
|
state
|
|
6
6
|
} = _ref;
|
|
7
7
|
const {
|
|
8
|
-
|
|
8
|
+
checked,
|
|
9
|
+
disabled,
|
|
10
|
+
size,
|
|
11
|
+
tooltip
|
|
9
12
|
} = state.properties;
|
|
10
13
|
return /*#__PURE__*/React.createElement(Switch, {
|
|
11
14
|
getRef: ref,
|
|
12
|
-
checked:
|
|
13
|
-
disabled:
|
|
14
|
-
|
|
15
|
+
checked: checked,
|
|
16
|
+
disabled: disabled,
|
|
17
|
+
size: size,
|
|
18
|
+
tooltip: tooltip
|
|
15
19
|
});
|
|
16
20
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import TagConstants from "../../../../../../../cc/tag/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
|
+
[TagConstants.TAG_CLICKED]: clickHandler
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
}
|
package/es/library/dot/legacy-to-new-arch/table-field-components/tag-field/frameworks/ui/TagField.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { createCustomComponent } from "../../../../../../custom-component";
|
|
2
|
+
import TagProperties from "../../../../../../../cc/tag/Properties";
|
|
3
|
+
import FieldEvents from "../../../../../../../cc/fields/field/Events";
|
|
4
|
+
import TagFieldView from "./TagFieldView";
|
|
5
|
+
import { EventHandlersFactory } from "./EventHandlersFactory";
|
|
6
|
+
const TagField = createCustomComponent({
|
|
7
|
+
name: 'TagField',
|
|
8
|
+
View: TagFieldView,
|
|
9
|
+
properties: { ...TagProperties,
|
|
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 TagField;
|