Skip to content

Commit 5af1699

Browse files
committed
1.8.0
1 parent 548c236 commit 5af1699

16 files changed

+978
-21
lines changed

CHANGELOG.md

+11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
[//]: # (Don't use <tags>)
22

3+
## v1.8.0
4+
5+
> `2024-10-29`
6+
7+
### 🎉 Feature
8+
- New Matrix element.
9+
- Allow users to save custom elements.
10+
11+
### 🐞 Bug Fixes
12+
- Don't show resizer between elements in preview mode #85.
13+
314
## v1.7.4
415

516
> `2024-09-17`

index.css

+41-5
Original file line numberDiff line numberDiff line change
@@ -1927,23 +1927,37 @@ div > div:first-of-type[style*="none;"] + .vfb-util-props-separator-top {
19271927
}
19281928

19291929
.vfb-config-panel-header-close {
1930-
@apply mt-0.5 mr-2 text-gray-400 transition-colors hover:text-gray-800 cursor-pointer dark:text-dark-400 dark:hover:text-dark-300;
1930+
@apply mt-1 mr-2 text-gray-400 transition-colors hover:text-gray-800 cursor-pointer dark:text-dark-400 dark:hover:text-dark-300;
1931+
}
1932+
1933+
.vfb-config-panel-header-label-wrapper {
1934+
@apply flex flex-col justify-center min-h-[2rem];
19311935
}
19321936

19331937
.vfb-config-panel-header-label {
19341938
@apply text-xl;
19351939
}
19361940

1941+
.vfb-config-panel-header-description {
1942+
@apply text-gray-500 text-xs leading-none;
1943+
}
1944+
1945+
.vfb-config-panel-header-label-wrapper.has-subtitle .vfb-config-panel-header-label {
1946+
@apply text-lg leading-none;
1947+
}
1948+
19371949
.vfb-config-panel-header-warning {
19381950
@apply text-red-500 text-[12px] ml-1.5 mt-1 cursor-pointer relative;
19391951
}
19401952

1953+
.vfb-config-panel-header-save,
19411954
.vfb-config-panel-header-clone,
19421955
.vfb-config-panel-header-remove,
19431956
.vfb-config-panel-header-collapse {
1944-
@apply flex items-center justify-center h-full text-gray-500 transition-colors cursor-pointer hover:text-gray-600 dark:text-dark-400 hover:dark:text-dark-300;
1957+
@apply flex items-center justify-center h-full text-gray-500 transition-colors cursor-pointer hover:text-gray-600 dark:text-dark-400 hover:dark:text-dark-300 vfb-tooltip-group relative;
19451958
}
19461959

1960+
.vfb-config-panel-header-save,
19471961
.vfb-config-panel-header-clone,
19481962
.vfb-config-panel-header-remove {
19491963
@apply mr-3;
@@ -1996,7 +2010,7 @@ div > div:first-of-type[style*="none;"] + .vfb-util-props-separator-top {
19962010
--vf-border-color-checkbox: var(--vf-dark-800);
19972011
}
19982012

1999-
.vfb-config-toggle + .vfb-config-toggle {
2013+
.vfb-config-toggle + .vfb-config-toggle:not(.vfb-util-props-separator-top) {
20002014
@apply -mt-2;
20012015
}
20022016

@@ -2102,7 +2116,25 @@ div > div:first-of-type[style*="none;"] + .vfb-util-props-separator-top {
21022116
}
21032117

21042118
.vfb-element-container {
2105-
@apply flex items-center -ml-2.5 -mr-2.5 px-2.5 py-2.5 my-2 border border-primary-500 bg-primary-500 bg-opacity-0 border-opacity-0 duration-300 rounded-lg transition-shadow shadow-none duration-300;
2119+
@apply flex items-center -ml-2.5 -mr-2.5 px-2.5 py-2.5 my-2 border border-primary-500 bg-primary-500 bg-opacity-0 border-opacity-0 duration-300 rounded-lg transition-shadow shadow-none relative;
2120+
}
2121+
.vfb-element-container:hover .vfb-element-actions, .vfb-element-container:focus .vfb-element-actions, .vfb-element-container:focus-within .vfb-element-actions {
2122+
@apply opacity-100;
2123+
}
2124+
.vfb-element-container:hover .vfb-element-action, .vfb-element-container:focus .vfb-element-action, .vfb-element-container:focus-within .vfb-element-action {
2125+
@apply block;
2126+
}
2127+
2128+
.vfb-element-actions {
2129+
@apply transition-opacity duration-300 opacity-0 absolute right-2 top-1/2 transform -translate-y-1/2 text-gray-300 bg-white px-3 py-2 rounded dark:bg-dark-800 flex items-center justify-center gap-4;
2130+
}
2131+
2132+
.vfb-element-action {
2133+
@apply hidden;
2134+
}
2135+
2136+
.vfb-element-action-icon {
2137+
@apply transition-colors hover:text-gray-500 dark:text-dark-500 dark:hover:text-dark-200;
21062138
}
21072139

21082140
.vfb-element-container-enabled {
@@ -2432,7 +2464,7 @@ div > div:first-of-type[style*="none;"] + .vfb-util-props-separator-top {
24322464
}
24332465

24342466
.vfb-export-container {
2435-
@apply max-w-100vw-194.5 mx-auto my-4;
2467+
@apply max-w-100vw-194.5 mx-auto my-4 min-w-[352px];
24362468
}
24372469

24382470
.vfb-export-code {
@@ -3733,6 +3765,10 @@ div > div:first-of-type[style*="none;"] + .vfb-util-props-separator-top {
37333765
@apply border-transparent;
37343766
}
37353767

3768+
.vfb-preview-element-inert-wrapper {
3769+
@apply h-full;
3770+
}
3771+
37363772
.vfb-preview-element-multi-resizer {
37373773
@apply w-4 absolute right-[calc((var(--vf-gutter)/2+0.5rem)*-1)] -bottom-2 -top-2 z-2 cursor-ew-resize flex items-stretch justify-stretch;
37383774
}

index.d.mts

+40
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,15 @@ declare module '@vueform/builder' {
104104
const BoolValueField: any;
105105
const ButtonLabelField: any;
106106
const ButtonTypeField: any;
107+
const CanAddField: any;
107108
const CanClearField: any;
108109
const CanDropField: any;
110+
const CanRemoveField: any;
109111
const CanUndoField: any;
110112
const ClickableField: any;
111113
const ColorsField: any;
112114
const ColumnsField: any;
115+
const ColWrapField: any;
113116
const ConditionsField: any;
114117
const ContentField: any;
115118
const ControlsField: any;
@@ -166,6 +169,8 @@ declare module '@vueform/builder' {
166169
const FormWidthField: any;
167170
const FullField: any;
168171
const HeightField: any;
172+
const HideColsField: any;
173+
const HideRowsField: any;
169174
const Hour24Field: any;
170175
const HrefField: any;
171176
const IdField: any;
@@ -180,6 +185,15 @@ declare module '@vueform/builder' {
180185
const LabelsField: any;
181186
const LineField: any;
182187
const LinkField: any;
188+
const MatrixColsField: any;
189+
const MatrixGapField: any;
190+
const MatrixInputTypeField: any;
191+
const MatrixItemsField: any;
192+
const MatrixMaxField: any;
193+
const MatrixMaxWidthField: any;
194+
const MatrixMinField: any;
195+
const MatrixMinWidthField: any;
196+
const MatrixRowsField: any;
183197
const MaxField: any;
184198
const MaxFontSizeField: any;
185199
const MaxOptionsField: any;
@@ -197,6 +211,7 @@ declare module '@vueform/builder' {
197211
const NoResultsField: any;
198212
const ObjectField: any;
199213
const OrientationField: any;
214+
const PaddingField: any;
200215
const PageButtonsField: any;
201216
const PageConditionsField: any;
202217
const PageLabelField: any;
@@ -208,6 +223,8 @@ declare module '@vueform/builder' {
208223
const ReadonlyField: any;
209224
const ResetsField: any;
210225
const RowsField: any;
226+
const RowWrapField: any;
227+
const ScrollableField: any;
211228
const SearchField: any;
212229
const SearchField_tags: any;
213230
const SecondsField: any;
@@ -220,6 +237,8 @@ declare module '@vueform/builder' {
220237
const SoftRemoveField: any;
221238
const SpaceField: any;
222239
const StepField: any;
240+
const StickyColsField: any;
241+
const StickyRowsField: any;
223242
const StoreField: any;
224243
const StoreOrderField: any;
225244
const SubmitField: any;
@@ -252,6 +271,7 @@ declare module '@vueform/builder' {
252271
const ValidationField: any;
253272
const ViewField: any;
254273
const ViewField_file: any;
274+
const ViewField_matrix: any;
255275

256276
function defineConfig(options: BuilderConfig): BuilderConfig;
257277

@@ -289,12 +309,15 @@ declare module '@vueform/builder' {
289309
BoolValueField,
290310
ButtonLabelField,
291311
ButtonTypeField,
312+
CanAddField,
292313
CanClearField,
293314
CanDropField,
315+
CanRemoveField,
294316
CanUndoField,
295317
ClickableField,
296318
ColorsField,
297319
ColumnsField,
320+
ColWrapField,
298321
ConditionsField,
299322
ContentField,
300323
ControlsField,
@@ -351,6 +374,8 @@ declare module '@vueform/builder' {
351374
FormWidthField,
352375
FullField,
353376
HeightField,
377+
HideColsField,
378+
HideRowsField,
354379
Hour24Field,
355380
HrefField,
356381
IdField,
@@ -365,6 +390,15 @@ declare module '@vueform/builder' {
365390
LabelsField,
366391
LineField,
367392
LinkField,
393+
MatrixColsField,
394+
MatrixGapField,
395+
MatrixInputTypeField,
396+
MatrixItemsField,
397+
MatrixMaxField,
398+
MatrixMaxWidthField,
399+
MatrixMinField,
400+
MatrixMinWidthField,
401+
MatrixRowsField,
368402
MaxField,
369403
MaxFontSizeField,
370404
MaxOptionsField,
@@ -382,6 +416,7 @@ declare module '@vueform/builder' {
382416
NoResultsField,
383417
ObjectField,
384418
OrientationField,
419+
PaddingField,
385420
PageButtonsField,
386421
PageConditionsField,
387422
PageLabelField,
@@ -393,6 +428,8 @@ declare module '@vueform/builder' {
393428
ReadonlyField,
394429
ResetsField,
395430
RowsField,
431+
RowWrapField,
432+
ScrollableField,
396433
SearchField,
397434
SearchField_tags,
398435
SecondsField,
@@ -405,6 +442,8 @@ declare module '@vueform/builder' {
405442
SoftRemoveField,
406443
SpaceField,
407444
StepField,
445+
StickyColsField,
446+
StickyRowsField,
408447
StoreField,
409448
StoreOrderField,
410449
SubmitField,
@@ -437,6 +476,7 @@ declare module '@vueform/builder' {
437476
ValidationField,
438477
ViewField,
439478
ViewField_file,
479+
ViewField_matrix,
440480

441481
}
442482

index.mjs

+2-2
Large diffs are not rendered by default.

locales/en_US/index.mjs

+120-1
Original file line numberDiff line numberDiff line change
@@ -1373,5 +1373,124 @@ export default {
13731373
"validation_disabled_conditions_display_empty_text": "No conditions for disabled",
13741374
"validation_readonly_conditions_display_empty_text": "No conditions for readonly",
13751375
"condition_modal_title_disabled": "/ disabled",
1376-
"condition_modal_title_readonly": "/ readonly"
1376+
"condition_modal_title_readonly": "/ readonly",
1377+
"matrix_label": "Matrix",
1378+
"matrix_description": "A matrix of input fields",
1379+
"matrix_cols_1": "Column 1",
1380+
"matrix_cols_2": "Column 2",
1381+
"matrix_rows_1": "Row 1",
1382+
"matrix_rows_2": "Row 2",
1383+
"section_matrix_rows": "Options",
1384+
"condition_modal_title_column": "/ Column condition",
1385+
"condition_modal_title_row": "/ Row condition",
1386+
"col_wrap_col_wrap_label": "Allow multi-line columns",
1387+
"matrix_gap_gap_label": "Cell gap",
1388+
"matrix_rows_rows_wrapper_item_static": "Static rows",
1389+
"matrix_rows_rows_wrapper_item_dynamic": "Dynamic rows",
1390+
"matrix_rows_rows_count_label": "Initial rows count",
1391+
"matrix_rows_min_label": "Min rows",
1392+
"matrix_rows_min_placeholder": "none",
1393+
"matrix_rows_max_label": "Max rows",
1394+
"matrix_rows_max_placeholder": "none",
1395+
"matrix_rows_can_add_label": "Can add rows",
1396+
"matrix_rows_add_text_label": "Add button text",
1397+
"matrix_rows_can_remove_label": "Can remove rows",
1398+
"matrix_rows_rows_list_add_text": "+ Add row",
1399+
"matrix_rows_rows_list_label_placeholder": "Text",
1400+
"matrix_rows_rows_list_value_placeholder": "Value",
1401+
"matrix_rows_rows_list_button_conditions": "Conditions",
1402+
"matrix_cols_cols_add_text": "+ Add column",
1403+
"matrix_cols_label_placeholder": "Text",
1404+
"matrix_cols_value_placeholder": "Value",
1405+
"matrix_cols_input_type_placeholder": "Type",
1406+
"matrix_cols_width_placeholder": "Width",
1407+
"matrix_cols_button_conditions": "Conditions",
1408+
"matrix_cols_items_label": "Options",
1409+
"matrix_cols_items_add_text": "+ Add option",
1410+
"matrix_cols_items_label_placeholder": "Text",
1411+
"matrix_cols_items_value_placeholder": "Value",
1412+
"matrix_items_items_label": "Options",
1413+
"matrix_items_items_add_text": "+ Add option",
1414+
"matrix_items_items_label_placeholder": "Text",
1415+
"matrix_items_items_value_placeholder": "Value",
1416+
"matrix_input_type_input_type_label": "Default type",
1417+
"matrix_max_width_max_width_label": "Max column width",
1418+
"matrix_max_width_max_width_placeholder": "auto",
1419+
"matrix_min_width_min_width_label": "Min column width",
1420+
"matrix_min_width_min_width_placeholder": "auto",
1421+
"hide_cols_hide_cols_label": "Hide column labels",
1422+
"hide_rows_hide_rows_label": "Hide row labels",
1423+
"padding_padding_label": "Horizontal padding",
1424+
"row_wrap_row_wrap_label": "Allow multi-line rows",
1425+
"scrollable_scrollable_label": "Allow scroll",
1426+
"sticky_cols_sticky_cols_label": "Sticky columns headers",
1427+
"sticky_rows_sticky_rows_label": "Sticky row labels",
1428+
"view_matrix_view_label": "View",
1429+
"view_matrix_view_item_table": "Table",
1430+
"save": "Save",
1431+
"cancel": "Cancel",
1432+
"delete": "Delete",
1433+
"category_custom": "Custom",
1434+
"custom_element_modal_title_save": "Save element",
1435+
"custom_element_modal_title_edit": "Save element",
1436+
"custom_element_modal_subtitle_edit": "Saving existing element will not update existing copies!",
1437+
"custom_element_modal_form_label_label": "Name",
1438+
"custom_element_modal_form_label_description": "This is how it will appear in the list of elements.",
1439+
"custom_element_modal_form_label_placeholder": "Eg. Text element",
1440+
"custom_element_modal_form_description_label": "Description",
1441+
"custom_element_modal_form_description_description": "This should briefly describe what an element does.",
1442+
"custom_element_modal_form_description_placeholder": "Eg. Single line text input",
1443+
"custom_element_modal_form_key_label": "Key",
1444+
"custom_element_modal_form_key_description": "Unique identifier and initial name of the element.",
1445+
"custom_element_modal_error_restricted": "The key <b>%key%</b> is restricted, please choose another.",
1446+
"custom_element_modal_error_used": "The key <b>%key%</b> is already in use.",
1447+
"custom_element_modal_form_note": "Please note that updating a custom element type will not update instances that are already added to the form!",
1448+
"delete_element_confirm": "Are you sure you want to delete this element?",
1449+
"column_text_label": "Text",
1450+
"column_number_label": "Number",
1451+
"column_email_label": "Email",
1452+
"column_phone_label": "Phone",
1453+
"column_password_label": "Password",
1454+
"column_url_label": "URL",
1455+
"column_location_label": "Location",
1456+
"column_textarea_label": "Textarea",
1457+
"column_editor_label": "Editor",
1458+
"column_checkbox_label": "Checkbox",
1459+
"column_checkboxgroup_label": "Checkbox group",
1460+
"column_checkboxgroup_tabs_label": "Checkbox tabs",
1461+
"column_checkboxgroup_blocks_label": "Checkbox blocks",
1462+
"column_radiogroup_label": "Radio group",
1463+
"column_radiogroup_tabs_label": "Radio tabs",
1464+
"column_radiogroup_blocks_label": "Radio blocks",
1465+
"column_toggle_label": "Toggle",
1466+
"column_select_label": "Select",
1467+
"column_multiselect_label": "Multiselect",
1468+
"column_tags_label": "Tags",
1469+
"column_date_label": "Date",
1470+
"column_time_label": "Time",
1471+
"column_datetime_label": "Date-time",
1472+
"column_week_label": "Week",
1473+
"column_month_label": "Month",
1474+
"column_file_label": "File upload",
1475+
"column_image_label": "Image upload",
1476+
"simple_matrix_label": "Single choice matrix",
1477+
"simple_matrix_description": "Matrix of single choice options",
1478+
"simple_matrix_multi_label": "Multiple choice matrix",
1479+
"simple_matrix_multi_description": "Matrix of multiple choice options",
1480+
"element_save_button_tooltip": "Save as new element",
1481+
"element_edit_button_tooltip": "Save",
1482+
"section_rows": "Rows",
1483+
"section_columns": "Columns",
1484+
"simple_section_rows": "Rows",
1485+
"simple_section_columns": "Columns",
1486+
"matrix_default_option_label": "Option",
1487+
"matrix_default_option_value": "option",
1488+
"table_label": "Table",
1489+
"table_description": "Spreadsheet-like table of text inputs",
1490+
"table_cols_1": "Column 1",
1491+
"table_cols_2": "Column 2",
1492+
"table_rows_1": "Row 1",
1493+
"table_rows_2": "Row 2",
1494+
"simple_table_label": "Table",
1495+
"simple_table_description": "Spreadsheet-like table of text inputs"
13771496
};

0 commit comments

Comments
 (0)