@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,27 +0,0 @@
|
|
|
1
|
-
export function interpolateTemplate(template, dataMap) {
|
|
2
|
-
return template.replace(/\{(\w+)\}/g, (_, token) => {
|
|
3
|
-
const value = dataMap === null || dataMap === void 0 ? void 0 : dataMap[token];
|
|
4
|
-
return value === undefined || value === null ? '' : String(value);
|
|
5
|
-
});
|
|
6
|
-
}
|
|
7
|
-
export function parseHeaderLines(raw, dataMap) {
|
|
8
|
-
if (typeof raw !== 'string' || !raw.trim())
|
|
9
|
-
return undefined;
|
|
10
|
-
const headers = {};
|
|
11
|
-
for (const line of raw.split('\n')) {
|
|
12
|
-
const separator = line.indexOf(':');
|
|
13
|
-
if (separator <= 0)
|
|
14
|
-
continue;
|
|
15
|
-
const name = line.slice(0, separator).trim();
|
|
16
|
-
const value = interpolateTemplate(line.slice(separator + 1).trim(), dataMap);
|
|
17
|
-
if (name)
|
|
18
|
-
headers[name] = value;
|
|
19
|
-
}
|
|
20
|
-
return Object.keys(headers).length ? headers : undefined;
|
|
21
|
-
}
|
|
22
|
-
export function appendSearchParam(url, param, term) {
|
|
23
|
-
if (!term)
|
|
24
|
-
return url;
|
|
25
|
-
const separator = url.includes('?') ? '&' : '?';
|
|
26
|
-
return `${url}${separator}${encodeURIComponent(param)}=${encodeURIComponent(term)}`;
|
|
27
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
export const OPERATORS = [
|
|
2
|
-
{ id: 'equals', label: 'equals' },
|
|
3
|
-
{ id: 'notEquals', label: 'does not equal' },
|
|
4
|
-
{ id: 'greaterThan', label: 'is greater than' },
|
|
5
|
-
{ id: 'lessThan', label: 'is less than' },
|
|
6
|
-
{ id: 'isEmpty', label: 'is empty' },
|
|
7
|
-
{ id: 'isNotEmpty', label: 'is not empty' },
|
|
8
|
-
];
|
|
9
|
-
export function buildLogic(condition) {
|
|
10
|
-
const variable = { var: condition.field };
|
|
11
|
-
switch (condition.operator) {
|
|
12
|
-
case 'equals':
|
|
13
|
-
return { '==': [variable, condition.value] };
|
|
14
|
-
case 'notEquals':
|
|
15
|
-
return { '!=': [variable, condition.value] };
|
|
16
|
-
case 'greaterThan':
|
|
17
|
-
return { '>': [variable, condition.value] };
|
|
18
|
-
case 'lessThan':
|
|
19
|
-
return { '<': [variable, condition.value] };
|
|
20
|
-
case 'isEmpty':
|
|
21
|
-
return { '!': variable };
|
|
22
|
-
case 'isNotEmpty':
|
|
23
|
-
return { '!!': variable };
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
const varName = (value) => value !== null &&
|
|
27
|
-
typeof value === 'object' &&
|
|
28
|
-
typeof value.var === 'string'
|
|
29
|
-
? value.var
|
|
30
|
-
: undefined;
|
|
31
|
-
const BINARY_OPERATORS = {
|
|
32
|
-
'==': 'equals',
|
|
33
|
-
'!=': 'notEquals',
|
|
34
|
-
'>': 'greaterThan',
|
|
35
|
-
'<': 'lessThan',
|
|
36
|
-
};
|
|
37
|
-
export function parseLogic(logic) {
|
|
38
|
-
if (!logic || typeof logic !== 'object')
|
|
39
|
-
return undefined;
|
|
40
|
-
const entries = Object.entries(logic);
|
|
41
|
-
if (entries.length !== 1)
|
|
42
|
-
return undefined;
|
|
43
|
-
const [operator, args] = entries[0];
|
|
44
|
-
if (operator === '!' || operator === '!!') {
|
|
45
|
-
const field = varName(Array.isArray(args) ? args[0] : args);
|
|
46
|
-
if (!field)
|
|
47
|
-
return undefined;
|
|
48
|
-
return { field, operator: operator === '!' ? 'isEmpty' : 'isNotEmpty' };
|
|
49
|
-
}
|
|
50
|
-
const mapped = BINARY_OPERATORS[operator];
|
|
51
|
-
if (!mapped || !Array.isArray(args) || args.length !== 2)
|
|
52
|
-
return undefined;
|
|
53
|
-
const field = varName(args[0]);
|
|
54
|
-
if (!field)
|
|
55
|
-
return undefined;
|
|
56
|
-
return { field, operator: mapped, value: args[1] };
|
|
57
|
-
}
|
|
58
|
-
export function parseValueInput(raw) {
|
|
59
|
-
if (raw === '')
|
|
60
|
-
return '';
|
|
61
|
-
try {
|
|
62
|
-
return JSON.parse(raw);
|
|
63
|
-
}
|
|
64
|
-
catch (_a) {
|
|
65
|
-
return raw;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
export function formatValue(value) {
|
|
69
|
-
if (value === undefined)
|
|
70
|
-
return '';
|
|
71
|
-
return typeof value === 'string' ? value : JSON.stringify(value);
|
|
72
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
const toCamel = (key) => key.replace(/-([a-z])/g, (_, letter) => letter.toUpperCase());
|
|
2
|
-
export function asInlineStyle(styles) {
|
|
3
|
-
const entries = Object.entries(styles !== null && styles !== void 0 ? styles : {}).filter(([, value]) => value !== undefined && value !== null && value !== '');
|
|
4
|
-
if (entries.length === 0)
|
|
5
|
-
return undefined;
|
|
6
|
-
const result = {};
|
|
7
|
-
for (const [key, value] of entries) {
|
|
8
|
-
result[toCamel(key)] = String(value);
|
|
9
|
-
}
|
|
10
|
-
return result;
|
|
11
|
-
}
|