@streamline-pulse/formkrafter-wc 0.3.0 → 0.5.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 +23 -9
- 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-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-DYchD23x.js → p-BerMKKKo.js} +1 -1
- package/dist/components/p-Bey6yx4S.js +1 -0
- package/dist/{formkrafter-wc/p-C-wnqV3i.js → components/p-BietHxaT.js} +1 -1
- package/dist/components/p-Bj48EXdM.js +1 -0
- package/dist/components/p-BkqqQX6U.js +1 -0
- package/dist/components/p-BnxDCFjv.js +1 -0
- package/dist/components/p-BpkKcCCr.js +1 -0
- package/dist/components/p-C0Y8qh8R.js +1 -0
- package/dist/components/{p-BGkZP87K.js → p-CIzLjMz0.js} +1 -1
- package/dist/components/{p--vL6GR31.js → p-C_8wUoZ4.js} +1 -1
- package/dist/components/p-CeeVZgCr.js +1 -0
- package/dist/components/{p-4COASNrZ.js → p-CehxuHtl.js} +1 -1
- package/dist/components/{p-D6n74M9d.js → p-CjnF4RZI.js} +1 -1
- package/dist/components/{p-CIfjRTky.js → p-CsHWN99R.js} +1 -1
- package/dist/components/p-CyZA17qf.js +1 -0
- package/dist/components/p-DlqnIm46.js +1 -0
- package/dist/components/{p-v7LxwCAc.js → p-DwN4nM7G.js} +1 -1
- package/dist/components/{p-DMCkrZqi.js → p-RzeBwfwG.js} +1 -1
- package/dist/components/{p-BWdm2a6q.js → p-_64WINOr.js} +1 -1
- package/dist/components/p-bZPtT8wr.js +1 -0
- package/dist/components/{p-fDJP6whN.js → p-hELMtJ9v.js} +1 -1
- package/dist/components/{p-CKMHMpID.js → p-l7ULqDJ3.js} +4 -4
- package/dist/components/{p-wuC5rVU7.js → p-tSZpD5I-.js} +1 -1
- 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/{components/p-C-wnqV3i.js → formkrafter-wc/p-BietHxaT.js} +1 -1
- package/dist/formkrafter-wc/p-C0Y8qh8R.js +1 -0
- package/dist/formkrafter-wc/p-C5tYszq2.js +12 -0
- package/dist/formkrafter-wc/{p-4COASNrZ.js → p-CehxuHtl.js} +1 -1
- package/dist/formkrafter-wc/p-DYsf28oe.js +1 -0
- package/dist/formkrafter-wc/p-DlqnIm46.js +1 -0
- package/dist/formkrafter-wc/{p-DMCkrZqi.js → p-RzeBwfwG.js} +1 -1
- package/dist/formkrafter-wc/p-WWmY5Z05.js +1 -0
- package/dist/formkrafter-wc/p-bf962b94.entry.js +1 -0
- package/dist/formkrafter-wc/p-ca200eec.entry.js +1 -0
- package/dist/types/components/fk-code-editor/fk-code-editor.d.ts +1 -0
- 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-form-render/fk-form-render.d.ts +7 -1
- package/dist/types/components/fk-select-input/fk-select-input.d.ts +5 -1
- package/dist/types/components.d.ts +17 -0
- 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 -4224
- package/dist/cjs/formkrafter-wc.cjs.js +0 -25
- package/dist/cjs/index-Bhy1RJMV.js +0 -3042
- package/dist/cjs/index-CImTe9BG.js +0 -2126
- package/dist/cjs/index-CdaT3-qx.js +0 -5444
- package/dist/cjs/index-CkPPRg03.js +0 -17548
- package/dist/cjs/index-DHgK3reD.js +0 -12233
- package/dist/cjs/index-Ds0sDbXV.js +0 -4019
- package/dist/cjs/index-c9BL7y3N.js +0 -1922
- 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 -145
- 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 -239
- 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 -388
- 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 -153
- package/dist/collection/components/fk-select-input/fk-select-input.js +0 -454
- 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 -99
- package/dist/collection/components/fk-stepper/fk-stepper.js +0 -285
- package/dist/collection/components/fk-tabs/fk-tabs.css +0 -38
- package/dist/collection/components/fk-tabs/fk-tabs.js +0 -249
- package/dist/collection/i18n/i18n.js +0 -265
- package/dist/collection/index.js +0 -5
- package/dist/collection/registry/create-brick.js +0 -34
- package/dist/collection/registry/default-bricks.js +0 -564
- 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-BOmBVgfJ.js +0 -1
- package/dist/components/p-B_-x-GlA.js +0 -1
- package/dist/components/p-Br1s4Ujx.js +0 -1
- package/dist/components/p-CUF31e-P.js +0 -1
- package/dist/components/p-CWQX0sXS.js +0 -1
- package/dist/components/p-DFe3zZCI.js +0 -1
- package/dist/components/p-DOInQkG6.js +0 -1
- package/dist/components/p-PAr7WoWG.js +0 -1
- package/dist/components/p-YyGnQmX-.js +0 -1
- package/dist/components/p-swxZqinH.js +0 -1
- package/dist/esm/app-globals-DQuL1Twl.js +0 -3
- package/dist/esm/fk-brick-actions_18.entry.js +0 -4205
- package/dist/esm/formkrafter-wc.js +0 -21
- package/dist/esm/index-BAcz7b5u.js +0 -5416
- package/dist/esm/index-BkRMoLXK.js +0 -3029
- package/dist/esm/index-CGMDfZ5m.js +0 -1808
- package/dist/esm/index-D7Cta1UB.js +0 -17488
- package/dist/esm/index-DtcM1yw5.js +0 -3991
- package/dist/esm/index-DuVf3NlP.js +0 -12222
- package/dist/esm/index-qLZlXROB.js +0 -2117
- package/dist/esm/index.js +0 -2
- package/dist/esm/loader.js +0 -11
- package/dist/formkrafter-wc/p-6d29555b.entry.js +0 -1
- package/dist/formkrafter-wc/p-DOInQkG6.js +0 -1
- package/dist/formkrafter-wc/p-Ddu6BquK.js +0 -12
- 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,447 +0,0 @@
|
|
|
1
|
-
import { h } from "@stencil/core";
|
|
2
|
-
import { getAffectedProperties, resolveLocalizedRecord, } from "@streamline-pulse/formkrafter-core";
|
|
3
|
-
import { getBrick } from "../../registry/registry";
|
|
4
|
-
import { getBrickData, wrapBrickData } from "../../utils/brick-data";
|
|
5
|
-
export class FkBrickRender {
|
|
6
|
-
constructor() {
|
|
7
|
-
this.path = '0';
|
|
8
|
-
this.editable = false;
|
|
9
|
-
this.errors = {};
|
|
10
|
-
}
|
|
11
|
-
render() {
|
|
12
|
-
var _a, _b, _c, _d, _e, _f;
|
|
13
|
-
const spec = this.brickSpec;
|
|
14
|
-
if (!spec)
|
|
15
|
-
return null;
|
|
16
|
-
const brick = getBrick(spec.type, spec.id);
|
|
17
|
-
if (!brick) {
|
|
18
|
-
return h("fk-brick-not-found", null, `${spec.type}:${spec.id}`);
|
|
19
|
-
}
|
|
20
|
-
const editing = this.editable && ((_a = spec.editable) !== null && _a !== void 0 ? _a : true);
|
|
21
|
-
const affected = getAffectedProperties(spec.rules, this.dataMap);
|
|
22
|
-
if (!editing && affected.hidden === true)
|
|
23
|
-
return null;
|
|
24
|
-
const isContainer = spec.type === 'panel' || spec.type === 'collection';
|
|
25
|
-
const uid = (_b = spec.configs) === null || _b === void 0 ? void 0 : _b.uid;
|
|
26
|
-
const childNodes = ((_c = spec.children) !== null && _c !== void 0 ? _c : []).map((childSpec, index) => {
|
|
27
|
-
var _a;
|
|
28
|
-
return (h("fk-brick-render", { brickSpec: childSpec, rootSpec: (_a = this.rootSpec) !== null && _a !== void 0 ? _a : this.brickSpec, data: this.data, dataMap: this.dataMap, errors: this.errors, locale: this.locale, path: `${this.path}.${index}`, editable: this.editable, selectedUid: this.selectedUid, utils: this.utils }));
|
|
29
|
-
});
|
|
30
|
-
if (editing && isContainer) {
|
|
31
|
-
childNodes.push(h("fk-drop-area", { path: this.path }));
|
|
32
|
-
}
|
|
33
|
-
const props = {
|
|
34
|
-
brickSpec: spec,
|
|
35
|
-
configsForm: spec.configsForm,
|
|
36
|
-
configs: resolveLocalizedRecord(spec.configs, this.locale),
|
|
37
|
-
locale: this.locale,
|
|
38
|
-
styles: (_d = spec.styles) !== null && _d !== void 0 ? _d : {},
|
|
39
|
-
data: getBrickData(spec, this.data),
|
|
40
|
-
dataMap: this.dataMap,
|
|
41
|
-
rootSpec: (_e = this.rootSpec) !== null && _e !== void 0 ? _e : this.brickSpec,
|
|
42
|
-
error: ((_f = spec.configs) === null || _f === void 0 ? void 0 : _f.key) ? this.errors[spec.configs.key] : undefined,
|
|
43
|
-
disabled: editing ? false : affected.disabled === true,
|
|
44
|
-
path: this.path,
|
|
45
|
-
editable: editing,
|
|
46
|
-
children: childNodes,
|
|
47
|
-
validations: spec.validations,
|
|
48
|
-
rules: spec.rules,
|
|
49
|
-
utils: this.utils,
|
|
50
|
-
onDataChange: (value) => {
|
|
51
|
-
const wrapped = wrapBrickData(spec, value);
|
|
52
|
-
if (wrapped !== undefined)
|
|
53
|
-
this.brickDataChange.emit(wrapped);
|
|
54
|
-
},
|
|
55
|
-
onConfigsChange: (configs, changedUid) => this.brickConfigsChange.emit({ configs, uid: changedUid !== null && changedUid !== void 0 ? changedUid : uid }),
|
|
56
|
-
onStylesChange: (styles, changedUid) => this.brickStylesChange.emit({
|
|
57
|
-
styles: styles,
|
|
58
|
-
uid: changedUid !== null && changedUid !== void 0 ? changedUid : uid,
|
|
59
|
-
}),
|
|
60
|
-
onValidationsChange: (validations, changedUid) => this.brickValidationsChange.emit({ validations, uid: changedUid !== null && changedUid !== void 0 ? changedUid : uid }),
|
|
61
|
-
onRulesChange: (rules, changedUid) => this.brickRulesChange.emit({ rules, uid: changedUid !== null && changedUid !== void 0 ? changedUid : uid }),
|
|
62
|
-
onDelete: (path) => this.brickRemove.emit({ path }),
|
|
63
|
-
onDuplicate: (path) => this.brickDuplicate.emit({ path }),
|
|
64
|
-
};
|
|
65
|
-
const node = (editing ? brick.renderBuilder(props) : brick.render(props));
|
|
66
|
-
if (!editing || this.path === '0')
|
|
67
|
-
return node;
|
|
68
|
-
return (h("fk-brick-actions", { path: this.path, selected: uid !== undefined && uid === this.selectedUid }, node));
|
|
69
|
-
}
|
|
70
|
-
static get is() { return "fk-brick-render"; }
|
|
71
|
-
static get properties() {
|
|
72
|
-
return {
|
|
73
|
-
"brickSpec": {
|
|
74
|
-
"type": "unknown",
|
|
75
|
-
"mutable": false,
|
|
76
|
-
"complexType": {
|
|
77
|
-
"original": "BrickSpec",
|
|
78
|
-
"resolved": "BrickSpec",
|
|
79
|
-
"references": {
|
|
80
|
-
"BrickSpec": {
|
|
81
|
-
"location": "import",
|
|
82
|
-
"path": "@streamline-pulse/formkrafter-core",
|
|
83
|
-
"id": "../core/dist/index.d.ts::BrickSpec",
|
|
84
|
-
"referenceLocation": "BrickSpec"
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
"required": true,
|
|
89
|
-
"optional": false,
|
|
90
|
-
"docs": {
|
|
91
|
-
"tags": [],
|
|
92
|
-
"text": ""
|
|
93
|
-
},
|
|
94
|
-
"getter": false,
|
|
95
|
-
"setter": false
|
|
96
|
-
},
|
|
97
|
-
"rootSpec": {
|
|
98
|
-
"type": "unknown",
|
|
99
|
-
"mutable": false,
|
|
100
|
-
"complexType": {
|
|
101
|
-
"original": "BrickSpec",
|
|
102
|
-
"resolved": "BrickSpec",
|
|
103
|
-
"references": {
|
|
104
|
-
"BrickSpec": {
|
|
105
|
-
"location": "import",
|
|
106
|
-
"path": "@streamline-pulse/formkrafter-core",
|
|
107
|
-
"id": "../core/dist/index.d.ts::BrickSpec",
|
|
108
|
-
"referenceLocation": "BrickSpec"
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
"required": false,
|
|
113
|
-
"optional": true,
|
|
114
|
-
"docs": {
|
|
115
|
-
"tags": [],
|
|
116
|
-
"text": ""
|
|
117
|
-
},
|
|
118
|
-
"getter": false,
|
|
119
|
-
"setter": false
|
|
120
|
-
},
|
|
121
|
-
"data": {
|
|
122
|
-
"type": "unknown",
|
|
123
|
-
"mutable": false,
|
|
124
|
-
"complexType": {
|
|
125
|
-
"original": "Record<string, unknown>",
|
|
126
|
-
"resolved": "string | unknown",
|
|
127
|
-
"references": {
|
|
128
|
-
"Record": {
|
|
129
|
-
"location": "global",
|
|
130
|
-
"id": "global::Record"
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
"required": false,
|
|
135
|
-
"optional": true,
|
|
136
|
-
"docs": {
|
|
137
|
-
"tags": [],
|
|
138
|
-
"text": ""
|
|
139
|
-
},
|
|
140
|
-
"getter": false,
|
|
141
|
-
"setter": false
|
|
142
|
-
},
|
|
143
|
-
"dataMap": {
|
|
144
|
-
"type": "unknown",
|
|
145
|
-
"mutable": false,
|
|
146
|
-
"complexType": {
|
|
147
|
-
"original": "Record<string, unknown>",
|
|
148
|
-
"resolved": "string | unknown",
|
|
149
|
-
"references": {
|
|
150
|
-
"Record": {
|
|
151
|
-
"location": "global",
|
|
152
|
-
"id": "global::Record"
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
},
|
|
156
|
-
"required": false,
|
|
157
|
-
"optional": true,
|
|
158
|
-
"docs": {
|
|
159
|
-
"tags": [],
|
|
160
|
-
"text": ""
|
|
161
|
-
},
|
|
162
|
-
"getter": false,
|
|
163
|
-
"setter": false
|
|
164
|
-
},
|
|
165
|
-
"path": {
|
|
166
|
-
"type": "string",
|
|
167
|
-
"mutable": false,
|
|
168
|
-
"complexType": {
|
|
169
|
-
"original": "string",
|
|
170
|
-
"resolved": "string",
|
|
171
|
-
"references": {}
|
|
172
|
-
},
|
|
173
|
-
"required": false,
|
|
174
|
-
"optional": false,
|
|
175
|
-
"docs": {
|
|
176
|
-
"tags": [],
|
|
177
|
-
"text": ""
|
|
178
|
-
},
|
|
179
|
-
"getter": false,
|
|
180
|
-
"setter": false,
|
|
181
|
-
"reflect": false,
|
|
182
|
-
"attribute": "path",
|
|
183
|
-
"defaultValue": "'0'"
|
|
184
|
-
},
|
|
185
|
-
"editable": {
|
|
186
|
-
"type": "boolean",
|
|
187
|
-
"mutable": false,
|
|
188
|
-
"complexType": {
|
|
189
|
-
"original": "boolean",
|
|
190
|
-
"resolved": "boolean",
|
|
191
|
-
"references": {}
|
|
192
|
-
},
|
|
193
|
-
"required": false,
|
|
194
|
-
"optional": false,
|
|
195
|
-
"docs": {
|
|
196
|
-
"tags": [],
|
|
197
|
-
"text": ""
|
|
198
|
-
},
|
|
199
|
-
"getter": false,
|
|
200
|
-
"setter": false,
|
|
201
|
-
"reflect": false,
|
|
202
|
-
"attribute": "editable",
|
|
203
|
-
"defaultValue": "false"
|
|
204
|
-
},
|
|
205
|
-
"selectedUid": {
|
|
206
|
-
"type": "string",
|
|
207
|
-
"mutable": false,
|
|
208
|
-
"complexType": {
|
|
209
|
-
"original": "string",
|
|
210
|
-
"resolved": "string",
|
|
211
|
-
"references": {}
|
|
212
|
-
},
|
|
213
|
-
"required": false,
|
|
214
|
-
"optional": true,
|
|
215
|
-
"docs": {
|
|
216
|
-
"tags": [],
|
|
217
|
-
"text": ""
|
|
218
|
-
},
|
|
219
|
-
"getter": false,
|
|
220
|
-
"setter": false,
|
|
221
|
-
"reflect": false,
|
|
222
|
-
"attribute": "selected-uid"
|
|
223
|
-
},
|
|
224
|
-
"errors": {
|
|
225
|
-
"type": "unknown",
|
|
226
|
-
"mutable": false,
|
|
227
|
-
"complexType": {
|
|
228
|
-
"original": "Record<string, string>",
|
|
229
|
-
"resolved": "string",
|
|
230
|
-
"references": {
|
|
231
|
-
"Record": {
|
|
232
|
-
"location": "global",
|
|
233
|
-
"id": "global::Record"
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
},
|
|
237
|
-
"required": false,
|
|
238
|
-
"optional": false,
|
|
239
|
-
"docs": {
|
|
240
|
-
"tags": [],
|
|
241
|
-
"text": ""
|
|
242
|
-
},
|
|
243
|
-
"getter": false,
|
|
244
|
-
"setter": false,
|
|
245
|
-
"defaultValue": "{}"
|
|
246
|
-
},
|
|
247
|
-
"locale": {
|
|
248
|
-
"type": "string",
|
|
249
|
-
"mutable": false,
|
|
250
|
-
"complexType": {
|
|
251
|
-
"original": "string",
|
|
252
|
-
"resolved": "string",
|
|
253
|
-
"references": {}
|
|
254
|
-
},
|
|
255
|
-
"required": false,
|
|
256
|
-
"optional": true,
|
|
257
|
-
"docs": {
|
|
258
|
-
"tags": [],
|
|
259
|
-
"text": ""
|
|
260
|
-
},
|
|
261
|
-
"getter": false,
|
|
262
|
-
"setter": false,
|
|
263
|
-
"reflect": false,
|
|
264
|
-
"attribute": "locale"
|
|
265
|
-
},
|
|
266
|
-
"utils": {
|
|
267
|
-
"type": "unknown",
|
|
268
|
-
"mutable": false,
|
|
269
|
-
"complexType": {
|
|
270
|
-
"original": "Utils",
|
|
271
|
-
"resolved": "object & { validateForm: () => { isValid: boolean; }; }",
|
|
272
|
-
"references": {
|
|
273
|
-
"Utils": {
|
|
274
|
-
"location": "import",
|
|
275
|
-
"path": "@streamline-pulse/formkrafter-core",
|
|
276
|
-
"id": "../core/dist/index.d.ts::Utils",
|
|
277
|
-
"referenceLocation": "Utils"
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
},
|
|
281
|
-
"required": true,
|
|
282
|
-
"optional": false,
|
|
283
|
-
"docs": {
|
|
284
|
-
"tags": [],
|
|
285
|
-
"text": ""
|
|
286
|
-
},
|
|
287
|
-
"getter": false,
|
|
288
|
-
"setter": false
|
|
289
|
-
}
|
|
290
|
-
};
|
|
291
|
-
}
|
|
292
|
-
static get events() {
|
|
293
|
-
return [{
|
|
294
|
-
"method": "brickDataChange",
|
|
295
|
-
"name": "brickDataChange",
|
|
296
|
-
"bubbles": true,
|
|
297
|
-
"cancelable": true,
|
|
298
|
-
"composed": true,
|
|
299
|
-
"docs": {
|
|
300
|
-
"tags": [],
|
|
301
|
-
"text": ""
|
|
302
|
-
},
|
|
303
|
-
"complexType": {
|
|
304
|
-
"original": "Record<string, unknown>",
|
|
305
|
-
"resolved": "string | unknown",
|
|
306
|
-
"references": {
|
|
307
|
-
"Record": {
|
|
308
|
-
"location": "global",
|
|
309
|
-
"id": "global::Record"
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
}
|
|
313
|
-
}, {
|
|
314
|
-
"method": "brickConfigsChange",
|
|
315
|
-
"name": "brickConfigsChange",
|
|
316
|
-
"bubbles": true,
|
|
317
|
-
"cancelable": true,
|
|
318
|
-
"composed": true,
|
|
319
|
-
"docs": {
|
|
320
|
-
"tags": [],
|
|
321
|
-
"text": ""
|
|
322
|
-
},
|
|
323
|
-
"complexType": {
|
|
324
|
-
"original": "BrickConfigsChangeDetail",
|
|
325
|
-
"resolved": "BrickConfigsChangeDetail",
|
|
326
|
-
"references": {
|
|
327
|
-
"BrickConfigsChangeDetail": {
|
|
328
|
-
"location": "import",
|
|
329
|
-
"path": "../../utils/events",
|
|
330
|
-
"id": "src/utils/events.ts::BrickConfigsChangeDetail",
|
|
331
|
-
"referenceLocation": "BrickConfigsChangeDetail"
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
}, {
|
|
336
|
-
"method": "brickStylesChange",
|
|
337
|
-
"name": "brickStylesChange",
|
|
338
|
-
"bubbles": true,
|
|
339
|
-
"cancelable": true,
|
|
340
|
-
"composed": true,
|
|
341
|
-
"docs": {
|
|
342
|
-
"tags": [],
|
|
343
|
-
"text": ""
|
|
344
|
-
},
|
|
345
|
-
"complexType": {
|
|
346
|
-
"original": "BrickStylesChangeDetail",
|
|
347
|
-
"resolved": "BrickStylesChangeDetail",
|
|
348
|
-
"references": {
|
|
349
|
-
"BrickStylesChangeDetail": {
|
|
350
|
-
"location": "import",
|
|
351
|
-
"path": "../../utils/events",
|
|
352
|
-
"id": "src/utils/events.ts::BrickStylesChangeDetail",
|
|
353
|
-
"referenceLocation": "BrickStylesChangeDetail"
|
|
354
|
-
}
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
}, {
|
|
358
|
-
"method": "brickValidationsChange",
|
|
359
|
-
"name": "brickValidationsChange",
|
|
360
|
-
"bubbles": true,
|
|
361
|
-
"cancelable": true,
|
|
362
|
-
"composed": true,
|
|
363
|
-
"docs": {
|
|
364
|
-
"tags": [],
|
|
365
|
-
"text": ""
|
|
366
|
-
},
|
|
367
|
-
"complexType": {
|
|
368
|
-
"original": "BrickValidationsChangeDetail",
|
|
369
|
-
"resolved": "BrickValidationsChangeDetail",
|
|
370
|
-
"references": {
|
|
371
|
-
"BrickValidationsChangeDetail": {
|
|
372
|
-
"location": "import",
|
|
373
|
-
"path": "../../utils/events",
|
|
374
|
-
"id": "src/utils/events.ts::BrickValidationsChangeDetail",
|
|
375
|
-
"referenceLocation": "BrickValidationsChangeDetail"
|
|
376
|
-
}
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
}, {
|
|
380
|
-
"method": "brickRulesChange",
|
|
381
|
-
"name": "brickRulesChange",
|
|
382
|
-
"bubbles": true,
|
|
383
|
-
"cancelable": true,
|
|
384
|
-
"composed": true,
|
|
385
|
-
"docs": {
|
|
386
|
-
"tags": [],
|
|
387
|
-
"text": ""
|
|
388
|
-
},
|
|
389
|
-
"complexType": {
|
|
390
|
-
"original": "BrickRulesChangeDetail",
|
|
391
|
-
"resolved": "BrickRulesChangeDetail",
|
|
392
|
-
"references": {
|
|
393
|
-
"BrickRulesChangeDetail": {
|
|
394
|
-
"location": "import",
|
|
395
|
-
"path": "../../utils/events",
|
|
396
|
-
"id": "src/utils/events.ts::BrickRulesChangeDetail",
|
|
397
|
-
"referenceLocation": "BrickRulesChangeDetail"
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
}, {
|
|
402
|
-
"method": "brickRemove",
|
|
403
|
-
"name": "brickRemove",
|
|
404
|
-
"bubbles": true,
|
|
405
|
-
"cancelable": true,
|
|
406
|
-
"composed": true,
|
|
407
|
-
"docs": {
|
|
408
|
-
"tags": [],
|
|
409
|
-
"text": ""
|
|
410
|
-
},
|
|
411
|
-
"complexType": {
|
|
412
|
-
"original": "BrickPathDetail",
|
|
413
|
-
"resolved": "BrickPathDetail",
|
|
414
|
-
"references": {
|
|
415
|
-
"BrickPathDetail": {
|
|
416
|
-
"location": "import",
|
|
417
|
-
"path": "../../utils/events",
|
|
418
|
-
"id": "src/utils/events.ts::BrickPathDetail",
|
|
419
|
-
"referenceLocation": "BrickPathDetail"
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
}, {
|
|
424
|
-
"method": "brickDuplicate",
|
|
425
|
-
"name": "brickDuplicate",
|
|
426
|
-
"bubbles": true,
|
|
427
|
-
"cancelable": true,
|
|
428
|
-
"composed": true,
|
|
429
|
-
"docs": {
|
|
430
|
-
"tags": [],
|
|
431
|
-
"text": ""
|
|
432
|
-
},
|
|
433
|
-
"complexType": {
|
|
434
|
-
"original": "BrickPathDetail",
|
|
435
|
-
"resolved": "BrickPathDetail",
|
|
436
|
-
"references": {
|
|
437
|
-
"BrickPathDetail": {
|
|
438
|
-
"location": "import",
|
|
439
|
-
"path": "../../utils/events",
|
|
440
|
-
"id": "src/utils/events.ts::BrickPathDetail",
|
|
441
|
-
"referenceLocation": "BrickPathDetail"
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
}];
|
|
446
|
-
}
|
|
447
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
:host {
|
|
2
|
-
display: block;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
:host .cm-editor {
|
|
6
|
-
min-height: 88px;
|
|
7
|
-
font-size: 0.75rem;
|
|
8
|
-
border: 1px solid var(--fk-color-border);
|
|
9
|
-
border-radius: calc(var(--fk-radius) / 2);
|
|
10
|
-
background: var(--fk-color-surface);
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
:host .cm-editor.cm-focused {
|
|
14
|
-
outline: none;
|
|
15
|
-
border-color: var(--fk-color-primary);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
:host .cm-gutters {
|
|
19
|
-
border-right: 1px solid var(--fk-color-border);
|
|
20
|
-
background: color-mix(in srgb, var(--fk-color-surface) 70%, transparent);
|
|
21
|
-
color: var(--fk-color-muted);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
:host .cm-content {
|
|
25
|
-
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
26
|
-
}
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
const fetchCodeMirror = () => Promise.all([
|
|
2
|
-
import('@codemirror/state'),
|
|
3
|
-
import('@codemirror/view'),
|
|
4
|
-
import('@codemirror/commands'),
|
|
5
|
-
import('@codemirror/language'),
|
|
6
|
-
import('@codemirror/lang-javascript'),
|
|
7
|
-
]);
|
|
8
|
-
let codeMirrorModules;
|
|
9
|
-
const loadCodeMirror = () => (codeMirrorModules !== null && codeMirrorModules !== void 0 ? codeMirrorModules : (codeMirrorModules = fetchCodeMirror()));
|
|
10
|
-
export class FkCodeEditor {
|
|
11
|
-
constructor() {
|
|
12
|
-
this.value = '';
|
|
13
|
-
this.placeholder = '';
|
|
14
|
-
this.disconnected = false;
|
|
15
|
-
}
|
|
16
|
-
async componentDidLoad() {
|
|
17
|
-
const [{ EditorState }, { EditorView: View, keymap, lineNumbers, placeholder: cmPlaceholder }, { defaultKeymap, history, historyKeymap }, { defaultHighlightStyle, syntaxHighlighting }, { javascript },] = await loadCodeMirror();
|
|
18
|
-
if (this.disconnected)
|
|
19
|
-
return;
|
|
20
|
-
this.view = new View({
|
|
21
|
-
parent: this.host,
|
|
22
|
-
state: EditorState.create({
|
|
23
|
-
doc: this.value,
|
|
24
|
-
extensions: [
|
|
25
|
-
lineNumbers(),
|
|
26
|
-
history(),
|
|
27
|
-
keymap.of([...defaultKeymap, ...historyKeymap]),
|
|
28
|
-
javascript(),
|
|
29
|
-
syntaxHighlighting(defaultHighlightStyle),
|
|
30
|
-
cmPlaceholder(this.placeholder),
|
|
31
|
-
View.domEventHandlers({
|
|
32
|
-
blur: () => this.emitIfChanged(),
|
|
33
|
-
}),
|
|
34
|
-
],
|
|
35
|
-
}),
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
syncValue(next) {
|
|
39
|
-
if (!this.view || this.view.hasFocus)
|
|
40
|
-
return;
|
|
41
|
-
const current = this.view.state.doc.toString();
|
|
42
|
-
if (current !== next) {
|
|
43
|
-
this.view.dispatch({
|
|
44
|
-
changes: { from: 0, to: current.length, insert: next },
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
emitIfChanged() {
|
|
49
|
-
if (!this.view)
|
|
50
|
-
return;
|
|
51
|
-
const doc = this.view.state.doc.toString();
|
|
52
|
-
if (doc !== this.value)
|
|
53
|
-
this.codeChange.emit(doc);
|
|
54
|
-
}
|
|
55
|
-
disconnectedCallback() {
|
|
56
|
-
var _a;
|
|
57
|
-
this.disconnected = true;
|
|
58
|
-
(_a = this.view) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
59
|
-
this.view = undefined;
|
|
60
|
-
}
|
|
61
|
-
render() {
|
|
62
|
-
return null;
|
|
63
|
-
}
|
|
64
|
-
static get is() { return "fk-code-editor"; }
|
|
65
|
-
static get encapsulation() { return "scoped"; }
|
|
66
|
-
static get originalStyleUrls() {
|
|
67
|
-
return {
|
|
68
|
-
"$": ["fk-code-editor.css"]
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
static get styleUrls() {
|
|
72
|
-
return {
|
|
73
|
-
"$": ["fk-code-editor.css"]
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
static get properties() {
|
|
77
|
-
return {
|
|
78
|
-
"value": {
|
|
79
|
-
"type": "string",
|
|
80
|
-
"mutable": false,
|
|
81
|
-
"complexType": {
|
|
82
|
-
"original": "string",
|
|
83
|
-
"resolved": "string",
|
|
84
|
-
"references": {}
|
|
85
|
-
},
|
|
86
|
-
"required": false,
|
|
87
|
-
"optional": false,
|
|
88
|
-
"docs": {
|
|
89
|
-
"tags": [],
|
|
90
|
-
"text": ""
|
|
91
|
-
},
|
|
92
|
-
"getter": false,
|
|
93
|
-
"setter": false,
|
|
94
|
-
"reflect": false,
|
|
95
|
-
"attribute": "value",
|
|
96
|
-
"defaultValue": "''"
|
|
97
|
-
},
|
|
98
|
-
"placeholder": {
|
|
99
|
-
"type": "string",
|
|
100
|
-
"mutable": false,
|
|
101
|
-
"complexType": {
|
|
102
|
-
"original": "string",
|
|
103
|
-
"resolved": "string",
|
|
104
|
-
"references": {}
|
|
105
|
-
},
|
|
106
|
-
"required": false,
|
|
107
|
-
"optional": false,
|
|
108
|
-
"docs": {
|
|
109
|
-
"tags": [],
|
|
110
|
-
"text": ""
|
|
111
|
-
},
|
|
112
|
-
"getter": false,
|
|
113
|
-
"setter": false,
|
|
114
|
-
"reflect": false,
|
|
115
|
-
"attribute": "placeholder",
|
|
116
|
-
"defaultValue": "''"
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
static get events() {
|
|
121
|
-
return [{
|
|
122
|
-
"method": "codeChange",
|
|
123
|
-
"name": "codeChange",
|
|
124
|
-
"bubbles": true,
|
|
125
|
-
"cancelable": true,
|
|
126
|
-
"composed": true,
|
|
127
|
-
"docs": {
|
|
128
|
-
"tags": [],
|
|
129
|
-
"text": ""
|
|
130
|
-
},
|
|
131
|
-
"complexType": {
|
|
132
|
-
"original": "string",
|
|
133
|
-
"resolved": "string",
|
|
134
|
-
"references": {}
|
|
135
|
-
}
|
|
136
|
-
}];
|
|
137
|
-
}
|
|
138
|
-
static get elementRef() { return "host"; }
|
|
139
|
-
static get watchers() {
|
|
140
|
-
return [{
|
|
141
|
-
"propName": "value",
|
|
142
|
-
"methodName": "syncValue"
|
|
143
|
-
}];
|
|
144
|
-
}
|
|
145
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
:host {
|
|
2
|
-
display: block;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
|
-
.fk-grid {
|
|
6
|
-
display: flex;
|
|
7
|
-
flex-direction: column;
|
|
8
|
-
gap: var(--fk-spacing);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
.fk-grid__empty {
|
|
12
|
-
margin: 0;
|
|
13
|
-
padding: var(--fk-spacing);
|
|
14
|
-
border: 1px dashed var(--fk-color-border);
|
|
15
|
-
border-radius: var(--fk-radius);
|
|
16
|
-
font-size: 0.85rem;
|
|
17
|
-
color: var(--fk-color-muted);
|
|
18
|
-
text-align: center;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.fk-grid__row {
|
|
22
|
-
display: flex;
|
|
23
|
-
align-items: flex-start;
|
|
24
|
-
gap: var(--fk-spacing);
|
|
25
|
-
padding: var(--fk-spacing);
|
|
26
|
-
border: 1px solid var(--fk-color-border);
|
|
27
|
-
border-radius: var(--fk-radius);
|
|
28
|
-
background: color-mix(in srgb, var(--fk-color-surface) 60%, transparent);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.fk-grid__cells {
|
|
32
|
-
display: flex;
|
|
33
|
-
flex: 1;
|
|
34
|
-
flex-wrap: wrap;
|
|
35
|
-
gap: var(--fk-spacing);
|
|
36
|
-
min-width: 0;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.fk-grid__cells > * {
|
|
40
|
-
flex: 1;
|
|
41
|
-
min-width: 160px;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.fk-grid__remove {
|
|
45
|
-
border: none;
|
|
46
|
-
background: transparent;
|
|
47
|
-
color: var(--fk-color-muted);
|
|
48
|
-
font-size: 0.8rem;
|
|
49
|
-
cursor: pointer;
|
|
50
|
-
padding: 4px 6px;
|
|
51
|
-
border-radius: calc(var(--fk-radius) / 2);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.fk-grid__remove:hover:not(:disabled) {
|
|
55
|
-
color: var(--fk-color-danger);
|
|
56
|
-
background: color-mix(in srgb, var(--fk-color-danger) 10%, transparent);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.fk-grid__add {
|
|
60
|
-
align-self: flex-start;
|
|
61
|
-
font: inherit;
|
|
62
|
-
font-size: 0.8rem;
|
|
63
|
-
font-weight: 600;
|
|
64
|
-
padding: calc(var(--fk-spacing) / 1.5) var(--fk-spacing);
|
|
65
|
-
border: 1px dashed var(--fk-color-border);
|
|
66
|
-
border-radius: var(--fk-radius);
|
|
67
|
-
background: transparent;
|
|
68
|
-
color: var(--fk-color-muted);
|
|
69
|
-
cursor: pointer;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.fk-grid__add:hover:not(:disabled) {
|
|
73
|
-
border-color: var(--fk-color-primary);
|
|
74
|
-
color: var(--fk-color-primary);
|
|
75
|
-
}
|