@zohodesk/library-platform 1.1.5 → 1.1.6-temp-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/bc/zform/Properties.js +3 -26
- package/es/cc/action-icon/Properties.js +19 -1
- package/es/cc/button/Constants.js +7 -0
- package/es/cc/button/Events.js +5 -0
- package/es/cc/button/Properties.js +77 -0
- package/es/cc/button/index.js +3 -0
- package/es/cc/fields/field/FormDefaultUIType.js +37 -0
- package/es/cc/form-connected/Properties.js +43 -1
- package/es/cc/index.js +3 -0
- package/es/cc/list-item/Constants.js +7 -0
- package/es/cc/list-item/Events.js +14 -0
- package/es/cc/list-item/Properties.js +131 -0
- package/es/cc/list-item/index.js +3 -0
- package/es/cc/more-dropdown/Constants.js +7 -0
- package/es/cc/more-dropdown/Events.js +14 -0
- package/es/cc/more-dropdown/Properties.js +66 -0
- package/es/cc/more-dropdown/index.js +3 -0
- package/es/cc/section/Properties.js +16 -0
- package/es/cc/switch/Properties.js +2 -2
- package/es/index.js +6 -1
- package/es/library/dot/components/action-location/frameworks/ui/ActionComponentMapping.js +6 -0
- package/es/library/dot/components/form/adapters/presenter/TransformState.js +25 -1
- package/es/library/dot/components/form/frameworks/ui/DefaultComponentRegister.js +28 -0
- package/es/library/dot/components/form/frameworks/ui/Form.js +2 -0
- package/es/library/dot/components/form/frameworks/ui/FormView.js +41 -26
- package/es/library/dot/components/form/frameworks/ui/css/Form.module.css +8 -4
- package/es/library/dot/components/form/frameworks/ui/sub-components/Sections.js +7 -9
- package/es/library/dot/components/section/frameworks/ui/RenderField.js +19 -0
- package/es/library/dot/components/section/frameworks/ui/Section.js +13 -4
- package/es/library/dot/components/section/frameworks/ui/SectionView.js +7 -26
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/Header.js +6 -12
- package/es/library/dot/legacy-to-new-arch/action-icon/frameworks/ui/ActionIconView.js +10 -1
- package/es/library/dot/legacy-to-new-arch/action-icon/frameworks/ui/css/ActionIconView.module.css +3 -0
- package/es/library/dot/legacy-to-new-arch/button/frameworks/ui/Button.js +12 -0
- package/es/library/dot/legacy-to-new-arch/button/frameworks/ui/ButtonView.js +41 -0
- package/es/library/dot/legacy-to-new-arch/list-item/frameworks/ui/ListItem.js +12 -0
- package/es/library/dot/legacy-to-new-arch/list-item/frameworks/ui/ListItemView.js +122 -0
- package/es/library/dot/legacy-to-new-arch/more-dropdown/frameworks/ui/MoreDropdown.js +12 -0
- package/es/library/dot/legacy-to-new-arch/more-dropdown/frameworks/ui/MoreDropdownView.js +43 -0
- package/es/library/dot/legacy-to-new-arch/switch/frameworks/ui/SwitchView.js +5 -5
- package/es/library/dot/legacy-to-new-arch/table-field-components/switch-field/frameworks/ui/SwitchFieldView.js +0 -1
- package/es/platform/zform/adapters/presenter/FormTranslator.js +32 -45
- package/es/platform/zform/adapters/presenter/translators/SectionTranslator.js +35 -26
- package/es/platform/zform/adapters/presenter/translators/interfaces/ComponentMapping.js +1 -0
- package/es/platform/zform/adapters/presenter/translators/interfaces/FieldContract.js +1 -0
- package/es/platform/zform/adapters/presenter/translators/interfaces/FormTranslatorState.js +1 -0
- package/es/platform/zform/adapters/presenter/translators/interfaces/SectionContract.js +1 -0
- package/es/platform/zform/domain/ZSection.js +6 -0
- package/package.json +18 -16
- package/es/library/dot/components/section/adapters/presenter/TransFormState.js +0 -26
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import Loader from '@zohodesk/svg/es/v1/Loader/Loader';
|
|
3
|
+
import Flex from '@zohodesk/layout/es/Flex/Flex';
|
|
4
|
+
import FormAction, { LeftSide, RightSide } from '@zohodesk/dot/es/FormAction/FormAction';
|
|
3
5
|
import SectionsWrapper from '@zohodesk-private/desk-components/es/form/SectionsWrapper/SectionsWrapper';
|
|
6
|
+
import FormHeader from '@zohodesk-private/desk-components/es/setup/SetupHeader/SetupHeader';
|
|
7
|
+
import MiddleContainer from '@zohodesk-private/desk-components/es/setup/SetupContent/SetupContent';
|
|
4
8
|
import Sections from "./sub-components/Sections";
|
|
5
|
-
import
|
|
9
|
+
import ActionEventMediator from "../../../../../../platform/client-actions/components/action-event-mediator/frameworks/ui/ActionEventMediator";
|
|
10
|
+
import { ActionViewGap } from "../../../../../../platform/client-actions/components/interfaces/ActionViewModel"; // @ts-ignore
|
|
6
11
|
|
|
7
12
|
import style from "./css/Form.module.css";
|
|
8
13
|
|
|
@@ -11,36 +16,46 @@ function FormView(_ref, ref) {
|
|
|
11
16
|
state,
|
|
12
17
|
helpers
|
|
13
18
|
} = _ref;
|
|
14
|
-
const {
|
|
15
|
-
dispatch
|
|
16
|
-
} = helpers;
|
|
17
19
|
const {
|
|
18
20
|
sections,
|
|
19
|
-
isLoading
|
|
21
|
+
isLoading,
|
|
22
|
+
headerLeftActions,
|
|
23
|
+
headerRightActions,
|
|
24
|
+
footerLeftActions,
|
|
25
|
+
footerRightActions
|
|
20
26
|
} = state.viewModel;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
});
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
30
|
-
className: style.formWrapper,
|
|
27
|
+
return /*#__PURE__*/React.createElement(Flex, {
|
|
28
|
+
$ui_tagName: "form",
|
|
29
|
+
$ui_displayMode: "flex",
|
|
30
|
+
$ui_direction: "column",
|
|
31
|
+
$flag_fullsize: true,
|
|
31
32
|
ref: ref
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
}, /*#__PURE__*/React.createElement(FormHeader, {
|
|
34
|
+
$render_leftElement: headerLeftActions.length > 0 ? /*#__PURE__*/React.createElement(ActionEventMediator, {
|
|
35
|
+
actions: headerLeftActions,
|
|
36
|
+
gap: ActionViewGap.MEDIUM
|
|
37
|
+
}) : null,
|
|
38
|
+
$render_rightElement: headerRightActions.length > 0 ? /*#__PURE__*/React.createElement(ActionEventMediator, {
|
|
39
|
+
actions: headerRightActions,
|
|
40
|
+
gap: ActionViewGap.MEDIUM
|
|
41
|
+
}) : null
|
|
42
|
+
}), /*#__PURE__*/React.createElement(MiddleContainer, {
|
|
43
|
+
$flag_padding: true,
|
|
44
|
+
$flag_greyBg: true,
|
|
45
|
+
$flag_childrenWrapper: true
|
|
46
|
+
}, isLoading ? /*#__PURE__*/React.createElement(Loader, null) : /*#__PURE__*/React.createElement(SectionsWrapper, null, /*#__PURE__*/React.createElement(Sections, {
|
|
39
47
|
sections: sections
|
|
40
|
-
}), /*#__PURE__*/React.createElement(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
48
|
+
}))), /*#__PURE__*/React.createElement(FormAction, {
|
|
49
|
+
size: "small",
|
|
50
|
+
paddingLeftSize: "xmedium",
|
|
51
|
+
paddingRightClass: style.footer
|
|
52
|
+
}, /*#__PURE__*/React.createElement(LeftSide, null, /*#__PURE__*/React.createElement(ActionEventMediator, {
|
|
53
|
+
actions: footerLeftActions,
|
|
54
|
+
gap: ActionViewGap.LARGE
|
|
55
|
+
})), /*#__PURE__*/React.createElement(RightSide, null, /*#__PURE__*/React.createElement(ActionEventMediator, {
|
|
56
|
+
actions: footerRightActions,
|
|
57
|
+
gap: ActionViewGap.LARGE
|
|
58
|
+
}))));
|
|
44
59
|
}
|
|
45
60
|
|
|
46
61
|
export default FormView;
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
.formWrapper {
|
|
2
|
-
height: 100% ;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
1
|
.fieldWrapper {
|
|
6
2
|
position: relative
|
|
7
3
|
}
|
|
@@ -30,4 +26,12 @@
|
|
|
30
26
|
}
|
|
31
27
|
.cursor_default {
|
|
32
28
|
cursor: default
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
[dir=ltr] .footer {
|
|
32
|
+
padding-right: var(--zd_size32)
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
[dir=rtl] .footer {
|
|
36
|
+
padding-left: var(--zd_size32)
|
|
33
37
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import DefaultSection from "../../../../section/frameworks/ui/Section";
|
|
3
2
|
import ComponentRegistry from "../../../../../../custom-component/frameworks/ui/ComponentRegistry";
|
|
4
3
|
export default function Sections(_ref) {
|
|
5
4
|
let {
|
|
@@ -10,23 +9,22 @@ export default function Sections(_ref) {
|
|
|
10
9
|
id,
|
|
11
10
|
title,
|
|
12
11
|
description,
|
|
12
|
+
isCollapsed,
|
|
13
13
|
isVisible,
|
|
14
14
|
fields,
|
|
15
|
-
type
|
|
15
|
+
type,
|
|
16
|
+
...extraProps
|
|
16
17
|
} = section;
|
|
18
|
+
const Section = ComponentRegistry.get(type);
|
|
17
19
|
if (isVisible === false) return null;
|
|
18
|
-
let Section = DefaultSection;
|
|
19
|
-
|
|
20
|
-
if (type) {
|
|
21
|
-
Section = ComponentRegistry.get(type);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
20
|
return /*#__PURE__*/React.createElement(Section, {
|
|
25
21
|
key: id,
|
|
26
22
|
id: id,
|
|
27
23
|
title: title,
|
|
28
24
|
description: description,
|
|
29
|
-
fields: fields
|
|
25
|
+
fields: fields,
|
|
26
|
+
isCollapsed: isCollapsed,
|
|
27
|
+
...extraProps
|
|
30
28
|
});
|
|
31
29
|
});
|
|
32
30
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ComponentRegistry from "../../../../../custom-component/frameworks/ui/ComponentRegistry";
|
|
3
|
+
export function renderField(field, key) {
|
|
4
|
+
const {
|
|
5
|
+
type,
|
|
6
|
+
...properties
|
|
7
|
+
} = field;
|
|
8
|
+
const Component = ComponentRegistry.get(type);
|
|
9
|
+
|
|
10
|
+
if (!Component) {
|
|
11
|
+
console.warn(`Component for type "${type}" not found.`);
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
return /*#__PURE__*/React.createElement(Component, {
|
|
16
|
+
key: key,
|
|
17
|
+
...properties
|
|
18
|
+
});
|
|
19
|
+
}
|
|
@@ -2,14 +2,23 @@
|
|
|
2
2
|
import { createCustomComponent } from "../../../../../custom-component";
|
|
3
3
|
import { SectionProperties } from "../../../../../../cc/section";
|
|
4
4
|
import SectionView from "./SectionView";
|
|
5
|
-
import TransFormState from "../../adapters/presenter/TransFormState";
|
|
6
5
|
import EventHandlersFactory from "./EventHandlerFactory";
|
|
6
|
+
export class FieldSectionEventMappingBehaviourFactory {
|
|
7
|
+
static create() {
|
|
8
|
+
return {
|
|
9
|
+
name: 'fieldSectionEventMapping',
|
|
10
|
+
setInitialState: () => ({}),
|
|
11
|
+
properties: {},
|
|
12
|
+
eventHandlers: EventHandlersFactory.create()
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
}
|
|
7
17
|
let WrapSection = createCustomComponent({
|
|
8
18
|
name: 'Section',
|
|
9
19
|
View: SectionView,
|
|
10
20
|
properties: SectionProperties,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
behaviours: []
|
|
21
|
+
eventHandlers: {},
|
|
22
|
+
behaviours: [FieldSectionEventMappingBehaviourFactory.create()]
|
|
14
23
|
});
|
|
15
24
|
export default WrapSection;
|
|
@@ -1,29 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import ConvertSlotToComponent from "../../../../../slot/frameworks/ui/ConvertSlotToComponent";
|
|
3
2
|
import Section from '@zohodesk-private/desk-components/es/setup/SetupFormBox/SetupFormBox';
|
|
4
3
|
import FieldsLayout from '@zohodesk-private/desk-components/es/form/FieldsLayout/FieldsLayout';
|
|
5
|
-
import
|
|
6
|
-
import { TextArea, TextBox, Email, PickList, Currency, MultiSelect, Url, Percentage, Phone, Number, Decimal, Date, DateTime, Checkbox } from "../../../form-fields";
|
|
7
|
-
import EPHITag from "../../../form-fields/ephi-tag/frameworks/ui/EPHITag";
|
|
8
|
-
import InfoIcon from "../../../form-fields/info-icon/frameworks/ui/InfoIcon"; // NOTE: This is a workaround to avoid dynamic imports
|
|
9
|
-
// NOTE: register these components in place
|
|
10
|
-
|
|
11
|
-
ComponentRegistry.register('TextBox', TextBox);
|
|
12
|
-
ComponentRegistry.register('TextArea', TextArea);
|
|
13
|
-
ComponentRegistry.register('PickList', PickList);
|
|
14
|
-
ComponentRegistry.register('Email', Email);
|
|
15
|
-
ComponentRegistry.register('Currency', Currency);
|
|
16
|
-
ComponentRegistry.register('MultiSelect', MultiSelect);
|
|
17
|
-
ComponentRegistry.register('Url', Url);
|
|
18
|
-
ComponentRegistry.register('Percentage', Percentage);
|
|
19
|
-
ComponentRegistry.register('Phone', Phone);
|
|
20
|
-
ComponentRegistry.register('Number', Number);
|
|
21
|
-
ComponentRegistry.register('Decimal', Decimal);
|
|
22
|
-
ComponentRegistry.register('Date', Date);
|
|
23
|
-
ComponentRegistry.register('DateTime', DateTime);
|
|
24
|
-
ComponentRegistry.register('Checkbox', Checkbox);
|
|
25
|
-
ComponentRegistry.register('EPHITag', EPHITag);
|
|
26
|
-
ComponentRegistry.register('InfoIcon', InfoIcon);
|
|
4
|
+
import { renderField } from "./RenderField";
|
|
27
5
|
|
|
28
6
|
function SectionView(_ref, ref) {
|
|
29
7
|
let {
|
|
@@ -31,8 +9,10 @@ function SectionView(_ref, ref) {
|
|
|
31
9
|
} = _ref;
|
|
32
10
|
const {
|
|
33
11
|
id,
|
|
12
|
+
name,
|
|
34
13
|
title,
|
|
35
14
|
description,
|
|
15
|
+
isCollapsed,
|
|
36
16
|
fields
|
|
37
17
|
} = state.properties;
|
|
38
18
|
return /*#__PURE__*/React.createElement(Section, {
|
|
@@ -41,11 +21,12 @@ function SectionView(_ref, ref) {
|
|
|
41
21
|
testId: id,
|
|
42
22
|
customId: id,
|
|
43
23
|
$tagAttributes_container: {
|
|
44
|
-
ref
|
|
24
|
+
ref,
|
|
25
|
+
'data-section-name': name
|
|
45
26
|
}
|
|
46
|
-
}, /*#__PURE__*/React.createElement(FieldsLayout, {
|
|
27
|
+
}, !isCollapsed && /*#__PURE__*/React.createElement(FieldsLayout, {
|
|
47
28
|
$flag_topSpace: !!title || !!description
|
|
48
|
-
},
|
|
29
|
+
}, fields.filter(field => field.isVisible).map((field, index) => renderField(field, index))));
|
|
49
30
|
}
|
|
50
31
|
|
|
51
32
|
export default SectionView;
|
|
@@ -1,22 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import TableHeader from '@zohodesk-private/desk-components/es/table/TableHeader/TableHeader';
|
|
3
|
-
import TableHeadFirstNode from '@zohodesk-private/desk-components/es/table/TableHeadFirstNode/TableHeadFirstNode';
|
|
4
|
-
|
|
5
|
-
const TableHeaderRow = _ref => {
|
|
6
|
-
let {
|
|
7
|
-
children
|
|
8
|
-
} = _ref;
|
|
9
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, children);
|
|
10
|
-
};
|
|
11
|
-
|
|
3
|
+
import TableHeadFirstNode from '@zohodesk-private/desk-components/es/table/TableHeadFirstNode/TableHeadFirstNode';
|
|
4
|
+
import TableHeaderRow from '@zohodesk-private/desk-components/es/table/TableHeader/TableHeaderRow';
|
|
12
5
|
import MassAction from "./header/MassAction";
|
|
13
6
|
import Headers from "./header/Headers";
|
|
14
7
|
import ActionColumn from "./header/ActionColumn";
|
|
15
8
|
import ResizerExtraSpace from "./header/ResizerExtraSpace";
|
|
16
|
-
import getHeaderClasses from "./../../utils/getHeaderClasses";
|
|
9
|
+
import getHeaderClasses from "./../../utils/getHeaderClasses"; // @ts-ignore
|
|
10
|
+
|
|
17
11
|
import style from "./../css/TableList.module.css";
|
|
18
12
|
|
|
19
|
-
function Header(
|
|
13
|
+
function Header(_ref) {
|
|
20
14
|
let {
|
|
21
15
|
isReorderEnabled,
|
|
22
16
|
isSelectionEnabled,
|
|
@@ -31,7 +25,7 @@ function Header(_ref2) {
|
|
|
31
25
|
rowActionsColumnWidth,
|
|
32
26
|
headers,
|
|
33
27
|
dispatch
|
|
34
|
-
} =
|
|
28
|
+
} = _ref;
|
|
35
29
|
|
|
36
30
|
if (headers.length <= 0) {
|
|
37
31
|
return null;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import ActionIcon from '@zohodesk-private/desk-components/es/ActionIcon/ActionIcon';
|
|
3
|
-
import Constants from "../../../../../../cc/action-icon/Constants";
|
|
3
|
+
import Constants from "../../../../../../cc/action-icon/Constants"; // @ts-ignore
|
|
4
|
+
|
|
5
|
+
import style from "./css/ActionIconView.module.css";
|
|
4
6
|
export default function ActionIconView(_ref, ref) {
|
|
5
7
|
let {
|
|
6
8
|
state,
|
|
@@ -8,6 +10,8 @@ export default function ActionIconView(_ref, ref) {
|
|
|
8
10
|
} = _ref;
|
|
9
11
|
const {
|
|
10
12
|
icon,
|
|
13
|
+
iconSize,
|
|
14
|
+
hasPadding,
|
|
11
15
|
label,
|
|
12
16
|
hoverVariant,
|
|
13
17
|
isDisabled
|
|
@@ -18,9 +22,14 @@ export default function ActionIconView(_ref, ref) {
|
|
|
18
22
|
return /*#__PURE__*/React.createElement(ActionIcon, {
|
|
19
23
|
ref: ref,
|
|
20
24
|
$ui_iconName: icon,
|
|
25
|
+
$ui_size: JSON.stringify(iconSize),
|
|
21
26
|
$ui_hoverVariant: hoverVariant,
|
|
22
27
|
$flag_disabled: isDisabled,
|
|
23
28
|
$i18n_tooltip: label,
|
|
29
|
+
hasPadding: hasPadding,
|
|
30
|
+
customStyle: hoverVariant === 'default' ? {
|
|
31
|
+
icon: style.cursor_default
|
|
32
|
+
} : undefined,
|
|
24
33
|
$event_onClick: !isDisabled ? () => {
|
|
25
34
|
dispatch({
|
|
26
35
|
type: Constants.ACTION_ICON_CLICKED
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createCustomComponent } from "../../../../../custom-component";
|
|
2
|
+
import ButtonProperties from "../../../../../../cc/button/Properties";
|
|
3
|
+
import ButtonEvents from "../../../../../../cc/button/Events";
|
|
4
|
+
import ButtonView from "./ButtonView";
|
|
5
|
+
let Button = createCustomComponent({
|
|
6
|
+
name: "Button",
|
|
7
|
+
View: ButtonView,
|
|
8
|
+
properties: ButtonProperties,
|
|
9
|
+
events: ButtonEvents,
|
|
10
|
+
eventHandlers: {}
|
|
11
|
+
});
|
|
12
|
+
export default Button;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Button from '@zohodesk/components/es/Button/Button';
|
|
3
|
+
import ButtonConstants from "../../../../../../cc/button/Constants";
|
|
4
|
+
|
|
5
|
+
function ButtonView(_ref, ref) {
|
|
6
|
+
let {
|
|
7
|
+
state,
|
|
8
|
+
helpers
|
|
9
|
+
} = _ref;
|
|
10
|
+
const {
|
|
11
|
+
dispatch
|
|
12
|
+
} = helpers;
|
|
13
|
+
const {
|
|
14
|
+
text,
|
|
15
|
+
palette,
|
|
16
|
+
size,
|
|
17
|
+
isRounded,
|
|
18
|
+
isDisabled,
|
|
19
|
+
id,
|
|
20
|
+
status,
|
|
21
|
+
tooltip
|
|
22
|
+
} = state.properties;
|
|
23
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
24
|
+
getRef: ref,
|
|
25
|
+
text: text,
|
|
26
|
+
palette: palette,
|
|
27
|
+
size: size,
|
|
28
|
+
isRounded: isRounded,
|
|
29
|
+
isDisabled: isDisabled,
|
|
30
|
+
id: id,
|
|
31
|
+
status: status,
|
|
32
|
+
tooltip: tooltip,
|
|
33
|
+
onClick: () => {
|
|
34
|
+
dispatch({
|
|
35
|
+
type: ButtonConstants.BUTTON_CLICKED
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export default ButtonView;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createCustomComponent } from "../../../../../custom-component";
|
|
2
|
+
import ListItemProperties from "../../../../../../cc/list-item/Properties";
|
|
3
|
+
import ListItemEvents from "../../../../../../cc/list-item/Events";
|
|
4
|
+
import ListItemView from "./ListItemView";
|
|
5
|
+
let ListItem = createCustomComponent({
|
|
6
|
+
name: "ListItem",
|
|
7
|
+
View: ListItemView,
|
|
8
|
+
properties: ListItemProperties,
|
|
9
|
+
events: ListItemEvents,
|
|
10
|
+
eventHandlers: {}
|
|
11
|
+
});
|
|
12
|
+
export default ListItem;
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import DropDownSeparator from '@zohodesk/components/es/DropDown/DropDownSeparator';
|
|
3
|
+
import ListItem from '@zohodesk/components/es/ListItem/ListItem';
|
|
4
|
+
import ListItemWithAvatar from '@zohodesk/components/es/ListItem/ListItemWithAvatar';
|
|
5
|
+
import ListItemWithIcon from '@zohodesk/components/es/ListItem/ListItemWithIcon';
|
|
6
|
+
import ListItemConstants from "../../../../../../cc/list-item/Constants";
|
|
7
|
+
|
|
8
|
+
function ListItemView(_ref, ref) {
|
|
9
|
+
let {
|
|
10
|
+
state,
|
|
11
|
+
helpers
|
|
12
|
+
} = _ref;
|
|
13
|
+
const {
|
|
14
|
+
dispatch
|
|
15
|
+
} = helpers;
|
|
16
|
+
const {
|
|
17
|
+
id,
|
|
18
|
+
isDisabled,
|
|
19
|
+
isActive,
|
|
20
|
+
text,
|
|
21
|
+
secondaryText,
|
|
22
|
+
size,
|
|
23
|
+
tooltip,
|
|
24
|
+
icon,
|
|
25
|
+
iconSize,
|
|
26
|
+
imgSrc,
|
|
27
|
+
imgName,
|
|
28
|
+
href,
|
|
29
|
+
target,
|
|
30
|
+
divider
|
|
31
|
+
} = state.properties;
|
|
32
|
+
const isLink = !!href;
|
|
33
|
+
let listItemElement = null;
|
|
34
|
+
|
|
35
|
+
if (!!imgSrc || !!imgName) {
|
|
36
|
+
listItemElement = /*#__PURE__*/React.createElement(ListItemWithAvatar, {
|
|
37
|
+
getRef: ref,
|
|
38
|
+
id: id,
|
|
39
|
+
isDisabled: isDisabled,
|
|
40
|
+
autoHover: true,
|
|
41
|
+
active: isActive,
|
|
42
|
+
value: text,
|
|
43
|
+
secondaryValue: secondaryText,
|
|
44
|
+
size: size,
|
|
45
|
+
title: tooltip,
|
|
46
|
+
disableTitle: tooltip,
|
|
47
|
+
lhsJustifyContent: "start",
|
|
48
|
+
imgSrc: imgSrc,
|
|
49
|
+
name: imgName,
|
|
50
|
+
onClick: () => {
|
|
51
|
+
dispatch({
|
|
52
|
+
type: ListItemConstants.LISTITEM_CLICKED,
|
|
53
|
+
payload: {
|
|
54
|
+
id
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
},
|
|
58
|
+
customProps: isLink ? {
|
|
59
|
+
ContainerProps: {
|
|
60
|
+
isLink,
|
|
61
|
+
href,
|
|
62
|
+
target
|
|
63
|
+
}
|
|
64
|
+
} : undefined
|
|
65
|
+
});
|
|
66
|
+
} else if (!!icon) {
|
|
67
|
+
listItemElement = /*#__PURE__*/React.createElement(ListItemWithIcon, {
|
|
68
|
+
getRef: ref,
|
|
69
|
+
id: id,
|
|
70
|
+
isDisabled: isDisabled,
|
|
71
|
+
autoHover: true,
|
|
72
|
+
active: isActive,
|
|
73
|
+
value: text,
|
|
74
|
+
secondaryValue: secondaryText,
|
|
75
|
+
size: size,
|
|
76
|
+
title: tooltip,
|
|
77
|
+
disableTitle: tooltip,
|
|
78
|
+
lhsJustifyContent: "start",
|
|
79
|
+
iconName: icon,
|
|
80
|
+
iconSize: JSON.stringify(iconSize),
|
|
81
|
+
isLink: isLink,
|
|
82
|
+
href: href,
|
|
83
|
+
target: target,
|
|
84
|
+
onClick: () => {
|
|
85
|
+
dispatch({
|
|
86
|
+
type: ListItemConstants.LISTITEM_CLICKED,
|
|
87
|
+
payload: {
|
|
88
|
+
id
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
} else {
|
|
94
|
+
listItemElement = /*#__PURE__*/React.createElement(ListItem, {
|
|
95
|
+
getRef: ref,
|
|
96
|
+
id: id,
|
|
97
|
+
isDisabled: isDisabled,
|
|
98
|
+
autoHover: true,
|
|
99
|
+
active: isActive,
|
|
100
|
+
value: text,
|
|
101
|
+
secondaryValue: secondaryText,
|
|
102
|
+
size: size,
|
|
103
|
+
title: tooltip,
|
|
104
|
+
disableTitle: tooltip,
|
|
105
|
+
isLink: isLink,
|
|
106
|
+
href: href,
|
|
107
|
+
target: target,
|
|
108
|
+
onClick: () => {
|
|
109
|
+
dispatch({
|
|
110
|
+
type: ListItemConstants.LISTITEM_CLICKED,
|
|
111
|
+
payload: {
|
|
112
|
+
id
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, divider === 'before' && /*#__PURE__*/React.createElement(DropDownSeparator, null), listItemElement, divider === 'after' && /*#__PURE__*/React.createElement(DropDownSeparator, null));
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export default ListItemView;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createCustomComponent } from "../../../../../custom-component";
|
|
2
|
+
import MoreDropdownProperties from "../../../../../../cc/more-dropdown/Properties";
|
|
3
|
+
import MoreDropdownEvents from "../../../../../../cc/more-dropdown/Events";
|
|
4
|
+
import MoreDropdownView from "./MoreDropdownView";
|
|
5
|
+
let MoreDropdown = createCustomComponent({
|
|
6
|
+
name: "MoreDropdown",
|
|
7
|
+
View: MoreDropdownView,
|
|
8
|
+
properties: MoreDropdownProperties,
|
|
9
|
+
events: MoreDropdownEvents,
|
|
10
|
+
eventHandlers: {}
|
|
11
|
+
});
|
|
12
|
+
export default MoreDropdown;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import MoreDropdown from '@zohodesk-private/desk-components/es/MoreAction/MoreAction';
|
|
3
|
+
import MoreDropdownConstants from "../../../../../../cc/more-dropdown/Constants";
|
|
4
|
+
|
|
5
|
+
function MoreDropdownView(_ref, ref) {
|
|
6
|
+
let {
|
|
7
|
+
state,
|
|
8
|
+
helpers
|
|
9
|
+
} = _ref;
|
|
10
|
+
const {
|
|
11
|
+
dispatch
|
|
12
|
+
} = helpers;
|
|
13
|
+
const {
|
|
14
|
+
heading,
|
|
15
|
+
options,
|
|
16
|
+
isDisabled,
|
|
17
|
+
tooltip
|
|
18
|
+
} = state.properties;
|
|
19
|
+
return /*#__PURE__*/React.createElement(MoreDropdown, {
|
|
20
|
+
$customProps_container: {
|
|
21
|
+
title: heading,
|
|
22
|
+
customProps: {
|
|
23
|
+
ToggleDropDownProps: {
|
|
24
|
+
ref
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
$data_options: options,
|
|
29
|
+
$flag_isDisabled: isDisabled // $i18n_heading={heading}
|
|
30
|
+
,
|
|
31
|
+
$i18n_moreIconTooltip: tooltip,
|
|
32
|
+
$event_onClick: id => {
|
|
33
|
+
dispatch({
|
|
34
|
+
type: MoreDropdownConstants.MORE_DROPDOWN_OPTION_CLICKED,
|
|
35
|
+
payload: {
|
|
36
|
+
id
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export default MoreDropdownView;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import Switch from '@zohodesk/
|
|
2
|
+
import Switch from '@zohodesk-private/dot-registry/es/Switch/Switch';
|
|
3
3
|
import { useUniqueId } from '@zohodesk/components/es/Provider/IdProvider';
|
|
4
4
|
import { SwitchConstants } from "../../../../../../cc";
|
|
5
5
|
|
|
@@ -21,14 +21,14 @@ function SwitchView(_ref, ref) {
|
|
|
21
21
|
let id = getId();
|
|
22
22
|
return /*#__PURE__*/React.createElement(Switch, {
|
|
23
23
|
customProps: {
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
container: {
|
|
25
|
+
ref
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
id: id,
|
|
29
29
|
size: size,
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
isChecked: checked,
|
|
31
|
+
isDisabled: disabled,
|
|
32
32
|
title: tooltip,
|
|
33
33
|
onChange: () => {
|
|
34
34
|
dispatch({
|