@streamline-pulse/formkrafter-wc 0.2.0 → 0.4.0
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/README.md +10 -8
- package/dist/components/fk-brick-actions.js +1 -1
- package/dist/components/fk-brick-list.js +1 -1
- package/dist/components/fk-brick-mold-item.js +1 -1
- package/dist/components/fk-brick-not-found.js +1 -1
- package/dist/components/fk-brick-render.js +1 -1
- package/dist/components/fk-code-editor.js +1 -1
- package/dist/components/fk-data-grid.js +1 -1
- package/dist/components/fk-drop-area.js +1 -1
- package/dist/components/fk-empty-form.js +1 -1
- package/dist/components/fk-file-input.js +1 -1
- package/dist/components/fk-form-builder.js +1 -1
- package/dist/components/fk-form-render.js +1 -1
- package/dist/components/fk-property-panel.js +1 -1
- package/dist/components/fk-rules-editor.js +1 -1
- package/dist/components/fk-select-input.js +1 -1
- package/dist/components/fk-signature-input.js +1 -1
- package/dist/components/fk-stepper.js +1 -1
- package/dist/components/fk-tabs.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/{p-LXnm2ogM.js → p-28GBFlUX.js} +4 -4
- package/dist/components/p-BB4Llg42.js +1 -0
- package/dist/components/p-BGxmFcpL.js +1 -0
- package/dist/components/{p-BVBfbMl_.js → p-BInUBjyw.js} +1 -1
- package/dist/components/p-BietHxaT.js +1 -0
- package/dist/components/{p-C85zhhpr.js → p-BnzSarwW.js} +1 -1
- package/dist/components/p-BpkKcCCr.js +1 -0
- package/dist/components/p-C0Y8qh8R.js +1 -0
- package/dist/components/p-C5OWoRhO.js +1 -0
- package/dist/components/p-CKs1CWVz.js +1 -0
- package/dist/components/{p-BSPTuA1p.js → p-CZHykCYD.js} +1 -1
- package/dist/components/p-CehxuHtl.js +1 -0
- package/dist/components/p-CqVSd56Z.js +1 -0
- package/dist/components/p-CyZA17qf.js +1 -0
- package/dist/components/p-D4HhZxQ-.js +1 -0
- package/dist/components/p-DC6Wxbnz.js +1 -0
- package/dist/components/p-DRNycSdI.js +1 -0
- package/dist/components/{p-B0YjIsVn.js → p-Dh5Z49YD.js} +1 -1
- package/dist/components/p-DiOstAi9.js +1 -0
- package/dist/components/p-DlqnIm46.js +1 -0
- package/dist/components/{p-BDvqHJih.js → p-DshUS8Zm.js} +1 -1
- package/dist/components/p-DtcM1yw5.js +1 -0
- package/dist/components/p-NDbmiiYk.js +1 -0
- package/dist/components/p-RzeBwfwG.js +1 -0
- package/dist/components/p-ajy8ZcBX.js +1 -0
- package/dist/components/p-kYG3E0GQ.js +1 -0
- package/dist/components/p-tTJg_I4V.js +1 -0
- package/dist/formkrafter-wc/formkrafter-wc.css +1 -1
- package/dist/formkrafter-wc/formkrafter-wc.esm.js +1 -1
- package/dist/formkrafter-wc/index.esm.js +1 -1
- package/dist/formkrafter-wc/p-3579150a.entry.js +1 -0
- package/dist/formkrafter-wc/p-8b0ff66e.entry.js +1 -0
- package/dist/formkrafter-wc/p-BHZMDq2e.js +1 -0
- package/dist/formkrafter-wc/p-BietHxaT.js +1 -0
- package/dist/formkrafter-wc/p-C0Y8qh8R.js +1 -0
- package/dist/formkrafter-wc/p-CehxuHtl.js +1 -0
- package/dist/formkrafter-wc/p-DlqnIm46.js +1 -0
- package/dist/formkrafter-wc/p-DtcM1yw5.js +1 -0
- package/dist/formkrafter-wc/p-RzeBwfwG.js +1 -0
- package/dist/formkrafter-wc/p-WWmY5Z05.js +1 -0
- package/dist/formkrafter-wc/p-hcT25XX4.js +12 -0
- package/dist/formkrafter-wc/p-qLZlXROB.js +2 -0
- package/dist/types/components/fk-code-editor/fk-code-editor.d.ts +3 -1
- package/dist/types/components/fk-data-grid/fk-data-grid.d.ts +1 -0
- package/dist/types/components/fk-drop-area/fk-drop-area.d.ts +1 -0
- package/dist/types/components/fk-file-input/fk-file-input.d.ts +7 -3
- package/dist/types/components/fk-form-render/fk-form-render.d.ts +7 -1
- package/dist/types/components/fk-select-input/fk-select-input.d.ts +9 -0
- package/dist/types/components.d.ts +39 -4
- package/dist/types/index.d.ts +1 -1
- package/dist/types/registry/default-bricks.d.ts +36 -0
- package/dist/types/utils/mask.d.ts +1 -0
- package/package.json +10 -15
- package/dist/cjs/app-globals-V2Kpy_OQ.js +0 -5
- package/dist/cjs/fk-brick-actions_18.cjs.entry.js +0 -26443
- package/dist/cjs/formkrafter-wc.cjs.js +0 -25
- package/dist/cjs/index-Can2MpG5.js +0 -17538
- package/dist/cjs/index-CbyFxLc_.js +0 -2114
- package/dist/cjs/index.cjs.js +0 -48
- package/dist/cjs/loader.cjs.js +0 -13
- package/dist/collection/collection-manifest.json +0 -30
- package/dist/collection/components/fk-brick-actions/fk-brick-actions.css +0 -78
- package/dist/collection/components/fk-brick-actions/fk-brick-actions.js +0 -215
- package/dist/collection/components/fk-brick-list/fk-brick-list.css +0 -71
- package/dist/collection/components/fk-brick-list/fk-brick-list.js +0 -55
- package/dist/collection/components/fk-brick-mold-item/fk-brick-mold-item.css +0 -33
- package/dist/collection/components/fk-brick-mold-item/fk-brick-mold-item.js +0 -73
- package/dist/collection/components/fk-brick-not-found/fk-brick-not-found.css +0 -8
- package/dist/collection/components/fk-brick-not-found/fk-brick-not-found.js +0 -18
- package/dist/collection/components/fk-brick-render/fk-brick-render.js +0 -447
- package/dist/collection/components/fk-code-editor/fk-code-editor.css +0 -26
- package/dist/collection/components/fk-code-editor/fk-code-editor.js +0 -136
- package/dist/collection/components/fk-data-grid/fk-data-grid.css +0 -75
- package/dist/collection/components/fk-data-grid/fk-data-grid.js +0 -300
- package/dist/collection/components/fk-drop-area/fk-drop-area.css +0 -18
- package/dist/collection/components/fk-drop-area/fk-drop-area.js +0 -98
- package/dist/collection/components/fk-empty-form/fk-empty-form.css +0 -22
- package/dist/collection/components/fk-empty-form/fk-empty-form.js +0 -19
- package/dist/collection/components/fk-file-input/fk-file-input.css +0 -95
- package/dist/collection/components/fk-file-input/fk-file-input.js +0 -196
- package/dist/collection/components/fk-form-builder/fk-form-builder.css +0 -112
- package/dist/collection/components/fk-form-builder/fk-form-builder.js +0 -431
- package/dist/collection/components/fk-form-render/fk-form-render.css +0 -7
- package/dist/collection/components/fk-form-render/fk-form-render.js +0 -352
- package/dist/collection/components/fk-property-panel/fk-property-panel.css +0 -153
- package/dist/collection/components/fk-property-panel/fk-property-panel.js +0 -384
- package/dist/collection/components/fk-rules-editor/fk-rules-editor.css +0 -166
- package/dist/collection/components/fk-rules-editor/fk-rules-editor.js +0 -250
- package/dist/collection/components/fk-select-input/fk-select-input.css +0 -144
- package/dist/collection/components/fk-select-input/fk-select-input.js +0 -356
- package/dist/collection/components/fk-signature-input/fk-signature-input.css +0 -42
- package/dist/collection/components/fk-signature-input/fk-signature-input.js +0 -158
- package/dist/collection/components/fk-stepper/fk-stepper.css +0 -85
- package/dist/collection/components/fk-stepper/fk-stepper.js +0 -282
- package/dist/collection/components/fk-tabs/fk-tabs.css +0 -38
- package/dist/collection/components/fk-tabs/fk-tabs.js +0 -236
- package/dist/collection/i18n/i18n.js +0 -257
- package/dist/collection/index.js +0 -5
- package/dist/collection/registry/create-brick.js +0 -34
- package/dist/collection/registry/default-bricks.js +0 -562
- package/dist/collection/registry/registry.js +0 -44
- package/dist/collection/utils/brick-data.js +0 -16
- package/dist/collection/utils/drop.js +0 -14
- package/dist/collection/utils/events.js +0 -1
- package/dist/collection/utils/options.js +0 -21
- package/dist/collection/utils/remote.js +0 -27
- package/dist/collection/utils/rule-condition.js +0 -72
- package/dist/collection/utils/style.js +0 -11
- package/dist/components/p-B1t0M_hN.js +0 -1
- package/dist/components/p-B21cOFRx.js +0 -1
- package/dist/components/p-B7ED8qMb.js +0 -1
- package/dist/components/p-BrOXMyOG.js +0 -1
- package/dist/components/p-CMQ_4Zfv.js +0 -1
- package/dist/components/p-CWQX0sXS.js +0 -1
- package/dist/components/p-CXEvsomA.js +0 -1
- package/dist/components/p-Cq9HSEn8.js +0 -1
- package/dist/components/p-D7bf2ztq.js +0 -1
- package/dist/components/p-DIPoAaGe.js +0 -1
- package/dist/components/p-DYBirEew.js +0 -1
- package/dist/components/p-DluDp8V5.js +0 -1
- package/dist/components/p-Do6-yRva.js +0 -1
- package/dist/components/p-GjmAhT2E.js +0 -1
- package/dist/components/p-y0xDvzJR.js +0 -1
- package/dist/esm/app-globals-DQuL1Twl.js +0 -3
- package/dist/esm/fk-brick-actions_18.entry.js +0 -26424
- package/dist/esm/formkrafter-wc.js +0 -21
- package/dist/esm/index-BB2OOj__.js +0 -17478
- package/dist/esm/index-DMDO6w5-.js +0 -2105
- package/dist/esm/index.js +0 -2
- package/dist/esm/loader.js +0 -11
- package/dist/formkrafter-wc/p-0de7cbe1.entry.js +0 -1
- package/dist/formkrafter-wc/p-Bp_A8oL5.js +0 -12
- package/dist/formkrafter-wc/p-DMDO6w5-.js +0 -2
- package/dist/index.cjs.js +0 -1
- package/dist/index.js +0 -1
- package/dist/stencil.config.js +0 -34
- package/loader/cdn.js +0 -1
- package/loader/index.cjs.js +0 -1
- package/loader/index.d.ts +0 -24
- package/loader/index.es2017.js +0 -1
- package/loader/index.js +0 -2
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
import { h } from "@stencil/core";
|
|
2
|
-
import { services } from "@streamline-pulse/formkrafter-core";
|
|
3
|
-
import { OPERATORS, buildLogic, formatValue, parseLogic, parseValueInput, } from "../../utils/rule-condition";
|
|
4
|
-
import { fkT } from "../../i18n/i18n";
|
|
5
|
-
const EFFECT_TARGETS = ['hidden', 'disabled', 'required', 'value'];
|
|
6
|
-
export class FkRulesEditor {
|
|
7
|
-
constructor() {
|
|
8
|
-
this.fields = [];
|
|
9
|
-
this.forcedModes = {};
|
|
10
|
-
this.jsonErrors = {};
|
|
11
|
-
this.codeErrors = {};
|
|
12
|
-
this.addRule = () => {
|
|
13
|
-
var _a;
|
|
14
|
-
this.commit([
|
|
15
|
-
...this.rules(),
|
|
16
|
-
{
|
|
17
|
-
name: `Rule ${this.rules().length + 1}`,
|
|
18
|
-
type: 'jsonLogic',
|
|
19
|
-
logic: buildLogic({
|
|
20
|
-
field: (_a = this.fields[0]) !== null && _a !== void 0 ? _a : '',
|
|
21
|
-
operator: 'equals',
|
|
22
|
-
value: '',
|
|
23
|
-
}),
|
|
24
|
-
effects: [{ property: { target: 'hidden', type: 'boolean' }, boolean: true }],
|
|
25
|
-
},
|
|
26
|
-
]);
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
rules() {
|
|
30
|
-
var _a;
|
|
31
|
-
return (_a = this.brick.rules) !== null && _a !== void 0 ? _a : [];
|
|
32
|
-
}
|
|
33
|
-
commit(rules) {
|
|
34
|
-
var _a;
|
|
35
|
-
const uid = (_a = this.brick.configs) === null || _a === void 0 ? void 0 : _a.uid;
|
|
36
|
-
if (!uid)
|
|
37
|
-
return;
|
|
38
|
-
this.brickRulesChange.emit({ rules, uid });
|
|
39
|
-
}
|
|
40
|
-
updateRule(index, patch) {
|
|
41
|
-
this.commit(this.rules().map((rule, i) => (i === index ? Object.assign(Object.assign({}, rule), patch) : rule)));
|
|
42
|
-
}
|
|
43
|
-
removeRule(index) {
|
|
44
|
-
this.commit(this.rules().filter((_, i) => i !== index));
|
|
45
|
-
this.forcedModes = Object.assign(Object.assign({}, this.forcedModes), { [index]: undefined });
|
|
46
|
-
}
|
|
47
|
-
modeOf(index, rule) {
|
|
48
|
-
if (rule.type === 'javaScript')
|
|
49
|
-
return 'javaScript';
|
|
50
|
-
if (this.forcedModes[index])
|
|
51
|
-
return this.forcedModes[index];
|
|
52
|
-
return parseLogic(rule.logic) ? 'simple' : 'json';
|
|
53
|
-
}
|
|
54
|
-
setMode(index, rule, mode) {
|
|
55
|
-
var _a, _b, _c;
|
|
56
|
-
this.forcedModes = Object.assign(Object.assign({}, this.forcedModes), { [index]: mode });
|
|
57
|
-
this.jsonErrors = Object.assign(Object.assign({}, this.jsonErrors), { [index]: '' });
|
|
58
|
-
this.codeErrors = Object.assign(Object.assign({}, this.codeErrors), { [index]: '' });
|
|
59
|
-
if (mode === 'javaScript' && rule.type !== 'javaScript') {
|
|
60
|
-
this.updateRule(index, { type: 'javaScript', code: (_a = rule.code) !== null && _a !== void 0 ? _a : 'return true;' });
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
if (mode !== 'javaScript' && rule.type !== 'jsonLogic') {
|
|
64
|
-
this.updateRule(index, {
|
|
65
|
-
type: 'jsonLogic',
|
|
66
|
-
logic: (_b = rule.logic) !== null && _b !== void 0 ? _b : buildLogic({ field: (_c = this.fields[0]) !== null && _c !== void 0 ? _c : '', operator: 'equals', value: '' }),
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
updateCondition(index, rule, patch) {
|
|
71
|
-
var _a, _b;
|
|
72
|
-
const current = (_a = parseLogic(rule.logic)) !== null && _a !== void 0 ? _a : {
|
|
73
|
-
field: (_b = this.fields[0]) !== null && _b !== void 0 ? _b : '',
|
|
74
|
-
operator: 'equals',
|
|
75
|
-
value: '',
|
|
76
|
-
};
|
|
77
|
-
this.updateRule(index, {
|
|
78
|
-
logic: buildLogic(Object.assign(Object.assign({}, current), patch)),
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
commitJson(index, raw) {
|
|
82
|
-
try {
|
|
83
|
-
const logic = JSON.parse(raw);
|
|
84
|
-
this.jsonErrors = Object.assign(Object.assign({}, this.jsonErrors), { [index]: '' });
|
|
85
|
-
this.updateRule(index, { logic });
|
|
86
|
-
}
|
|
87
|
-
catch (error) {
|
|
88
|
-
this.jsonErrors = Object.assign(Object.assign({}, this.jsonErrors), { [index]: error instanceof Error ? error.message : String(error) });
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
commitCode(index, code) {
|
|
92
|
-
var _a, _b;
|
|
93
|
-
const validation = services.jsRunnerService.validateJs(`(() => {${code}})();`);
|
|
94
|
-
this.codeErrors = Object.assign(Object.assign({}, this.codeErrors), { [index]: validation.valide ? '' : ((_b = (_a = validation.error) === null || _a === void 0 ? void 0 : _a.message) !== null && _b !== void 0 ? _b : 'Invalid code') });
|
|
95
|
-
this.updateRule(index, { code });
|
|
96
|
-
}
|
|
97
|
-
updateEffect(ruleIndex, effectIndex, effect) {
|
|
98
|
-
var _a;
|
|
99
|
-
const rule = this.rules()[ruleIndex];
|
|
100
|
-
const effects = ((_a = rule.effects) !== null && _a !== void 0 ? _a : []).map((current, i) => i === effectIndex ? effect : current);
|
|
101
|
-
this.updateRule(ruleIndex, { effects });
|
|
102
|
-
}
|
|
103
|
-
addEffect(ruleIndex) {
|
|
104
|
-
var _a;
|
|
105
|
-
const rule = this.rules()[ruleIndex];
|
|
106
|
-
this.updateRule(ruleIndex, {
|
|
107
|
-
effects: [
|
|
108
|
-
...((_a = rule.effects) !== null && _a !== void 0 ? _a : []),
|
|
109
|
-
{ property: { target: 'hidden', type: 'boolean' }, boolean: true },
|
|
110
|
-
],
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
removeEffect(ruleIndex, effectIndex) {
|
|
114
|
-
var _a;
|
|
115
|
-
const rule = this.rules()[ruleIndex];
|
|
116
|
-
this.updateRule(ruleIndex, {
|
|
117
|
-
effects: ((_a = rule.effects) !== null && _a !== void 0 ? _a : []).filter((_, i) => i !== effectIndex),
|
|
118
|
-
});
|
|
119
|
-
}
|
|
120
|
-
renderCondition(index, rule) {
|
|
121
|
-
var _a, _b;
|
|
122
|
-
const condition = (_a = parseLogic(rule.logic)) !== null && _a !== void 0 ? _a : {
|
|
123
|
-
field: (_b = this.fields[0]) !== null && _b !== void 0 ? _b : '',
|
|
124
|
-
operator: 'equals',
|
|
125
|
-
value: '',
|
|
126
|
-
};
|
|
127
|
-
const needsValue = condition.operator !== 'isEmpty' && condition.operator !== 'isNotEmpty';
|
|
128
|
-
return (h("div", { class: "fk-rule__condition" }, h("span", { class: "fk-rule__keyword" }, fkT('rules.when')), h("select", { class: "fk-rule__control", onChange: (event) => this.updateCondition(index, rule, {
|
|
129
|
-
field: event.target.value,
|
|
130
|
-
}) }, this.fields.map((field) => (h("option", { value: field, selected: field === condition.field }, field)))), h("select", { class: "fk-rule__control", onChange: (event) => this.updateCondition(index, rule, {
|
|
131
|
-
operator: event.target.value,
|
|
132
|
-
}) }, OPERATORS.map((operator) => (h("option", { value: operator.id, selected: operator.id === condition.operator }, operator.label)))), needsValue ? (h("input", { class: "fk-rule__control", type: "text", value: formatValue(condition.value), onChange: (event) => this.updateCondition(index, rule, {
|
|
133
|
-
value: parseValueInput(event.target.value),
|
|
134
|
-
}) })) : null));
|
|
135
|
-
}
|
|
136
|
-
renderEffect(ruleIndex, effect, effectIndex) {
|
|
137
|
-
var _a, _b, _c, _d, _e;
|
|
138
|
-
const target = (_b = (_a = effect.property) === null || _a === void 0 ? void 0 : _a.target) !== null && _b !== void 0 ? _b : 'hidden';
|
|
139
|
-
const type = (_d = (_c = effect.property) === null || _c === void 0 ? void 0 : _c.type) !== null && _d !== void 0 ? _d : 'boolean';
|
|
140
|
-
return (h("div", { class: "fk-rule__effect" }, h("select", { class: "fk-rule__control", onChange: (event) => this.updateEffect(ruleIndex, effectIndex, Object.assign(Object.assign({}, effect), { property: {
|
|
141
|
-
target: event.target.value,
|
|
142
|
-
type: type,
|
|
143
|
-
} })) }, EFFECT_TARGETS.map((candidate) => (h("option", { value: candidate, selected: candidate === target }, candidate)))), h("select", { class: "fk-rule__control", onChange: (event) => {
|
|
144
|
-
const nextType = event.target.value;
|
|
145
|
-
this.updateEffect(ruleIndex, effectIndex, Object.assign({ property: { target, type: nextType } }, (nextType === 'boolean' ? { boolean: true } : { string: '' })));
|
|
146
|
-
} }, h("option", { value: "boolean", selected: type === 'boolean' }, "boolean"), h("option", { value: "string", selected: type === 'string' }, "string")), type === 'boolean' ? (h("select", { class: "fk-rule__control", onChange: (event) => this.updateEffect(ruleIndex, effectIndex, Object.assign(Object.assign({}, effect), { boolean: event.target.value === 'true' })) }, h("option", { value: "true", selected: effect.boolean !== false }, "true"), h("option", { value: "false", selected: effect.boolean === false }, "false"))) : (h("input", { class: "fk-rule__control", type: "text", value: (_e = effect.string) !== null && _e !== void 0 ? _e : '', onChange: (event) => this.updateEffect(ruleIndex, effectIndex, Object.assign(Object.assign({}, effect), { string: event.target.value })) })), h("button", { type: "button", class: "fk-rule__remove", title: fkT('rules.removeEffect'), onClick: () => this.removeEffect(ruleIndex, effectIndex) }, "\u2715")));
|
|
147
|
-
}
|
|
148
|
-
render() {
|
|
149
|
-
return (h("div", { key: '24bddb2835ae3148acc15bef38c855e0b5de0bf8', class: "fk-rules" }, this.rules().map((rule, index) => {
|
|
150
|
-
var _a, _b, _c;
|
|
151
|
-
const mode = this.modeOf(index, rule);
|
|
152
|
-
return (h("article", { class: "fk-rule" }, h("header", { class: "fk-rule__header" }, h("input", { class: "fk-rule__name", type: "text", value: rule.name, onChange: (event) => this.updateRule(index, {
|
|
153
|
-
name: event.target.value,
|
|
154
|
-
}) }), h("button", { type: "button", class: "fk-rule__remove", title: fkT('rules.removeRule'), onClick: () => this.removeRule(index) }, "\u2715")), h("div", { class: "fk-rule__modes" }, ['simple', 'json', 'javaScript'].map((candidate) => (h("button", { type: "button", class: {
|
|
155
|
-
'fk-rule__mode': true,
|
|
156
|
-
'fk-rule__mode--active': mode === candidate,
|
|
157
|
-
}, onClick: () => this.setMode(index, rule, candidate) }, fkT(`rules.mode.${candidate === 'javaScript' ? 'js' : candidate}`))))), mode === 'simple' ? this.renderCondition(index, rule) : null, mode === 'json' ? (h("div", { class: "fk-rule__advanced" }, h("textarea", { class: "fk-rule__code", onChange: (event) => this.commitJson(index, event.target.value) }, JSON.stringify((_a = rule.logic) !== null && _a !== void 0 ? _a : null, null, 2)), this.jsonErrors[index] ? (h("p", { class: "fk-rule__error" }, this.jsonErrors[index])) : null)) : null, mode === 'javaScript' ? (h("div", { class: "fk-rule__advanced" }, h("fk-code-editor", { value: (_b = rule.code) !== null && _b !== void 0 ? _b : '', placeholder: "return dataMap.country === 'BJ';", onCodeChange: (event) => this.commitCode(index, event.detail) }), this.codeErrors[index] ? (h("p", { class: "fk-rule__error" }, this.codeErrors[index])) : null)) : null, h("div", { class: "fk-rule__effects" }, h("span", { class: "fk-rule__keyword" }, fkT('rules.then')), ((_c = rule.effects) !== null && _c !== void 0 ? _c : []).map((effect, effectIndex) => this.renderEffect(index, effect, effectIndex)), h("button", { type: "button", class: "fk-rule__add", onClick: () => this.addEffect(index) }, fkT('rules.addEffect')))));
|
|
158
|
-
}), h("button", { key: '55f42fc21a6054d46f53835e0b9638391d12bf6f', type: "button", class: "fk-rule__add", onClick: this.addRule }, fkT('rules.addRule'))));
|
|
159
|
-
}
|
|
160
|
-
static get is() { return "fk-rules-editor"; }
|
|
161
|
-
static get encapsulation() { return "scoped"; }
|
|
162
|
-
static get originalStyleUrls() {
|
|
163
|
-
return {
|
|
164
|
-
"$": ["fk-rules-editor.css"]
|
|
165
|
-
};
|
|
166
|
-
}
|
|
167
|
-
static get styleUrls() {
|
|
168
|
-
return {
|
|
169
|
-
"$": ["fk-rules-editor.css"]
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
static get properties() {
|
|
173
|
-
return {
|
|
174
|
-
"brick": {
|
|
175
|
-
"type": "unknown",
|
|
176
|
-
"mutable": false,
|
|
177
|
-
"complexType": {
|
|
178
|
-
"original": "BrickSpec",
|
|
179
|
-
"resolved": "BrickSpec",
|
|
180
|
-
"references": {
|
|
181
|
-
"BrickSpec": {
|
|
182
|
-
"location": "import",
|
|
183
|
-
"path": "@streamline-pulse/formkrafter-core",
|
|
184
|
-
"id": "../core/dist/index.d.ts::BrickSpec",
|
|
185
|
-
"referenceLocation": "BrickSpec"
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
},
|
|
189
|
-
"required": true,
|
|
190
|
-
"optional": false,
|
|
191
|
-
"docs": {
|
|
192
|
-
"tags": [],
|
|
193
|
-
"text": ""
|
|
194
|
-
},
|
|
195
|
-
"getter": false,
|
|
196
|
-
"setter": false
|
|
197
|
-
},
|
|
198
|
-
"fields": {
|
|
199
|
-
"type": "unknown",
|
|
200
|
-
"mutable": false,
|
|
201
|
-
"complexType": {
|
|
202
|
-
"original": "string[]",
|
|
203
|
-
"resolved": "string[]",
|
|
204
|
-
"references": {}
|
|
205
|
-
},
|
|
206
|
-
"required": false,
|
|
207
|
-
"optional": false,
|
|
208
|
-
"docs": {
|
|
209
|
-
"tags": [],
|
|
210
|
-
"text": ""
|
|
211
|
-
},
|
|
212
|
-
"getter": false,
|
|
213
|
-
"setter": false,
|
|
214
|
-
"defaultValue": "[]"
|
|
215
|
-
}
|
|
216
|
-
};
|
|
217
|
-
}
|
|
218
|
-
static get states() {
|
|
219
|
-
return {
|
|
220
|
-
"forcedModes": {},
|
|
221
|
-
"jsonErrors": {},
|
|
222
|
-
"codeErrors": {}
|
|
223
|
-
};
|
|
224
|
-
}
|
|
225
|
-
static get events() {
|
|
226
|
-
return [{
|
|
227
|
-
"method": "brickRulesChange",
|
|
228
|
-
"name": "brickRulesChange",
|
|
229
|
-
"bubbles": true,
|
|
230
|
-
"cancelable": true,
|
|
231
|
-
"composed": true,
|
|
232
|
-
"docs": {
|
|
233
|
-
"tags": [],
|
|
234
|
-
"text": ""
|
|
235
|
-
},
|
|
236
|
-
"complexType": {
|
|
237
|
-
"original": "BrickRulesChangeDetail",
|
|
238
|
-
"resolved": "BrickRulesChangeDetail",
|
|
239
|
-
"references": {
|
|
240
|
-
"BrickRulesChangeDetail": {
|
|
241
|
-
"location": "import",
|
|
242
|
-
"path": "../../utils/events",
|
|
243
|
-
"id": "src/utils/events.ts::BrickRulesChangeDetail",
|
|
244
|
-
"referenceLocation": "BrickRulesChangeDetail"
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
}];
|
|
249
|
-
}
|
|
250
|
-
}
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
:host {
|
|
2
|
-
display: block;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.fk-select {
|
|
6
|
-
position: relative;
|
|
7
|
-
font-family: var(--fk-font);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.fk-select__trigger {
|
|
11
|
-
display: flex;
|
|
12
|
-
align-items: center;
|
|
13
|
-
gap: calc(var(--fk-spacing) / 2);
|
|
14
|
-
min-height: 38px;
|
|
15
|
-
padding: calc(var(--fk-spacing) / 2) var(--fk-spacing);
|
|
16
|
-
border: 1px solid var(--fk-color-border);
|
|
17
|
-
border-radius: var(--fk-radius);
|
|
18
|
-
background: var(--fk-color-surface);
|
|
19
|
-
color: var(--fk-color-text);
|
|
20
|
-
cursor: pointer;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.fk-select--disabled .fk-select__trigger {
|
|
24
|
-
cursor: not-allowed;
|
|
25
|
-
opacity: 0.6;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.fk-select__trigger--open {
|
|
29
|
-
border-color: var(--fk-color-primary);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.fk-select__values {
|
|
33
|
-
display: flex;
|
|
34
|
-
flex: 1;
|
|
35
|
-
flex-wrap: wrap;
|
|
36
|
-
align-items: center;
|
|
37
|
-
gap: 4px;
|
|
38
|
-
min-width: 0;
|
|
39
|
-
font-size: 0.9rem;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.fk-select__placeholder {
|
|
43
|
-
color: var(--fk-color-muted);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
.fk-select__chip {
|
|
47
|
-
display: inline-flex;
|
|
48
|
-
align-items: center;
|
|
49
|
-
gap: 4px;
|
|
50
|
-
padding: 1px 8px;
|
|
51
|
-
border-radius: 999px;
|
|
52
|
-
background: color-mix(in srgb, var(--fk-color-primary) 14%, transparent);
|
|
53
|
-
color: var(--fk-color-primary);
|
|
54
|
-
font-size: 0.8rem;
|
|
55
|
-
font-weight: 600;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.fk-select__chip-remove,
|
|
59
|
-
.fk-select__clear {
|
|
60
|
-
border: none;
|
|
61
|
-
background: transparent;
|
|
62
|
-
color: inherit;
|
|
63
|
-
font-size: 0.7rem;
|
|
64
|
-
cursor: pointer;
|
|
65
|
-
padding: 0 2px;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.fk-select__clear {
|
|
69
|
-
color: var(--fk-color-muted);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.fk-select__clear:hover {
|
|
73
|
-
color: var(--fk-color-danger);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
.fk-select__caret {
|
|
77
|
-
color: var(--fk-color-muted);
|
|
78
|
-
font-size: 0.8rem;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.fk-select__dropdown {
|
|
82
|
-
position: absolute;
|
|
83
|
-
top: calc(100% + 4px);
|
|
84
|
-
left: 0;
|
|
85
|
-
right: 0;
|
|
86
|
-
z-index: 20;
|
|
87
|
-
display: flex;
|
|
88
|
-
flex-direction: column;
|
|
89
|
-
border: 1px solid var(--fk-color-border);
|
|
90
|
-
border-radius: var(--fk-radius);
|
|
91
|
-
background: var(--fk-color-surface);
|
|
92
|
-
box-shadow: 0 8px 24px var(--fk-color-shadow);
|
|
93
|
-
overflow: hidden;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.fk-select__search {
|
|
97
|
-
font: inherit;
|
|
98
|
-
font-size: 0.85rem;
|
|
99
|
-
padding: calc(var(--fk-spacing) / 1.5) var(--fk-spacing);
|
|
100
|
-
border: none;
|
|
101
|
-
border-bottom: 1px solid var(--fk-color-border);
|
|
102
|
-
background: transparent;
|
|
103
|
-
color: var(--fk-color-text);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
.fk-select__search:focus {
|
|
107
|
-
outline: none;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
.fk-select__options {
|
|
111
|
-
max-height: 220px;
|
|
112
|
-
overflow-y: auto;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.fk-select__option {
|
|
116
|
-
display: flex;
|
|
117
|
-
align-items: center;
|
|
118
|
-
justify-content: space-between;
|
|
119
|
-
gap: var(--fk-spacing);
|
|
120
|
-
padding: calc(var(--fk-spacing) / 1.5) var(--fk-spacing);
|
|
121
|
-
font-size: 0.9rem;
|
|
122
|
-
color: var(--fk-color-text);
|
|
123
|
-
cursor: pointer;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
.fk-select__option:hover {
|
|
127
|
-
background: color-mix(in srgb, var(--fk-color-primary) 8%, transparent);
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
.fk-select__option--selected {
|
|
131
|
-
color: var(--fk-color-primary);
|
|
132
|
-
font-weight: 600;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
.fk-select__check {
|
|
136
|
-
font-size: 0.8rem;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
.fk-select__empty {
|
|
140
|
-
margin: 0;
|
|
141
|
-
padding: var(--fk-spacing);
|
|
142
|
-
font-size: 0.85rem;
|
|
143
|
-
color: var(--fk-color-muted);
|
|
144
|
-
}
|