@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,4 +1,4 @@
|
|
|
1
|
-
import { h } from './index-
|
|
1
|
+
import { h } from './index-qLZlXROB.js';
|
|
2
2
|
|
|
3
3
|
var _a$1;
|
|
4
4
|
const GLOBAL_KEY$2 = Symbol.for('formkrafter.wc.bricks');
|
|
@@ -15783,7 +15783,7 @@ function buildValidationSchema(brickSpecs, locale) {
|
|
|
15783
15783
|
};
|
|
15784
15784
|
for (const brick of iterateSchemaBricks(brickSpecs)) {
|
|
15785
15785
|
const key = brick.configs?.key;
|
|
15786
|
-
const dataType = brick.dataType;
|
|
15786
|
+
const dataType = brick.configs?.multiple === true && brick.dataType === "object" ? "array" : brick.dataType;
|
|
15787
15787
|
if (!key || !dataType || dataType === "void")
|
|
15788
15788
|
continue;
|
|
15789
15789
|
const isRequired = brick.validations?.find((validation2) => validation2.validator === "required");
|
|
@@ -16591,7 +16591,7 @@ class SpecHistory {
|
|
|
16591
16591
|
}
|
|
16592
16592
|
}
|
|
16593
16593
|
|
|
16594
|
-
//# debugId=
|
|
16594
|
+
//# debugId=889DCABFD85A92E164756E2164756E21
|
|
16595
16595
|
|
|
16596
16596
|
function createBrick(params) {
|
|
16597
16597
|
return new (class extends Brick {
|
|
@@ -16697,6 +16697,9 @@ const en = {
|
|
|
16697
16697
|
'panel.placeholder': 'Placeholder',
|
|
16698
16698
|
'panel.prefix': 'Prefix',
|
|
16699
16699
|
'panel.suffix': 'Suffix',
|
|
16700
|
+
'panel.accept': 'Accepted file types',
|
|
16701
|
+
'panel.uploadUrl': 'Upload URL',
|
|
16702
|
+
'panel.cfg.multiple': 'Allow multiple files',
|
|
16700
16703
|
'panel.optionsSource': 'Options source',
|
|
16701
16704
|
'panel.options': 'Options (one per line)',
|
|
16702
16705
|
'panel.content': 'Content',
|
|
@@ -16724,6 +16727,7 @@ const en = {
|
|
|
16724
16727
|
'file.choose': 'Choose a file…',
|
|
16725
16728
|
'file.uploading': 'Uploading…',
|
|
16726
16729
|
'file.remove': 'Remove file',
|
|
16730
|
+
'file.addAnother': '+ Add a file',
|
|
16727
16731
|
'address.street': 'Street',
|
|
16728
16732
|
'address.city': 'City',
|
|
16729
16733
|
'address.zip': 'Postal code',
|
|
@@ -16816,6 +16820,9 @@ const frFkTranslations = {
|
|
|
16816
16820
|
'panel.placeholder': 'Placeholder',
|
|
16817
16821
|
'panel.prefix': 'Préfixe',
|
|
16818
16822
|
'panel.suffix': 'Suffixe',
|
|
16823
|
+
'panel.accept': 'Types de fichiers acceptés',
|
|
16824
|
+
'panel.uploadUrl': "URL d'upload",
|
|
16825
|
+
'panel.cfg.multiple': 'Autoriser plusieurs fichiers',
|
|
16819
16826
|
'panel.optionsSource': 'Source des options',
|
|
16820
16827
|
'panel.options': 'Options (une par ligne)',
|
|
16821
16828
|
'panel.content': 'Contenu',
|
|
@@ -16843,6 +16850,7 @@ const frFkTranslations = {
|
|
|
16843
16850
|
'file.choose': 'Choisir un fichier…',
|
|
16844
16851
|
'file.uploading': 'Envoi en cours…',
|
|
16845
16852
|
'file.remove': 'Retirer le fichier',
|
|
16853
|
+
'file.addAnother': '+ Ajouter un fichier',
|
|
16846
16854
|
'address.street': 'Rue',
|
|
16847
16855
|
'address.city': 'Ville',
|
|
16848
16856
|
'address.zip': 'Code postal',
|
|
@@ -16928,8 +16936,10 @@ const adorned = (props, control) => {
|
|
|
16928
16936
|
return control;
|
|
16929
16937
|
return (h("div", { class: "fk-adorned" }, prefix ? h("span", { class: "fk-adorned__affix" }, prefix) : null, control, suffix ? h("span", { class: "fk-adorned__affix" }, suffix) : null));
|
|
16930
16938
|
};
|
|
16931
|
-
const
|
|
16932
|
-
const
|
|
16939
|
+
const fieldError = (props) => props.error ? (h("span", { class: "fk-field__error", role: "alert" }, props.error)) : null;
|
|
16940
|
+
const invalidAttr = (props) => props.error ? { 'aria-invalid': 'true' } : {};
|
|
16941
|
+
const fieldBlock = (props, fallback, control) => (h("div", { class: "fk-field", style: asInlineStyle(props.styles) }, h("span", { class: "fk-field__label" }, labelOf(props, fallback)), control, fieldError(props)));
|
|
16942
|
+
const field = (props, fallback, control) => (h("label", { class: "fk-field", style: asInlineStyle(props.styles) }, h("span", { class: "fk-field__label" }, labelOf(props, fallback)), control, fieldError(props)));
|
|
16933
16943
|
const createTextVariant = (params) => createBrick({
|
|
16934
16944
|
type: 'input',
|
|
16935
16945
|
dataType: 'string',
|
|
@@ -16939,7 +16949,7 @@ const createTextVariant = (params) => createBrick({
|
|
|
16939
16949
|
defaultConfigs: { label: params.name },
|
|
16940
16950
|
render: (props) => {
|
|
16941
16951
|
var _a, _b;
|
|
16942
|
-
return field(props, params.name, adorned(props, 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); } })));
|
|
16952
|
+
return field(props, params.name, adorned(props, 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); } }))));
|
|
16943
16953
|
},
|
|
16944
16954
|
});
|
|
16945
16955
|
const textInputBrick = createTextVariant({
|
|
@@ -16976,7 +16986,7 @@ const textareaBrick = createBrick({
|
|
|
16976
16986
|
defaultConfigs: { label: 'Text area' },
|
|
16977
16987
|
render: (props) => {
|
|
16978
16988
|
var _a, _b;
|
|
16979
|
-
return field(props, 'Text area', 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); } }));
|
|
16989
|
+
return field(props, 'Text area', 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); } })));
|
|
16980
16990
|
},
|
|
16981
16991
|
});
|
|
16982
16992
|
const numberBrick = createBrick({
|
|
@@ -16988,11 +16998,11 @@ const numberBrick = createBrick({
|
|
|
16988
16998
|
defaultConfigs: { label: 'Number' },
|
|
16989
16999
|
render: (props) => {
|
|
16990
17000
|
var _a;
|
|
16991
|
-
return field(props, 'Number', adorned(props, 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) => {
|
|
17001
|
+
return field(props, 'Number', adorned(props, 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) => {
|
|
16992
17002
|
var _a;
|
|
16993
17003
|
const raw = event.target.value;
|
|
16994
17004
|
(_a = props.onDataChange) === null || _a === void 0 ? void 0 : _a.call(props, raw === '' ? undefined : Number(raw));
|
|
16995
|
-
} })));
|
|
17005
|
+
} }))));
|
|
16996
17006
|
},
|
|
16997
17007
|
});
|
|
16998
17008
|
const dateBrick = createBrick({
|
|
@@ -17004,11 +17014,11 @@ const dateBrick = createBrick({
|
|
|
17004
17014
|
defaultConfigs: { label: 'Date' },
|
|
17005
17015
|
render: (props) => {
|
|
17006
17016
|
var _a;
|
|
17007
|
-
return field(props, 'Date', h("input", { class: "fk-field__input", type: "date", value: (_a = props.data) !== null && _a !== void 0 ? _a : '', disabled: props.editable || props.disabled, onInput: (event) => {
|
|
17017
|
+
return field(props, 'Date', 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) => {
|
|
17008
17018
|
var _a;
|
|
17009
17019
|
const raw = event.target.value;
|
|
17010
17020
|
(_a = props.onDataChange) === null || _a === void 0 ? void 0 : _a.call(props, raw === '' ? undefined : raw);
|
|
17011
|
-
} }));
|
|
17021
|
+
} })));
|
|
17012
17022
|
},
|
|
17013
17023
|
});
|
|
17014
17024
|
const selectBrick = createBrick({
|
|
@@ -17024,7 +17034,7 @@ const selectBrick = createBrick({
|
|
|
17024
17034
|
},
|
|
17025
17035
|
render: (props) => {
|
|
17026
17036
|
var _a;
|
|
17027
|
-
return fieldBlock(props, 'Select', 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) => {
|
|
17037
|
+
return fieldBlock(props, 'Select', 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) => {
|
|
17028
17038
|
var _a;
|
|
17029
17039
|
event.stopPropagation();
|
|
17030
17040
|
(_a = props.onDataChange) === null || _a === void 0 ? void 0 : _a.call(props, event.detail);
|
|
@@ -17042,7 +17052,7 @@ const multiSelectBrick = createBrick({
|
|
|
17042
17052
|
optionsSource: 'static',
|
|
17043
17053
|
options: 'Option 1\nOption 2\nOption 3',
|
|
17044
17054
|
},
|
|
17045
|
-
render: (props) => fieldBlock(props, 'Multi select', 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) => {
|
|
17055
|
+
render: (props) => fieldBlock(props, 'Multi select', 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) => {
|
|
17046
17056
|
var _a;
|
|
17047
17057
|
event.stopPropagation();
|
|
17048
17058
|
(_a = props.onDataChange) === null || _a === void 0 ? void 0 : _a.call(props, event.detail);
|
|
@@ -17150,7 +17160,7 @@ const radioBrick = createBrick({
|
|
|
17150
17160
|
name: 'Radio',
|
|
17151
17161
|
category: 'Inputs',
|
|
17152
17162
|
defaultConfigs: { label: 'Radio', options: 'Option 1\nOption 2' },
|
|
17153
|
-
render: (props) => (h("div", { class: "fk-field", style: asInlineStyle(props.styles) }, h("span", { class: "fk-field__label" }, labelOf(props, 'Radio')), h("div", { class: "fk-radio-group", role: "radiogroup" }, staticOptions(props).map((option) => {
|
|
17163
|
+
render: (props) => (h("div", { class: "fk-field", style: asInlineStyle(props.styles) }, h("span", { class: "fk-field__label" }, labelOf(props, 'Radio')), h("div", Object.assign({ class: "fk-radio-group", role: "radiogroup" }, invalidAttr(props)), staticOptions(props).map((option) => {
|
|
17154
17164
|
var _a, _b;
|
|
17155
17165
|
return (h("label", { class: "fk-radio", key: option.value }, 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); } }), h("span", null, option.label)));
|
|
17156
17166
|
})), props.error ? h("span", { class: "fk-field__error" }, props.error) : null)),
|
|
@@ -17189,10 +17199,10 @@ const fileBrick = createBrick({
|
|
|
17189
17199
|
id: 'file',
|
|
17190
17200
|
name: 'File',
|
|
17191
17201
|
category: 'Data',
|
|
17192
|
-
defaultConfigs: { label: 'File' },
|
|
17202
|
+
defaultConfigs: { label: 'File', accept: '', uploadUrl: '', multiple: false },
|
|
17193
17203
|
render: (props) => {
|
|
17194
|
-
var _a, _b;
|
|
17195
|
-
return fieldBlock(props, 'File', 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) => {
|
|
17204
|
+
var _a, _b, _c;
|
|
17205
|
+
return fieldBlock(props, 'File', 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) => {
|
|
17196
17206
|
var _a;
|
|
17197
17207
|
event.stopPropagation();
|
|
17198
17208
|
(_a = props.onDataChange) === null || _a === void 0 ? void 0 : _a.call(props, event.detail);
|