@streamline-pulse/formkrafter-wc 0.2.0 → 0.3.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 +1 -1
- package/dist/cjs/fk-brick-actions_18.cjs.entry.js +188 -22407
- package/dist/cjs/formkrafter-wc.cjs.js +2 -2
- package/dist/cjs/index-Bhy1RJMV.js +3042 -0
- package/dist/cjs/{index-CbyFxLc_.js → index-CImTe9BG.js} +14 -2
- package/dist/cjs/index-CdaT3-qx.js +5444 -0
- package/dist/cjs/{index-Can2MpG5.js → index-CkPPRg03.js} +27 -17
- package/dist/cjs/index-DHgK3reD.js +12233 -0
- package/dist/cjs/index-Ds0sDbXV.js +4019 -0
- package/dist/cjs/index-c9BL7y3N.js +1922 -0
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/components/fk-code-editor/fk-code-editor.js +17 -8
- package/dist/collection/components/fk-file-input/fk-file-input.js +67 -24
- package/dist/collection/components/fk-property-panel/fk-property-panel.js +5 -1
- package/dist/collection/components/fk-select-input/fk-select-input.css +9 -0
- package/dist/collection/components/fk-select-input/fk-select-input.js +118 -20
- package/dist/collection/components/fk-stepper/fk-stepper.css +14 -0
- package/dist/collection/components/fk-stepper/fk-stepper.js +4 -1
- package/dist/collection/components/fk-tabs/fk-tabs.js +15 -2
- package/dist/collection/i18n/i18n.js +8 -0
- package/dist/collection/registry/default-bricks.js +16 -14
- 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-B0YjIsVn.js → p--vL6GR31.js} +1 -1
- package/dist/components/p-4COASNrZ.js +1 -0
- package/dist/components/p-BB4Llg42.js +1 -0
- package/dist/components/p-BGkZP87K.js +1 -0
- package/dist/components/p-BOmBVgfJ.js +1 -0
- package/dist/components/p-BWdm2a6q.js +1 -0
- package/dist/components/{p-GjmAhT2E.js → p-B_-x-GlA.js} +1 -1
- package/dist/components/p-Br1s4Ujx.js +1 -0
- package/dist/components/p-C-wnqV3i.js +1 -0
- package/dist/components/{p-BDvqHJih.js → p-CIfjRTky.js} +1 -1
- package/dist/components/{p-LXnm2ogM.js → p-CKMHMpID.js} +1 -1
- package/dist/components/p-CUF31e-P.js +1 -0
- package/dist/components/p-D6n74M9d.js +1 -0
- package/dist/components/{p-CXEvsomA.js → p-DFe3zZCI.js} +1 -1
- package/dist/components/p-DMCkrZqi.js +1 -0
- package/dist/components/p-DOInQkG6.js +1 -0
- package/dist/components/{p-BVBfbMl_.js → p-DYchD23x.js} +1 -1
- package/dist/components/p-DtcM1yw5.js +1 -0
- package/dist/components/p-NDbmiiYk.js +1 -0
- package/dist/components/p-PAr7WoWG.js +1 -0
- package/dist/components/{p-y0xDvzJR.js → p-YyGnQmX-.js} +1 -1
- package/dist/components/{p-C85zhhpr.js → p-fDJP6whN.js} +1 -1
- package/dist/components/p-swxZqinH.js +1 -0
- package/dist/components/{p-BSPTuA1p.js → p-v7LxwCAc.js} +1 -1
- package/dist/components/p-wuC5rVU7.js +1 -0
- package/dist/esm/fk-brick-actions_18.entry.js +188 -22407
- package/dist/esm/formkrafter-wc.js +3 -3
- package/dist/esm/index-BAcz7b5u.js +5416 -0
- package/dist/esm/index-BkRMoLXK.js +3029 -0
- package/dist/esm/index-CGMDfZ5m.js +1808 -0
- package/dist/esm/{index-BB2OOj__.js → index-D7Cta1UB.js} +27 -17
- package/dist/esm/index-DtcM1yw5.js +3991 -0
- package/dist/esm/index-DuVf3NlP.js +12222 -0
- package/dist/esm/{index-DMDO6w5-.js → index-qLZlXROB.js} +14 -2
- package/dist/esm/index.js +2 -2
- package/dist/esm/loader.js +3 -3
- 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-4COASNrZ.js +1 -0
- package/dist/formkrafter-wc/p-6d29555b.entry.js +1 -0
- package/dist/formkrafter-wc/p-C-wnqV3i.js +1 -0
- package/dist/formkrafter-wc/p-DMCkrZqi.js +1 -0
- package/dist/formkrafter-wc/p-DOInQkG6.js +1 -0
- package/dist/formkrafter-wc/{p-Bp_A8oL5.js → p-Ddu6BquK.js} +4 -4
- package/dist/formkrafter-wc/p-DtcM1yw5.js +1 -0
- package/dist/formkrafter-wc/p-qLZlXROB.js +2 -0
- package/dist/types/components/fk-code-editor/fk-code-editor.d.ts +2 -1
- package/dist/types/components/fk-file-input/fk-file-input.d.ts +7 -3
- package/dist/types/components/fk-select-input/fk-select-input.d.ts +9 -0
- package/dist/types/components.d.ts +22 -4
- package/package.json +2 -2
- 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-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/formkrafter-wc/p-0de7cbe1.entry.js +0 -1
- package/dist/formkrafter-wc/p-DMDO6w5-.js +0 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var index$1 = require('./index-
|
|
3
|
+
var index$1 = require('./index-CImTe9BG.js');
|
|
4
4
|
|
|
5
5
|
var _a$1;
|
|
6
6
|
const GLOBAL_KEY$2 = Symbol.for('formkrafter.wc.bricks');
|
|
@@ -15785,7 +15785,7 @@ function buildValidationSchema(brickSpecs, locale) {
|
|
|
15785
15785
|
};
|
|
15786
15786
|
for (const brick of iterateSchemaBricks(brickSpecs)) {
|
|
15787
15787
|
const key = brick.configs?.key;
|
|
15788
|
-
const dataType = brick.dataType;
|
|
15788
|
+
const dataType = brick.configs?.multiple === true && brick.dataType === "object" ? "array" : brick.dataType;
|
|
15789
15789
|
if (!key || !dataType || dataType === "void")
|
|
15790
15790
|
continue;
|
|
15791
15791
|
const isRequired = brick.validations?.find((validation2) => validation2.validator === "required");
|
|
@@ -16593,7 +16593,7 @@ class SpecHistory {
|
|
|
16593
16593
|
}
|
|
16594
16594
|
}
|
|
16595
16595
|
|
|
16596
|
-
//# debugId=
|
|
16596
|
+
//# debugId=889DCABFD85A92E164756E2164756E21
|
|
16597
16597
|
|
|
16598
16598
|
function createBrick(params) {
|
|
16599
16599
|
return new (class extends Brick {
|
|
@@ -16699,6 +16699,9 @@ const en = {
|
|
|
16699
16699
|
'panel.placeholder': 'Placeholder',
|
|
16700
16700
|
'panel.prefix': 'Prefix',
|
|
16701
16701
|
'panel.suffix': 'Suffix',
|
|
16702
|
+
'panel.accept': 'Accepted file types',
|
|
16703
|
+
'panel.uploadUrl': 'Upload URL',
|
|
16704
|
+
'panel.cfg.multiple': 'Allow multiple files',
|
|
16702
16705
|
'panel.optionsSource': 'Options source',
|
|
16703
16706
|
'panel.options': 'Options (one per line)',
|
|
16704
16707
|
'panel.content': 'Content',
|
|
@@ -16726,6 +16729,7 @@ const en = {
|
|
|
16726
16729
|
'file.choose': 'Choose a file…',
|
|
16727
16730
|
'file.uploading': 'Uploading…',
|
|
16728
16731
|
'file.remove': 'Remove file',
|
|
16732
|
+
'file.addAnother': '+ Add a file',
|
|
16729
16733
|
'address.street': 'Street',
|
|
16730
16734
|
'address.city': 'City',
|
|
16731
16735
|
'address.zip': 'Postal code',
|
|
@@ -16818,6 +16822,9 @@ const frFkTranslations = {
|
|
|
16818
16822
|
'panel.placeholder': 'Placeholder',
|
|
16819
16823
|
'panel.prefix': 'Préfixe',
|
|
16820
16824
|
'panel.suffix': 'Suffixe',
|
|
16825
|
+
'panel.accept': 'Types de fichiers acceptés',
|
|
16826
|
+
'panel.uploadUrl': "URL d'upload",
|
|
16827
|
+
'panel.cfg.multiple': 'Autoriser plusieurs fichiers',
|
|
16821
16828
|
'panel.optionsSource': 'Source des options',
|
|
16822
16829
|
'panel.options': 'Options (une par ligne)',
|
|
16823
16830
|
'panel.content': 'Contenu',
|
|
@@ -16845,6 +16852,7 @@ const frFkTranslations = {
|
|
|
16845
16852
|
'file.choose': 'Choisir un fichier…',
|
|
16846
16853
|
'file.uploading': 'Envoi en cours…',
|
|
16847
16854
|
'file.remove': 'Retirer le fichier',
|
|
16855
|
+
'file.addAnother': '+ Ajouter un fichier',
|
|
16848
16856
|
'address.street': 'Rue',
|
|
16849
16857
|
'address.city': 'Ville',
|
|
16850
16858
|
'address.zip': 'Code postal',
|
|
@@ -16930,8 +16938,10 @@ const adorned = (props, control) => {
|
|
|
16930
16938
|
return control;
|
|
16931
16939
|
return (index$1.h("div", { class: "fk-adorned" }, prefix ? index$1.h("span", { class: "fk-adorned__affix" }, prefix) : null, control, suffix ? index$1.h("span", { class: "fk-adorned__affix" }, suffix) : null));
|
|
16932
16940
|
};
|
|
16933
|
-
const
|
|
16934
|
-
const
|
|
16941
|
+
const fieldError = (props) => props.error ? (index$1.h("span", { class: "fk-field__error", role: "alert" }, props.error)) : null;
|
|
16942
|
+
const invalidAttr = (props) => props.error ? { 'aria-invalid': 'true' } : {};
|
|
16943
|
+
const fieldBlock = (props, fallback, control) => (index$1.h("div", { class: "fk-field", style: asInlineStyle(props.styles) }, index$1.h("span", { class: "fk-field__label" }, labelOf(props, fallback)), control, fieldError(props)));
|
|
16944
|
+
const field = (props, fallback, control) => (index$1.h("label", { class: "fk-field", style: asInlineStyle(props.styles) }, index$1.h("span", { class: "fk-field__label" }, labelOf(props, fallback)), control, fieldError(props)));
|
|
16935
16945
|
const createTextVariant = (params) => createBrick({
|
|
16936
16946
|
type: 'input',
|
|
16937
16947
|
dataType: 'string',
|
|
@@ -16941,7 +16951,7 @@ const createTextVariant = (params) => createBrick({
|
|
|
16941
16951
|
defaultConfigs: { label: params.name },
|
|
16942
16952
|
render: (props) => {
|
|
16943
16953
|
var _a, _b;
|
|
16944
|
-
return field(props, params.name, adorned(props, index$1.h("input", { class: "fk-field__input fk-adorned__input", type: params.inputType, value: (_a = props.data) !== null && _a !== void 0 ? _a : '', placeholder: (_b = props.configs) === null || _b === void 0 ? void 0 : _b.placeholder, disabled: props.editable || props.disabled, onInput: (event) => { var _a; return (_a = props.onDataChange) === null || _a === void 0 ? void 0 : _a.call(props, event.target.value); } })));
|
|
16954
|
+
return field(props, params.name, adorned(props, index$1.h("input", Object.assign({}, invalidAttr(props), { class: "fk-field__input fk-adorned__input", type: params.inputType, value: (_a = props.data) !== null && _a !== void 0 ? _a : '', placeholder: (_b = props.configs) === null || _b === void 0 ? void 0 : _b.placeholder, disabled: props.editable || props.disabled, onInput: (event) => { var _a; return (_a = props.onDataChange) === null || _a === void 0 ? void 0 : _a.call(props, event.target.value); } }))));
|
|
16945
16955
|
},
|
|
16946
16956
|
});
|
|
16947
16957
|
const textInputBrick = createTextVariant({
|
|
@@ -16978,7 +16988,7 @@ const textareaBrick = createBrick({
|
|
|
16978
16988
|
defaultConfigs: { label: 'Text area' },
|
|
16979
16989
|
render: (props) => {
|
|
16980
16990
|
var _a, _b;
|
|
16981
|
-
return field(props, 'Text area', index$1.h("textarea", { class: "fk-field__input fk-field__input--textarea", value: (_a = props.data) !== null && _a !== void 0 ? _a : '', placeholder: (_b = props.configs) === null || _b === void 0 ? void 0 : _b.placeholder, disabled: props.editable || props.disabled, onInput: (event) => { var _a; return (_a = props.onDataChange) === null || _a === void 0 ? void 0 : _a.call(props, event.target.value); } }));
|
|
16991
|
+
return field(props, 'Text area', index$1.h("textarea", Object.assign({}, invalidAttr(props), { class: "fk-field__input fk-field__input--textarea", value: (_a = props.data) !== null && _a !== void 0 ? _a : '', placeholder: (_b = props.configs) === null || _b === void 0 ? void 0 : _b.placeholder, disabled: props.editable || props.disabled, onInput: (event) => { var _a; return (_a = props.onDataChange) === null || _a === void 0 ? void 0 : _a.call(props, event.target.value); } })));
|
|
16982
16992
|
},
|
|
16983
16993
|
});
|
|
16984
16994
|
const numberBrick = createBrick({
|
|
@@ -16990,11 +17000,11 @@ const numberBrick = createBrick({
|
|
|
16990
17000
|
defaultConfigs: { label: 'Number' },
|
|
16991
17001
|
render: (props) => {
|
|
16992
17002
|
var _a;
|
|
16993
|
-
return field(props, 'Number', adorned(props, index$1.h("input", { class: "fk-field__input fk-adorned__input", type: "number", value: props.data == null ? '' : String(props.data), placeholder: (_a = props.configs) === null || _a === void 0 ? void 0 : _a.placeholder, disabled: props.editable || props.disabled, onInput: (event) => {
|
|
17003
|
+
return field(props, 'Number', adorned(props, index$1.h("input", Object.assign({}, invalidAttr(props), { class: "fk-field__input fk-adorned__input", type: "number", value: props.data == null ? '' : String(props.data), placeholder: (_a = props.configs) === null || _a === void 0 ? void 0 : _a.placeholder, disabled: props.editable || props.disabled, onInput: (event) => {
|
|
16994
17004
|
var _a;
|
|
16995
17005
|
const raw = event.target.value;
|
|
16996
17006
|
(_a = props.onDataChange) === null || _a === void 0 ? void 0 : _a.call(props, raw === '' ? undefined : Number(raw));
|
|
16997
|
-
} })));
|
|
17007
|
+
} }))));
|
|
16998
17008
|
},
|
|
16999
17009
|
});
|
|
17000
17010
|
const dateBrick = createBrick({
|
|
@@ -17006,11 +17016,11 @@ const dateBrick = createBrick({
|
|
|
17006
17016
|
defaultConfigs: { label: 'Date' },
|
|
17007
17017
|
render: (props) => {
|
|
17008
17018
|
var _a;
|
|
17009
|
-
return field(props, 'Date', index$1.h("input", { class: "fk-field__input", type: "date", value: (_a = props.data) !== null && _a !== void 0 ? _a : '', disabled: props.editable || props.disabled, onInput: (event) => {
|
|
17019
|
+
return field(props, 'Date', index$1.h("input", Object.assign({}, invalidAttr(props), { class: "fk-field__input", type: "date", value: (_a = props.data) !== null && _a !== void 0 ? _a : '', disabled: props.editable || props.disabled, onInput: (event) => {
|
|
17010
17020
|
var _a;
|
|
17011
17021
|
const raw = event.target.value;
|
|
17012
17022
|
(_a = props.onDataChange) === null || _a === void 0 ? void 0 : _a.call(props, raw === '' ? undefined : raw);
|
|
17013
|
-
} }));
|
|
17023
|
+
} })));
|
|
17014
17024
|
},
|
|
17015
17025
|
});
|
|
17016
17026
|
const selectBrick = createBrick({
|
|
@@ -17026,7 +17036,7 @@ const selectBrick = createBrick({
|
|
|
17026
17036
|
},
|
|
17027
17037
|
render: (props) => {
|
|
17028
17038
|
var _a;
|
|
17029
|
-
return fieldBlock(props, 'Select', index$1.h("fk-select-input", { configs: props.configs, value: (_a = props.data) !== null && _a !== void 0 ? _a : '', disabled: props.editable || props.disabled, dataMap: props.dataMap, onSelectValueChange: (event) => {
|
|
17039
|
+
return fieldBlock(props, 'Select', index$1.h("fk-select-input", { configs: props.configs, value: (_a = props.data) !== null && _a !== void 0 ? _a : '', disabled: props.editable || props.disabled, invalid: !!props.error, dataMap: props.dataMap, onSelectValueChange: (event) => {
|
|
17030
17040
|
var _a;
|
|
17031
17041
|
event.stopPropagation();
|
|
17032
17042
|
(_a = props.onDataChange) === null || _a === void 0 ? void 0 : _a.call(props, event.detail);
|
|
@@ -17044,7 +17054,7 @@ const multiSelectBrick = createBrick({
|
|
|
17044
17054
|
optionsSource: 'static',
|
|
17045
17055
|
options: 'Option 1\nOption 2\nOption 3',
|
|
17046
17056
|
},
|
|
17047
|
-
render: (props) => fieldBlock(props, 'Multi select', index$1.h("fk-select-input", { configs: props.configs, value: Array.isArray(props.data) ? props.data : [], multiple: true, disabled: props.editable || props.disabled, dataMap: props.dataMap, onSelectValueChange: (event) => {
|
|
17057
|
+
render: (props) => fieldBlock(props, 'Multi select', index$1.h("fk-select-input", { configs: props.configs, value: Array.isArray(props.data) ? props.data : [], multiple: true, disabled: props.editable || props.disabled, invalid: !!props.error, dataMap: props.dataMap, onSelectValueChange: (event) => {
|
|
17048
17058
|
var _a;
|
|
17049
17059
|
event.stopPropagation();
|
|
17050
17060
|
(_a = props.onDataChange) === null || _a === void 0 ? void 0 : _a.call(props, event.detail);
|
|
@@ -17152,7 +17162,7 @@ const radioBrick = createBrick({
|
|
|
17152
17162
|
name: 'Radio',
|
|
17153
17163
|
category: 'Inputs',
|
|
17154
17164
|
defaultConfigs: { label: 'Radio', options: 'Option 1\nOption 2' },
|
|
17155
|
-
render: (props) => (index$1.h("div", { class: "fk-field", style: asInlineStyle(props.styles) }, index$1.h("span", { class: "fk-field__label" }, labelOf(props, 'Radio')), index$1.h("div", { class: "fk-radio-group", role: "radiogroup" }, staticOptions(props).map((option) => {
|
|
17165
|
+
render: (props) => (index$1.h("div", { class: "fk-field", style: asInlineStyle(props.styles) }, index$1.h("span", { class: "fk-field__label" }, labelOf(props, 'Radio')), index$1.h("div", Object.assign({ class: "fk-radio-group", role: "radiogroup" }, invalidAttr(props)), staticOptions(props).map((option) => {
|
|
17156
17166
|
var _a, _b;
|
|
17157
17167
|
return (index$1.h("label", { class: "fk-radio", key: option.value }, index$1.h("input", { type: "radio", name: (_b = (_a = props.configs) === null || _a === void 0 ? void 0 : _a.key) !== null && _b !== void 0 ? _b : props.path, checked: props.data === option.value, disabled: props.editable || props.disabled, onChange: () => { var _a; return (_a = props.onDataChange) === null || _a === void 0 ? void 0 : _a.call(props, option.value); } }), index$1.h("span", null, option.label)));
|
|
17158
17168
|
})), props.error ? index$1.h("span", { class: "fk-field__error" }, props.error) : null)),
|
|
@@ -17191,10 +17201,10 @@ const fileBrick = createBrick({
|
|
|
17191
17201
|
id: 'file',
|
|
17192
17202
|
name: 'File',
|
|
17193
17203
|
category: 'Data',
|
|
17194
|
-
defaultConfigs: { label: 'File' },
|
|
17204
|
+
defaultConfigs: { label: 'File', accept: '', uploadUrl: '', multiple: false },
|
|
17195
17205
|
render: (props) => {
|
|
17196
|
-
var _a, _b;
|
|
17197
|
-
return fieldBlock(props, 'File', index$1.h("fk-file-input", { value: props.data, accept: (_a = props.configs) === null || _a === void 0 ? void 0 : _a.accept, uploadUrl: (_b = props.configs) === null || _b === void 0 ? void 0 : _b.uploadUrl, disabled: props.editable || props.disabled, onFileValueChange: (event) => {
|
|
17206
|
+
var _a, _b, _c;
|
|
17207
|
+
return fieldBlock(props, 'File', index$1.h("fk-file-input", { value: props.data, accept: (_a = props.configs) === null || _a === void 0 ? void 0 : _a.accept, uploadUrl: (_b = props.configs) === null || _b === void 0 ? void 0 : _b.uploadUrl, multiple: ((_c = props.configs) === null || _c === void 0 ? void 0 : _c.multiple) === true, disabled: props.editable || props.disabled, onFileValueChange: (event) => {
|
|
17198
17208
|
var _a;
|
|
17199
17209
|
event.stopPropagation();
|
|
17200
17210
|
(_a = props.onDataChange) === null || _a === void 0 ? void 0 : _a.call(props, event.detail);
|