@bimdata/bcf-components 1.0.3 → 1.0.4
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/README.md +57 -4
- package/dist/vue2/bcf-components.es.js +16 -16
- package/package.json +2 -2
- package/vue3-plugin.js +4 -4
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
A set (library) of Vue components to manage BCF and build BCF related
|
|
4
4
|
features into your app.
|
|
5
5
|
|
|
6
|
-
Made with :heart: by [BIMData.io](https://
|
|
6
|
+
Made with :heart: by [BIMData.io](https://bimdata.io/).
|
|
7
7
|
|
|
8
8
|
## Usage
|
|
9
9
|
|
|
@@ -21,11 +21,13 @@ In order to use the library in your Vue 2 app you'll need to use
|
|
|
21
21
|
[Vue Composition API plugin](https://github.com/vuejs/composition-api).
|
|
22
22
|
|
|
23
23
|
First add it to your dependencies:
|
|
24
|
+
|
|
24
25
|
```bash
|
|
25
26
|
npm install @vue/composition-api
|
|
26
27
|
```
|
|
27
28
|
|
|
28
29
|
Then, in your application bootstrap script, add the following:
|
|
30
|
+
|
|
29
31
|
```js
|
|
30
32
|
import Vue from "vue";
|
|
31
33
|
import VueCompositionApi from "@vue/composition-api";
|
|
@@ -36,15 +38,66 @@ Vue.use(VueCompositionApi);
|
|
|
36
38
|
```
|
|
37
39
|
|
|
38
40
|
You can now use library components like so:
|
|
41
|
+
|
|
39
42
|
```js
|
|
40
|
-
import {
|
|
43
|
+
import { components } from "@bimdata/bcf-components/dist/vue2/bcf-components.es.js";
|
|
44
|
+
|
|
45
|
+
const { BcfTopicCard } = components;
|
|
41
46
|
```
|
|
42
47
|
|
|
43
48
|
### Vue 3.x application
|
|
44
49
|
|
|
45
|
-
|
|
50
|
+
**Using Vue plugin**
|
|
51
|
+
|
|
52
|
+
The package provide a Vue plugin that can be used to setup the library for your app
|
|
53
|
+
and make all components available globally.
|
|
54
|
+
|
|
55
|
+
```js
|
|
56
|
+
import { createApp } from "vue";
|
|
57
|
+
import { createI18n } from "vue-i18n";
|
|
58
|
+
import { makeBIMDataApiClient } from "@bimdata/typescript-fetch-api-client";
|
|
59
|
+
// Import Vue 3 plugin factory
|
|
60
|
+
import BIMDataBcfComponents from "@bimdata/bcf-components/vue3-plugin.js";
|
|
61
|
+
|
|
62
|
+
// Instanciate i18n plugin (v9+)
|
|
63
|
+
const i18nPlugin = createI18n({ ... });
|
|
64
|
+
// Instanciate BIMData API client (v8.2+)
|
|
65
|
+
const apiClient = makeBIMDataApiClient({ ... });
|
|
66
|
+
|
|
67
|
+
const app = createApp()
|
|
68
|
+
.use(i18nPlugin)
|
|
69
|
+
// Provide both i18n plugin and API client as plugin config
|
|
70
|
+
.use(BIMDataBcfComponents({ i18nPlugin, apiClient }));
|
|
71
|
+
...
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
It is also possible to provide your own translations for i18n by removing
|
|
75
|
+
`i18nPlugin` from plugin config and adding translation keys from
|
|
76
|
+
[`src/i18n/lang/fr.js`](./src/i18n/lang/fr.json) to the translation files of your app.
|
|
77
|
+
|
|
78
|
+
**Using "manual" setup**
|
|
79
|
+
|
|
80
|
+
To setup the library without the use of the plugin you have to provide your own translations
|
|
81
|
+
(as described above in the *Using Vue plugin* section) and inject an API client like so:
|
|
82
|
+
|
|
46
83
|
```js
|
|
47
|
-
import {
|
|
84
|
+
import { makeBIMDataApiClient } from "@bimdata/typescript-fetch-api-client";
|
|
85
|
+
// Import the `setApiClient` function
|
|
86
|
+
import { setApiClient } from "@bimdata/bcf-components";
|
|
87
|
+
|
|
88
|
+
// Instanciate BIMData API client (v8.2+)
|
|
89
|
+
const apiClient = makeBIMDataApiClient({ ... });
|
|
90
|
+
|
|
91
|
+
// Inject API client
|
|
92
|
+
setApiClient(apiClient);
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Then you can directly use components in your app that way:
|
|
96
|
+
|
|
97
|
+
```js
|
|
98
|
+
import { components } from "@bimdata/bcf-components";
|
|
99
|
+
|
|
100
|
+
const { BcfTopicCard } = components;
|
|
48
101
|
```
|
|
49
102
|
|
|
50
103
|
## Build
|
|
@@ -772,7 +772,7 @@ var render$i = function() {
|
|
|
772
772
|
}, expression: "tags" } }), _c("div", { staticClass: "flex justify-center m-t-24" }, [_c("BIMDataButton", { staticClass: "m-r-12", attrs: { "color": "primary", "ghost": "", "radius": "" }, on: { "click": _vm.resetFilters } }, [_vm._v(_vm._s(_vm.$t("BcfComponents.BcfFilters.resetButton")))]), _c("BIMDataButton", { attrs: { "color": "primary", "fill": "", "radius": "" }, on: { "click": _vm.submitFilters } }, [_c("BIMDataIcon", { attrs: { "name": "search", "size": "xxs", "fill": "", "color": "default", "margin": "0 6px 0 0" } }), _c("span", [_vm._v(_vm._s(_vm.$t("BcfComponents.BcfFilters.searchButton")))])], 1)], 1)], 1)])], 1);
|
|
773
773
|
};
|
|
774
774
|
var staticRenderFns$i = [];
|
|
775
|
-
var
|
|
775
|
+
var BcfFilters_scss_vue_type_style_index_0_from__2Fhome_2Frunner_2FactionsRunner_2F_work_2FbcfComponents_2FbcfComponents_2Fsrc_2Fcomponents_2FbcfFilters_2FBcfFilters_vue_src_scoped_true_lang = "";
|
|
776
776
|
function normalizeComponent(scriptExports, render2, staticRenderFns2, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
|
|
777
777
|
var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
|
|
778
778
|
if (render2) {
|
|
@@ -1236,7 +1236,7 @@ var render$h = function() {
|
|
|
1236
1236
|
} } }, [_c("BIMDataIcon", { attrs: { "name": "close", "size": "xxxs" } })], 1)], 1)]) : _vm._e()], 1);
|
|
1237
1237
|
};
|
|
1238
1238
|
var staticRenderFns$h = [];
|
|
1239
|
-
var
|
|
1239
|
+
var SettingCardItem_scss_vue_type_style_index_0_from__2Fhome_2Frunner_2FactionsRunner_2F_work_2FbcfComponents_2FbcfComponents_2Fsrc_2Fcomponents_2FbcfSettings_2FsettingCard_2FSettingCardItem_vue_src_scoped_true_lang = "";
|
|
1240
1240
|
const __vue2_script$h = {
|
|
1241
1241
|
components: {
|
|
1242
1242
|
BIMDataButton: c$5,
|
|
@@ -1344,7 +1344,7 @@ var render$g = function() {
|
|
|
1344
1344
|
}), 1)], 1)]);
|
|
1345
1345
|
};
|
|
1346
1346
|
var staticRenderFns$g = [];
|
|
1347
|
-
var
|
|
1347
|
+
var SettingCard_scss_vue_type_style_index_0_from__2Fhome_2Frunner_2FactionsRunner_2F_work_2FbcfComponents_2FbcfComponents_2Fsrc_2Fcomponents_2FbcfSettings_2FsettingCard_2FSettingCard_vue_src_scoped_true_lang = "";
|
|
1348
1348
|
const __vue2_script$g = {
|
|
1349
1349
|
components: {
|
|
1350
1350
|
BIMDataButton: c$5,
|
|
@@ -1428,7 +1428,7 @@ var render$f = function() {
|
|
|
1428
1428
|
})], 2)]);
|
|
1429
1429
|
};
|
|
1430
1430
|
var staticRenderFns$f = [];
|
|
1431
|
-
var
|
|
1431
|
+
var BcfSettings_scss_vue_type_style_index_0_from__2Fhome_2Frunner_2FactionsRunner_2F_work_2FbcfComponents_2FbcfComponents_2Fsrc_2Fcomponents_2FbcfSettings_2FBcfSettings_vue_src_scoped_true_lang = "";
|
|
1432
1432
|
const __vue2_script$f = {
|
|
1433
1433
|
components: {
|
|
1434
1434
|
BIMDataButton: c$5,
|
|
@@ -1725,7 +1725,7 @@ var render$e = function() {
|
|
|
1725
1725
|
} }]) })], 1)], 1)]);
|
|
1726
1726
|
};
|
|
1727
1727
|
var staticRenderFns$e = [];
|
|
1728
|
-
var
|
|
1728
|
+
var BcfStatistics_scss_vue_type_style_index_0_from__2Fhome_2Frunner_2FactionsRunner_2F_work_2FbcfComponents_2FbcfComponents_2Fsrc_2Fcomponents_2FbcfStatistics_2FBcfStatistics_vue_src_scoped_true_lang = "";
|
|
1729
1729
|
const __vue2_script$e = {
|
|
1730
1730
|
components: {
|
|
1731
1731
|
BIMDataPaginatedList: b$1,
|
|
@@ -1874,7 +1874,7 @@ var render$c = function() {
|
|
|
1874
1874
|
} } }, [_vm._v(" " + _vm._s(_vm.$t("BcfComponents.BcfTopicCard.see")) + " ")])], 1)])]);
|
|
1875
1875
|
};
|
|
1876
1876
|
var staticRenderFns$c = [];
|
|
1877
|
-
var
|
|
1877
|
+
var BcfTopicCard_scss_vue_type_style_index_0_from__2Fhome_2Frunner_2FactionsRunner_2F_work_2FbcfComponents_2FbcfComponents_2Fsrc_2Fcomponents_2FbcfTopicCard_2FBcfTopicCard_vue_src_scoped_true_lang = "";
|
|
1878
1878
|
const __vue2_script$c = {
|
|
1879
1879
|
components: {
|
|
1880
1880
|
BcfTopicDefaultImage,
|
|
@@ -2103,7 +2103,7 @@ var render$b = function() {
|
|
|
2103
2103
|
}, expression: "topicLabels" } })], 1)], 2), _c("div", { staticClass: "bcf-topic-create__footer" }, [_c("BIMDataButton", { attrs: { "disabled": !_vm.topicTitle, "width": "100%", "color": "primary", "fill": "", "radius": "" }, on: { "click": _vm.submit } }, [_vm._v(" " + _vm._s(_vm.$t("BcfComponents.BcfTopicCreate.validateButton")) + " ")])], 1), _vm.loading ? _c("div", { staticClass: "bcf-topic-create__loader" }, [_c("BIMDataLoading")], 1) : _vm._e()]);
|
|
2104
2104
|
};
|
|
2105
2105
|
var staticRenderFns$b = [];
|
|
2106
|
-
var
|
|
2106
|
+
var BcfTopicCreate_scss_vue_type_style_index_0_from__2Fhome_2Frunner_2FactionsRunner_2F_work_2FbcfComponents_2FbcfComponents_2Fsrc_2Fcomponents_2FbcfTopicCreate_2FBcfTopicCreate_vue_src_scoped_true_lang = "";
|
|
2107
2107
|
const __vue2_script$b = {
|
|
2108
2108
|
components: {
|
|
2109
2109
|
BIMDataButton: c$5,
|
|
@@ -2270,7 +2270,7 @@ var render$9 = function() {
|
|
|
2270
2270
|
} } }, [_c("BIMDataIcon", { attrs: { "name": "plus", "size": "m", "fill": "", "color": "default" } })], 1)], 1);
|
|
2271
2271
|
};
|
|
2272
2272
|
var staticRenderFns$9 = [];
|
|
2273
|
-
var
|
|
2273
|
+
var BcfTopicCreationCard_scss_vue_type_style_index_0_from__2Fhome_2Frunner_2FactionsRunner_2F_work_2FbcfComponents_2FbcfComponents_2Fsrc_2Fcomponents_2FbcfTopicCreationCard_2FBcfTopicCreationCard_vue_src_scoped_true_lang = "";
|
|
2274
2274
|
const __vue2_script$9 = {
|
|
2275
2275
|
components: {
|
|
2276
2276
|
BcfTopicCreationCardImage,
|
|
@@ -2743,7 +2743,7 @@ var render$8 = function() {
|
|
|
2743
2743
|
}, proxy: true }], null, false, 4095619558) }) : _vm._e()], 1);
|
|
2744
2744
|
};
|
|
2745
2745
|
var staticRenderFns$8 = [];
|
|
2746
|
-
var
|
|
2746
|
+
var BcfTopicForm_scss_vue_type_style_index_0_from__2Fhome_2Frunner_2FactionsRunner_2F_work_2FbcfComponents_2FbcfComponents_2Fsrc_2Fcomponents_2FbcfTopicForm_2FBcfTopicForm_vue_src_scoped_true_lang = "";
|
|
2747
2747
|
const __vue2_script$8 = {
|
|
2748
2748
|
components: {
|
|
2749
2749
|
BIMDataButton: c$5,
|
|
@@ -3356,7 +3356,7 @@ var render$7 = function() {
|
|
|
3356
3356
|
} }, [_vm.user.profilePicture ? [_c("img", { attrs: { "src": _vm.user.profilePicture } })] : _vm.initials ? [_vm._v(" " + _vm._s(_vm.initials) + " ")] : [_c("BIMDataIcon", { attrs: { "name": "user", "size": "s" } })]], 2);
|
|
3357
3357
|
};
|
|
3358
3358
|
var staticRenderFns$7 = [];
|
|
3359
|
-
var
|
|
3359
|
+
var UserAvatar_scss_vue_type_style_index_0_from__2Fhome_2Frunner_2FactionsRunner_2F_work_2FbcfComponents_2FbcfComponents_2Fsrc_2Fcomponents_2FuserAvatar_2FUserAvatar_vue_src_scoped_true_lang = "";
|
|
3360
3360
|
const __vue2_script$7 = {
|
|
3361
3361
|
props: {
|
|
3362
3362
|
user: {
|
|
@@ -3407,7 +3407,7 @@ var render$6 = function() {
|
|
|
3407
3407
|
}, expression: "text" } })], 1), _vm.loading ? [_c("BIMDataLoading")] : _vm._e()], 2);
|
|
3408
3408
|
};
|
|
3409
3409
|
var staticRenderFns$6 = [];
|
|
3410
|
-
var
|
|
3410
|
+
var Comment_scss_vue_type_style_index_0_from__2Fhome_2Frunner_2FactionsRunner_2F_work_2FbcfComponents_2FbcfComponents_2Fsrc_2Fcomponents_2FbcfTopicOverview_2FbcfTopicComments_2Fcomment_2FComment_vue_src_scoped_true_lang = "";
|
|
3411
3411
|
const __vue2_script$6 = {
|
|
3412
3412
|
components: {
|
|
3413
3413
|
BIMDataButton: c$5,
|
|
@@ -3524,7 +3524,7 @@ var render$5 = function() {
|
|
|
3524
3524
|
}), 1) : _vm._e()]), _vm.loading ? [_c("BIMDataLoading")] : _vm._e()], 2);
|
|
3525
3525
|
};
|
|
3526
3526
|
var staticRenderFns$5 = [];
|
|
3527
|
-
var
|
|
3527
|
+
var BcfTopicComments_scss_vue_type_style_index_0_from__2Fhome_2Frunner_2FactionsRunner_2F_work_2FbcfComponents_2FbcfComponents_2Fsrc_2Fcomponents_2FbcfTopicOverview_2FbcfTopicComments_2FBcfTopicComments_vue_src_scoped_true_lang = "";
|
|
3528
3528
|
const __vue2_script$5 = {
|
|
3529
3529
|
components: {
|
|
3530
3530
|
BIMDataButton: c$5,
|
|
@@ -3625,7 +3625,7 @@ var render$4 = function() {
|
|
|
3625
3625
|
}, proxy: true }], null, false, 2806232332) }) : _vm._e(), _vm.loading ? _c("div", [_c("BIMDataLoading")], 1) : _vm._e()], 1);
|
|
3626
3626
|
};
|
|
3627
3627
|
var staticRenderFns$4 = [];
|
|
3628
|
-
var
|
|
3628
|
+
var BcfTopicOverview_scss_vue_type_style_index_0_from__2Fhome_2Frunner_2FactionsRunner_2F_work_2FbcfComponents_2FbcfComponents_2Fsrc_2Fcomponents_2FbcfTopicOverview_2FBcfTopicOverview_vue_src_scoped_true_lang = "";
|
|
3629
3629
|
const __vue2_script$4 = {
|
|
3630
3630
|
components: {
|
|
3631
3631
|
BcfTopicComments,
|
|
@@ -3951,7 +3951,7 @@ var render$3 = function() {
|
|
|
3951
3951
|
} } }, [_vm._v(" " + _vm._s(_vm.$t("BcfComponents.BcfTopicActionsCell.seeButton")) + " ")])], 1);
|
|
3952
3952
|
};
|
|
3953
3953
|
var staticRenderFns$3 = [];
|
|
3954
|
-
var
|
|
3954
|
+
var BcfTopicActionsCell_scss_vue_type_style_index_0_from__2Fhome_2Frunner_2FactionsRunner_2F_work_2FbcfComponents_2FbcfComponents_2Fsrc_2Fcomponents_2FbcfTopicsTable_2FbcfTopicActionsCell_2FBcfTopicActionsCell_vue_src_scoped_true_lang = "";
|
|
3955
3955
|
const __vue2_script$3 = {
|
|
3956
3956
|
components: {
|
|
3957
3957
|
BIMDataButton: c$5
|
|
@@ -3981,7 +3981,7 @@ var render$2 = function() {
|
|
|
3981
3981
|
return _c("span", { staticClass: "bcf-topic-priority-cell", style: { color: _vm.priorityColor } }, [_vm._v(" " + _vm._s(_vm.bcfTopic.priority || _vm.$t("BcfComponents.BcfTopicPriorityCell.noPriority")) + " ")]);
|
|
3982
3982
|
};
|
|
3983
3983
|
var staticRenderFns$2 = [];
|
|
3984
|
-
var
|
|
3984
|
+
var BcfTopicPriorityCell_scss_vue_type_style_index_0_from__2Fhome_2Frunner_2FactionsRunner_2F_work_2FbcfComponents_2FbcfComponents_2Fsrc_2Fcomponents_2FbcfTopicsTable_2FbcfTopicPriorityCell_2FBcfTopicPriorityCell_vue_src_scoped_true_lang = "";
|
|
3985
3985
|
const __vue2_script$2 = {
|
|
3986
3986
|
props: {
|
|
3987
3987
|
bcfTopic: {
|
|
@@ -4028,7 +4028,7 @@ var render$1 = function() {
|
|
|
4028
4028
|
} }, [_vm._v(" " + _vm._s(_vm.bcfTopic.topicStatus) + " ")]);
|
|
4029
4029
|
};
|
|
4030
4030
|
var staticRenderFns$1 = [];
|
|
4031
|
-
var
|
|
4031
|
+
var BcfTopicStatusCell_scss_vue_type_style_index_0_from__2Fhome_2Frunner_2FactionsRunner_2F_work_2FbcfComponents_2FbcfComponents_2Fsrc_2Fcomponents_2FbcfTopicsTable_2FbcfTopicStatusCell_2FBcfTopicStatusCell_vue_src_scoped_true_lang = "";
|
|
4032
4032
|
const __vue2_script$1 = {
|
|
4033
4033
|
props: {
|
|
4034
4034
|
bcfTopic: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bimdata/bcf-components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist",
|
|
6
6
|
"vue3-plugin.js"
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
21
|
"@vue/composition-api": "^1.4.9",
|
|
22
|
-
"vue": "^2.6 ||
|
|
22
|
+
"vue": "^2.6 || ^3.0"
|
|
23
23
|
},
|
|
24
24
|
"peerDependenciesMeta": {
|
|
25
25
|
"@vue/composition-api": {
|
package/vue3-plugin.js
CHANGED
|
@@ -11,7 +11,7 @@ import messages from "./dist/i18n/index.js";
|
|
|
11
11
|
* @param {
|
|
12
12
|
* {
|
|
13
13
|
* apiClient: Object,
|
|
14
|
-
*
|
|
14
|
+
* i18nPlugin: Object,
|
|
15
15
|
* includedComponents?: string[],
|
|
16
16
|
* excludedComponents?: string[],
|
|
17
17
|
* }
|
|
@@ -19,9 +19,9 @@ import messages from "./dist/i18n/index.js";
|
|
|
19
19
|
*/
|
|
20
20
|
const pluginFactory = ({
|
|
21
21
|
apiClient,
|
|
22
|
+
i18nPlugin,
|
|
22
23
|
includedComponents = [],
|
|
23
24
|
excludedComponents = [],
|
|
24
|
-
i18n,
|
|
25
25
|
} = {}) => {
|
|
26
26
|
return {
|
|
27
27
|
install(app) {
|
|
@@ -35,9 +35,9 @@ const pluginFactory = ({
|
|
|
35
35
|
);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
if (
|
|
38
|
+
if (i18nPlugin) {
|
|
39
39
|
Object.entries(messages).forEach(([locale, translations]) => {
|
|
40
|
-
|
|
40
|
+
i18nPlugin.global.mergeLocaleMessage(locale, translations);
|
|
41
41
|
});
|
|
42
42
|
} else {
|
|
43
43
|
console.warn(
|