@sfxcode/formkit-openvue 0.0.0-stage → 0.9.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/LICENSE +21 -0
- package/README.md +227 -2
- package/components.d.ts +1 -0
- package/dist/components/FormAutoComplete.vue +100 -0
- package/dist/components/FormCascadeSelect.vue +41 -0
- package/dist/components/FormCheckbox.vue +49 -0
- package/dist/components/FormColorPicker.vue +31 -0
- package/dist/components/FormDatePicker.vue +93 -0
- package/dist/components/FormInputMask.vue +67 -0
- package/dist/components/FormInputNumber.vue +72 -0
- package/dist/components/FormInputOtp.vue +40 -0
- package/dist/components/FormInputText.vue +63 -0
- package/dist/components/FormKitDataDebug.vue +25 -0
- package/dist/components/FormKitDataEdit.vue +123 -0
- package/dist/components/FormKitDataView.vue +56 -0
- package/dist/components/FormKitIcon.vue +23 -0
- package/dist/components/FormKitPrefix.vue +9 -0
- package/dist/components/FormKitSuffix.vue +9 -0
- package/dist/components/FormKnob.vue +48 -0
- package/dist/components/FormListbox.vue +482 -0
- package/dist/components/FormMultiSelect.vue +68 -0
- package/dist/components/FormOutputBoolean.vue +30 -0
- package/dist/components/FormOutputDate.vue +40 -0
- package/dist/components/FormOutputDuration.vue +24 -0
- package/dist/components/FormOutputLink.vue +39 -0
- package/dist/components/FormOutputList.vue +105 -0
- package/dist/components/FormOutputNumber.vue +47 -0
- package/dist/components/FormOutputReference.vue +52 -0
- package/dist/components/FormOutputText.vue +52 -0
- package/dist/components/FormPassword.vue +47 -0
- package/dist/components/FormRadioButton.vue +39 -0
- package/dist/components/FormRating.vue +38 -0
- package/dist/components/FormSelect.vue +69 -0
- package/dist/components/FormSelectButton.vue +42 -0
- package/dist/components/FormSlider.vue +40 -0
- package/dist/components/FormTextarea.vue +35 -0
- package/dist/components/FormToggleButton.vue +40 -0
- package/dist/components/FormToggleSwitch.vue +40 -0
- package/dist/components/FormTreeSelect.vue +46 -0
- package/dist/components/index.d.ts +24 -0
- package/dist/components/index.js +167 -0
- package/dist/components/index.mjs +48 -0
- package/dist/composables/index.d.ts +9 -0
- package/dist/composables/index.js +61 -0
- package/dist/composables/index.mjs +18 -0
- package/dist/composables/useFormInputs.d.ts +3 -0
- package/dist/composables/useFormInputs.js +62 -0
- package/dist/composables/useFormInputs.mjs +53 -0
- package/dist/composables/useFormKitInput.d.ts +11 -0
- package/dist/composables/useFormKitInput.js +58 -0
- package/dist/composables/useFormKitInput.mjs +45 -0
- package/dist/composables/useFormKitRepeater.d.ts +18 -0
- package/dist/composables/useFormKitRepeater.js +74 -0
- package/dist/composables/useFormKitRepeater.mjs +54 -0
- package/dist/composables/useFormKitSchema.d.ts +36 -0
- package/dist/composables/useFormKitSchema.js +83 -0
- package/dist/composables/useFormKitSchema.mjs +58 -0
- package/dist/composables/useFormKitSection.d.ts +7 -0
- package/dist/composables/useFormKitSection.js +31 -0
- package/dist/composables/useFormKitSection.mjs +19 -0
- package/dist/composables/useInputEditor.d.ts +8 -0
- package/dist/composables/useInputEditor.js +148 -0
- package/dist/composables/useInputEditor.mjs +143 -0
- package/dist/composables/useInputEditorSchema.d.ts +163 -0
- package/dist/composables/useInputEditorSchema.js +313 -0
- package/dist/composables/useInputEditorSchema.mjs +315 -0
- package/dist/composables/useOutputDuration.d.ts +4 -0
- package/dist/composables/useOutputDuration.js +40 -0
- package/dist/composables/useOutputDuration.mjs +35 -0
- package/dist/definitions/index.d.ts +35 -0
- package/dist/definitions/index.js +44 -0
- package/dist/definitions/index.mjs +70 -0
- package/dist/definitions/input.d.ts +23 -0
- package/dist/definitions/input.js +118 -0
- package/dist/definitions/input.mjs +111 -0
- package/dist/definitions/output.d.ts +9 -0
- package/dist/definitions/output.js +46 -0
- package/dist/definitions/output.mjs +136 -0
- package/dist/definitions/repeater.d.ts +2 -0
- package/dist/definitions/repeater.js +234 -0
- package/dist/definitions/repeater.mjs +215 -0
- package/dist/index.d.ts +148 -0
- package/dist/index.js +62 -0
- package/dist/index.mjs +14 -0
- package/dist/plugins/autoAnimate.d.ts +9 -0
- package/dist/plugins/autoAnimate.js +93 -0
- package/dist/plugins/autoAnimate.mjs +87 -0
- package/dist/plugins/index.d.ts +5 -0
- package/dist/plugins/index.js +67 -0
- package/dist/plugins/index.mjs +56 -0
- package/dist/sass/formkit-openvue.scss +491 -0
- package/dist/style.css +1 -0
- package/dist/utils/clonePlain.d.ts +10 -0
- package/dist/utils/clonePlain.js +25 -0
- package/dist/utils/clonePlain.mjs +24 -0
- package/package.json +136 -4
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.formRepeaterDefinition = void 0;
|
|
7
|
+
var _vue = require("@formkit/vue");
|
|
8
|
+
var _composables = require("../composables");
|
|
9
|
+
var _clonePlain = require("../utils/clonePlain");
|
|
10
|
+
const {
|
|
11
|
+
addList,
|
|
12
|
+
addElement,
|
|
13
|
+
addListGroup,
|
|
14
|
+
addComponent
|
|
15
|
+
} = (0, _composables.useFormKitSchema)();
|
|
16
|
+
function addButtonGroup(buttonGroupClass = "", buttonGroupItemClass = "", buttonSize, render = "true") {
|
|
17
|
+
const addActionButtonComponent = (onClick = "", icon = "", severity = "", render2 = "true", disabled = "false", label = "") => {
|
|
18
|
+
const name = `${label} + " " + ($index + 1)`;
|
|
19
|
+
return addElement("div", [addComponent("Button", {
|
|
20
|
+
"onClick": onClick,
|
|
21
|
+
icon,
|
|
22
|
+
severity,
|
|
23
|
+
disabled,
|
|
24
|
+
"size": buttonSize,
|
|
25
|
+
"aria-label": name,
|
|
26
|
+
"title": name
|
|
27
|
+
})], {
|
|
28
|
+
class: buttonGroupItemClass
|
|
29
|
+
}, render2);
|
|
30
|
+
};
|
|
31
|
+
return addElement("div", [addActionButtonComponent("$moveNodeUp($node.parent, $index)", "oi oi-arrow-up", "secondary", "$renderMoveButtons", "$index === 0", "$moveUpLabel"), addActionButtonComponent("$removeNode($node.parent, $index)", "oi oi-trash", "danger", "$displayDeleteButton", "$node.parent.value.length === $minItems", "$deleteLabel"), addActionButtonComponent("$cloneNode($node.parent, $index)", "oi oi-clone", "", "$displayCloneButton", "$node.parent.value.length > $maxItems -1", "$cloneLabel"), addActionButtonComponent("$addNode($node.parent, $index)", "oi oi-plus", "", "$displayAddButton", "$node.parent.value.length > $maxItems -1", "$addLabel"), addActionButtonComponent("$moveNodeDown($node.parent, $index)", "oi oi-arrow-down", "secondary", "$renderMoveButtons", "$index === $node.parent.value.length -1", "$moveDownLabel")], {
|
|
32
|
+
class: buttonGroupClass
|
|
33
|
+
}, render);
|
|
34
|
+
}
|
|
35
|
+
function addInsertButton(label = "Add Item", icon = "i-lucide-plus", styleClass = "", buttonSize, render = "true") {
|
|
36
|
+
return addElement("div", [addComponent("Button", {
|
|
37
|
+
onClick: "$insertNode($node)",
|
|
38
|
+
label,
|
|
39
|
+
icon,
|
|
40
|
+
size: buttonSize,
|
|
41
|
+
disabled: "$node.value.length > $maxItems -1"
|
|
42
|
+
})], {
|
|
43
|
+
class: styleClass
|
|
44
|
+
}, render);
|
|
45
|
+
}
|
|
46
|
+
function addUndoBar(render = "true") {
|
|
47
|
+
return addElement("div", [addElement("div", [addElement("span", ["$deletedLabel"]), addComponent("Button", {
|
|
48
|
+
onClick: "$undoRemoveNode($node)",
|
|
49
|
+
label: "$undoLabel",
|
|
50
|
+
size: "small",
|
|
51
|
+
variant: "text"
|
|
52
|
+
})], {
|
|
53
|
+
class: "formkit-repeater-undo"
|
|
54
|
+
}, "$removedItem")], {
|
|
55
|
+
"role": "status",
|
|
56
|
+
"aria-live": "polite"
|
|
57
|
+
}, render);
|
|
58
|
+
}
|
|
59
|
+
function addDragHandle(handleClass = "", iconClass = "", render = "true") {
|
|
60
|
+
return addElement("span", [addElement("i", [], {
|
|
61
|
+
class: iconClass
|
|
62
|
+
})], {
|
|
63
|
+
"class": handleClass,
|
|
64
|
+
"aria-label": "Drag to reorder"
|
|
65
|
+
}, render);
|
|
66
|
+
}
|
|
67
|
+
const formRepeaterDefinition = exports.formRepeaterDefinition = (0, _vue.createInput)(addElement("div", [addList("$listName", [addInsertButton("$insertButtonLabel", "oi oi-plus", "$insertButtonClass", "$insertButtonSize", "$node.children.length == 0 || $alwaysDisplayInsertButton"), addListGroup([addElement("div", [addDragHandle("$internalDragHandleClass", "$dragHandleIconClass", "$renderDragHandle"), {
|
|
68
|
+
children: "$slots.default"
|
|
69
|
+
}, addButtonGroup("$buttonGroupClass", "$buttonGroupItemClass", "$buttonSize", "$renderButtons")], {
|
|
70
|
+
id: "$getListItemId($index)",
|
|
71
|
+
class: "$getListItemClass($index)",
|
|
72
|
+
draggable: "$draggable",
|
|
73
|
+
onDragstart: "$dragNodeStart($node.parent, $index)",
|
|
74
|
+
onDragover: "$dragNodeOver($index)",
|
|
75
|
+
onDragleave: "$dragNodeLeave($index)",
|
|
76
|
+
onDrop: "$dropNode($node.parent, $index)",
|
|
77
|
+
onDragend: "$dragNodeEnd"
|
|
78
|
+
})], true, {}), addUndoBar("$undoDelete")], true, "true", {
|
|
79
|
+
value: "$value",
|
|
80
|
+
validation: "$repeaterValidation"
|
|
81
|
+
})], {
|
|
82
|
+
class: "$internalListClass",
|
|
83
|
+
id: "$internalListId"
|
|
84
|
+
}, true), {
|
|
85
|
+
props: ["insertButtonLabel", "insertButtonClass", "insertButtonSize", "alwaysDisplayInsertButton", "newItem", "listClass", "listItemClass", "hideButtonGroup", "hideMoveButtons", "buttonGroupClass", "buttonGroupItemClass", "buttonSize", "displayCloneButton", "displayAddButton", "displayDeleteButton", "minItems", "maxItems", "moveUpLabel", "moveDownLabel", "deleteLabel", "cloneLabel", "addLabel", "undoDelete", "undoLabel", "deletedLabel", "undoTimeout", "displayDragHandle", "draggable", "dragHandleClass", "dragHandleIconClass"],
|
|
86
|
+
features: [addRepeaterHandler]
|
|
87
|
+
});
|
|
88
|
+
function addRepeaterHandler(node) {
|
|
89
|
+
const swapElements = (array, index1, index2) => {
|
|
90
|
+
array.splice(index2, 0, array.splice(index1, 1)[0]);
|
|
91
|
+
return array;
|
|
92
|
+
};
|
|
93
|
+
node.on("created", () => {
|
|
94
|
+
if (node.context) {
|
|
95
|
+
let dragStartIndex = null;
|
|
96
|
+
const makeNewItem = () => (0, _clonePlain.clonePlain)(node.context?.newItem || {});
|
|
97
|
+
const instanceId = String(node.props.id ?? node.name);
|
|
98
|
+
const context = node.context;
|
|
99
|
+
context.dragOverIndex = null;
|
|
100
|
+
let undoTimer;
|
|
101
|
+
const forgetRemoved = () => {
|
|
102
|
+
clearTimeout(undoTimer);
|
|
103
|
+
undoTimer = void 0;
|
|
104
|
+
context.removedItem = void 0;
|
|
105
|
+
};
|
|
106
|
+
node.on("destroying", () => clearTimeout(undoTimer));
|
|
107
|
+
node.context.listName = node.name;
|
|
108
|
+
node.context.renderButtons = !node.context.hideButtonGroup;
|
|
109
|
+
node.context.insertButtonSize = node.context.insertButtonSize ? node.context.insertButtonSize : "";
|
|
110
|
+
node.context.buttonSize = node.context.buttonSize ? node.context.buttonSize : "";
|
|
111
|
+
node.context.renderMoveButtons = !node.context.hideMoveButtons;
|
|
112
|
+
node.context.draggable = !!node.context.draggable;
|
|
113
|
+
node.context.renderDragHandle = !!node.context.displayDragHandle;
|
|
114
|
+
node.context.dragHandleIconClass = node.context.dragHandleIconClass || "oi oi-bars";
|
|
115
|
+
node.context.internalDragHandleClass = node.context.dragHandleClass ? `formkit-repeater-drag-handle ${node.context.dragHandleClass}` : "formkit-repeater-drag-handle";
|
|
116
|
+
node.context.internalListClass = node.context.listClass ? `formkit-items ${node.context.listClass}` : "formkit-items";
|
|
117
|
+
node.context.internalListItemClass = node.context.listItemClass ? `formkit-item ${node.context.listItemClass}` : "formkit-item";
|
|
118
|
+
node.context.moveUpLabel = node.context.moveUpLabel || "Move item up";
|
|
119
|
+
node.context.moveDownLabel = node.context.moveDownLabel || "Move item down";
|
|
120
|
+
node.context.deleteLabel = node.context.deleteLabel || "Delete item";
|
|
121
|
+
node.context.cloneLabel = node.context.cloneLabel || "Clone item";
|
|
122
|
+
node.context.addLabel = node.context.addLabel || "Add item below";
|
|
123
|
+
node.context.undoDelete = !!node.context.undoDelete;
|
|
124
|
+
node.context.undoLabel = node.context.undoLabel || "Undo";
|
|
125
|
+
node.context.deletedLabel = node.context.deletedLabel || "Item deleted";
|
|
126
|
+
node.context.undoTimeout = node.context.undoTimeout !== void 0 ? Number(node.context.undoTimeout) : 8e3;
|
|
127
|
+
node.context.removedItem = void 0;
|
|
128
|
+
node.context.minItems = node.context.minItems !== void 0 ? node.context.minItems : 0;
|
|
129
|
+
node.context.maxItems = node.context.maxItems !== void 0 ? node.context.maxItems : Number.POSITIVE_INFINITY;
|
|
130
|
+
node.context.repeaterValidation = [["+length", node.context.minItems, node.context.maxItems]];
|
|
131
|
+
node.context.internalListId = `formkit-items-${instanceId}`;
|
|
132
|
+
node.context.getListItemClass = index => {
|
|
133
|
+
if (context.dragOverIndex === index && dragStartIndex !== index) return `${node.context?.internalListItemClass} formkit-repeater-drop-target`;
|
|
134
|
+
return node.context?.internalListItemClass?.toString() ?? "";
|
|
135
|
+
};
|
|
136
|
+
node.context.getListItemId = index => {
|
|
137
|
+
return `formkit-item-${index}-${instanceId}`;
|
|
138
|
+
};
|
|
139
|
+
node.context.insertNode = parentNode => () => {
|
|
140
|
+
if (parentNode && Array.isArray(parentNode._value)) {
|
|
141
|
+
const newArray = [makeNewItem(), ...parentNode.value];
|
|
142
|
+
parentNode.input(newArray, false);
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
node.context.removeNode = (parentNode, index) => () => {
|
|
146
|
+
if (parentNode && Array.isArray(parentNode._value)) {
|
|
147
|
+
const removed = (0, _clonePlain.clonePlain)(parentNode._value[index]);
|
|
148
|
+
parentNode.input(parentNode._value.filter((_, i) => i !== index), false);
|
|
149
|
+
if (context.undoDelete) {
|
|
150
|
+
clearTimeout(undoTimer);
|
|
151
|
+
context.removedItem = {
|
|
152
|
+
index,
|
|
153
|
+
item: removed
|
|
154
|
+
};
|
|
155
|
+
const timeout = Number(context.undoTimeout);
|
|
156
|
+
undoTimer = timeout > 0 ? setTimeout(forgetRemoved, timeout) : void 0;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
node.context.undoRemoveNode = parentNode => () => {
|
|
161
|
+
const removed = context.removedItem;
|
|
162
|
+
if (removed && parentNode && Array.isArray(parentNode._value) && parentNode._value.length < Number(context.maxItems)) {
|
|
163
|
+
const array = [...parentNode.value];
|
|
164
|
+
array.splice(Math.min(removed.index, array.length), 0, (0, _clonePlain.clonePlain)(removed.item));
|
|
165
|
+
parentNode.input(array, false);
|
|
166
|
+
}
|
|
167
|
+
forgetRemoved();
|
|
168
|
+
};
|
|
169
|
+
node.context.addNode = (parentNode, index) => () => {
|
|
170
|
+
if (parentNode && Array.isArray(parentNode._value)) {
|
|
171
|
+
const array = parentNode.value;
|
|
172
|
+
array.splice(index + 1, 0, makeNewItem());
|
|
173
|
+
parentNode.input(array, false);
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
node.context.cloneNode = (parentNode, index) => () => {
|
|
177
|
+
if (parentNode && Array.isArray(parentNode._value)) {
|
|
178
|
+
const array = parentNode.value;
|
|
179
|
+
array.splice(index + 1, 0, (0, _clonePlain.clonePlain)(array[index]));
|
|
180
|
+
parentNode.input(array, false);
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
node.context.moveNodeUp = (parentNode, index) => () => {
|
|
184
|
+
if (parentNode && Array.isArray(parentNode._value)) {
|
|
185
|
+
if (index > 0) parentNode.input(swapElements(parentNode.value, index - 1, index), false);
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
node.context.moveNodeDown = (parentNode, index) => () => {
|
|
189
|
+
if (parentNode && Array.isArray(parentNode._value)) {
|
|
190
|
+
if (index < parentNode.value.length - 1) parentNode.input(swapElements(parentNode.value, index, index + 1), false);
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
node.context.dragNodeStart = (_parentNode, index) => event => {
|
|
194
|
+
dragStartIndex = index;
|
|
195
|
+
if (event?.dataTransfer) {
|
|
196
|
+
event.dataTransfer.effectAllowed = "move";
|
|
197
|
+
event.dataTransfer.setData("text/plain", String(index));
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
node.context.dragNodeOver = targetIndex => event => {
|
|
201
|
+
event?.preventDefault();
|
|
202
|
+
context.dragOverIndex = targetIndex;
|
|
203
|
+
if (event?.dataTransfer) event.dataTransfer.dropEffect = "move";
|
|
204
|
+
};
|
|
205
|
+
node.context.dragNodeLeave = targetIndex => () => {
|
|
206
|
+
if (context.dragOverIndex === targetIndex) context.dragOverIndex = null;
|
|
207
|
+
};
|
|
208
|
+
node.context.dropNode = (parentNode, targetIndex) => event => {
|
|
209
|
+
event?.preventDefault();
|
|
210
|
+
if (!parentNode || !Array.isArray(parentNode._value)) {
|
|
211
|
+
context.dragOverIndex = null;
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
const sourceFromEvent = Number.parseInt(event?.dataTransfer?.getData("text/plain") || "", 10);
|
|
215
|
+
const sourceIndex = Number.isInteger(sourceFromEvent) ? sourceFromEvent : dragStartIndex;
|
|
216
|
+
if (sourceIndex === null || sourceIndex === targetIndex) {
|
|
217
|
+
context.dragOverIndex = null;
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
if (sourceIndex < 0 || sourceIndex >= parentNode.value.length) {
|
|
221
|
+
context.dragOverIndex = null;
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
224
|
+
parentNode.input(swapElements(parentNode.value, sourceIndex, targetIndex), false);
|
|
225
|
+
dragStartIndex = null;
|
|
226
|
+
context.dragOverIndex = null;
|
|
227
|
+
};
|
|
228
|
+
node.context.dragNodeEnd = () => {
|
|
229
|
+
dragStartIndex = null;
|
|
230
|
+
context.dragOverIndex = null;
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { createInput } from "@formkit/vue";
|
|
2
|
+
import { useFormKitSchema } from "../composables/index.mjs";
|
|
3
|
+
import { clonePlain } from "../utils/clonePlain.mjs";
|
|
4
|
+
const { addList, addElement, addListGroup, addComponent } = useFormKitSchema();
|
|
5
|
+
function addButtonGroup(buttonGroupClass = "", buttonGroupItemClass = "", buttonSize, render = "true") {
|
|
6
|
+
const addActionButtonComponent = (onClick = "", icon = "", severity = "", render2 = "true", disabled = "false", label = "") => {
|
|
7
|
+
const name = `${label} + " " + ($index + 1)`;
|
|
8
|
+
return addElement("div", [addComponent("Button", { "onClick": onClick, icon, severity, disabled, "size": buttonSize, "aria-label": name, "title": name })], { class: buttonGroupItemClass }, render2);
|
|
9
|
+
};
|
|
10
|
+
return addElement("div", [
|
|
11
|
+
addActionButtonComponent("$moveNodeUp($node.parent, $index)", "oi oi-arrow-up", "secondary", "$renderMoveButtons", "$index === 0", "$moveUpLabel"),
|
|
12
|
+
addActionButtonComponent("$removeNode($node.parent, $index)", "oi oi-trash", "danger", "$displayDeleteButton", "$node.parent.value.length === $minItems", "$deleteLabel"),
|
|
13
|
+
addActionButtonComponent("$cloneNode($node.parent, $index)", "oi oi-clone", "", "$displayCloneButton", "$node.parent.value.length > $maxItems -1", "$cloneLabel"),
|
|
14
|
+
addActionButtonComponent("$addNode($node.parent, $index)", "oi oi-plus", "", "$displayAddButton", "$node.parent.value.length > $maxItems -1", "$addLabel"),
|
|
15
|
+
addActionButtonComponent("$moveNodeDown($node.parent, $index)", "oi oi-arrow-down", "secondary", "$renderMoveButtons", "$index === $node.parent.value.length -1", "$moveDownLabel")
|
|
16
|
+
], { class: buttonGroupClass }, render);
|
|
17
|
+
}
|
|
18
|
+
function addInsertButton(label = "Add Item", icon = "i-lucide-plus", styleClass = "", buttonSize, render = "true") {
|
|
19
|
+
return addElement("div", [
|
|
20
|
+
addComponent("Button", { onClick: "$insertNode($node)", label, icon, size: buttonSize, disabled: "$node.value.length > $maxItems -1" })
|
|
21
|
+
], { class: styleClass }, render);
|
|
22
|
+
}
|
|
23
|
+
function addUndoBar(render = "true") {
|
|
24
|
+
return addElement("div", [
|
|
25
|
+
addElement("div", [
|
|
26
|
+
addElement("span", ["$deletedLabel"]),
|
|
27
|
+
addComponent("Button", { onClick: "$undoRemoveNode($node)", label: "$undoLabel", size: "small", variant: "text" })
|
|
28
|
+
], { class: "formkit-repeater-undo" }, "$removedItem")
|
|
29
|
+
], { "role": "status", "aria-live": "polite" }, render);
|
|
30
|
+
}
|
|
31
|
+
function addDragHandle(handleClass = "", iconClass = "", render = "true") {
|
|
32
|
+
return addElement("span", [
|
|
33
|
+
addElement("i", [], { class: iconClass })
|
|
34
|
+
], {
|
|
35
|
+
"class": handleClass,
|
|
36
|
+
"aria-label": "Drag to reorder"
|
|
37
|
+
}, render);
|
|
38
|
+
}
|
|
39
|
+
export const formRepeaterDefinition = createInput(
|
|
40
|
+
addElement("div", [
|
|
41
|
+
addList("$listName", [
|
|
42
|
+
addInsertButton("$insertButtonLabel", "oi oi-plus", "$insertButtonClass", "$insertButtonSize", "$node.children.length == 0 || $alwaysDisplayInsertButton"),
|
|
43
|
+
addListGroup([
|
|
44
|
+
addElement("div", [
|
|
45
|
+
addDragHandle("$internalDragHandleClass", "$dragHandleIconClass", "$renderDragHandle"),
|
|
46
|
+
{ children: "$slots.default" },
|
|
47
|
+
addButtonGroup("$buttonGroupClass", "$buttonGroupItemClass", "$buttonSize", "$renderButtons")
|
|
48
|
+
], {
|
|
49
|
+
id: "$getListItemId($index)",
|
|
50
|
+
class: "$getListItemClass($index)",
|
|
51
|
+
draggable: "$draggable",
|
|
52
|
+
onDragstart: "$dragNodeStart($node.parent, $index)",
|
|
53
|
+
onDragover: "$dragNodeOver($index)",
|
|
54
|
+
onDragleave: "$dragNodeLeave($index)",
|
|
55
|
+
onDrop: "$dropNode($node.parent, $index)",
|
|
56
|
+
onDragend: "$dragNodeEnd"
|
|
57
|
+
})
|
|
58
|
+
], true, {}),
|
|
59
|
+
addUndoBar("$undoDelete")
|
|
60
|
+
], true, "true", { value: "$value", validation: "$repeaterValidation" })
|
|
61
|
+
], { class: "$internalListClass", id: "$internalListId" }, true),
|
|
62
|
+
{
|
|
63
|
+
props: ["insertButtonLabel", "insertButtonClass", "insertButtonSize", "alwaysDisplayInsertButton", "newItem", "listClass", "listItemClass", "hideButtonGroup", "hideMoveButtons", "buttonGroupClass", "buttonGroupItemClass", "buttonSize", "displayCloneButton", "displayAddButton", "displayDeleteButton", "minItems", "maxItems", "moveUpLabel", "moveDownLabel", "deleteLabel", "cloneLabel", "addLabel", "undoDelete", "undoLabel", "deletedLabel", "undoTimeout", "displayDragHandle", "draggable", "dragHandleClass", "dragHandleIconClass"],
|
|
64
|
+
features: [addRepeaterHandler]
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
function addRepeaterHandler(node) {
|
|
68
|
+
const swapElements = (array, index1, index2) => {
|
|
69
|
+
array.splice(index2, 0, array.splice(index1, 1)[0]);
|
|
70
|
+
return array;
|
|
71
|
+
};
|
|
72
|
+
node.on("created", () => {
|
|
73
|
+
if (node.context) {
|
|
74
|
+
let dragStartIndex = null;
|
|
75
|
+
const makeNewItem = () => clonePlain(node.context?.newItem || {});
|
|
76
|
+
const instanceId = String(node.props.id ?? node.name);
|
|
77
|
+
const context = node.context;
|
|
78
|
+
context.dragOverIndex = null;
|
|
79
|
+
let undoTimer;
|
|
80
|
+
const forgetRemoved = () => {
|
|
81
|
+
clearTimeout(undoTimer);
|
|
82
|
+
undoTimer = void 0;
|
|
83
|
+
context.removedItem = void 0;
|
|
84
|
+
};
|
|
85
|
+
node.on("destroying", () => clearTimeout(undoTimer));
|
|
86
|
+
node.context.listName = node.name;
|
|
87
|
+
node.context.renderButtons = !node.context.hideButtonGroup;
|
|
88
|
+
node.context.insertButtonSize = node.context.insertButtonSize ? node.context.insertButtonSize : "";
|
|
89
|
+
node.context.buttonSize = node.context.buttonSize ? node.context.buttonSize : "";
|
|
90
|
+
node.context.renderMoveButtons = !node.context.hideMoveButtons;
|
|
91
|
+
node.context.draggable = !!node.context.draggable;
|
|
92
|
+
node.context.renderDragHandle = !!node.context.displayDragHandle;
|
|
93
|
+
node.context.dragHandleIconClass = node.context.dragHandleIconClass || "oi oi-bars";
|
|
94
|
+
node.context.internalDragHandleClass = node.context.dragHandleClass ? `formkit-repeater-drag-handle ${node.context.dragHandleClass}` : "formkit-repeater-drag-handle";
|
|
95
|
+
node.context.internalListClass = node.context.listClass ? `formkit-items ${node.context.listClass}` : "formkit-items";
|
|
96
|
+
node.context.internalListItemClass = node.context.listItemClass ? `formkit-item ${node.context.listItemClass}` : "formkit-item";
|
|
97
|
+
node.context.moveUpLabel = node.context.moveUpLabel || "Move item up";
|
|
98
|
+
node.context.moveDownLabel = node.context.moveDownLabel || "Move item down";
|
|
99
|
+
node.context.deleteLabel = node.context.deleteLabel || "Delete item";
|
|
100
|
+
node.context.cloneLabel = node.context.cloneLabel || "Clone item";
|
|
101
|
+
node.context.addLabel = node.context.addLabel || "Add item below";
|
|
102
|
+
node.context.undoDelete = !!node.context.undoDelete;
|
|
103
|
+
node.context.undoLabel = node.context.undoLabel || "Undo";
|
|
104
|
+
node.context.deletedLabel = node.context.deletedLabel || "Item deleted";
|
|
105
|
+
node.context.undoTimeout = node.context.undoTimeout !== void 0 ? Number(node.context.undoTimeout) : 8e3;
|
|
106
|
+
node.context.removedItem = void 0;
|
|
107
|
+
node.context.minItems = node.context.minItems !== void 0 ? node.context.minItems : 0;
|
|
108
|
+
node.context.maxItems = node.context.maxItems !== void 0 ? node.context.maxItems : Number.POSITIVE_INFINITY;
|
|
109
|
+
node.context.repeaterValidation = [["+length", node.context.minItems, node.context.maxItems]];
|
|
110
|
+
node.context.internalListId = `formkit-items-${instanceId}`;
|
|
111
|
+
node.context.getListItemClass = (index) => {
|
|
112
|
+
if (context.dragOverIndex === index && dragStartIndex !== index)
|
|
113
|
+
return `${node.context?.internalListItemClass} formkit-repeater-drop-target`;
|
|
114
|
+
return node.context?.internalListItemClass?.toString() ?? "";
|
|
115
|
+
};
|
|
116
|
+
node.context.getListItemId = (index) => {
|
|
117
|
+
return `formkit-item-${index}-${instanceId}`;
|
|
118
|
+
};
|
|
119
|
+
node.context.insertNode = (parentNode) => () => {
|
|
120
|
+
if (parentNode && Array.isArray(parentNode._value)) {
|
|
121
|
+
const newArray = [makeNewItem(), ...parentNode.value];
|
|
122
|
+
parentNode.input(newArray, false);
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
node.context.removeNode = (parentNode, index) => () => {
|
|
126
|
+
if (parentNode && Array.isArray(parentNode._value)) {
|
|
127
|
+
const removed = clonePlain(parentNode._value[index]);
|
|
128
|
+
parentNode.input(parentNode._value.filter((_, i) => i !== index), false);
|
|
129
|
+
if (context.undoDelete) {
|
|
130
|
+
clearTimeout(undoTimer);
|
|
131
|
+
context.removedItem = { index, item: removed };
|
|
132
|
+
const timeout = Number(context.undoTimeout);
|
|
133
|
+
undoTimer = timeout > 0 ? setTimeout(forgetRemoved, timeout) : void 0;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
node.context.undoRemoveNode = (parentNode) => () => {
|
|
138
|
+
const removed = context.removedItem;
|
|
139
|
+
if (removed && parentNode && Array.isArray(parentNode._value) && parentNode._value.length < Number(context.maxItems)) {
|
|
140
|
+
const array = [...parentNode.value];
|
|
141
|
+
array.splice(Math.min(removed.index, array.length), 0, clonePlain(removed.item));
|
|
142
|
+
parentNode.input(array, false);
|
|
143
|
+
}
|
|
144
|
+
forgetRemoved();
|
|
145
|
+
};
|
|
146
|
+
node.context.addNode = (parentNode, index) => () => {
|
|
147
|
+
if (parentNode && Array.isArray(parentNode._value)) {
|
|
148
|
+
const array = parentNode.value;
|
|
149
|
+
array.splice(index + 1, 0, makeNewItem());
|
|
150
|
+
parentNode.input(array, false);
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
node.context.cloneNode = (parentNode, index) => () => {
|
|
154
|
+
if (parentNode && Array.isArray(parentNode._value)) {
|
|
155
|
+
const array = parentNode.value;
|
|
156
|
+
array.splice(index + 1, 0, clonePlain(array[index]));
|
|
157
|
+
parentNode.input(array, false);
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
node.context.moveNodeUp = (parentNode, index) => () => {
|
|
161
|
+
if (parentNode && Array.isArray(parentNode._value)) {
|
|
162
|
+
if (index > 0)
|
|
163
|
+
parentNode.input(swapElements(parentNode.value, index - 1, index), false);
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
node.context.moveNodeDown = (parentNode, index) => () => {
|
|
167
|
+
if (parentNode && Array.isArray(parentNode._value)) {
|
|
168
|
+
if (index < parentNode.value.length - 1)
|
|
169
|
+
parentNode.input(swapElements(parentNode.value, index, index + 1), false);
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
node.context.dragNodeStart = (_parentNode, index) => (event) => {
|
|
173
|
+
dragStartIndex = index;
|
|
174
|
+
if (event?.dataTransfer) {
|
|
175
|
+
event.dataTransfer.effectAllowed = "move";
|
|
176
|
+
event.dataTransfer.setData("text/plain", String(index));
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
node.context.dragNodeOver = (targetIndex) => (event) => {
|
|
180
|
+
event?.preventDefault();
|
|
181
|
+
context.dragOverIndex = targetIndex;
|
|
182
|
+
if (event?.dataTransfer)
|
|
183
|
+
event.dataTransfer.dropEffect = "move";
|
|
184
|
+
};
|
|
185
|
+
node.context.dragNodeLeave = (targetIndex) => () => {
|
|
186
|
+
if (context.dragOverIndex === targetIndex)
|
|
187
|
+
context.dragOverIndex = null;
|
|
188
|
+
};
|
|
189
|
+
node.context.dropNode = (parentNode, targetIndex) => (event) => {
|
|
190
|
+
event?.preventDefault();
|
|
191
|
+
if (!parentNode || !Array.isArray(parentNode._value)) {
|
|
192
|
+
context.dragOverIndex = null;
|
|
193
|
+
return;
|
|
194
|
+
}
|
|
195
|
+
const sourceFromEvent = Number.parseInt(event?.dataTransfer?.getData("text/plain") || "", 10);
|
|
196
|
+
const sourceIndex = Number.isInteger(sourceFromEvent) ? sourceFromEvent : dragStartIndex;
|
|
197
|
+
if (sourceIndex === null || sourceIndex === targetIndex) {
|
|
198
|
+
context.dragOverIndex = null;
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
if (sourceIndex < 0 || sourceIndex >= parentNode.value.length) {
|
|
202
|
+
context.dragOverIndex = null;
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
parentNode.input(swapElements(parentNode.value, sourceIndex, targetIndex), false);
|
|
206
|
+
dragStartIndex = null;
|
|
207
|
+
context.dragOverIndex = null;
|
|
208
|
+
};
|
|
209
|
+
node.context.dragNodeEnd = () => {
|
|
210
|
+
dragStartIndex = null;
|
|
211
|
+
context.dragOverIndex = null;
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import type { FormKitBaseSlots, FormKitInputs } from '@formkit/inputs';
|
|
2
|
+
import type { AutoCompleteSlots, CascadeSelectSlots, CheckboxSlots, ColorPickerSlots, DatePickerSlots, InputMaskSlots, InputNumberSlots, InputOtpSlots, InputTextSlots, KnobSlots, ListboxSlots, MultiSelectSlots, PasswordSlots, RadioButtonSlots, RatingSlots, SelectButtonSlots, SelectSlots, SliderSlots, TextareaSlots, ToggleButtonSlots, ToggleSwitchSlots, TreeSelectSlots } from 'openvue';
|
|
3
|
+
import type { CascadeSelectProps } from 'openvue/cascadeselect';
|
|
4
|
+
import type { ListboxProps } from 'openvue/listbox';
|
|
5
|
+
import type { MultiSelectProps } from 'openvue/multiselect';
|
|
6
|
+
import type { SelectProps } from 'openvue/select';
|
|
7
|
+
import type { SelectButtonProps } from 'openvue/selectbutton';
|
|
8
|
+
import type { TreeSelectProps } from 'openvue/treeselect';
|
|
9
|
+
import { FormKitDataEdit, FormKitDataView } from './components';
|
|
10
|
+
import { useFormInputs, useFormKitRepeater, useFormKitSchema, useInputEditor, useInputEditorSchema } from './composables';
|
|
11
|
+
import { formInputs, formOutputs } from './definitions';
|
|
12
|
+
export { formInputs, FormKitDataEdit, FormKitDataView, formOutputs, useFormInputs, useFormKitRepeater, useFormKitSchema, useInputEditor, useInputEditorSchema, };
|
|
13
|
+
/**
|
|
14
|
+
* Keeps all slots from 1st argument, add any slots from 2nd type which do not collide with the 1st's names.
|
|
15
|
+
*/
|
|
16
|
+
type MergeSlots<A, B> = A & Omit<B, keyof A>;
|
|
17
|
+
declare module '@formkit/inputs' {
|
|
18
|
+
interface FormKitInputProps<Props extends FormKitInputs<Props>> {
|
|
19
|
+
formAutoComplete: {
|
|
20
|
+
type: 'formAutoComplete';
|
|
21
|
+
};
|
|
22
|
+
formInputText: {
|
|
23
|
+
type: 'formInputText';
|
|
24
|
+
};
|
|
25
|
+
formInputNumber: {
|
|
26
|
+
type: 'formInputNumber';
|
|
27
|
+
};
|
|
28
|
+
formInputMask: {
|
|
29
|
+
type: 'formInputMask';
|
|
30
|
+
};
|
|
31
|
+
formPassword: {
|
|
32
|
+
type: 'formPassword';
|
|
33
|
+
};
|
|
34
|
+
formCheckbox: {
|
|
35
|
+
type: 'formCheckbox';
|
|
36
|
+
};
|
|
37
|
+
formToggleSwitch: {
|
|
38
|
+
type: 'formToggleSwitch';
|
|
39
|
+
};
|
|
40
|
+
formTextarea: {
|
|
41
|
+
type: 'formTextarea';
|
|
42
|
+
};
|
|
43
|
+
formSelect: {
|
|
44
|
+
type: 'formSelect';
|
|
45
|
+
options?: SelectProps['options'];
|
|
46
|
+
};
|
|
47
|
+
formMultiSelect: {
|
|
48
|
+
type: 'formMultiSelect';
|
|
49
|
+
options?: MultiSelectProps['options'];
|
|
50
|
+
};
|
|
51
|
+
formDatePicker: {
|
|
52
|
+
type: 'formDatePicker';
|
|
53
|
+
};
|
|
54
|
+
formSlider: {
|
|
55
|
+
type: 'formSlider';
|
|
56
|
+
};
|
|
57
|
+
formKnob: {
|
|
58
|
+
type: 'formKnob';
|
|
59
|
+
};
|
|
60
|
+
formRating: {
|
|
61
|
+
type: 'formRating';
|
|
62
|
+
};
|
|
63
|
+
formRadioButton: {
|
|
64
|
+
type: 'formRadioButton';
|
|
65
|
+
};
|
|
66
|
+
formColorPicker: {
|
|
67
|
+
type: 'formColorPicker';
|
|
68
|
+
};
|
|
69
|
+
formToggleButton: {
|
|
70
|
+
type: 'formToggleButton';
|
|
71
|
+
};
|
|
72
|
+
formListbox: {
|
|
73
|
+
type: 'formListbox';
|
|
74
|
+
options?: ListboxProps['options'];
|
|
75
|
+
};
|
|
76
|
+
formSelectButton: {
|
|
77
|
+
type: 'formSelectButton';
|
|
78
|
+
options?: SelectButtonProps['options'];
|
|
79
|
+
};
|
|
80
|
+
formCascadeSelect: {
|
|
81
|
+
type: 'formCascadeSelect';
|
|
82
|
+
options?: CascadeSelectProps['options'];
|
|
83
|
+
};
|
|
84
|
+
formTreeSelect: {
|
|
85
|
+
type: 'formTreeSelect';
|
|
86
|
+
options?: TreeSelectProps['options'];
|
|
87
|
+
};
|
|
88
|
+
formInputOtp: {
|
|
89
|
+
type: 'formInputOtp';
|
|
90
|
+
};
|
|
91
|
+
formOutputText: {
|
|
92
|
+
type: 'formOutputText';
|
|
93
|
+
};
|
|
94
|
+
formOutputLink: {
|
|
95
|
+
type: 'formOutputLink';
|
|
96
|
+
};
|
|
97
|
+
formOutputReference: {
|
|
98
|
+
type: 'formOutputReference';
|
|
99
|
+
};
|
|
100
|
+
formOutputNumber: {
|
|
101
|
+
type: 'formOutputNumber';
|
|
102
|
+
};
|
|
103
|
+
formOutputDate: {
|
|
104
|
+
type: 'formOutputDate';
|
|
105
|
+
};
|
|
106
|
+
formOutputBoolean: {
|
|
107
|
+
type: 'formOutputBoolean';
|
|
108
|
+
};
|
|
109
|
+
formOutputDuration: {
|
|
110
|
+
type: 'formOutputDuration';
|
|
111
|
+
};
|
|
112
|
+
formOutputList: {
|
|
113
|
+
type: 'formOutputList';
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
interface FormKitInputSlots<Props extends FormKitInputs<Props>> {
|
|
117
|
+
formAutoComplete: MergeSlots<FormKitBaseSlots<Props>, AutoCompleteSlots>;
|
|
118
|
+
formCascadeSelect: MergeSlots<FormKitBaseSlots<Props>, CascadeSelectSlots>;
|
|
119
|
+
formCheckbox: MergeSlots<FormKitBaseSlots<Props>, CheckboxSlots>;
|
|
120
|
+
formColorPicker: MergeSlots<FormKitBaseSlots<Props>, ColorPickerSlots>;
|
|
121
|
+
formDatePicker: MergeSlots<FormKitBaseSlots<Props>, DatePickerSlots>;
|
|
122
|
+
formInputMask: MergeSlots<FormKitBaseSlots<Props>, InputMaskSlots>;
|
|
123
|
+
formInputNumber: MergeSlots<FormKitBaseSlots<Props>, InputNumberSlots>;
|
|
124
|
+
formInputOtp: MergeSlots<FormKitBaseSlots<Props>, InputOtpSlots>;
|
|
125
|
+
formInputText: MergeSlots<FormKitBaseSlots<Props>, InputTextSlots>;
|
|
126
|
+
formKnob: MergeSlots<FormKitBaseSlots<Props>, KnobSlots>;
|
|
127
|
+
formListbox: MergeSlots<FormKitBaseSlots<Props>, ListboxSlots>;
|
|
128
|
+
formMultiSelect: MergeSlots<FormKitBaseSlots<Props>, MultiSelectSlots>;
|
|
129
|
+
formOutputBoolean: FormKitBaseSlots<Props>;
|
|
130
|
+
formOutputDate: FormKitBaseSlots<Props>;
|
|
131
|
+
formOutputDuration: FormKitBaseSlots<Props>;
|
|
132
|
+
formOutputLink: FormKitBaseSlots<Props>;
|
|
133
|
+
formOutputList: FormKitBaseSlots<Props>;
|
|
134
|
+
formOutputNumber: FormKitBaseSlots<Props>;
|
|
135
|
+
formOutputReference: FormKitBaseSlots<Props>;
|
|
136
|
+
formOutputText: FormKitBaseSlots<Props>;
|
|
137
|
+
formPassword: MergeSlots<FormKitBaseSlots<Props>, PasswordSlots>;
|
|
138
|
+
formRadioButton: MergeSlots<FormKitBaseSlots<Props>, RadioButtonSlots>;
|
|
139
|
+
formRating: MergeSlots<FormKitBaseSlots<Props>, RatingSlots>;
|
|
140
|
+
formSelect: MergeSlots<FormKitBaseSlots<Props>, SelectSlots>;
|
|
141
|
+
formSelectButton: MergeSlots<FormKitBaseSlots<Props>, SelectButtonSlots>;
|
|
142
|
+
formSlider: MergeSlots<FormKitBaseSlots<Props>, SliderSlots>;
|
|
143
|
+
formTextarea: MergeSlots<FormKitBaseSlots<Props>, TextareaSlots>;
|
|
144
|
+
formToggleButton: MergeSlots<FormKitBaseSlots<Props>, ToggleButtonSlots>;
|
|
145
|
+
formToggleSwitch: MergeSlots<FormKitBaseSlots<Props>, ToggleSwitchSlots>;
|
|
146
|
+
formTreeSelect: MergeSlots<FormKitBaseSlots<Props>, TreeSelectSlots>;
|
|
147
|
+
}
|
|
148
|
+
}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "FormKitDataEdit", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _components.FormKitDataEdit;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "FormKitDataView", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _components.FormKitDataView;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "formInputs", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _definitions.formInputs;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "formOutputs", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return _definitions.formOutputs;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "useFormInputs", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _composables.useFormInputs;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
Object.defineProperty(exports, "useFormKitRepeater", {
|
|
37
|
+
enumerable: true,
|
|
38
|
+
get: function () {
|
|
39
|
+
return _composables.useFormKitRepeater;
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports, "useFormKitSchema", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () {
|
|
45
|
+
return _composables.useFormKitSchema;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
Object.defineProperty(exports, "useInputEditor", {
|
|
49
|
+
enumerable: true,
|
|
50
|
+
get: function () {
|
|
51
|
+
return _composables.useInputEditor;
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(exports, "useInputEditorSchema", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () {
|
|
57
|
+
return _composables.useInputEditorSchema;
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
var _components = require("./components");
|
|
61
|
+
var _composables = require("./composables");
|
|
62
|
+
var _definitions = require("./definitions");
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FormKitDataEdit, FormKitDataView } from "./components/index.mjs";
|
|
2
|
+
import { useFormInputs, useFormKitRepeater, useFormKitSchema, useInputEditor, useInputEditorSchema } from "./composables/index.mjs";
|
|
3
|
+
import { formInputs, formOutputs } from "./definitions/index.mjs";
|
|
4
|
+
export {
|
|
5
|
+
formInputs,
|
|
6
|
+
FormKitDataEdit,
|
|
7
|
+
FormKitDataView,
|
|
8
|
+
formOutputs,
|
|
9
|
+
useFormInputs,
|
|
10
|
+
useFormKitRepeater,
|
|
11
|
+
useFormKitSchema,
|
|
12
|
+
useInputEditor,
|
|
13
|
+
useInputEditorSchema
|
|
14
|
+
};
|