@zohodesk/library-platform 1.1.12-exp.1 → 1.1.12-exp.2
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/index.js +0 -1
- package/es/bc/zlist/Constants.js +0 -1
- package/es/bc/zlist/Types.js +10 -0
- package/es/bc/zrecord/Constants.js +1 -0
- package/es/bc/zrecord/Schemas.js +29 -0
- package/es/bc/zrecord/Types.js +45 -0
- package/es/cc/checkbox/Properties.js +1 -2
- package/es/cc/email/Properties.js +0 -8
- package/es/cc/fields/field/Types.js +23 -31
- package/es/cc/fields/lookup/Properties.js +10 -26
- package/es/cc/highlighted-value/Properties.js +0 -18
- package/es/cc/link/Properties.js +3 -13
- package/es/cc/switch/Properties.js +2 -2
- package/es/cc/table-connected/SdkContract.js +21 -0
- package/es/cc/table-connected/constants/Events.js +2 -0
- package/es/cc/table-list/Actions.js +0 -2
- package/es/cc/table-list/Constants.js +0 -1
- package/es/cc/table-list/Events.js +0 -2
- package/es/cc/table-list/Properties.js +35 -4
- package/es/cc/tags/Data.js +6 -0
- package/es/cc/tags/model/TagModel.js +26 -0
- package/es/cc/tags/model/index.js +1 -1
- package/es/library/custom-component/frameworks/ui/CustomComponentFactory.js +56 -0
- package/es/library/dot/components/table-list/adapters/controllers/index.js +0 -2
- package/es/library/dot/components/table-list/frameworks/ui/EventHandlersFactory.js +1 -2
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/Row.js +1 -3
- package/es/library/dot/legacy-to-new-arch/email/frameworks/ui/EmailView.js +2 -4
- package/es/library/dot/legacy-to-new-arch/highlighted-value/frameworks/ui/HighlightedValueView.js +1 -6
- package/es/library/dot/legacy-to-new-arch/index.js +0 -1
- package/es/library/dot/legacy-to-new-arch/link/frameworks/ui/LinkView.js +2 -4
- package/es/library/dot/legacy-to-new-arch/table-field-components/checkbox-field/frameworks/ui/CheckboxField.js +2 -12
- package/es/library/dot/legacy-to-new-arch/table-field-components/checkbox-field/frameworks/ui/CheckboxFieldView.js +5 -8
- 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 +6 -8
- package/es/library/dot/legacy-to-new-arch/table-field-components/index.js +5 -22
- 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/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 +4 -14
- package/es/library/dot/legacy-to-new-arch/table-field-components/switch-field/frameworks/ui/SwitchFieldView.js +4 -8
- package/es/library/dot/legacy-to-new-arch/table-field-components/url-field/frameworks/ui/UrlFieldView.js +1 -1
- package/es/platform/components/table-connected/adapters/resources/SmartTableResource.js +169 -8
- package/es/platform/components/table-connected/frameworks/EventHandlersFactory.js +11 -2
- package/es/platform/data-source/http-template/fetchLookupFields.js +0 -6
- package/es/platform/data-source/http-template/getRecords.js +1 -0
- package/es/platform/data-source/index.js +1 -3
- package/es/platform/zfield/applications/usecases/FetchSuccessUseCase.js +0 -33
- package/es/platform/zfield/domain/entities/fields-manager/FieldsManager.js +0 -5
- package/es/platform/zform/adapters/gateway/FormRepository.js +3 -1
- package/es/platform/zform/adapters/presenter/translators/fields/LookUpFieldTranslator.js +12 -11
- package/es/platform/zform/applications/usecases/MyFormSuccessUseCase.js +9 -10
- package/es/platform/zform/domain/ZForm.js +2 -0
- package/es/platform/zlist/adapters/controllers/RefreshRecordsRequestedController.js +21 -0
- package/es/platform/zlist/adapters/controllers/SortController.js +2 -2
- package/es/platform/zlist/adapters/gateways/Repository.js +6 -11
- package/es/platform/zlist/adapters/gateways/Service.js +2 -0
- package/es/platform/zlist/adapters/presenters/TableTranslator.js +11 -21
- package/es/platform/zlist/adapters/presenters/translators/ColumnTranslator.js +52 -48
- package/es/platform/zlist/adapters/presenters/translators/Header.js +29 -21
- package/es/platform/zlist/adapters/presenters/translators/HeadersTranslator.js +3 -3
- package/es/platform/zlist/adapters/presenters/translators/Row.js +2 -3
- package/es/platform/zlist/adapters/presenters/translators/RowsTranslator.js +1 -3
- package/es/platform/zlist/adapters/presenters/translators/fields/BooleanFieldTranslator.js +12 -87
- package/es/platform/zlist/adapters/presenters/translators/fields/CurrencyFieldTranslator.js +11 -66
- package/es/platform/zlist/adapters/presenters/translators/fields/DateFieldTranslator.js +9 -16
- package/es/platform/zlist/adapters/presenters/translators/fields/DateTimeFieldTranslator.js +9 -16
- package/es/platform/zlist/adapters/presenters/translators/fields/DecimalFieldTranslator.js +9 -16
- package/es/platform/zlist/adapters/presenters/translators/fields/EmailFieldTranslator.js +9 -29
- package/es/platform/zlist/adapters/presenters/translators/fields/FormulaFieldTranslator.js +27 -23
- package/es/platform/zlist/adapters/presenters/translators/fields/LookUpFieldTranslator.js +17 -106
- package/es/platform/zlist/adapters/presenters/translators/fields/MultiLineFieldTranslator.js +9 -16
- package/es/platform/zlist/adapters/presenters/translators/fields/MultiSelectFieldTranslator.js +26 -100
- package/es/platform/zlist/adapters/presenters/translators/fields/NumberFieldTranslator.js +9 -16
- package/es/platform/zlist/adapters/presenters/translators/fields/PercentageFieldTranslator.js +9 -16
- package/es/platform/zlist/adapters/presenters/translators/fields/PhoneFieldTranslator.js +9 -16
- package/es/platform/zlist/adapters/presenters/translators/fields/PickListFieldTranslator.js +26 -167
- package/es/platform/zlist/adapters/presenters/translators/fields/SingleLineFieldTranslator.js +9 -16
- package/es/platform/zlist/adapters/presenters/translators/fields/URLFieldTranslator.js +9 -32
- package/es/platform/zlist/adapters/presenters/utils/DefaultClientActions.js +7 -4
- package/es/platform/zlist/applications/entities-factory/ListFactory.js +2 -2
- package/es/platform/zlist/applications/interfaces/input/GetSortConfigUseCaseInputModel.js +1 -0
- package/es/platform/zlist/applications/interfaces/input/RefreshRecordsRequestedUseCaseInputModel.js +1 -0
- package/es/platform/zlist/applications/interfaces/input/SetSortConfigUseCaseInputModel.js +1 -0
- package/es/platform/zlist/applications/usecases/GetSortConfigUseCase.js +17 -0
- package/es/platform/zlist/applications/usecases/RecordSuccessCallbackUsecase.js +1 -1
- package/es/platform/zlist/applications/usecases/RefreshRecordsRequestedUseCase.js +17 -0
- package/es/platform/zlist/applications/usecases/SetSortConfigUseCase.js +26 -0
- package/es/platform/zlist/applications/usecases/SortUseCase.js +6 -6
- package/es/platform/zlist/domain/entities/List.js +27 -15
- package/es/platform/zlist/domain/entities/interfaces/Properties.js +5 -5
- package/es/platform/zlist/frameworks/EventHandlersFactory.js +3 -4
- package/es/platform/zlist/frameworks/ZListBehaviourFactory.js +2 -5
- package/es/platform/zrecord/adapters/gateways/Repository.js +5 -2
- package/es/platform/zrecord/applications/entities-factory/RecordsManagerFactory.js +2 -2
- package/es/platform/zrecord/applications/interfaces/input/ClearAllFiltersUseCaseInputModel.js +1 -0
- package/es/platform/zrecord/applications/interfaces/input/GetFilterConditionUseCaseInputModel.js +1 -0
- package/es/platform/zrecord/applications/interfaces/input/GetFilterConfigUseCaseInputModel.js +1 -0
- package/es/platform/zrecord/applications/interfaces/input/RefreshRecordsUseCaseInputModel.js +1 -0
- package/es/platform/zrecord/applications/interfaces/input/SetFilterUseCaseInputModel.js +1 -0
- package/es/platform/zrecord/applications/usecases/ClearAllFiltersUseCase.js +24 -0
- package/es/platform/zrecord/applications/usecases/GetFilterConditionUseCase.js +15 -0
- package/es/platform/zrecord/applications/usecases/GetFilterConfigUseCase.js +15 -0
- package/es/platform/zrecord/applications/usecases/RefreshRecordsUseCase.js +14 -0
- package/es/platform/zrecord/applications/usecases/SetFilterUseCase.js +24 -0
- package/es/platform/zrecord/domain/entities/Filter.js +247 -0
- package/es/platform/zrecord/domain/entities/RecordsManager.js +19 -1
- package/es/platform/zrecord/domain/entities/interfaces/IFilter.js +1 -0
- package/es/platform/zrecord/frameworks/RecordBehaviourFactory.js +11 -1
- package/package.json +7 -7
package/es/bc/index.js
CHANGED
package/es/bc/zlist/Constants.js
CHANGED
|
@@ -3,7 +3,6 @@ export const ZLIST_DELETE_RECORD = 'ZLIST#DELETE_RECORD';
|
|
|
3
3
|
export const ZLIST_RECORD_UPDATE = 'ZLIST#RECORD_UPDATE';
|
|
4
4
|
export const ZLIST_FETCH_MORE = 'ZLIST#FETCH_MORE';
|
|
5
5
|
export const ZLIST_SORT = 'ZLIST#SORT';
|
|
6
|
-
export const ZLIST_FETCH_SORTED = 'ZLIST#FETCH_SORTED';
|
|
7
6
|
export const ZLIST_RECORD_UPDATE_SUCCEEDED = 'ZLIST#RECORD_UPDATE_SUCCEEDED';
|
|
8
7
|
export const ZLIST_RECORD_UPDATE_FAILED = 'ZLIST#RECORD_UPDATE_FAILED';
|
|
9
8
|
export const ZLIST_RECORD_DELETE_SUCCEEDED = 'ZLIST#RECORD_DELETE_SUCCEEDED';
|
|
@@ -11,6 +11,7 @@ export const RECORD_FIELD_CHANGE = 'RECORD#FIELD_CHANGE';
|
|
|
11
11
|
export const RECORD_LOCAL_UPDATE = 'RECORD#LOCAL_UPDATE';
|
|
12
12
|
export const RECORD_LOCAL_MULTIPLE_DELETE = 'RECORD#LOCAL_MULTIPLE_DELETE';
|
|
13
13
|
export const APPEND_RECORDS = 'RECORD#APPEND_RECORDS';
|
|
14
|
+
export const REFRESH_RECORDS_REQUESTED = 'RECORD#REFRESH_RECORDS_REQUESTED';
|
|
14
15
|
export const SET_RECORDS = 'RECORD#SET_RECORDS';
|
|
15
16
|
export const SET_RECORDS_SUCCESS = 'RECORD#SET_RECORDS_SUCCESS';
|
|
16
17
|
export const CREATE_RECORD = 'RECORD#CREATE_RECORD';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { CommonComparators, TextComparators, NumberComparators, DateComparators } from "./Types";
|
|
2
|
+
export const filterConfigSchema = {
|
|
3
|
+
type: "object",
|
|
4
|
+
properties: {
|
|
5
|
+
conditions: {
|
|
6
|
+
type: "array",
|
|
7
|
+
items: {
|
|
8
|
+
type: "object",
|
|
9
|
+
properties: {
|
|
10
|
+
fieldName: {
|
|
11
|
+
type: "string"
|
|
12
|
+
},
|
|
13
|
+
condition: {
|
|
14
|
+
type: "string",
|
|
15
|
+
enum: [...Object.values(CommonComparators), ...Object.values(TextComparators), ...Object.values(NumberComparators), ...Object.values(DateComparators)]
|
|
16
|
+
},
|
|
17
|
+
value: {// Can be any type
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
required: ["fieldName", "condition", "value"]
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
pattern: {
|
|
24
|
+
type: "string",
|
|
25
|
+
description: "Pattern representing logical combination, e.g., '(1and(2or3))'"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
required: ["conditions", "pattern"]
|
|
29
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// ---------------- ENUMS ----------------
|
|
2
|
+
export let CommonComparators = /*#__PURE__*/function (CommonComparators) {
|
|
3
|
+
CommonComparators["ISEMPTY"] = "is empty";
|
|
4
|
+
CommonComparators["ISNOTEMPTY"] = "is not empty";
|
|
5
|
+
return CommonComparators;
|
|
6
|
+
}({});
|
|
7
|
+
export let TextComparators = /*#__PURE__*/function (TextComparators) {
|
|
8
|
+
TextComparators["IS"] = "is";
|
|
9
|
+
TextComparators["ISNT"] = "isn't";
|
|
10
|
+
TextComparators["STARTSWITH"] = "starts with";
|
|
11
|
+
TextComparators["ENDSWITH"] = "ends with";
|
|
12
|
+
TextComparators["CONTAINS"] = "contains";
|
|
13
|
+
TextComparators["DOESNTCONTAIN"] = "doesn't contain";
|
|
14
|
+
return TextComparators;
|
|
15
|
+
}({});
|
|
16
|
+
export let NumberComparators = /*#__PURE__*/function (NumberComparators) {
|
|
17
|
+
NumberComparators["EQUAL"] = "=";
|
|
18
|
+
NumberComparators["NOTEQUAL"] = "<>";
|
|
19
|
+
NumberComparators["LESSTHAN"] = "<";
|
|
20
|
+
NumberComparators["LESSTHANEQUAL"] = "<=";
|
|
21
|
+
NumberComparators["GREATERTHAN"] = ">";
|
|
22
|
+
NumberComparators["GREATERTHANEQUAL"] = ">=";
|
|
23
|
+
return NumberComparators;
|
|
24
|
+
}({});
|
|
25
|
+
export let DateComparators = /*#__PURE__*/function (DateComparators) {
|
|
26
|
+
DateComparators["ISAFTER"] = "is after";
|
|
27
|
+
DateComparators["ISBEFORE"] = "is before";
|
|
28
|
+
DateComparators["BETWEEN"] = "between";
|
|
29
|
+
DateComparators["NOTBETWEEN"] = "not between";
|
|
30
|
+
return DateComparators;
|
|
31
|
+
}({}); // Union type of all comparators
|
|
32
|
+
|
|
33
|
+
export let ConditionTokens = /*#__PURE__*/function (ConditionTokens) {
|
|
34
|
+
ConditionTokens["CONDITION"] = "CONDITION";
|
|
35
|
+
ConditionTokens["OPEN"] = "(";
|
|
36
|
+
ConditionTokens["CLOSE"] = ")";
|
|
37
|
+
ConditionTokens["AND"] = "AND";
|
|
38
|
+
ConditionTokens["OR"] = "OR";
|
|
39
|
+
ConditionTokens["NOT"] = "NOT";
|
|
40
|
+
return ConditionTokens;
|
|
41
|
+
}({});
|
|
42
|
+
export const initialFilterConfig = {
|
|
43
|
+
conditions: [],
|
|
44
|
+
pattern: ''
|
|
45
|
+
};
|
|
@@ -1,32 +1,24 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
FieldUiComponentNames["TagField"] = "Tag";
|
|
24
|
-
FieldUiComponentNames["TagsField"] = "Tags";
|
|
25
|
-
FieldUiComponentNames["TagsListDropdownField"] = "TagsListDropdown";
|
|
26
|
-
FieldUiComponentNames["RadioDropdownField"] = "RadioDropdown";
|
|
27
|
-
FieldUiComponentNames["LabeledAvatarField"] = "LabeledAvatar";
|
|
28
|
-
FieldUiComponentNames["HighlightedValueField"] = "HighlightedValue";
|
|
29
|
-
return FieldUiComponentNames;
|
|
30
|
-
}(FieldUiComponentNames || {});
|
|
1
|
+
var Types = /*#__PURE__*/function (Types) {
|
|
2
|
+
Types["PrimaryField"] = "Primary";
|
|
3
|
+
Types["CheckboxField"] = "Checkbox";
|
|
4
|
+
Types["SwitchField"] = "Switch";
|
|
5
|
+
Types["SingleLineField"] = "SingleLine";
|
|
6
|
+
Types["MultiLineField"] = "MultiLine";
|
|
7
|
+
Types["EmailField"] = "Email";
|
|
8
|
+
Types["URLField"] = "URL";
|
|
9
|
+
Types["PhoneField"] = "Phone";
|
|
10
|
+
Types["CurrencyField"] = "Currency";
|
|
11
|
+
Types["LookUpField"] = "LookUp";
|
|
12
|
+
Types["PickListField"] = "PickList";
|
|
13
|
+
Types["PercentageField"] = "Percentage";
|
|
14
|
+
Types["DateField"] = "Date";
|
|
15
|
+
Types["DateTimeField"] = "DateTime";
|
|
16
|
+
Types["NumberField"] = "Number";
|
|
17
|
+
Types["DecimalField"] = "Decimal";
|
|
18
|
+
Types["ColouredPickListField"] = "ColouredPickList";
|
|
19
|
+
Types["ColouredMultiSelectField"] = "ColouredMultiSelect";
|
|
20
|
+
Types["MultiSelectField"] = "MultiSelect";
|
|
21
|
+
return Types;
|
|
22
|
+
}(Types || {});
|
|
31
23
|
|
|
32
|
-
export default
|
|
24
|
+
export default Types;
|
|
@@ -9,36 +9,20 @@ export default { ...FieldProperties,
|
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
11
|
},
|
|
12
|
+
//schema is not defiend properly from server so handled like this
|
|
12
13
|
value: {
|
|
13
|
-
required:
|
|
14
|
+
required: false,
|
|
15
|
+
defaultValue: null,
|
|
16
|
+
typeMetadata: {
|
|
17
|
+
schema: {}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
maxLength: {
|
|
21
|
+
required: false,
|
|
14
22
|
defaultValue: '',
|
|
15
23
|
typeMetadata: {
|
|
16
24
|
schema: {
|
|
17
|
-
|
|
18
|
-
anyOf: [{
|
|
19
|
-
// NOTE: object type is used in Table Lookup field translator
|
|
20
|
-
type: 'object',
|
|
21
|
-
properties: {
|
|
22
|
-
id: {
|
|
23
|
-
type: 'string'
|
|
24
|
-
},
|
|
25
|
-
name: {
|
|
26
|
-
type: 'string'
|
|
27
|
-
},
|
|
28
|
-
photoURL: {
|
|
29
|
-
type: ['string', 'null']
|
|
30
|
-
},
|
|
31
|
-
url: {
|
|
32
|
-
type: ['string', 'null']
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
required: ['id', 'name'],
|
|
36
|
-
additionalProperties: true
|
|
37
|
-
}, {
|
|
38
|
-
// NOTE: string type is used in Form Lookup field translator
|
|
39
|
-
type: 'string' // Allowing string type for backward compatibility or alternative usage
|
|
40
|
-
|
|
41
|
-
}]
|
|
25
|
+
type: 'number'
|
|
42
26
|
}
|
|
43
27
|
}
|
|
44
28
|
}
|
|
@@ -17,24 +17,6 @@ export default {
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
|
-
weight: {
|
|
21
|
-
required: false,
|
|
22
|
-
typeMetadata: {
|
|
23
|
-
schema: {
|
|
24
|
-
type: "string",
|
|
25
|
-
enum: ["light", "regular", "semibold", "bold"]
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
isDotted: {
|
|
30
|
-
required: false,
|
|
31
|
-
defaultValue: true,
|
|
32
|
-
typeMetadata: {
|
|
33
|
-
schema: {
|
|
34
|
-
type: "boolean"
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
20
|
tooltip: {
|
|
39
21
|
required: false,
|
|
40
22
|
typeMetadata: {
|
package/es/cc/link/Properties.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
|
|
3
|
-
required:
|
|
4
|
-
defaultValue: "",
|
|
2
|
+
label: {
|
|
3
|
+
required: true,
|
|
5
4
|
typeMetadata: {
|
|
6
5
|
schema: {
|
|
7
6
|
type: "string"
|
|
@@ -9,7 +8,7 @@ export default {
|
|
|
9
8
|
}
|
|
10
9
|
},
|
|
11
10
|
variant: {
|
|
12
|
-
required:
|
|
11
|
+
required: true,
|
|
13
12
|
defaultValue: "primary",
|
|
14
13
|
typeMetadata: {
|
|
15
14
|
schema: {
|
|
@@ -45,15 +44,6 @@ export default {
|
|
|
45
44
|
}
|
|
46
45
|
}
|
|
47
46
|
},
|
|
48
|
-
tooltip: {
|
|
49
|
-
required: false,
|
|
50
|
-
defaultValue: "",
|
|
51
|
-
typeMetadata: {
|
|
52
|
-
schema: {
|
|
53
|
-
type: "string"
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
47
|
opensNewTab: {
|
|
58
48
|
defaultValue: false,
|
|
59
49
|
typeMetadata: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
checked: {
|
|
3
|
-
required:
|
|
3
|
+
required: true,
|
|
4
4
|
defaultValue: false,
|
|
5
5
|
typeMetadata: {
|
|
6
6
|
schema: {
|
|
@@ -18,7 +18,7 @@ export default {
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
size: {
|
|
21
|
-
required:
|
|
21
|
+
required: true,
|
|
22
22
|
defaultValue: "medium",
|
|
23
23
|
typeMetadata: {
|
|
24
24
|
schema: {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { SortOrder } from "../../bc/zlist/Types";
|
|
2
|
+
import { filterConfigSchema } from "../../bc/zrecord/Schemas";
|
|
1
3
|
export const SdkContracts = {
|
|
2
4
|
getRecordInputMeta: {
|
|
3
5
|
type: 'object',
|
|
@@ -107,6 +109,13 @@ export const SdkContracts = {
|
|
|
107
109
|
},
|
|
108
110
|
required: ['recordsMap']
|
|
109
111
|
},
|
|
112
|
+
setFilterInputMeta: {
|
|
113
|
+
type: 'object',
|
|
114
|
+
properties: {
|
|
115
|
+
filterConfig: filterConfigSchema
|
|
116
|
+
},
|
|
117
|
+
required: ['filterConfig']
|
|
118
|
+
},
|
|
110
119
|
selectRecordsInputMeta: {
|
|
111
120
|
type: 'object',
|
|
112
121
|
properties: {
|
|
@@ -147,6 +156,18 @@ export const SdkContracts = {
|
|
|
147
156
|
},
|
|
148
157
|
required: ['ids']
|
|
149
158
|
},
|
|
159
|
+
setSortConfigInputMeta: {
|
|
160
|
+
type: 'object',
|
|
161
|
+
properties: {
|
|
162
|
+
fieldName: {
|
|
163
|
+
type: 'string'
|
|
164
|
+
},
|
|
165
|
+
order: {
|
|
166
|
+
type: 'string',
|
|
167
|
+
enum: [SortOrder.ASC, SortOrder.DES, SortOrder.NONE]
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
},
|
|
150
171
|
sortByInputMeta: {
|
|
151
172
|
type: 'object',
|
|
152
173
|
properties: {
|
|
@@ -5,5 +5,7 @@ export default {
|
|
|
5
5
|
SORTED: 'SMART_TABLE#SORTED',
|
|
6
6
|
ERROR_OCCURRED
|
|
7
7
|
};
|
|
8
|
+
export const SMART_TABLE_SORT_BY_REQUESTED = 'SMART_TABLE#SORT_BY_REQUESTED';
|
|
9
|
+
export const SMART_TABLE_SORTED = 'SMART_TABLE#SORTED';
|
|
8
10
|
export const SMART_TABLE_SELECTION_TOGGLED = 'SMART_TABLE#SELECTION_TOGGLED';
|
|
9
11
|
export const SMART_TABLE_ACTION_TRIGGERED = 'SMART_TABLE#ACTION_TRIGGERED';
|
|
@@ -7,7 +7,6 @@ class Constants {
|
|
|
7
7
|
static TABLE_LIST_SCROLLED = 'TABLE_LIST#SCROLLED';
|
|
8
8
|
static TABLE_LIST_TOGGLE_ITEM_SELECTION = 'TABLE_LIST#ITEM_SELECTED';
|
|
9
9
|
static TABLE_LIST_TOGGLE_ALL_SELECTION = 'TABLE_LIST#ALL_SELECT_TOGGLED';
|
|
10
|
-
static TABLE_LIST_SORTED = 'TABLE_LIST#SORTED';
|
|
11
10
|
static TABLE_LIST_FIELD_CLICKED = 'TABLE_LIST#FIELD_CLICKED';
|
|
12
11
|
static TABLE_LIST_FIELD_CHANGED = 'TABLE_LIST#FIELD_CHANGED';
|
|
13
12
|
static TABLE_LIST_ROW_CLICKED = 'TABLE_LIST#ROW_CLICKED';
|
|
@@ -2,6 +2,22 @@ import { Alignment, Width, SortedBy } from "./data-types/Header";
|
|
|
2
2
|
import RowCursor from "./data-types/RowCursor";
|
|
3
3
|
import SelectionConfigProperties from "../../bc/list-selection/Properties";
|
|
4
4
|
import { actionsSchema } from "../../platform/client-actions/cc/action-event-mediator/Properties";
|
|
5
|
+
import PropertiesConverter from "../component/properties/PropertiesConverter";
|
|
6
|
+
import BooleanProperties from "../fields/boolean/Properties";
|
|
7
|
+
import CurrencyProperties from "../fields/currency/Properties";
|
|
8
|
+
import DateProperties from "../fields/date/Properties";
|
|
9
|
+
import DatetimeProperties from "../fields/datetime/Properties";
|
|
10
|
+
import DecimalProperties from "../fields/decimal/Properties";
|
|
11
|
+
import EmailProperties from "../fields/email/Properties";
|
|
12
|
+
import LookupProperties from "../fields/lookup/Properties";
|
|
13
|
+
import MultiSelectProperties from "../fields/multi-select/Properties";
|
|
14
|
+
import NumberProperties from "../fields/number/Properties";
|
|
15
|
+
import PercentProperties from "../fields/percent/Properties";
|
|
16
|
+
import PhoneProperties from "../fields/phone/Properties";
|
|
17
|
+
import PickListProperties from "../fields/pick-list/Properties";
|
|
18
|
+
import TextProperties from "../fields/text/Properties";
|
|
19
|
+
import UrlProperties from "../fields/url/Properties";
|
|
20
|
+
import NameFieldProperties from "../fields/name/Properties";
|
|
5
21
|
const TableListProperties = {
|
|
6
22
|
isReOrderLoading: {
|
|
7
23
|
required: false,
|
|
@@ -51,9 +67,6 @@ const TableListProperties = {
|
|
|
51
67
|
},
|
|
52
68
|
name: {
|
|
53
69
|
type: 'string'
|
|
54
|
-
},
|
|
55
|
-
id: {
|
|
56
|
-
type: 'string'
|
|
57
70
|
}
|
|
58
71
|
}
|
|
59
72
|
}
|
|
@@ -187,6 +200,21 @@ const TableListProperties = {
|
|
|
187
200
|
},
|
|
188
201
|
required: ['id', 'name', 'text']
|
|
189
202
|
},
|
|
203
|
+
Column: {
|
|
204
|
+
anyOf: [PropertiesConverter.toJsonSchema(BooleanProperties), PropertiesConverter.toJsonSchema(CurrencyProperties), PropertiesConverter.toJsonSchema(DateProperties), PropertiesConverter.toJsonSchema(DatetimeProperties), PropertiesConverter.toJsonSchema(DecimalProperties), PropertiesConverter.toJsonSchema(EmailProperties), PropertiesConverter.toJsonSchema(LookupProperties), PropertiesConverter.toJsonSchema(MultiSelectProperties), PropertiesConverter.toJsonSchema(NumberProperties), PropertiesConverter.toJsonSchema(PercentProperties), PropertiesConverter.toJsonSchema(PhoneProperties), PropertiesConverter.toJsonSchema(PickListProperties), PropertiesConverter.toJsonSchema(TextProperties), PropertiesConverter.toJsonSchema(UrlProperties), PropertiesConverter.toJsonSchema(NameFieldProperties), // Below field is for the empty cell
|
|
205
|
+
{
|
|
206
|
+
type: 'object',
|
|
207
|
+
properties: {
|
|
208
|
+
type: {
|
|
209
|
+
type: 'string'
|
|
210
|
+
},
|
|
211
|
+
value: {
|
|
212
|
+
type: 'string'
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
required: ['type', 'value']
|
|
216
|
+
}]
|
|
217
|
+
},
|
|
190
218
|
ActionLocation: {
|
|
191
219
|
renderComponentType: 'object',
|
|
192
220
|
properties: {
|
|
@@ -217,7 +245,10 @@ const TableListProperties = {
|
|
|
217
245
|
type: 'string'
|
|
218
246
|
},
|
|
219
247
|
columns: {
|
|
220
|
-
type: 'array'
|
|
248
|
+
type: 'array',
|
|
249
|
+
items: {
|
|
250
|
+
$ref: '#/definitions/Column'
|
|
251
|
+
}
|
|
221
252
|
},
|
|
222
253
|
rowActionLocation: {
|
|
223
254
|
$ref: '#/definitions/ActionLocation'
|
package/es/cc/tags/Data.js
CHANGED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
function TagModel(_ref) {
|
|
2
|
+
let {
|
|
3
|
+
id,
|
|
4
|
+
label,
|
|
5
|
+
color,
|
|
6
|
+
imageSrc,
|
|
7
|
+
imageAltText,
|
|
8
|
+
iconName,
|
|
9
|
+
disabled,
|
|
10
|
+
size,
|
|
11
|
+
tooltip
|
|
12
|
+
} = _ref;
|
|
13
|
+
return {
|
|
14
|
+
id,
|
|
15
|
+
label,
|
|
16
|
+
color,
|
|
17
|
+
imageSrc,
|
|
18
|
+
imageAltText,
|
|
19
|
+
iconName,
|
|
20
|
+
disabled,
|
|
21
|
+
size,
|
|
22
|
+
tooltip
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default TagModel;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React, { useState, useRef, useEffect, forwardRef } from 'react';
|
|
2
|
+
import DependencyFactory from "./DependencyFactory";
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
|
|
5
|
+
function Component(props) {
|
|
6
|
+
const [state, setState] = useState(null);
|
|
7
|
+
const elementRef = useRef(null);
|
|
8
|
+
const {
|
|
9
|
+
controller,
|
|
10
|
+
presenter,
|
|
11
|
+
eventManager
|
|
12
|
+
} = DependencyFactory.create({
|
|
13
|
+
updateState: newState => {
|
|
14
|
+
// Hack initial render
|
|
15
|
+
if (state == null) {
|
|
16
|
+
setState(newState);
|
|
17
|
+
} else {
|
|
18
|
+
setState(() => newState);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
const helpers = {
|
|
23
|
+
updateState: controller.updateState.bind(controller),
|
|
24
|
+
updateProperties: controller.updateProperties.bind(controller),
|
|
25
|
+
dispatch: controller.dispatch.bind(controller)
|
|
26
|
+
};
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
controller.initialize({ ...input,
|
|
29
|
+
newProps: props,
|
|
30
|
+
helpers
|
|
31
|
+
});
|
|
32
|
+
eventManager.name = input.name;
|
|
33
|
+
controller.mount();
|
|
34
|
+
return () => {
|
|
35
|
+
controller.unmount();
|
|
36
|
+
};
|
|
37
|
+
}, []);
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
controller.updateProperties(props);
|
|
40
|
+
}, [props]);
|
|
41
|
+
const View = /*#__PURE__*/forwardRef(input.View);
|
|
42
|
+
|
|
43
|
+
if (state?.error) {
|
|
44
|
+
console.log(state.error);
|
|
45
|
+
return /*#__PURE__*/React.createElement("div", null, "error");
|
|
46
|
+
} else {
|
|
47
|
+
return /*#__PURE__*/React.createElement(View, {
|
|
48
|
+
ref: eventManager.setElement.bind(eventManager),
|
|
49
|
+
helpers: helpers,
|
|
50
|
+
state: state
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
;
|
|
56
|
+
export default Component;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
export { default as SelectItemController } from "./SelectItemController";
|
|
2
2
|
export { default as SelectAllController } from "./SelectAllController";
|
|
3
3
|
export { default as ScrollController } from "./ScrollController";
|
|
4
|
-
export { default as SortByController } from "./SortByController";
|
|
5
|
-
export { default as SortedController } from "./SortedController";
|
|
6
4
|
export { default as FieldChangeController } from "./FieldChangeController";
|
|
7
5
|
export { default as FieldClickController } from "./FieldClickController";
|
|
8
6
|
export { default as KeyboardRowSelectController } from "./KeyboardRowSelectController";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TableListConstants } from "../../../../../../cc/table-list";
|
|
2
|
-
import { SelectItemController, SelectAllController, ScrollController, FieldChangeController, FieldClickController,
|
|
2
|
+
import { SelectItemController, SelectAllController, ScrollController, FieldChangeController, FieldClickController, KeyboardRowSelectController, KeyboardRowClickController, ResolutionBasedCountController } from "../../adapters/controllers";
|
|
3
3
|
import TableRowConstants from "../../../../../../cc/table-list/row/Constants";
|
|
4
4
|
import RowClickController from "../../adapters/controllers/RowClickController";
|
|
5
5
|
import { SMART_TABLE_ACTION_TRIGGERED, SMART_TABLE_SELECTION_TOGGLED } from "../../../../../../cc/table-connected/constants/Events";
|
|
@@ -14,7 +14,6 @@ class EventHandlersFactory {
|
|
|
14
14
|
[TableListConstants.TABLE_LIST_TOGGLE_ITEM_SELECTION]: new SelectItemController().handle,
|
|
15
15
|
[TableListConstants.TABLE_LIST_TOGGLE_ALL_SELECTION]: new SelectAllController().handle,
|
|
16
16
|
[TableListConstants.TABLE_LIST_SCROLLED]: new ScrollController().handle,
|
|
17
|
-
[TableListConstants.TABLE_LIST_SORTED]: new SortByController().handle,
|
|
18
17
|
[TableRowConstants.TABLE_ROW_FIELD_CHANGED]: new FieldChangeController().handle,
|
|
19
18
|
[TableRowConstants.TABLE_ROW_FIELD_CLICKED]: new FieldClickController().handle
|
|
20
19
|
};
|
|
@@ -10,8 +10,6 @@ import TableRowProperties from "../../../../../../../../cc/table-list/row/Proper
|
|
|
10
10
|
import TableRowConstants from "../../../../../../../../cc/table-list/row/Constants";
|
|
11
11
|
import { SortableHandle } from 'react-sortable-hoc'; // @ts-ignore
|
|
12
12
|
|
|
13
|
-
import arrowStyle from '@zohodesk/components/es/shared/ArrowIcon/ArrowIcon.module.css'; // @ts-ignore
|
|
14
|
-
|
|
15
13
|
import style from "../../css/TableList.module.css";
|
|
16
14
|
|
|
17
15
|
function RowView(_ref, ref) {
|
|
@@ -65,7 +63,7 @@ function RowView(_ref, ref) {
|
|
|
65
63
|
}
|
|
66
64
|
}),
|
|
67
65
|
customStyle: {
|
|
68
|
-
tableList:
|
|
66
|
+
tableList: style.row,
|
|
69
67
|
$pointer: style[`rowCursor_${cursor}`]
|
|
70
68
|
}
|
|
71
69
|
}, renderReorderer({
|
|
@@ -13,8 +13,7 @@ function EmailView(_ref, ref) {
|
|
|
13
13
|
let {
|
|
14
14
|
email,
|
|
15
15
|
isDotted,
|
|
16
|
-
weight
|
|
17
|
-
tooltip
|
|
16
|
+
weight
|
|
18
17
|
} = state.properties;
|
|
19
18
|
return /*#__PURE__*/React.createElement(TableEmail, {
|
|
20
19
|
$method_getRef: ref,
|
|
@@ -28,8 +27,7 @@ function EmailView(_ref, ref) {
|
|
|
28
27
|
}
|
|
29
28
|
});
|
|
30
29
|
},
|
|
31
|
-
$data_email: email
|
|
32
|
-
$i18n_tooltip: tooltip
|
|
30
|
+
$data_email: email
|
|
33
31
|
});
|
|
34
32
|
}
|
|
35
33
|
|
package/es/library/dot/legacy-to-new-arch/highlighted-value/frameworks/ui/HighlightedValueView.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import StatusBox from "@zohodesk-private/desk-components/es/table/StatusBox/StatusBox";
|
|
3
|
-
import HighlightedValueConstants from "../../../../../../cc
|
|
4
|
-
|
|
3
|
+
import { HighlightedValueConstants } from "../../../../../../cc";
|
|
5
4
|
import style from "./css/HighlightedValue.module.css";
|
|
6
5
|
|
|
7
6
|
function HighlightedValueView(_ref, ref) {
|
|
@@ -16,8 +15,6 @@ function HighlightedValueView(_ref, ref) {
|
|
|
16
15
|
text,
|
|
17
16
|
color,
|
|
18
17
|
tooltip,
|
|
19
|
-
weight,
|
|
20
|
-
isDotted,
|
|
21
18
|
cursor
|
|
22
19
|
} = state.properties;
|
|
23
20
|
return /*#__PURE__*/React.createElement(StatusBox, {
|
|
@@ -26,8 +23,6 @@ function HighlightedValueView(_ref, ref) {
|
|
|
26
23
|
},
|
|
27
24
|
$ui_color: color,
|
|
28
25
|
$i18n_text: text,
|
|
29
|
-
$ui_weight: weight,
|
|
30
|
-
$flag_wrapText: !isDotted,
|
|
31
26
|
$i18n_tooltip: tooltip,
|
|
32
27
|
customStyle: {
|
|
33
28
|
pointer: cursor === "default" && style.default
|