@genesislcap/pbc-notify-ui 1.0.30 → 1.0.32
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/dist/dts/components/foundation-inbox/components/foundation-inbox-counter/foundation-inbox-counter.d.ts.map +1 -1
- package/dist/dts/components/foundation-inbox/inbox-base/inbox-base.d.ts +9 -9
- package/dist/dts/components/foundation-inbox/inbox-base/inbox-base.d.ts.map +1 -1
- package/dist/dts/components/foundation-inbox/inbox.template.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-condition-builder/rule-condition-builder.d.ts +12 -11
- package/dist/dts/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-condition-builder/rule-condition-builder.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-condition-builder/rule-condition-builder.template.d.ts +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-condition-builder/rule-condition-builder.template.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-condition-builder/rule-condition-builder.types.d.ts +4 -12
- package/dist/dts/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-condition-builder/rule-condition-builder.types.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-dialog.d.ts +14 -9
- package/dist/dts/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-dialog.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-dialog.template.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-dialog.types.d.ts +1 -6
- package/dist/dts/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-dialog.types.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/rules/rule-management.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/templates/template-dialog/template-condition-builder/template-condition-builder.d.ts +29 -0
- package/dist/dts/components/foundation-notification-dashboard/components/templates/template-dialog/template-condition-builder/template-condition-builder.d.ts.map +1 -0
- package/dist/dts/components/foundation-notification-dashboard/components/templates/template-dialog/template-condition-builder/template-condition-builder.template.d.ts +3 -0
- package/dist/dts/components/foundation-notification-dashboard/components/templates/template-dialog/template-condition-builder/template-condition-builder.template.d.ts.map +1 -0
- package/dist/dts/components/foundation-notification-dashboard/components/templates/template-dialog/template-dialog.d.ts +13 -7
- package/dist/dts/components/foundation-notification-dashboard/components/templates/template-dialog/template-dialog.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/templates/template-dialog/template-dialog.template.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/templates/template-dialog/template-dialog.types.d.ts +1 -8
- package/dist/dts/components/foundation-notification-dashboard/components/templates/template-dialog/template-dialog.types.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/templates/template-management.d.ts.map +1 -1
- package/dist/dts/components/foundation-notification-dashboard/notification-dashboard.utils.d.ts +42 -0
- package/dist/dts/components/foundation-notification-dashboard/notification-dashboard.utils.d.ts.map +1 -0
- package/dist/dts/components/foundation-notification-dashboard/styles/condition-builder.styles.d.ts.map +1 -0
- package/dist/dts/components/foundation-notification-dashboard/styles/dynamic-rule.styles.d.ts +3 -0
- package/dist/dts/components/foundation-notification-dashboard/styles/dynamic-rule.styles.d.ts.map +1 -0
- package/dist/dts/components/foundation-notification-dashboard/types/logical-operator.d.ts +4 -0
- package/dist/dts/components/foundation-notification-dashboard/types/logical-operator.d.ts.map +1 -1
- package/dist/dts/notify.types.d.ts +60 -0
- package/dist/dts/notify.types.d.ts.map +1 -0
- package/dist/dts/services/inbox.service.d.ts.map +1 -1
- package/dist/esm/components/components.js +2 -2
- package/dist/esm/components/foundation-inbox/components/foundation-inbox-counter/foundation-inbox-counter.js +3 -3
- package/dist/esm/components/foundation-inbox/inbox-base/inbox-base.js +10 -12
- package/dist/esm/components/foundation-inbox/inbox.template.js +1 -2
- package/dist/esm/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-condition-builder/rule-condition-builder.js +84 -60
- package/dist/esm/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-condition-builder/rule-condition-builder.template.js +42 -28
- package/dist/esm/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-condition-builder/rule-condition-builder.types.js +5 -4
- package/dist/esm/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-dialog.js +99 -101
- package/dist/esm/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-dialog.template.js +30 -30
- package/dist/esm/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-dialog.types.js +0 -7
- package/dist/esm/components/foundation-notification-dashboard/components/rules/rule-management.js +3 -5
- package/dist/esm/components/foundation-notification-dashboard/components/templates/template-dialog/template-condition-builder/template-condition-builder.js +169 -0
- package/dist/esm/components/foundation-notification-dashboard/components/templates/template-dialog/template-condition-builder/template-condition-builder.template.js +66 -0
- package/dist/esm/components/foundation-notification-dashboard/components/templates/template-dialog/template-dialog.js +106 -116
- package/dist/esm/components/foundation-notification-dashboard/components/templates/template-dialog/template-dialog.template.js +27 -31
- package/dist/esm/components/foundation-notification-dashboard/components/templates/template-management.js +3 -5
- package/dist/esm/components/foundation-notification-dashboard/notification-dashboard.utils.js +259 -0
- package/dist/esm/components/foundation-notification-dashboard/{components/templates/template-dialog/condition-builder → styles}/condition-builder.styles.js +6 -6
- package/dist/esm/components/foundation-notification-dashboard/{components/templates/template-dialog/template-dialog.styles.js → styles/dynamic-rule.styles.js} +57 -16
- package/dist/esm/components/foundation-notification-dashboard/types/logical-operator.js +4 -0
- package/dist/esm/notify.types.js +70 -0
- package/dist/esm/services/inbox.service.js +1 -5
- package/package.json +1 -1
- package/dist/dts/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-condition-builder/rule-condition-builder.styles.d.ts +0 -2
- package/dist/dts/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-condition-builder/rule-condition-builder.styles.d.ts.map +0 -1
- package/dist/dts/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-dialog.styles.d.ts +0 -2
- package/dist/dts/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-dialog.styles.d.ts.map +0 -1
- package/dist/dts/components/foundation-notification-dashboard/components/templates/template-dialog/condition-builder/condition-builder.d.ts +0 -32
- package/dist/dts/components/foundation-notification-dashboard/components/templates/template-dialog/condition-builder/condition-builder.d.ts.map +0 -1
- package/dist/dts/components/foundation-notification-dashboard/components/templates/template-dialog/condition-builder/condition-builder.styles.d.ts.map +0 -1
- package/dist/dts/components/foundation-notification-dashboard/components/templates/template-dialog/condition-builder/condition-builder.template.d.ts +0 -3
- package/dist/dts/components/foundation-notification-dashboard/components/templates/template-dialog/condition-builder/condition-builder.template.d.ts.map +0 -1
- package/dist/dts/components/foundation-notification-dashboard/components/templates/template-dialog/template-dialog.styles.d.ts +0 -2
- package/dist/dts/components/foundation-notification-dashboard/components/templates/template-dialog/template-dialog.styles.d.ts.map +0 -1
- package/dist/dts/components/foundation-notification-dashboard/components/templates/template-dialog/template-dialog.utils.d.ts +0 -41
- package/dist/dts/components/foundation-notification-dashboard/components/templates/template-dialog/template-dialog.utils.d.ts.map +0 -1
- package/dist/dts/components/foundation-notification-dashboard/styles/rules-and-templates.styles.d.ts +0 -2
- package/dist/dts/components/foundation-notification-dashboard/styles/rules-and-templates.styles.d.ts.map +0 -1
- package/dist/esm/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-condition-builder/rule-condition-builder.styles.js +0 -53
- package/dist/esm/components/foundation-notification-dashboard/components/rules/rule-dialog/rule-dialog.styles.js +0 -95
- package/dist/esm/components/foundation-notification-dashboard/components/templates/template-dialog/condition-builder/condition-builder.js +0 -179
- package/dist/esm/components/foundation-notification-dashboard/components/templates/template-dialog/condition-builder/condition-builder.template.js +0 -42
- package/dist/esm/components/foundation-notification-dashboard/components/templates/template-dialog/template-dialog.utils.js +0 -119
- package/dist/esm/components/foundation-notification-dashboard/styles/rules-and-templates.styles.js +0 -17
- /package/dist/dts/components/foundation-notification-dashboard/{components/templates/template-dialog/condition-builder → styles}/condition-builder.styles.d.ts +0 -0
|
@@ -1,29 +1,23 @@
|
|
|
1
1
|
import { sync } from '@genesislcap/foundation-utils';
|
|
2
2
|
import { html, ref, repeat } from '@microsoft/fast-element';
|
|
3
|
+
import { Severity, UpdateType } from '../../../../../notify.types';
|
|
3
4
|
import { eventDetail } from '../../../../../utils/eventDetail';
|
|
4
|
-
import { ALL_SEVERITIES } from '../../../types/severity';
|
|
5
|
-
import { UpdateType } from './rule-dialog.types';
|
|
6
5
|
export const RuleDialogTemplate = html `
|
|
7
|
-
<zero-modal ${ref('dialog')} class="
|
|
8
|
-
<div slot="top" class="
|
|
6
|
+
<zero-modal ${ref('dialog')} class="dialog" :onCloseCallback=${(x) => () => x.close()}>
|
|
7
|
+
<div slot="top" class="dialog-top">${(x) => x.ruleDialogTitle}</div>
|
|
9
8
|
|
|
10
|
-
<div class="
|
|
9
|
+
<div class="dialog-content">
|
|
11
10
|
<div class="content-row">
|
|
12
11
|
<div class="control">
|
|
13
|
-
<
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
autofocus
|
|
17
|
-
autocomplete="off"
|
|
18
|
-
></zero-text-field>
|
|
12
|
+
<zero-text-field :value=${sync((x) => x.name)} autofocus autocomplete="off" required>
|
|
13
|
+
Name
|
|
14
|
+
</zero-text-field>
|
|
19
15
|
</div>
|
|
20
16
|
|
|
21
17
|
<div class="control">
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
autocomplete="off"
|
|
26
|
-
></zero-text-field>
|
|
18
|
+
<zero-text-field :value=${sync((x) => x.description)} autocomplete="off" required>
|
|
19
|
+
Description
|
|
20
|
+
</zero-text-field>
|
|
27
21
|
</div>
|
|
28
22
|
</div>
|
|
29
23
|
|
|
@@ -53,10 +47,11 @@ export const RuleDialogTemplate = html `
|
|
|
53
47
|
value-field="value"
|
|
54
48
|
label-field="value"
|
|
55
49
|
option-element="zero-option"
|
|
56
|
-
:data=${(_) =>
|
|
50
|
+
:data=${(_) => Object.values(Severity).map((value) => ({ value }))}
|
|
57
51
|
></options-datasource>
|
|
58
52
|
</zero-select>
|
|
59
53
|
</div>
|
|
54
|
+
|
|
60
55
|
<div class="control">
|
|
61
56
|
<label>Update Type</label>
|
|
62
57
|
<zero-multiselect
|
|
@@ -78,23 +73,25 @@ export const RuleDialogTemplate = html `
|
|
|
78
73
|
|
|
79
74
|
<div class="content-row">
|
|
80
75
|
<div class="control">
|
|
81
|
-
<
|
|
82
|
-
|
|
76
|
+
<zero-text-field required :value=${sync((x) => x.header)} autocomplete="off">
|
|
77
|
+
Header
|
|
78
|
+
</zero-text-field>
|
|
83
79
|
</div>
|
|
84
80
|
|
|
85
81
|
<div class="control">
|
|
86
|
-
<
|
|
87
|
-
|
|
82
|
+
<zero-text-field required :value=${sync((x) => x.message)} autocomplete="off">
|
|
83
|
+
Message
|
|
84
|
+
</zero-text-field>
|
|
88
85
|
</div>
|
|
89
86
|
</div>
|
|
90
87
|
|
|
91
88
|
<div class="control">
|
|
92
89
|
<label>Condition(s)</label>
|
|
93
|
-
<div class="
|
|
94
|
-
<div class="content-row
|
|
90
|
+
<div class="items">
|
|
91
|
+
<div class="content-row item">
|
|
95
92
|
${repeat((x) => x.conditions, html `
|
|
96
93
|
<rule-condition-builder
|
|
97
|
-
:
|
|
94
|
+
:fields=${(x, c) => c.parent.fields}
|
|
98
95
|
:condition=${(x) => x}
|
|
99
96
|
@edit=${(x, c) => c.parent.editCondition(eventDetail(c))}
|
|
100
97
|
@delete=${(x, c) => c.parent.deleteCondition(eventDetail(c))}
|
|
@@ -103,17 +100,20 @@ export const RuleDialogTemplate = html `
|
|
|
103
100
|
</div>
|
|
104
101
|
|
|
105
102
|
<div class="content-row">
|
|
106
|
-
<zero-button @click=${(x) => x.newCondition()}>
|
|
107
|
-
<zero-icon name="plus"></zero-icon>
|
|
108
|
-
Condition
|
|
109
|
-
</zero-button>
|
|
103
|
+
<zero-button @click=${(x) => x.newCondition()}>+ Condition</zero-button>
|
|
110
104
|
</div>
|
|
111
105
|
</div>
|
|
112
106
|
</div>
|
|
113
107
|
</div>
|
|
114
108
|
|
|
115
|
-
<div slot="bottom" class="
|
|
116
|
-
<zero-button
|
|
109
|
+
<div slot="bottom" class="dialog-bottom">
|
|
110
|
+
<zero-button
|
|
111
|
+
appearance="accent"
|
|
112
|
+
@click=${(x) => x.submit()}
|
|
113
|
+
?disabled=${(x) => x.validateRequiredFields}
|
|
114
|
+
>
|
|
115
|
+
Submit
|
|
116
|
+
</zero-button>
|
|
117
117
|
</div>
|
|
118
118
|
</zero-modal>
|
|
119
119
|
`;
|
|
@@ -2,10 +2,3 @@ export const RuleDialogMode = {
|
|
|
2
2
|
CREATE: 'create',
|
|
3
3
|
EDIT: 'edit',
|
|
4
4
|
};
|
|
5
|
-
export var UpdateType;
|
|
6
|
-
(function (UpdateType) {
|
|
7
|
-
UpdateType["INSERT"] = "INSERT";
|
|
8
|
-
UpdateType["MODIFY"] = "MODIFY";
|
|
9
|
-
UpdateType["DELETE"] = "DELETE";
|
|
10
|
-
})(UpdateType || (UpdateType = {}));
|
|
11
|
-
export const defaultUpdateType = [UpdateType.INSERT];
|
package/dist/esm/components/foundation-notification-dashboard/components/rules/rule-management.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __awaiter, __decorate } from "tslib";
|
|
2
2
|
import { showNotificationDialog } from '@genesislcap/foundation-notifications';
|
|
3
|
-
import {
|
|
3
|
+
import { customElement, FASTElement, html, ref, repeat } from '@microsoft/fast-element';
|
|
4
4
|
import { RuleService } from '../../../../services/rule.service';
|
|
5
|
-
import {
|
|
5
|
+
import { DynamicRuleManagementStyles } from '../../styles/dynamic-rule.styles';
|
|
6
6
|
import { RULE_MANAGEMENT_COLUMNS } from './columns';
|
|
7
7
|
import { RuleDialogMode } from './rule-dialog/rule-dialog.types';
|
|
8
8
|
let RuleManagement = class RuleManagement extends FASTElement {
|
|
@@ -62,9 +62,7 @@ RuleManagement = __decorate([
|
|
|
62
62
|
|
|
63
63
|
<rule-dialog ${ref('ruleDialog')}></rule-dialog>
|
|
64
64
|
`,
|
|
65
|
-
styles:
|
|
66
|
-
${rulesAndTemplatesStyles}
|
|
67
|
-
`,
|
|
65
|
+
styles: DynamicRuleManagementStyles,
|
|
68
66
|
})
|
|
69
67
|
], RuleManagement);
|
|
70
68
|
export { RuleManagement };
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { __awaiter, __decorate } from "tslib";
|
|
2
|
+
import { FASTElement, attr, customElement, observable } from '@microsoft/fast-element';
|
|
3
|
+
import { LogicalOperator, RightCriteria, nullAndBlankLogicalOperatorValues, } from '../../../../../../notify.types';
|
|
4
|
+
import { logger } from '../../../../../../utils';
|
|
5
|
+
import { ConditionBuilderStyles } from '../../../../styles/condition-builder.styles';
|
|
6
|
+
import { TemplateConditionBuilderTemplate } from './template-condition-builder.template';
|
|
7
|
+
let TemplateConditionBuilder = class TemplateConditionBuilder extends FASTElement {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.leftValueItems = [];
|
|
11
|
+
this.rightCriteria = RightCriteria.VALUE;
|
|
12
|
+
this.rightValueItems = [];
|
|
13
|
+
// #endregion
|
|
14
|
+
}
|
|
15
|
+
deleteCondition() {
|
|
16
|
+
this.$emit('delete', this.condition);
|
|
17
|
+
}
|
|
18
|
+
conditionChanged() {
|
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
if (this.fields) {
|
|
21
|
+
this.leftValueItems = this.fields;
|
|
22
|
+
}
|
|
23
|
+
this.assignLeftValue();
|
|
24
|
+
this.logicalOperator = this.condition.LOGICAL_OPERATOR;
|
|
25
|
+
const rightValue = this.condition.RIGHT_VALUE;
|
|
26
|
+
this.rightCriteria = this.condition.RIGHT_CRITERIA;
|
|
27
|
+
this.condition.RIGHT_VALUE = rightValue;
|
|
28
|
+
this.assignRightValue();
|
|
29
|
+
this.$emit('edit', this.condition);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
parametersChanged() {
|
|
33
|
+
if (!Array.isArray(this.parameters) || !this.parameters) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
this.rightValueItems = this.parameters;
|
|
37
|
+
}
|
|
38
|
+
fieldsChanged() {
|
|
39
|
+
if (!Array.isArray(this.fields) || !this.fields.length) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
this.leftValueItems = this.fields;
|
|
43
|
+
this.leftValue = JSON.stringify(this.leftValueItems[0]);
|
|
44
|
+
}
|
|
45
|
+
logicalOperatorChanged() {
|
|
46
|
+
if (!this.condition) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
if (nullAndBlankLogicalOperatorValues.includes(LogicalOperator[this.logicalOperator])) {
|
|
50
|
+
this.rightCriteria = RightCriteria.VALUE;
|
|
51
|
+
this.clearRightValueText();
|
|
52
|
+
}
|
|
53
|
+
this.condition.LOGICAL_OPERATOR = this.logicalOperator;
|
|
54
|
+
this.$emit('edit', this.condition);
|
|
55
|
+
}
|
|
56
|
+
// #region LeftValue
|
|
57
|
+
assignLeftValue() {
|
|
58
|
+
// Add (fresh new; assign the 1st element)
|
|
59
|
+
if (!this.condition.LEFT_VALUE) {
|
|
60
|
+
this.leftValue = JSON.stringify(this.leftValueItems[0]);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
// Add (value changed)
|
|
64
|
+
if (typeof this.condition.LEFT_VALUE !== 'string') {
|
|
65
|
+
this.leftValue = JSON.stringify(this.condition.LEFT_VALUE);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
// Edit
|
|
69
|
+
this.leftValue = JSON.stringify(this.leftValueItems.find((item) => item.FIELD_NAME === this.condition.LEFT_VALUE));
|
|
70
|
+
}
|
|
71
|
+
leftValueChanged() {
|
|
72
|
+
if (!this.condition) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
this.condition.LEFT_VALUE = JSON.parse(this.leftValue);
|
|
76
|
+
this.$emit('edit', this.condition);
|
|
77
|
+
}
|
|
78
|
+
// #endregion
|
|
79
|
+
// #region RightValue
|
|
80
|
+
assignRightValue() {
|
|
81
|
+
var _a;
|
|
82
|
+
if (this.condition.RIGHT_CRITERIA === RightCriteria.VALUE) {
|
|
83
|
+
this.rightValueText = this.condition.RIGHT_VALUE;
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
if (((_a = this.parameters) === null || _a === void 0 ? void 0 : _a.length) > 0) {
|
|
87
|
+
this.rightValueSelect = this.condition.RIGHT_VALUE;
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
this.rightValueSelect = null;
|
|
91
|
+
}
|
|
92
|
+
rightCriteriaChanged() {
|
|
93
|
+
if (!this.condition) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
this.condition.RIGHT_CRITERIA = this.rightCriteria;
|
|
97
|
+
switch (this.rightCriteria) {
|
|
98
|
+
case RightCriteria.VALUE:
|
|
99
|
+
this.clearRightValueText();
|
|
100
|
+
break;
|
|
101
|
+
case RightCriteria.USER_ENTRY:
|
|
102
|
+
this.clearRightValueSelect();
|
|
103
|
+
break;
|
|
104
|
+
default:
|
|
105
|
+
logger.error(`Unknown RightCriteria: ${this.rightCriteria}`);
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
this.$emit('edit', this.condition);
|
|
109
|
+
}
|
|
110
|
+
clearRightValueText() {
|
|
111
|
+
this.rightValueText = '';
|
|
112
|
+
}
|
|
113
|
+
clearRightValueSelect() {
|
|
114
|
+
var _a;
|
|
115
|
+
this.rightValueSelect = ((_a = this.parameters) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this.parameters[0].UUID : null;
|
|
116
|
+
}
|
|
117
|
+
rightValueTextChanged() {
|
|
118
|
+
if (!this.condition) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
this.condition.RIGHT_VALUE = this.rightValueText;
|
|
122
|
+
this.$emit('edit', this.condition);
|
|
123
|
+
}
|
|
124
|
+
rightValueSelectChanged() {
|
|
125
|
+
if (!this.condition) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
this.condition.RIGHT_VALUE = this.rightValueSelect;
|
|
129
|
+
this.$emit('edit', this.condition);
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
__decorate([
|
|
133
|
+
attr
|
|
134
|
+
], TemplateConditionBuilder.prototype, "condition", void 0);
|
|
135
|
+
__decorate([
|
|
136
|
+
attr
|
|
137
|
+
], TemplateConditionBuilder.prototype, "parameters", void 0);
|
|
138
|
+
__decorate([
|
|
139
|
+
attr
|
|
140
|
+
], TemplateConditionBuilder.prototype, "fields", void 0);
|
|
141
|
+
__decorate([
|
|
142
|
+
observable
|
|
143
|
+
], TemplateConditionBuilder.prototype, "leftValue", void 0);
|
|
144
|
+
__decorate([
|
|
145
|
+
observable
|
|
146
|
+
], TemplateConditionBuilder.prototype, "leftValueItems", void 0);
|
|
147
|
+
__decorate([
|
|
148
|
+
observable
|
|
149
|
+
], TemplateConditionBuilder.prototype, "logicalOperator", void 0);
|
|
150
|
+
__decorate([
|
|
151
|
+
observable
|
|
152
|
+
], TemplateConditionBuilder.prototype, "rightCriteria", void 0);
|
|
153
|
+
__decorate([
|
|
154
|
+
observable
|
|
155
|
+
], TemplateConditionBuilder.prototype, "rightValueText", void 0);
|
|
156
|
+
__decorate([
|
|
157
|
+
observable
|
|
158
|
+
], TemplateConditionBuilder.prototype, "rightValueSelect", void 0);
|
|
159
|
+
__decorate([
|
|
160
|
+
observable
|
|
161
|
+
], TemplateConditionBuilder.prototype, "rightValueItems", void 0);
|
|
162
|
+
TemplateConditionBuilder = __decorate([
|
|
163
|
+
customElement({
|
|
164
|
+
name: 'template-condition-builder',
|
|
165
|
+
template: TemplateConditionBuilderTemplate,
|
|
166
|
+
styles: ConditionBuilderStyles,
|
|
167
|
+
})
|
|
168
|
+
], TemplateConditionBuilder);
|
|
169
|
+
export { TemplateConditionBuilder };
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { sync } from '@genesislcap/foundation-utils';
|
|
2
|
+
import { html, repeat, when } from '@microsoft/fast-element';
|
|
3
|
+
import { classNames } from '@microsoft/fast-web-utilities';
|
|
4
|
+
import { LogicalOperator, RightCriteria, nullAndBlankLogicalOperatorValues, } from '../../../../../../notify.types';
|
|
5
|
+
export const TemplateConditionBuilderTemplate = html `
|
|
6
|
+
<div class="condition-builder">
|
|
7
|
+
<zero-select
|
|
8
|
+
:value=${sync((x) => x.leftValue)}
|
|
9
|
+
:initialValue=${sync((x) => x.leftValue)}
|
|
10
|
+
class="left-value"
|
|
11
|
+
>
|
|
12
|
+
${repeat((x) => x.leftValueItems, html `
|
|
13
|
+
<zero-option value=${(x) => JSON.stringify(x)}>${(x) => x.FIELD_NAME}</zero-option>
|
|
14
|
+
`)}
|
|
15
|
+
</zero-select>
|
|
16
|
+
|
|
17
|
+
<zero-select
|
|
18
|
+
class="logical-operator${(x) => classNames([
|
|
19
|
+
'-null-and-blank',
|
|
20
|
+
nullAndBlankLogicalOperatorValues.includes(LogicalOperator[x.logicalOperator]),
|
|
21
|
+
])}"
|
|
22
|
+
:value=${sync((x) => x.logicalOperator)}
|
|
23
|
+
>
|
|
24
|
+
${repeat((_) => Object.values(LogicalOperator), html `
|
|
25
|
+
<zero-option value=${(x) => x}>${(x) => x}</zero-option>
|
|
26
|
+
`)}
|
|
27
|
+
</zero-select>
|
|
28
|
+
|
|
29
|
+
${when((x) => !nullAndBlankLogicalOperatorValues.includes(LogicalOperator[x.logicalOperator]), html `
|
|
30
|
+
<zero-select class="right-criteria" :value=${sync((x) => x.rightCriteria)}>
|
|
31
|
+
${repeat((_) => Object.values(RightCriteria), html `
|
|
32
|
+
<zero-option value=${(x) => x}>${(x) => x}</zero-option>
|
|
33
|
+
`)}
|
|
34
|
+
</zero-select>
|
|
35
|
+
|
|
36
|
+
${when((x) => x.rightCriteria === RightCriteria.VALUE, html `
|
|
37
|
+
<zero-text-field
|
|
38
|
+
class="right-criteria-text"
|
|
39
|
+
:value=${sync((x) => x.rightValueText)}
|
|
40
|
+
placeholder="Value"
|
|
41
|
+
autocomplete="off"
|
|
42
|
+
></zero-text-field>
|
|
43
|
+
`)}
|
|
44
|
+
${when((x) => x.rightCriteria === RightCriteria.USER_ENTRY, html `
|
|
45
|
+
<zero-select class="right-criteria-select" :value=${sync((x) => x.rightValueSelect)}>
|
|
46
|
+
${(x) => rightValueItemsOptions(x.rightValueItems)}
|
|
47
|
+
</zero-select>
|
|
48
|
+
`)}
|
|
49
|
+
`)}
|
|
50
|
+
|
|
51
|
+
<zero-button appearance="icon" class="delete" @click=${(x) => x.deleteCondition()}>
|
|
52
|
+
<zero-icon
|
|
53
|
+
style="opacity: 0.5"
|
|
54
|
+
variant="regular"
|
|
55
|
+
name="trash-alt"
|
|
56
|
+
size="lg"
|
|
57
|
+
part="icon"
|
|
58
|
+
></zero-icon>
|
|
59
|
+
</zero-button>
|
|
60
|
+
</div>
|
|
61
|
+
`;
|
|
62
|
+
const rightValueItemsOptions = (rightValueItems) => html `
|
|
63
|
+
${repeat((x) => rightValueItems, html `
|
|
64
|
+
<zero-option value="${(x) => { var _a; return (_a = x.UUID) !== null && _a !== void 0 ? _a : ''; }}">${(x) => { var _a; return (_a = x.PARAM_NAME) !== null && _a !== void 0 ? _a : ''; }}</zero-option>
|
|
65
|
+
`)}
|
|
66
|
+
`;
|