@nanoporetech-digital/components-vue 3.7.1 → 3.8.1

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/CHANGELOG.md CHANGED
@@ -3,6 +3,28 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [3.8.1](https://git.oxfordnanolabs.local/Digital/nano-components/compare/v3.8.0...v3.8.1) (2023-02-15)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **nuxt:** update component libs ([5f75edf](https://git.oxfordnanolabs.local/Digital/nano-components/commits/5f75edf20c26fd7e7f75058decc83a40e43a5680))
12
+
13
+
14
+
15
+
16
+
17
+ # [3.8.0](https://git.oxfordnanolabs.local/Digital/nano-components/compare/v3.7.1...v3.8.0) (2023-02-15)
18
+
19
+
20
+ ### Features
21
+
22
+ * **nuxt:** new nuxt framework integration ([230f150](https://git.oxfordnanolabs.local/Digital/nano-components/commits/230f1503e3e7bb26d3478358a7aaeacdf7c82a50))
23
+
24
+
25
+
26
+
27
+
6
28
  ## [3.7.1](https://git.oxfordnanolabs.local/Digital/nano-components/compare/v3.7.0...v3.7.1) (2023-01-25)
7
29
 
8
30
  **Note:** Version bump only for package @nanoporetech-digital/components-vue
package/dist/demo/main.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { createApp } from 'vue';
2
2
  import App from './App.vue';
3
- import { NanoVue } from '../index';
4
- const app = createApp(App);
5
- NanoVue(app).then(() => app.mount('#app'));
3
+ import { NanoVue } from '../index.js';
4
+ // NanoVue().then(() => app.mount('#app'))
5
+ const app = createApp(App).use(NanoVue);
6
+ app.mount('#app');
6
7
  //# sourceMappingURL=main.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/demo/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,GAAG,MAAM,WAAW,CAAA;AAE3B,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,MAAM,GAAG,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC;AAC3B,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAA"}
1
+ {"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/demo/main.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,GAAG,MAAM,WAAW,CAAA;AAE3B,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,0CAA0C;AAE1C,MAAM,GAAG,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACxC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC"}
package/dist/nano-vue.js CHANGED
@@ -1,5 +1,4 @@
1
1
  import { defineCustomElements } from '@nanoporetech-digital/components/loader';
2
- const needsKebabCase = (version) => !['3.0.0', '3.0.1', '3.0.2', '3.0.3', '3.0.4', '3.0.5'].includes(version);
3
2
  const eventIgnoreList = ['nanoTplUpdated', 'openWormhole', 'nanoComponentsReady'];
4
3
  /**
5
4
  * We need to make sure that the web component fires an event
@@ -7,14 +6,6 @@ const eventIgnoreList = ['nanoTplUpdated', 'openWormhole', 'nanoComponentsReady'
7
6
  * otherwise the binding's callback will fire before any
8
7
  * v-model values have been updated.
9
8
  */
10
- const toLowerCase = (eventName) => {
11
- if (eventName === 'nanoChange')
12
- return 'v-nanochange';
13
- else if (eventIgnoreList.includes(eventName))
14
- return eventName;
15
- else
16
- return eventName.toLowerCase();
17
- };
18
9
  const toKebabCase = (eventName) => {
19
10
  if (eventName === 'nanoChange')
20
11
  return 'v-nano-change';
@@ -24,29 +15,32 @@ const toKebabCase = (eventName) => {
24
15
  return eventName.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, '$1-$2').toLowerCase();
25
16
  };
26
17
  /**
27
- * Vue 3.0.6 fixed a bug where events on custom elements
28
- * were always converted to lower case, so "ionRefresh"
29
- * became "ionRefresh". We need to account for the old
30
- * issue as well as the new behavior where "ionRefresh"
31
- * is converted to "ion-refresh".
18
+ * "ionRefresh" is converted to "ion-refresh".
32
19
  * See https://github.com/vuejs/vue-next/pull/2847
33
20
  */
34
- const getHelperFunctions = (needsKebabCase = true) => {
35
- const conversionFn = (needsKebabCase) ? toKebabCase : toLowerCase;
21
+ const getHelperFunctions = () => {
36
22
  return {
37
- ael: (el, eventName, cb, opts) => el.addEventListener(conversionFn(eventName), cb, opts),
38
- rel: (el, eventName, cb, opts) => el.removeEventListener(conversionFn(eventName), cb, opts),
39
- ce: (eventName, opts) => new CustomEvent(conversionFn(eventName), opts)
23
+ ael: (el, eventName, cb, opts) => el.addEventListener(toKebabCase(eventName), cb, opts),
24
+ rel: (el, eventName, cb, opts) => el.removeEventListener(toKebabCase(eventName), cb, opts),
25
+ ce: (eventName, opts) => new CustomEvent(toKebabCase(eventName), opts)
40
26
  };
41
27
  };
42
- export const NanoVue = async (app) => {
43
- if (typeof window !== 'undefined') {
44
- const { ael, rel, ce } = getHelperFunctions(needsKebabCase(app.version));
28
+ export const NanoVue = {
29
+ async install(_, _config = {}) {
30
+ if (typeof window === 'undefined')
31
+ return;
32
+ const { ael, rel, ce } = getHelperFunctions();
45
33
  await defineCustomElements(window, {
46
34
  ce,
47
35
  ael,
48
36
  rel
49
37
  });
50
- }
38
+ // To use custom-elements bundle instead
39
+ // initialize({
40
+ // _ael: ael,
41
+ // _rel: rel,
42
+ // _ce: ce,
43
+ // });
44
+ },
51
45
  };
52
46
  //# sourceMappingURL=nano-vue.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nano-vue.js","sourceRoot":"","sources":["../src/nano-vue.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAA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