From 8c32daa86bae23a02d795824ad85dd326a5148ab Mon Sep 17 00:00:00 2001 From: Cagatay Civici Date: Mon, 18 Jan 2021 11:25:54 +0300 Subject: [PATCH 01/19] Initiated new rollup based build --- package.json | 2 + rollup.config.js | 38 +++++++++++++++++++ src/components/breadcrumb/Breadcrumb.vue | 2 +- .../cascadeselect/CascadeSelect.vue | 2 +- src/components/contextmenu/ContextMenu.vue | 2 +- src/components/datatable/BodyCell.vue | 2 +- src/components/datatable/ScrollableView.vue | 2 +- src/components/galleria/Galleria.vue | 2 +- src/components/galleria/GalleriaContent.vue | 6 +-- src/components/menu/Menu.vue | 2 +- src/components/menubar/Menubar.vue | 2 +- .../organizationchart/OrganizationChart.vue | 2 +- src/components/paginator/Paginator.vue | 14 +++---- src/components/panelmenu/PanelMenu.vue | 2 +- src/components/tieredmenu/TieredMenu.vue | 2 +- src/components/toast/Toast.vue | 2 +- src/components/tree/Tree.vue | 2 +- src/components/treetable/TreeTable.vue | 2 +- 18 files changed, 64 insertions(+), 24 deletions(-) create mode 100644 rollup.config.js diff --git a/package.json b/package.json index 2bc3d6ce9..096d31a3c 100644 --- a/package.json +++ b/package.json @@ -54,6 +54,8 @@ "primeicons": "4.0.0", "prismjs": "^1.15.0", "quill": "^1.3.7", + "rollup-plugin-postcss": "^4.0.0", + "rollup-plugin-vue": "^6.0.0-beta.9", "sass-loader": "^8.0.2", "vue": "3.0.3", "vue-router": "^4.0.0-0", diff --git a/rollup.config.js b/rollup.config.js new file mode 100644 index 000000000..dd38df094 --- /dev/null +++ b/rollup.config.js @@ -0,0 +1,38 @@ +import vue from 'rollup-plugin-vue'; +import postcss from 'rollup-plugin-postcss'; + +const fs = require('fs-extra'); +const path = require('path'); + +let entries = []; + +fs.readdirSync(path.resolve(__dirname, './src/components/')).forEach(folder => { + fs.readdirSync(path.resolve(__dirname, './src/components/' + folder)).forEach(file => { + if (file !== 'index.js' && file !== 'index.d.ts') { + let name = file.split(/(.vue)$|(.js)$/)[0].toLowerCase(); + if (/\.vue$/.test(file)) { + entries.push({ + input: 'src/components/' + folder + '/' + file, + external: [/\.\./], + output: [ + { + format: 'esm', + file: 'dist/' + folder + '/' + name + '.esm.js' + }, + { + format: 'umd', + name: 'primevue', + file: 'dist/' + folder + '/' + name + '.umd.js' + } + ], + plugins: [ + vue(), + postcss() + ] + }); + } + } + }); +}); + +export default entries; \ No newline at end of file diff --git a/src/components/breadcrumb/Breadcrumb.vue b/src/components/breadcrumb/Breadcrumb.vue index c4588abbe..e65a1d2bf 100755 --- a/src/components/breadcrumb/Breadcrumb.vue +++ b/src/components/breadcrumb/Breadcrumb.vue @@ -11,7 +11,7 @@ diff --git a/src/views/checkbox/CheckboxDoc.vue b/src/views/checkbox/CheckboxDoc.vue index 83e1a78dd..641a8e88b 100755 --- a/src/views/checkbox/CheckboxDoc.vue +++ b/src/views/checkbox/CheckboxDoc.vue @@ -232,7 +232,7 @@ export default { }, created() { this.selectedCategories = this.categories.slice(1,3); - }, + } } ` diff --git a/src/views/dropdown/DropdownDoc.vue b/src/views/dropdown/DropdownDoc.vue index fdf8fe948..d86bfec41 100755 --- a/src/views/dropdown/DropdownDoc.vue +++ b/src/views/dropdown/DropdownDoc.vue @@ -402,7 +402,7 @@ export default { {name: 'United States', code: 'US'} ] } - }, + } } diff --git a/src/views/floatlabel/FloatLabelDemo.vue b/src/views/floatlabel/FloatLabelDemo.vue index ec34d434f..8a62295ed 100644 --- a/src/views/floatlabel/FloatLabelDemo.vue +++ b/src/views/floatlabel/FloatLabelDemo.vue @@ -203,7 +203,7 @@ export default { } }, 250); } - }, + } } @@ -260,7 +260,7 @@ export default { } }, 250); } - }, + } } diff --git a/src/views/invalid/InvalidDemo.vue b/src/views/invalid/InvalidDemo.vue index 9ded5bf81..cb1191a59 100644 --- a/src/views/invalid/InvalidDemo.vue +++ b/src/views/invalid/InvalidDemo.vue @@ -126,7 +126,7 @@ export default { } }, 250); } - }, + } } @@ -182,7 +182,7 @@ export default { } }, 250); } - }, + } } diff --git a/src/views/liveeditor/LiveEditorData.js b/src/views/liveeditor/LiveEditorData.js index f5ee53cc2..b92b06586 100644 --- a/src/views/liveeditor/LiveEditorData.js +++ b/src/views/liveeditor/LiveEditorData.js @@ -4298,7 +4298,7 @@ const data = { {"id": "1009","code": "cm230f032","name": "Gaming Set","description": "Product Description","image": "gaming-set.jpg","price": 299,"category": "Electronics","quantity": 63,"inventoryStatus": "INSTOCK","rating": 3,"orders": [{"id": "10000","productCode": "cm230f032","date": "2020-06-24","amount": 299,"quantity": 1,"customer": "Kadeem Mujtaba","status": "PENDING"},{"id": "10001","productCode": "cm230f032","date": "2020-05-11","amount": 299,"quantity": 1,"customer": "Ashley Wickens","status": "DELIVERED"},{"id": "10002","productCode": "cm230f032","date": "2019-02-07","amount": 299,"quantity": 1,"customer": "Julie Johnson","status": "DELIVERED"},{"id": "10003","productCode": "cm230f032","date": "2020-04-26","amount": 299,"quantity": 1,"customer": "Tony Costa","status": "CANCELLED"}]} ] } - `, + ` } export { services, data }; diff --git a/src/views/steps/ConfirmationDemo.vue b/src/views/steps/ConfirmationDemo.vue index b05b8d764..8a0fb1b24 100755 --- a/src/views/steps/ConfirmationDemo.vue +++ b/src/views/steps/ConfirmationDemo.vue @@ -64,6 +64,6 @@ export default { complete() { this.$emit('complete'); } - }, + } } \ No newline at end of file diff --git a/src/views/steps/StepsDoc.vue b/src/views/steps/StepsDoc.vue index 0ffb0731f..34cf8fdc0 100755 --- a/src/views/steps/StepsDoc.vue +++ b/src/views/steps/StepsDoc.vue @@ -495,7 +495,7 @@ export default { complete() { this.$emit('complete'); } - }, + } } From 44eefa9beabaf618f64b8508336a54159f43c9ca Mon Sep 17 00:00:00 2001 From: Cagatay Civici Date: Tue, 19 Jan 2021 10:52:41 +0300 Subject: [PATCH 19/19] Global setting for live editor visibility --- src/main.js | 2 +- src/views/liveeditor/LiveEditor.vue | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main.js b/src/main.js index 104fc6638..368775c7e 100644 --- a/src/main.js +++ b/src/main.js @@ -110,7 +110,7 @@ router.beforeEach(function (to, from, next) { const app = createApp(App); -app.config.globalProperties.$appState = reactive({inputStyle: 'outlined', darkTheme: false}); +app.config.globalProperties.$appState = reactive({inputStyle: 'outlined', darkTheme: false, codeSandbox: false}); app.use(PrimeVue, {ripple: true}); app.use(ToastService); diff --git a/src/views/liveeditor/LiveEditor.vue b/src/views/liveeditor/LiveEditor.vue index 0c9f23caf..fb388f9ba 100644 --- a/src/views/liveeditor/LiveEditor.vue +++ b/src/views/liveeditor/LiveEditor.vue @@ -1,5 +1,5 @@ @@ -45,7 +45,7 @@ export default { activeButtonIndex: { type: String, default: null - }, + } }, methods: { postSandboxParameters() { @@ -494,6 +494,11 @@ img.flag { return this.createSandboxParameters(`${name}${extension}`, _files, extDependencies); } + }, + computed: { + showEditor() { + return this.$appState.codeSandbox; + } } } \ No newline at end of file