Skip to content

Commit 6157119

Browse files
committed
1.4.3
1 parent 70a8c20 commit 6157119

File tree

9 files changed

+98
-16
lines changed

9 files changed

+98
-16
lines changed

CHANGELOG.md

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

3+
## v1.4.3
4+
5+
> `2024-05-10`
6+
7+
### 🎉 Feature
8+
- New Phone element.
9+
- Show warning at the element when data paths are duplicated #54.
10+
11+
### 🐞 Bug Fixes
12+
- Increment child names when cloning containers #54.
13+
314
## v1.4.2
415

516
> `2024-04-29`

index.css

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1869,6 +1869,10 @@ div > div:first-of-type[style*="none;"] + .vfb-util-props-separator-top {
18691869
@apply text-xl;
18701870
}
18711871

1872+
.vfb-config-panel-header-warning {
1873+
@apply text-red-500 text-[12px] ml-1.5 mt-1 cursor-pointer relative;
1874+
}
1875+
18721876
.vfb-config-panel-header-clone,
18731877
.vfb-config-panel-header-remove,
18741878
.vfb-config-panel-header-collapse {
@@ -1909,6 +1913,7 @@ div > div:first-of-type[style*="none;"] + .vfb-util-props-separator-top {
19091913
--vf-radius-checkbox-sm: 4px;
19101914
--vf-bg-input: var(--vf-gray-100);
19111915
--vf-bg-passive: var(--vf-gray-200);
1916+
--vf-bg-selected: var(--vf-gray-200);
19121917
--vf-border-color-passive: var(--vf-gray-200);
19131918
--vf-border-color-input: var(--vf-gray-200);
19141919
--vf-color-input: var(--vf-gray-900);
@@ -1961,6 +1966,22 @@ div > div:first-of-type[style*="none;"] + .vfb-util-props-separator-top {
19611966
@apply text-gray-400 font-bold text-0.5xs uppercase cursor-text select-none bg-gray-100 bg-opacity-50 absolute bottom-1.5 right-2 leading-none p-0.5 dark:bg-dark-700 dark:text-dark-400;
19621967
}
19631968

1969+
.vfb-config-panel-warning {
1970+
@apply bg-red-100 text-red-500 my-4 px-4 py-3 rounded leading-tight overflow-x-auto;
1971+
}
1972+
1973+
.vfb-config-panel-warning-text {
1974+
@apply my-1;
1975+
}
1976+
1977+
.vfb-config-panel-warning-ul {
1978+
@apply list-disc pl-5 leading-tight;
1979+
}
1980+
1981+
.vfb-config-panel-warning-li {
1982+
@apply text-xs font-semibold -ml-1 pr-4 underline cursor-pointer;
1983+
}
1984+
19641985
.vfb-elements-container {
19651986
@apply absolute inset-0;
19661987
}
@@ -3573,6 +3594,10 @@ div > div:first-of-type[style*="none;"] + .vfb-util-props-separator-top {
35733594
@apply border-dashed border;
35743595
}
35753596

3597+
.vfb-preview-element-warning {
3598+
@apply absolute inset-0 bg-red-500 bg-opacity-20;
3599+
}
3600+
35763601
.vfb-preview-element-outer-wrapper {
35773602
@apply grid grid-cols-12 flex-1;
35783603
}

index.d.mts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ declare module '@vueform/builder' {
135135
const DisabledField: any;
136136
const DragAndDropField: any;
137137
const EndpointField: any;
138+
const ExcludeCountriesField: any;
138139
const ExportApiField: any;
139140
const ExportDownloadField: any;
140141
const ExportOutputField: any;
@@ -164,6 +165,7 @@ declare module '@vueform/builder' {
164165
const HrefField: any;
165166
const IdField: any;
166167
const ImgField: any;
168+
const IncludeCountriesField: any;
167169
const InfoField: any;
168170
const InitialField: any;
169171
const InputTypeField: any;
@@ -228,6 +230,7 @@ declare module '@vueform/builder' {
228230
const TooltipFormatField: any;
229231
const TooltipsField: any;
230232
const TypeField: any;
233+
const UnmaskField: any;
231234
const ValidationField: any;
232235
const ViewField: any;
233236
const ViewField_file: any;
@@ -299,6 +302,7 @@ declare module '@vueform/builder' {
299302
DisabledField,
300303
DragAndDropField,
301304
EndpointField,
305+
ExcludeCountriesField,
302306
ExportApiField,
303307
ExportDownloadField,
304308
ExportOutputField,
@@ -328,6 +332,7 @@ declare module '@vueform/builder' {
328332
HrefField,
329333
IdField,
330334
ImgField,
335+
IncludeCountriesField,
331336
InfoField,
332337
InitialField,
333338
InputTypeField,
@@ -392,6 +397,7 @@ declare module '@vueform/builder' {
392397
TooltipFormatField,
393398
TooltipsField,
394399
TypeField,
400+
UnmaskField,
395401
ValidationField,
396402
ViewField,
397403
ViewField_file,

index.mjs

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": false,
33
"name": "@vueform/builder",
4-
"version": "1.4.2",
4+
"version": "1.4.3",
55
"description": "Vueform Builder development build.",
66
"homepage": "https://vueform.com",
77
"license": "SEE LICENSE IN LICENSE.txt",

plugin.mjs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -450,6 +450,10 @@ export default function () {
450450
required: false,
451451
type: String,
452452
},
453+
modelDuplicates: {
454+
required: false,
455+
type: Array,
456+
},
453457
},
454458
setup(props, context, component) {
455459
const { builder, schema, draggedSchema, tabs, steps } = toRefs(props)
@@ -2098,6 +2102,14 @@ export default function () {
20982102
return component.form$.value.pageType
20992103
})
21002104

2105+
const duplicates = computed(() => {
2106+
return component.form$.value.modelDuplicates.filter(d => d.dataPath === component.el$.value.dataPath)
2107+
})
2108+
2109+
const hasWarning = computed(() => {
2110+
return duplicates.value.length
2111+
})
2112+
21012113
// =============== METHODS ==============
21022114

21032115

@@ -2669,6 +2681,7 @@ export default function () {
26692681
hideDragLine,
26702682
lastWidth,
26712683
childRestrictions,
2684+
hasWarning,
26722685
handleOverlayClick,
26732686
handleCloneClick,
26742687
handleRemoveClick,

presets/simple.mjs

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ import {
4040
TypeField,
4141
ValidationField,
4242
ViewField,
43+
IncludeCountriesField,
44+
ExcludeCountriesField,
4345
} from './../'
4446

4547
/**
@@ -66,6 +68,7 @@ const rules = [
6668
'before',
6769
'before_or_equal',
6870
'boolean',
71+
'completed',
6972
'date',
7073
'date_equals',
7174
'date_format',
@@ -941,27 +944,32 @@ const email = {
941944

942945
const phone = {
943946
label: 'Phone',
944-
description: 'Input field that expects a phone number',
947+
description: 'Phone number with country selector',
945948
icon: ['fas', 'phone-rotary'],
946949
category: 'fields',
947950
schema: {
948-
type: 'text',
951+
type: 'phone',
949952
label: 'Phone',
950-
mask: { mask: '+1 (000) 000 0000', label: 'US Phone number', placeholder: true },
953+
allowIncomplete: true,
954+
unmask: true,
951955
},
952956
sections: {
953957
properties: {
954958
name: 'properties',
955959
label: 'Properties',
956960
fields: {
957961
type: { type: TypeField },
958-
inputType: { type: InputTypeField_simple },
959-
mask: { type: PhoneMask_simple },
960962
label: { type: LabelField },
961963
description: { type: DescriptionField },
962964
placeholder: { type: PlaceholderField },
963-
addons: { type: AddonsField },
964-
readonly: { type: ReadonlyField },
965+
},
966+
},
967+
options: {
968+
name: 'options',
969+
label: 'Phone options',
970+
fields: {
971+
include: { type: IncludeCountriesField, },
972+
exclude: { type: ExcludeCountriesField, },
965973
},
966974
},
967975
layout: {
@@ -996,12 +1004,6 @@ const phone = {
9961004
}
9971005
},
9981006
separators: {
999-
properties: [
1000-
['mask'],
1001-
['type', 'label', 'description', 'placeholder'],
1002-
['addons'],
1003-
['readonly',]
1004-
],
10051007
layout: [
10061008
['columns'],
10071009
['size'],

scss/_config-panel.scss

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838
@apply text-xl;
3939
}
4040

41+
.vfb-config-panel-header-warning {
42+
@apply text-red-500 text-[12px] ml-1.5 mt-1 cursor-pointer relative;
43+
}
44+
4145
.vfb-config-panel-header-clone,
4246
.vfb-config-panel-header-remove,
4347
.vfb-config-panel-header-collapse {
@@ -92,6 +96,7 @@
9296

9397
--vf-bg-input: var(--vf-gray-100);
9498
--vf-bg-passive: var(--vf-gray-200);
99+
--vf-bg-selected: var(--vf-gray-200);
95100
--vf-border-color-passive: var(--vf-gray-200);
96101

97102
--vf-border-color-input: var(--vf-gray-200);
@@ -158,4 +163,20 @@
158163

159164
.vfb-config-panel-input-language-editor {
160165
@apply text-gray-400 font-bold text-0.5xs uppercase cursor-text select-none bg-gray-100 bg-opacity-50 absolute bottom-1.5 right-2 leading-none p-0.5 dark:bg-dark-700 dark:text-dark-400;
166+
}
167+
168+
.vfb-config-panel-warning {
169+
@apply bg-red-100 text-red-500 my-4 px-4 py-3 rounded leading-tight overflow-x-auto;
170+
}
171+
172+
.vfb-config-panel-warning-text {
173+
@apply my-1;
174+
}
175+
176+
.vfb-config-panel-warning-ul {
177+
@apply list-disc pl-5 leading-tight;
178+
}
179+
180+
.vfb-config-panel-warning-li {
181+
@apply text-xs font-semibold -ml-1 pr-4 underline cursor-pointer;
161182
}

scss/_preview-element.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@
138138
}
139139
}
140140

141+
.vfb-preview-element-warning {
142+
@apply absolute inset-0 bg-red-500 bg-opacity-20;
143+
}
144+
141145
.vfb-preview-element-outer-wrapper {
142146
@apply grid grid-cols-12 flex-1;
143147
}

0 commit comments

Comments
 (0)