@zohodesk/library-platform 1.2.2 → 1.2.3
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/.DS_Store +0 -0
- package/es/cc/action-status/Constants.js +5 -0
- package/es/cc/action-status/Events.js +6 -0
- package/es/cc/action-status/Properties.js +29 -0
- package/es/cc/action-status/index.js +3 -0
- package/es/cc/button/Properties.js +28 -0
- package/es/cc/fields/field/Events.js +8 -0
- package/es/cc/highlighted-value/Properties.js +28 -0
- package/es/cc/index.js +1 -0
- package/es/cc/radio-dropdown/Events.js +16 -0
- package/es/cc/table-column-filter/Properties.js +9 -0
- package/es/cc/table-list/Events.js +8 -0
- package/es/library/custom-component/frameworks/ui/DependencyFactory.js +1 -1
- package/es/library/dot/components/action-location/frameworks/ui/ActionComponentMapping.js +3 -1
- package/es/library/dot/components/action-status/frameworks/ui/ActionStatus.js +12 -0
- package/es/library/dot/components/action-status/frameworks/ui/ActionStatusView.js +57 -0
- package/es/library/dot/components/action-status/frameworks/ui/css/ActionStatus.module.css +61 -0
- package/es/library/dot/components/form/frameworks/ui/sub-components/Footer.js +1 -1
- package/es/library/dot/components/table-list/adapters/controllers/FieldChangeController.js +4 -2
- package/es/library/dot/legacy-to-new-arch/button/frameworks/ui/ButtonView.js +17 -2
- package/es/library/dot/legacy-to-new-arch/highlighted-value/frameworks/ui/HighlightedValueView.js +13 -2
- package/es/library/dot/legacy-to-new-arch/highlighted-value/frameworks/ui/css/HighlightedValue.module.css +4 -0
- package/es/library/dot/legacy-to-new-arch/radio-dropdown/frameworks/ui/RadioDropdownView.js +3 -1
- package/es/library/dot/legacy-to-new-arch/table-column-filter/frameworks/ui/EventHandlersFactory.js +26 -0
- package/es/library/dot/legacy-to-new-arch/table-column-filter/frameworks/ui/TableColumnFilter.js +19 -1
- package/es/library/dot/legacy-to-new-arch/table-column-filter/frameworks/ui/TableColumnFilterView.js +3 -1
- package/es/library/dot/legacy-to-new-arch/table-field-components/checkbox-field/frameworks/ui/EventHandlersFactory.js +2 -1
- package/es/library/dot/legacy-to-new-arch/table-field-components/highlighted-value-field/frameworks/ui/HighlightedValueFieldView.js +8 -2
- package/es/library/dot/legacy-to-new-arch/table-field-components/radio-dropdown-field/frameworks/ui/EventHandlersFactory.js +4 -2
- package/es/library/dot/legacy-to-new-arch/table-field-components/switch-field/frameworks/ui/EventHandlersFactory.js +2 -1
- package/es/library/json-schema-validator/Validator.js +338 -0
- package/es/library/json-schema-validator/__tests__/Validator.test.js +753 -0
- package/es/library/json-schema-validator/index.js +1 -0
- package/es/platform/.DS_Store +0 -0
- package/es/platform/client-actions/cc/client-actions-renderer/Properties.js +1 -1
- package/es/platform/client-actions/cc/client-actions-renderer/ViewMetaSchema.js +1 -1
- package/es/platform/client-actions/components/client-actions-renderer/domain/entities/State.js +1 -8
- package/es/platform/client-actions/components/client-actions-renderer/frameworks/ui/client-actions-renderer/ClientActionsRendererView.js +2 -2
- package/es/platform/client-actions/components/client-actions-renderer/frameworks/ui/client-actions-renderer/views/DefaultActionsRendererView.js +2 -2
- package/es/platform/data-source/http-template/getAvailableFields.js +4 -2
- package/es/platform/sdk/application/interfaces/gateways/AbstractResource.js +1 -1
- package/es/platform/zform/domain/interfaces/IZForm.js +2 -5
- package/es/platform/zform/domain/interfaces/ValidationEvents.js +4 -0
- package/package.json +18 -6
- package/es/library/custom-component/frameworks/json-schema-validator/Validator.js +0 -164
package/es/.DS_Store
ADDED
|
Binary file
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
label: {
|
|
3
|
+
defaultValue: '',
|
|
4
|
+
required: false,
|
|
5
|
+
typeMetadata: {
|
|
6
|
+
schema: {
|
|
7
|
+
type: 'string'
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
actionLabel: {
|
|
12
|
+
defaultValue: 'Undo',
|
|
13
|
+
required: false,
|
|
14
|
+
typeMetadata: {
|
|
15
|
+
schema: {
|
|
16
|
+
type: 'string'
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
hasAction: {
|
|
21
|
+
defaultValue: false,
|
|
22
|
+
required: false,
|
|
23
|
+
typeMetadata: {
|
|
24
|
+
schema: {
|
|
25
|
+
type: 'boolean'
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
};
|
|
@@ -73,5 +73,33 @@ export default {
|
|
|
73
73
|
type: 'string'
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
+
},
|
|
77
|
+
iconName: {
|
|
78
|
+
defaultValue: '',
|
|
79
|
+
required: false,
|
|
80
|
+
typeMetadata: {
|
|
81
|
+
schema: {
|
|
82
|
+
type: 'string'
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
iconSize: {
|
|
87
|
+
defaultValue: '14',
|
|
88
|
+
required: false,
|
|
89
|
+
typeMetadata: {
|
|
90
|
+
schema: {
|
|
91
|
+
type: 'string'
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
iconPosition: {
|
|
96
|
+
defaultValue: 'right',
|
|
97
|
+
required: false,
|
|
98
|
+
typeMetadata: {
|
|
99
|
+
schema: {
|
|
100
|
+
type: 'string',
|
|
101
|
+
enum: ['left', 'right']
|
|
102
|
+
}
|
|
103
|
+
}
|
|
76
104
|
}
|
|
77
105
|
};
|
|
@@ -52,5 +52,33 @@ export default {
|
|
|
52
52
|
enum: ["default", "pointer"]
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
+
},
|
|
56
|
+
iconName: {
|
|
57
|
+
required: false,
|
|
58
|
+
defaultValue: '',
|
|
59
|
+
typeMetadata: {
|
|
60
|
+
schema: {
|
|
61
|
+
type: "string"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
iconSize: {
|
|
66
|
+
required: false,
|
|
67
|
+
defaultValue: '14',
|
|
68
|
+
typeMetadata: {
|
|
69
|
+
schema: {
|
|
70
|
+
type: "string"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
iconPosition: {
|
|
75
|
+
required: false,
|
|
76
|
+
defaultValue: 'right',
|
|
77
|
+
typeMetadata: {
|
|
78
|
+
schema: {
|
|
79
|
+
type: "string",
|
|
80
|
+
enum: ['left', 'right']
|
|
81
|
+
}
|
|
82
|
+
}
|
|
55
83
|
}
|
|
56
84
|
};
|
package/es/cc/index.js
CHANGED
|
@@ -25,6 +25,22 @@ export default [{
|
|
|
25
25
|
type: 'string'
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
+
},
|
|
29
|
+
previousId: {
|
|
30
|
+
name: 'previousId',
|
|
31
|
+
typeMetadata: {
|
|
32
|
+
schema: {
|
|
33
|
+
type: 'string'
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
previousValue: {
|
|
38
|
+
name: 'previousValue',
|
|
39
|
+
typeMetadata: {
|
|
40
|
+
schema: {
|
|
41
|
+
type: 'string'
|
|
42
|
+
}
|
|
43
|
+
}
|
|
28
44
|
}
|
|
29
45
|
}
|
|
30
46
|
}, {
|
|
@@ -97,6 +97,15 @@ export default {
|
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
},
|
|
100
|
+
emptyStateMessage: {
|
|
101
|
+
defaultValue: "No results found",
|
|
102
|
+
required: false,
|
|
103
|
+
typeMetadata: {
|
|
104
|
+
schema: {
|
|
105
|
+
type: "string"
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
},
|
|
100
109
|
clearFilterLabel: {
|
|
101
110
|
defaultValue: "Clear Filter",
|
|
102
111
|
required: false,
|
|
@@ -2,7 +2,7 @@ import Presenter from "../../adapters/presenters/Presenter";
|
|
|
2
2
|
import Service from "../../adapters/gateways/service/Service";
|
|
3
3
|
import Controller from "../../adapters/controllers/Controller";
|
|
4
4
|
import Repository from "../../adapters/gateways/repository/Repository";
|
|
5
|
-
import Validator from "
|
|
5
|
+
import { Validator } from "../../../json-schema-validator";
|
|
6
6
|
import EventManager from "../../adapters/gateways/event-manager/EventManager";
|
|
7
7
|
|
|
8
8
|
class DependencyFactory {
|
|
@@ -14,6 +14,7 @@ import ListItem from "../../../../legacy-to-new-arch/list-item/frameworks/ui/Lis
|
|
|
14
14
|
import Ribbon from "../../../../legacy-to-new-arch/ribbon/frameworks/ui/Ribbon";
|
|
15
15
|
import Search from "../../../../legacy-to-new-arch/action-band-components/search/frameworks/ui/Search";
|
|
16
16
|
import SortDropdown from "../../../../legacy-to-new-arch/sort-dropdown/frameworks/ui/SortDropdown";
|
|
17
|
+
import ActionStatus from "../../../action-status/frameworks/ui/ActionStatus";
|
|
17
18
|
const ActionComponentMapping = {
|
|
18
19
|
['ActionIcon']: ActionIcon,
|
|
19
20
|
['Button']: Button,
|
|
@@ -29,6 +30,7 @@ const ActionComponentMapping = {
|
|
|
29
30
|
['HighlightedValue']: HighlightedValue,
|
|
30
31
|
['Ribbon']: Ribbon,
|
|
31
32
|
['Search']: Search,
|
|
32
|
-
['SortDropdown']: SortDropdown
|
|
33
|
+
['SortDropdown']: SortDropdown,
|
|
34
|
+
['ActionStatus']: ActionStatus
|
|
33
35
|
};
|
|
34
36
|
export default ActionComponentMapping;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createCustomComponent } from "../../../../../custom-component";
|
|
2
|
+
import ActionStatusProperties from "../../../../../../cc/action-status/Properties";
|
|
3
|
+
import ActionStatusEvents from "../../../../../../cc/action-status/Events";
|
|
4
|
+
import ActionStatusView from "./ActionStatusView";
|
|
5
|
+
let ActionStatus = createCustomComponent({
|
|
6
|
+
name: "ActionStatus",
|
|
7
|
+
View: ActionStatusView,
|
|
8
|
+
properties: ActionStatusProperties,
|
|
9
|
+
events: ActionStatusEvents,
|
|
10
|
+
eventHandlers: {}
|
|
11
|
+
});
|
|
12
|
+
export default ActionStatus;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Flex from '@zohodesk/layout/es/Flex/Flex';
|
|
3
|
+
import ColoredTypography from '@zohodesk-private/desk-components/es/ColoredTypography/ColoredTypography';
|
|
4
|
+
import Button from '@zohodesk-private/dot-registry/es/Button/Button';
|
|
5
|
+
import { ActionStatusConstants } from "../../../../../../cc"; // @ts-ignore
|
|
6
|
+
|
|
7
|
+
import styles from "./css/ActionStatus.module.css";
|
|
8
|
+
|
|
9
|
+
function ActionStatusView(_ref, ref) {
|
|
10
|
+
let {
|
|
11
|
+
state,
|
|
12
|
+
helpers
|
|
13
|
+
} = _ref;
|
|
14
|
+
let {
|
|
15
|
+
dispatch
|
|
16
|
+
} = helpers;
|
|
17
|
+
let {
|
|
18
|
+
label,
|
|
19
|
+
actionLabel,
|
|
20
|
+
hasAction
|
|
21
|
+
} = state.properties;
|
|
22
|
+
return /*#__PURE__*/React.createElement(Flex, {
|
|
23
|
+
ref: ref,
|
|
24
|
+
$ui_displayMode: "inline",
|
|
25
|
+
$ui_alignItems: "center",
|
|
26
|
+
$ui_direction: "row",
|
|
27
|
+
$ui_className: styles.container,
|
|
28
|
+
$a11yAttributes_container: {
|
|
29
|
+
'role': 'status',
|
|
30
|
+
'aria-live': 'polite',
|
|
31
|
+
'aria-busy': true
|
|
32
|
+
}
|
|
33
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
34
|
+
className: styles.spinner,
|
|
35
|
+
"aria-hidden": "true"
|
|
36
|
+
}), label && /*#__PURE__*/React.createElement(ColoredTypography, {
|
|
37
|
+
$ui_size: "15",
|
|
38
|
+
$ui_weight: "regular",
|
|
39
|
+
$ui_color: "grey",
|
|
40
|
+
$flag_dotted: true,
|
|
41
|
+
$ui_className: styles.label
|
|
42
|
+
}, label), hasAction && /*#__PURE__*/React.createElement(Button, {
|
|
43
|
+
palette: "plainPrimary",
|
|
44
|
+
needAppearance: true,
|
|
45
|
+
text: actionLabel,
|
|
46
|
+
onClick: () => {
|
|
47
|
+
dispatch({
|
|
48
|
+
type: ActionStatusConstants.ACTION_STATUS_ACTION_CLICKED
|
|
49
|
+
});
|
|
50
|
+
},
|
|
51
|
+
customClass: {
|
|
52
|
+
customButton: styles.actionButton
|
|
53
|
+
}
|
|
54
|
+
}));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export default ActionStatusView;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
@property --_fill {
|
|
2
|
+
syntax: '<angle>';
|
|
3
|
+
inherits: false;
|
|
4
|
+
initial-value: 0deg;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.container {
|
|
8
|
+
gap: var(--zd_size8) ;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.spinner {
|
|
12
|
+
display: inline-block;
|
|
13
|
+
width: var(--zd_size16) ;
|
|
14
|
+
height: var(--zd_size16) ;
|
|
15
|
+
/* COLOR VARIABLES TO BE UPDATED PROPERLY USING COMMON COLORS */
|
|
16
|
+
flex-shrink: 0;
|
|
17
|
+
box-sizing: border-box;
|
|
18
|
+
border-radius: 50%;
|
|
19
|
+
border: 1px solid transparent;
|
|
20
|
+
background:
|
|
21
|
+
conic-gradient(var(--zdt_coloredtypography_grey_text) var(--_fill, 0deg),
|
|
22
|
+
var(--zdt_filterdropdown_clearbutton_bg) var(--_fill, 0deg)) content-box,
|
|
23
|
+
conic-gradient(var(--zdt_coloredtypography_grey_text) 0deg var(--_fill, 0deg),
|
|
24
|
+
transparent var(--_fill, 0deg) 360deg) border-box,
|
|
25
|
+
conic-gradient(transparent 0deg 4deg,
|
|
26
|
+
var(--zdt_coloredtypography_grey_text) 4deg 86deg,
|
|
27
|
+
transparent 86deg 94deg,
|
|
28
|
+
var(--zdt_coloredtypography_grey_text) 94deg 176deg,
|
|
29
|
+
transparent 176deg 184deg,
|
|
30
|
+
var(--zdt_coloredtypography_grey_text) 184deg 266deg,
|
|
31
|
+
transparent 266deg 274deg,
|
|
32
|
+
var(--zdt_coloredtypography_grey_text) 274deg 356deg,
|
|
33
|
+
transparent 356deg 360deg) border-box;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
[dir=ltr] .spinner {
|
|
37
|
+
animation: fill 9s linear infinite;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
[dir=rtl] .spinner {
|
|
41
|
+
animation: fill 9s linear infinite;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
@keyframes fill {
|
|
45
|
+
0% {
|
|
46
|
+
--_fill: 0deg;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
100% {
|
|
50
|
+
--_fill: 360deg;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.label {
|
|
55
|
+
line-height: 1.07;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.actionButton {
|
|
59
|
+
--button_font_size: 15px;
|
|
60
|
+
--button_text_transform: none;
|
|
61
|
+
}
|
|
@@ -3,7 +3,7 @@ import FormAction, { LeftSide, RightSide } from '@zohodesk/dot/es/FormAction/For
|
|
|
3
3
|
import { ActionViewGap } from "../../../../../../../platform/client-actions/components/interfaces/ActionViewModel"; // @ts-ignore
|
|
4
4
|
|
|
5
5
|
import style from "../css/Form.module.css";
|
|
6
|
-
import
|
|
6
|
+
import RowActionsRenderer from "../../../../../../../platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActions/RowActionsRenderer";
|
|
7
7
|
export default function Footer(_ref) {
|
|
8
8
|
let {
|
|
9
9
|
hasFooter,
|
|
@@ -13,7 +13,8 @@ class FieldChangeController extends AbstractController {
|
|
|
13
13
|
} = state;
|
|
14
14
|
const {
|
|
15
15
|
fieldName,
|
|
16
|
-
value
|
|
16
|
+
value,
|
|
17
|
+
previousValue
|
|
17
18
|
} = action.payload;
|
|
18
19
|
const {
|
|
19
20
|
id
|
|
@@ -23,7 +24,8 @@ class FieldChangeController extends AbstractController {
|
|
|
23
24
|
payload: {
|
|
24
25
|
rowId: id,
|
|
25
26
|
fieldName,
|
|
26
|
-
value
|
|
27
|
+
value,
|
|
28
|
+
previousValue
|
|
27
29
|
}
|
|
28
30
|
});
|
|
29
31
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import Button from '@zohodesk-private/dot-registry/es/Button/Button';
|
|
3
|
+
import Icon from "@zohodesk/icons/es/Icon";
|
|
3
4
|
import ButtonConstants from "../../../../../../cc/button/Constants";
|
|
4
5
|
|
|
5
6
|
function ButtonView(_ref, ref) {
|
|
@@ -18,11 +19,25 @@ function ButtonView(_ref, ref) {
|
|
|
18
19
|
isDisabled,
|
|
19
20
|
id,
|
|
20
21
|
status,
|
|
21
|
-
tooltip
|
|
22
|
+
tooltip,
|
|
23
|
+
iconName,
|
|
24
|
+
iconSize,
|
|
25
|
+
iconPosition
|
|
22
26
|
} = state.properties;
|
|
27
|
+
const iconElement = iconName ? /*#__PURE__*/React.createElement(Icon, {
|
|
28
|
+
name: iconName,
|
|
29
|
+
size: iconSize
|
|
30
|
+
}) : null;
|
|
31
|
+
const buttonText = iconElement ? /*#__PURE__*/React.createElement("span", {
|
|
32
|
+
style: {
|
|
33
|
+
display: 'inline-flex',
|
|
34
|
+
alignItems: 'center',
|
|
35
|
+
gap: '4px'
|
|
36
|
+
}
|
|
37
|
+
}, iconPosition === 'left' && iconElement, text, iconPosition !== 'left' && iconElement) : text;
|
|
23
38
|
return /*#__PURE__*/React.createElement(Button, {
|
|
24
39
|
getRef: ref,
|
|
25
|
-
text:
|
|
40
|
+
text: buttonText,
|
|
26
41
|
palette: palette,
|
|
27
42
|
size: size,
|
|
28
43
|
isRounded: isRounded,
|
package/es/library/dot/legacy-to-new-arch/highlighted-value/frameworks/ui/HighlightedValueView.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import StatusBox from "@zohodesk-private/desk-components/es/table/StatusBox/StatusBox";
|
|
3
|
+
import Icon from "@zohodesk/icons/es/Icon";
|
|
3
4
|
import HighlightedValueConstants from "../../../../../../cc/highlighted-value/Constants"; // @ts-ignore
|
|
4
5
|
|
|
5
6
|
import style from "./css/HighlightedValue.module.css";
|
|
@@ -18,8 +19,15 @@ function HighlightedValueView(_ref, ref) {
|
|
|
18
19
|
tooltip,
|
|
19
20
|
weight,
|
|
20
21
|
isDotted,
|
|
21
|
-
cursor
|
|
22
|
+
cursor,
|
|
23
|
+
iconName,
|
|
24
|
+
iconSize,
|
|
25
|
+
iconPosition
|
|
22
26
|
} = state.properties;
|
|
27
|
+
const iconElement = iconName ? /*#__PURE__*/React.createElement(Icon, {
|
|
28
|
+
name: iconName,
|
|
29
|
+
size: iconSize
|
|
30
|
+
}) : null;
|
|
23
31
|
return /*#__PURE__*/React.createElement(StatusBox, {
|
|
24
32
|
$customProps_container: {
|
|
25
33
|
ref
|
|
@@ -29,8 +37,11 @@ function HighlightedValueView(_ref, ref) {
|
|
|
29
37
|
$ui_weight: weight,
|
|
30
38
|
$flag_wrapText: !isDotted,
|
|
31
39
|
$i18n_tooltip: tooltip,
|
|
40
|
+
$render_leftChild: iconPosition === 'left' ? iconElement : null,
|
|
41
|
+
$render_rightChild: iconPosition !== 'left' ? iconElement : null,
|
|
32
42
|
customStyle: {
|
|
33
|
-
pointer: cursor === "default" && style.default
|
|
43
|
+
pointer: cursor === "default" && style.default,
|
|
44
|
+
container: iconName ? style.gap : undefined
|
|
34
45
|
},
|
|
35
46
|
$event_onClick: () => {
|
|
36
47
|
dispatch({
|
package/es/library/dot/legacy-to-new-arch/table-column-filter/frameworks/ui/EventHandlersFactory.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import TableColumnFilterConstants from "../../../../../../cc/table-column-filter/Constants";
|
|
2
|
+
import { SEARCH_REQUESTED } from "../../../../../../bc/search/Constants";
|
|
3
|
+
export default class EventHandlersFactory {
|
|
4
|
+
static create() {
|
|
5
|
+
const searchHandler = input => {
|
|
6
|
+
const {
|
|
7
|
+
dispatch,
|
|
8
|
+
action
|
|
9
|
+
} = input;
|
|
10
|
+
const {
|
|
11
|
+
searchText
|
|
12
|
+
} = action.payload;
|
|
13
|
+
dispatch({
|
|
14
|
+
type: SEARCH_REQUESTED,
|
|
15
|
+
payload: {
|
|
16
|
+
searchString: searchText
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
return {
|
|
22
|
+
[TableColumnFilterConstants.FILTER_SEARCHED]: searchHandler
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
}
|
package/es/library/dot/legacy-to-new-arch/table-column-filter/frameworks/ui/TableColumnFilter.js
CHANGED
|
@@ -1,12 +1,30 @@
|
|
|
1
1
|
import { createCustomComponent } from "../../../../../custom-component";
|
|
2
2
|
import TableColumnFilterProperties from "../../../../../../cc/table-column-filter/Properties";
|
|
3
3
|
import TableColumnFilterEvents from "../../../../../../cc/table-column-filter/Events";
|
|
4
|
+
import SearchTranslator from "../../../../../behaviours/search/adapters/presenter/SearchTranslator";
|
|
5
|
+
import SearchBehaviourFactory from "../../../../../behaviours/search/frameworks/ui/SearchStringStoreBehaviourFactory";
|
|
6
|
+
import EventHandlersFactory from "./EventHandlersFactory";
|
|
4
7
|
import TableColumnFilterView from "./TableColumnFilterView";
|
|
8
|
+
|
|
9
|
+
function transformState(state) {
|
|
10
|
+
const {
|
|
11
|
+
searchString
|
|
12
|
+
} = state.behaviours.search;
|
|
13
|
+
return { ...state,
|
|
14
|
+
viewModel: { ...state.properties,
|
|
15
|
+
...state.viewModel,
|
|
16
|
+
options: SearchTranslator(searchString, 'value', state.properties.options)
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
5
21
|
const TableColumnFilter = createCustomComponent({
|
|
6
22
|
name: 'TableColumnFilter',
|
|
7
23
|
View: TableColumnFilterView,
|
|
24
|
+
transformState,
|
|
8
25
|
properties: TableColumnFilterProperties,
|
|
26
|
+
behaviours: [SearchBehaviourFactory.create()],
|
|
9
27
|
events: TableColumnFilterEvents,
|
|
10
|
-
eventHandlers:
|
|
28
|
+
eventHandlers: EventHandlersFactory.create()
|
|
11
29
|
});
|
|
12
30
|
export default TableColumnFilter;
|
package/es/library/dot/legacy-to-new-arch/table-column-filter/frameworks/ui/TableColumnFilterView.js
CHANGED
|
@@ -22,11 +22,12 @@ function TableColumnFilterView(_ref, ref) {
|
|
|
22
22
|
heading,
|
|
23
23
|
hasSearch,
|
|
24
24
|
searchPlaceholder,
|
|
25
|
+
emptyStateMessage,
|
|
25
26
|
hasClearButton,
|
|
26
27
|
clearFilterLabel,
|
|
27
28
|
optionTagLabel,
|
|
28
29
|
taggedOption
|
|
29
|
-
} = state.
|
|
30
|
+
} = state.viewModel;
|
|
30
31
|
|
|
31
32
|
const handleFilter = (_ref2, e) => {
|
|
32
33
|
let {
|
|
@@ -87,6 +88,7 @@ function TableColumnFilterView(_ref, ref) {
|
|
|
87
88
|
options,
|
|
88
89
|
hasSearch,
|
|
89
90
|
searchPlaceholder,
|
|
91
|
+
emptyStateTitle: emptyStateMessage,
|
|
90
92
|
hasClearButton,
|
|
91
93
|
isClearButtonDisabled: !isFiltered,
|
|
92
94
|
clearFilterLabel,
|
|
@@ -10,7 +10,10 @@ export default function HighlightedValueFieldView(_ref, ref) {
|
|
|
10
10
|
tooltip,
|
|
11
11
|
weight,
|
|
12
12
|
isDotted,
|
|
13
|
-
cursor
|
|
13
|
+
cursor,
|
|
14
|
+
iconName,
|
|
15
|
+
iconSize,
|
|
16
|
+
iconPosition
|
|
14
17
|
} = state.properties;
|
|
15
18
|
return /*#__PURE__*/React.createElement(HighlightedValue, {
|
|
16
19
|
getRef: ref,
|
|
@@ -19,6 +22,9 @@ export default function HighlightedValueFieldView(_ref, ref) {
|
|
|
19
22
|
tooltip: tooltip,
|
|
20
23
|
cursor: cursor,
|
|
21
24
|
weight: weight,
|
|
22
|
-
isDotted: isDotted
|
|
25
|
+
isDotted: isDotted,
|
|
26
|
+
iconName: iconName,
|
|
27
|
+
iconSize: iconSize,
|
|
28
|
+
iconPosition: iconPosition
|
|
23
29
|
});
|
|
24
30
|
}
|
|
@@ -15,13 +15,15 @@ export class EventHandlersFactory {
|
|
|
15
15
|
fieldType
|
|
16
16
|
} = state.properties;
|
|
17
17
|
const {
|
|
18
|
-
id
|
|
18
|
+
id,
|
|
19
|
+
previousId
|
|
19
20
|
} = action.payload;
|
|
20
21
|
dispatch({
|
|
21
22
|
type: FieldConstants.FIELD_CHANGED,
|
|
22
23
|
payload: {
|
|
23
24
|
fieldName,
|
|
24
|
-
value: fieldType === 'Boolean' ? id === 'true' : id
|
|
25
|
+
value: fieldType === 'Boolean' ? id === 'true' : id,
|
|
26
|
+
previousValue: fieldType === 'Boolean' ? previousId === 'true' : previousId
|
|
25
27
|
}
|
|
26
28
|
});
|
|
27
29
|
};
|