Skip to content

Commit b350fdc

Browse files
committed
tablo eklendi
1 parent 55c20af commit b350fdc

File tree

15 files changed

+140445
-50666
lines changed

15 files changed

+140445
-50666
lines changed

dist/v-form-builder.common.js

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

dist/v-form-builder.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/v-form-builder.umd.js

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

dist/v-form-builder.umd.min.js

Lines changed: 13 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 266 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "v-form-builder",
3-
"version": "2.1.3",
3+
"version": "2.1.1",
44
"private": false,
55
"description": "Vue Form Builder PRO MAX built from top of Vue. Super dynamic and flexible including Drag and Drop feature.",
66
"author": {
@@ -16,12 +16,17 @@
1616
},
1717
"main": "./dist/v-form-builder.umd.min.js",
1818
"dependencies": {
19+
"axios": "^0.27.2",
20+
"bootstrap": "^5.2.2",
21+
"bootstrap-vue": "^2.22.0",
1922
"core-js": "^2.6.5",
2023
"dayjs": "^1.8.28",
2124
"deep-equal": "^2.0.3",
25+
"jquery": "^3.6.1",
2226
"litepicker": "^1.4.6",
2327
"vue": "^2.6.10",
2428
"vue-class-component": "^7.2.3",
29+
"vue-excel-editor": "^1.5.19",
2530
"vue-multiselect": "^2.1.6",
2631
"vue-property-decorator": "^8.4.2",
2732
"vue-select": "^3.20.0",

src/configs/row.js

Lines changed: 45 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -3,46 +3,48 @@
33
* @author Phat Tran
44
*/
55

6-
import {HELPER} from "@/libraries/helper";
7-
8-
9-
const ROW_TYPES = {
10-
normal: 'normal', // Normal Row in Div (div.row)
11-
tabRow: 'tabRow', // Tab Row
12-
tableRow: 'tableRow', // Table row (tr)
13-
};
14-
15-
const ROW_DEFAULT_DATA = {
16-
uniqueId: '',
17-
additionalClass: '',
18-
type: ROW_TYPES.normal,
19-
sortOrder: 0,
20-
controls: [], // ids of control
21-
extendData: null, // depends on the row, we would have specific configuration
22-
};
23-
24-
/**
25-
* Create new Row Object
26-
* @param {string} type
27-
* @param {any} extendData
28-
*/
29-
function createNewRow(type, extendData = null) {
30-
if (!ROW_TYPES[type]) {
31-
throw new TypeError(`Row Type: ${type} doesn't exists in Vue-Form-Builder`);
32-
}
33-
34-
// create new section data base on the default data
35-
let newRowObject = HELPER.cloneDeep(ROW_DEFAULT_DATA)
36-
newRowObject.type = type
37-
newRowObject.uniqueId = "row-" + HELPER.getUUIDv4()
38-
newRowObject.extendData = extendData
39-
40-
return newRowObject
41-
}
42-
43-
44-
export {
45-
ROW_TYPES,
46-
ROW_DEFAULT_DATA,
47-
createNewRow
48-
}
6+
import {HELPER} from "@/libraries/helper";
7+
8+
9+
const ROW_TYPES = {
10+
normal: 'normal', // Normal Row in Div (div.row)
11+
tabRow: 'tabRow', // Tab Row
12+
tableRow: 'tableRow', // Table row (tr)
13+
fileRow: 'fileRow'
14+
};
15+
16+
const ROW_DEFAULT_DATA = {
17+
uniqueId: '',
18+
additionalClass: '',
19+
type: ROW_TYPES.normal,
20+
sortOrder: 0,
21+
controls: [], // ids of control
22+
extendData: null, // depends on the row, we would have specific configuration
23+
};
24+
25+
/**
26+
* Create new Row Object
27+
* @param {string} type
28+
* @param {any} extendData
29+
*/
30+
function createNewRow(type, extendData = null) {
31+
if (!ROW_TYPES[type]) {
32+
throw new TypeError(`Row Type: ${type} doesn't exists in Vue-Form-Builder`);
33+
}
34+
35+
// create new section data base on the default data
36+
let newRowObject = HELPER.cloneDeep(ROW_DEFAULT_DATA)
37+
newRowObject.type = type
38+
newRowObject.uniqueId = "row-" + HELPER.getUUIDv4()
39+
newRowObject.extendData = extendData
40+
41+
return newRowObject
42+
}
43+
44+
45+
export {
46+
ROW_TYPES,
47+
ROW_DEFAULT_DATA,
48+
createNewRow
49+
}
50+

src/configs/section.js

Lines changed: 133 additions & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -2,124 +2,136 @@
22
* Supported Section & Section Constants in Vue-Form-Builder
33
* @author Phat Tran
44
*/
5-
import {HELPER} from "@/libraries/helper";
6-
import {ROW_TYPES} from "@/configs/row";
7-
8-
// Builder Views
9-
import NormalSectionView from "@/views/builder/section-views/NormalSectionView";
10-
// import TableSectionView from "@/views/builder/section-views/TableSectionView";
11-
import ToggleableSectionView from "@/views/builder/section-views/ToggleableSectionView";
12-
import TabSectionView from "@/views/builder/section-views/TabSectionView";
13-
14-
// Builder Buttons [PRE]
15-
import TabSectionPreButtons from "@/views/builder/section-navigation-buttons/TabSectionPreButtons";
16-
17-
// Builder Buttons [POST]
18-
19-
// Renderer Views
20-
import RendererNormalSectionView from "@/views/renderer/section-views/NormalSectionView";
21-
import RendererToggleableSectionView from "@/views/renderer/section-views/ToggleableSectionView";
22-
import RendererTabSectionView from "@/views/renderer/section-views/TabSectionView";
23-
// import $ml from "../../../../src/language/ml.js"
24-
// import "../../../../src/language/ml.js"
25-
26-
27-
28-
29-
const SECTION_TYPES = {
30-
normal: {
31-
name: "NORMAL_BLOCK",
32-
description: "NORMAL_BLOCK_DESC",
33-
// name: "Normal Block",
34-
// description: "Normal block with a headline",
35-
value: 'normal',
36-
37-
rowType: ROW_TYPES.normal,
38-
builderView: NormalSectionView,
39-
rendererView: RendererNormalSectionView,
40-
},
41-
42-
toggleable: {
43-
name: "TOGGLEABLE_BLOCK",
44-
description: "TOGGLEABLE_BLOCK_DESC",
45-
// name: "Toggle Block",
46-
// description: "Section block with toggle (display/hide) feature",
47-
value: 'toggleable',
48-
49-
rowType: ROW_TYPES.normal,
50-
builderView: ToggleableSectionView,
51-
rendererView: RendererToggleableSectionView
52-
},
53-
54-
// tab: {
55-
// name: "TAB_BLOCK",
56-
// description: "TAB_BLOCK_DESC",
57-
// // name: "Tab Block",
58-
// // description: "A block with multiple tabs feature",
59-
// value: "tab",
60-
61-
// rowType: ROW_TYPES.tabRow,
62-
// builderView: TabSectionView,
63-
// rendererView: RendererTabSectionView,
64-
// preCustomButtonView: TabSectionPreButtons,
65-
// }
66-
67-
// table: {
68-
// name: "Table Block",
69-
// description: "Section block built from a table with 2 column",
70-
// value: 'table',
71-
//
72-
// rowType: ROW_TYPES.tableRow,
73-
// builderView: TableSectionView
74-
// },
75-
76-
77-
};
78-
79-
/**
80-
* DEFAULT DATA in order to create/reread from the configuration
81-
*/
82-
const SECTION_DEFAULT_DATA = {
83-
uniqueId: '',
84-
85-
headline: '',
86-
headlineAdditionalClass: '',
87-
88-
subHeadline: '',
89-
subHeadlineAdditionalClass: '',
90-
91-
isShowHeadline: true,
92-
93-
sortOrder: 0,
94-
type: '',
95-
rows: [], // array of rowId
96-
controls: [], // array of controlIds
97-
permission: {}
98-
};
99-
100-
/**
101-
* Create new Section
102-
* @param type
103-
* @param sortOrder
104-
*/
105-
function createNewSection(type, sortOrder = 0) {
106-
if (!SECTION_TYPES[type]) {
107-
throw new TypeError(`Section Type: ${type} doesn't exists in Vue-Form-Builder`);
108-
}
109-
110-
// create new section data base on the default data
111-
let newSectionData = HELPER.cloneDeep(SECTION_DEFAULT_DATA)
112-
newSectionData.type = type
113-
newSectionData.uniqueId = "section-" + HELPER.getUUIDv4()
114-
newSectionData.headline = "Yeni Kısım"
115-
newSectionData.subHeadline = "Bu yeni bölümün alt başlığıdır"
116-
newSectionData.sortOrder = sortOrder
117-
118-
return newSectionData;
119-
}
120-
121-
export {
122-
SECTION_TYPES,
123-
SECTION_DEFAULT_DATA,
124-
createNewSection
125-
}
5+
import {HELPER} from "@/libraries/helper";
6+
import {ROW_TYPES} from "@/configs/row";
7+
8+
// Builder Views
9+
import NormalSectionView from "@/views/builder/section-views/NormalSectionView";
10+
import TableSectionView from "@/views/builder/section-views/TableSectionView";
11+
import ToggleableSectionView from "@/views/builder/section-views/ToggleableSectionView";
12+
import FileSectionView from "@/views/builder/section-views/FileSectionView";
13+
import TabSectionView from "@/views/builder/section-views/TabSectionView";
14+
15+
// Builder Buttons [PRE]
16+
import TabSectionPreButtons from "@/views/builder/section-navigation-buttons/TabSectionPreButtons";
17+
18+
// Builder Buttons [POST]
19+
20+
// Renderer Views
21+
import RendererNormalSectionView from "@/views/renderer/section-views/NormalSectionView";
22+
import RendererToggleableSectionView from "@/views/renderer/section-views/ToggleableSectionView";
23+
import RendererTabSectionView from "@/views/renderer/section-views/TabSectionView";
24+
import RendererTableSectionView from "@/views/renderer/section-views/TableSectionView";
25+
import RendererFileSectionView from "@/views/renderer/section-views/FileSectionView";
26+
27+
28+
29+
30+
const SECTION_TYPES = {
31+
normal: {
32+
name: "Normal Block",
33+
description: "Normal block with a headline",
34+
value: 'normal',
35+
36+
rowType: ROW_TYPES.normal,
37+
builderView: NormalSectionView,
38+
rendererView: RendererNormalSectionView,
39+
},
40+
41+
toggleable: {
42+
name: "Toggleable Block",
43+
description: "Section block with toggle (display/hide) feature",
44+
value: 'toggleable',
45+
46+
rowType: ROW_TYPES.normal,
47+
builderView: ToggleableSectionView,
48+
rendererView: RendererToggleableSectionView
49+
},
50+
51+
// tab: {
52+
// name: "Tab Block",
53+
// description: "A block with multiple tabs feature",
54+
// value: "tab",
55+
56+
// rowType: ROW_TYPES.tabRow,
57+
// builderView: TabSectionView,
58+
// rendererView: RendererTabSectionView,
59+
// preCustomButtonView: TabSectionPreButtons,
60+
// }
61+
62+
table: {
63+
name: "Table Block",
64+
description: "Section block built from a table",
65+
value: 'table',
66+
67+
rowType: ROW_TYPES.tableRow,
68+
builderView: TableSectionView,
69+
rendererView: RendererTableSectionView
70+
},
71+
72+
file: {
73+
name: "File Block",
74+
description: "Section block with add file feature",
75+
value: 'file',
76+
77+
rowType: ROW_TYPES.fileRow,
78+
builderView: FileSectionView,
79+
rendererView: RendererFileSectionView
80+
},
81+
82+
83+
};
84+
85+
/**
86+
* DEFAULT DATA in order to create/reread from the configuration
87+
*/
88+
const SECTION_DEFAULT_DATA = {
89+
uniqueId: '',
90+
91+
headline: '',
92+
headlineAdditionalClass: '',
93+
94+
subHeadline: '',
95+
subHeadlineAdditionalClass: '',
96+
97+
isShowHeadline: true,
98+
99+
sortOrder: 0,
100+
type: '',
101+
rows: [], // array of rowId
102+
controls: [], // array of controlIds
103+
permission: {},
104+
};
105+
106+
/**
107+
* Create new Section
108+
* @param type
109+
* @param sortOrder
110+
*/
111+
function createNewSection(type, sortOrder = 0) {
112+
if (!SECTION_TYPES[type]) {
113+
throw new TypeError(`Section Type: ${type} doesn't exists in Vue-Form-Builder`);
114+
}
115+
116+
// create new section data base on the default data
117+
let newSectionData = HELPER.cloneDeep(SECTION_DEFAULT_DATA)
118+
newSectionData.type = type
119+
newSectionData.uniqueId = "section-" + HELPER.getUUIDv4()
120+
newSectionData.headline = "New Section"
121+
newSectionData.subHeadline = "This is the sub-headline of the new section"
122+
newSectionData.sortOrder = sortOrder
123+
if(type == 'table'){
124+
newSectionData.tableObject = {
125+
data: [],
126+
tableColumns: []
127+
}
128+
}
129+
130+
return newSectionData;
131+
}
132+
133+
export {
134+
SECTION_TYPES,
135+
SECTION_DEFAULT_DATA,
136+
createNewSection
137+
}

src/installer.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import vSelect from "vue-select"
1111
import "vue-select/dist/vue-select.css";
1212
Vue.component("v-select", vSelect)
1313

14+
1415
const VueFormBuilderInstaller = function(
1516
Vue,
1617
properties = {}

src/mixins/form-renderer/configuration.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
if (deepEqual(val, this.formData)) {
4242
return
4343
}
44-
44+
4545
this.mapping(val)
4646
this.createValueContainer(val)
4747
}

0 commit comments

Comments
 (0)