@zohodesk/library-platform 1.1.5 → 1.1.6

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.
@@ -21,7 +21,25 @@ export default {
21
21
  typeMetadata: {
22
22
  schema: {
23
23
  type: 'string',
24
- enum: ['primary', 'danger']
24
+ enum: ['primary', 'danger', 'default']
25
+ }
26
+ }
27
+ },
28
+ iconSize: {
29
+ required: false,
30
+ defaultValue: 16,
31
+ typeMetadata: {
32
+ schema: {
33
+ type: 'number'
34
+ }
35
+ }
36
+ },
37
+ hasPadding: {
38
+ required: false,
39
+ defaultValue: true,
40
+ typeMetadata: {
41
+ schema: {
42
+ type: 'boolean'
25
43
  }
26
44
  }
27
45
  },
@@ -0,0 +1,7 @@
1
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+
3
+ class ButtonConstants {}
4
+
5
+ _defineProperty(ButtonConstants, "BUTTON_CLICKED", 'BUTTON#CLICKED');
6
+
7
+ export default ButtonConstants;
@@ -0,0 +1,5 @@
1
+ import Constants from "./Constants";
2
+ export default [{
3
+ type: Constants.BUTTON_CLICKED,
4
+ payload: {}
5
+ }];
@@ -0,0 +1,77 @@
1
+ export default {
2
+ text: {
3
+ defaultValue: '',
4
+ required: false,
5
+ typeMetadata: {
6
+ schema: {
7
+ type: 'string'
8
+ }
9
+ }
10
+ },
11
+ palette: {
12
+ defaultValue: 'primaryFilled',
13
+ required: false,
14
+ typeMetadata: {
15
+ schema: {
16
+ type: 'string',
17
+ enum: ['primary', 'secondary', 'danger', 'success', 'plainPrimary', 'plainSecondary', 'plainDanger', 'plainSuccess', 'primaryFilled', 'secondaryFilled', 'dangerFilled', 'successFilled', 'info', 'tertiaryFilled']
18
+ }
19
+ }
20
+ },
21
+ size: {
22
+ defaultValue: 'medium',
23
+ required: false,
24
+ typeMetadata: {
25
+ schema: {
26
+ type: 'string',
27
+ enum: ['small', 'medium', 'large', 'xlarge']
28
+ }
29
+ }
30
+ },
31
+ isRounded: {
32
+ defaultValue: false,
33
+ required: false,
34
+ typeMetadata: {
35
+ schema: {
36
+ type: 'boolean'
37
+ }
38
+ }
39
+ },
40
+ isDisabled: {
41
+ defaultValue: false,
42
+ required: false,
43
+ typeMetadata: {
44
+ schema: {
45
+ type: 'boolean'
46
+ }
47
+ }
48
+ },
49
+ id: {
50
+ defaultValue: '',
51
+ required: false,
52
+ typeMetadata: {
53
+ schema: {
54
+ type: 'string'
55
+ }
56
+ }
57
+ },
58
+ status: {
59
+ defaultValue: 'none',
60
+ required: false,
61
+ typeMetadata: {
62
+ schema: {
63
+ type: 'string',
64
+ enum: ['loading', 'success', 'none']
65
+ }
66
+ }
67
+ },
68
+ tooltip: {
69
+ defaultValue: '',
70
+ required: false,
71
+ typeMetadata: {
72
+ schema: {
73
+ type: 'string'
74
+ }
75
+ }
76
+ }
77
+ };
@@ -0,0 +1,3 @@
1
+ export { default as ButtonProperties } from "./Properties";
2
+ export { default as ButtonEvents } from "./Events";
3
+ export { default as ButtonConstants } from "./Constants";
package/es/cc/index.js CHANGED
@@ -1,9 +1,11 @@
1
1
  export * from "./avatar";
2
+ export * from "./button";
2
3
  export * from "./checkbox";
3
4
  export * from "./email";
4
5
  export * from "./highlighted-value";
5
6
  export * from "./info-icon";
6
7
  export * from "./link";
8
+ export * from "./list-item";
7
9
  export * from "./switch";
8
10
  export * from "./table-list";
9
11
  export * from "./tags";
@@ -0,0 +1,7 @@
1
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+
3
+ class ListItemConstants {}
4
+
5
+ _defineProperty(ListItemConstants, "LISTITEM_CLICKED", 'LISTITEM#CLICKED');
6
+
7
+ export default ListItemConstants;
@@ -0,0 +1,14 @@
1
+ import Constants from "./Constants";
2
+ export default [{
3
+ type: Constants.LISTITEM_CLICKED,
4
+ payload: {
5
+ id: {
6
+ name: 'id',
7
+ typeMetadata: {
8
+ schema: {
9
+ type: 'string'
10
+ }
11
+ }
12
+ }
13
+ }
14
+ }];
@@ -0,0 +1,131 @@
1
+ export default {
2
+ id: {
3
+ defaultValue: '',
4
+ required: false,
5
+ typeMetadata: {
6
+ schema: {
7
+ type: 'string'
8
+ }
9
+ }
10
+ },
11
+ isDisabled: {
12
+ defaultValue: false,
13
+ required: false,
14
+ typeMetadata: {
15
+ schema: {
16
+ type: 'boolean'
17
+ }
18
+ }
19
+ },
20
+ isActive: {
21
+ defaultValue: false,
22
+ required: false,
23
+ typeMetadata: {
24
+ schema: {
25
+ type: 'boolean'
26
+ }
27
+ }
28
+ },
29
+ text: {
30
+ defaultValue: '',
31
+ required: false,
32
+ typeMetadata: {
33
+ schema: {
34
+ type: 'string'
35
+ }
36
+ }
37
+ },
38
+ secondaryText: {
39
+ defaultValue: '',
40
+ required: false,
41
+ typeMetadata: {
42
+ schema: {
43
+ type: 'string'
44
+ }
45
+ }
46
+ },
47
+ size: {
48
+ defaultValue: 'medium',
49
+ required: false,
50
+ typeMetadata: {
51
+ schema: {
52
+ type: 'string',
53
+ enum: ['small', 'medium', 'large']
54
+ }
55
+ }
56
+ },
57
+ tooltip: {
58
+ defaultValue: '',
59
+ required: false,
60
+ typeMetadata: {
61
+ schema: {
62
+ type: 'string'
63
+ }
64
+ }
65
+ },
66
+ icon: {
67
+ defaultValue: '',
68
+ required: false,
69
+ typeMetadata: {
70
+ schema: {
71
+ type: 'string'
72
+ }
73
+ }
74
+ },
75
+ iconSize: {
76
+ defaultValue: 14,
77
+ required: false,
78
+ typeMetadata: {
79
+ schema: {
80
+ type: 'number'
81
+ }
82
+ }
83
+ },
84
+ imgSrc: {
85
+ defaultValue: '',
86
+ required: false,
87
+ typeMetadata: {
88
+ schema: {
89
+ type: 'string'
90
+ }
91
+ }
92
+ },
93
+ imgName: {
94
+ defaultValue: '',
95
+ required: false,
96
+ typeMetadata: {
97
+ schema: {
98
+ type: 'string'
99
+ }
100
+ }
101
+ },
102
+ href: {
103
+ defaultValue: '',
104
+ required: false,
105
+ typeMetadata: {
106
+ schema: {
107
+ type: 'string'
108
+ }
109
+ }
110
+ },
111
+ target: {
112
+ defaultValue: 'self',
113
+ required: false,
114
+ typeMetadata: {
115
+ schema: {
116
+ type: 'string',
117
+ enum: ['self', 'blank', 'parent', 'top']
118
+ }
119
+ }
120
+ },
121
+ divider: {
122
+ defaultValue: 'none',
123
+ required: false,
124
+ typeMetadata: {
125
+ schema: {
126
+ type: 'string',
127
+ enum: ['none', 'before', 'after']
128
+ }
129
+ }
130
+ }
131
+ };
@@ -0,0 +1,3 @@
1
+ export { default as ListItemProperties } from "./Properties";
2
+ export { default as ListItemEvents } from "./Events";
3
+ export { default as ListItemConstants } from "./Constants";
@@ -0,0 +1,7 @@
1
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
+
3
+ class MoreDropdownConstants {}
4
+
5
+ _defineProperty(MoreDropdownConstants, "MORE_DROPDOWN_OPTION_CLICKED", 'MORE_DROPDOWN#OPTION_CLICKED');
6
+
7
+ export default MoreDropdownConstants;
@@ -0,0 +1,14 @@
1
+ import Constants from "./Constants";
2
+ export default [{
3
+ type: Constants.MORE_DROPDOWN_OPTION_CLICKED,
4
+ payload: {
5
+ id: {
6
+ name: 'id',
7
+ typeMetadata: {
8
+ schema: {
9
+ type: 'string'
10
+ }
11
+ }
12
+ }
13
+ }
14
+ }];
@@ -0,0 +1,66 @@
1
+ export default {
2
+ heading: {
3
+ defaultValue: '',
4
+ required: false,
5
+ typeMetadata: {
6
+ schema: {
7
+ type: 'string'
8
+ }
9
+ }
10
+ },
11
+ options: {
12
+ defaultValue: [],
13
+ required: true,
14
+ typeMetadata: {
15
+ schema: {
16
+ type: 'array',
17
+ items: {
18
+ anyOf: [{
19
+ type: 'object',
20
+ properties: {
21
+ id: {
22
+ type: 'string'
23
+ },
24
+ value: {
25
+ type: 'string'
26
+ },
27
+ iconName: {
28
+ type: 'string'
29
+ },
30
+ iconSize: {
31
+ type: 'string'
32
+ }
33
+ },
34
+ required: ['id', 'value']
35
+ }, {
36
+ type: 'object',
37
+ properties: {
38
+ needDivider: {
39
+ type: 'boolean'
40
+ }
41
+ },
42
+ required: ['needDivider']
43
+ }]
44
+ }
45
+ }
46
+ }
47
+ },
48
+ isDisabled: {
49
+ defaultValue: false,
50
+ required: false,
51
+ typeMetadata: {
52
+ schema: {
53
+ type: 'boolean'
54
+ }
55
+ }
56
+ },
57
+ tooltip: {
58
+ defaultValue: '',
59
+ required: false,
60
+ typeMetadata: {
61
+ schema: {
62
+ type: 'string'
63
+ }
64
+ }
65
+ }
66
+ };
@@ -0,0 +1,3 @@
1
+ export { default as MoreDropdownProperties } from "./Properties";
2
+ export { default as MoreDropdownEvents } from "./Events";
3
+ export { default as MoreDropdownConstants } from "./Constants";
@@ -1,10 +1,16 @@
1
1
  import ActionIcon from "../../../../legacy-to-new-arch/action-icon/frameworks/ui/ActionIcon";
2
+ import Button from "../../../../legacy-to-new-arch/button/frameworks/ui/Button"; // import ListItem from '@library/dot/legacy-to-new-arch/list-item/frameworks/ui/ListItem';
3
+
2
4
  import TableColumnSort from "../../../../legacy-to-new-arch/table-column-sort/frameworks/ui/TableColumnSort";
3
5
  import TableColumnChooser from "../../../../legacy-to-new-arch/table-column-chooser/frameworks/ui/TableColumnChooser";
4
6
  import Checkbox from "../../../../legacy-to-new-arch/checkbox/frameworks/ui/Checkbox";
5
7
  import TableColumnFilter from "../../../../legacy-to-new-arch/table-column-filter/frameworks/ui/TableColumnFilter";
8
+ import MoreDropdown from "../../../../legacy-to-new-arch/more-dropdown/frameworks/ui/MoreDropdown";
6
9
  const ActionComponentMapping = {
7
10
  ['ActionIcon']: ActionIcon,
11
+ ['Button']: Button,
12
+ // ['ListItem']: ListItem,
13
+ ['MoreDropdown']: MoreDropdown,
8
14
  ['TableColumnSort']: TableColumnSort,
9
15
  ['TableColumnChooser']: TableColumnChooser,
10
16
  ['TableSelectAll']: Checkbox,
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/library-platform",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
4
4
  "description": "",
5
5
  "main": "es/index.js",
6
6
  "files": [