@community-release/nx-ui 0.0.16 → 0.0.18

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/dist/module.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "ui",
3
3
  "configKey": "ui",
4
- "version": "0.0.16"
4
+ "version": "0.0.18"
5
5
  }
package/dist/module.mjs CHANGED
@@ -1,5 +1,6 @@
1
1
  import { defineNuxtModule, createResolver, addTemplate, addPlugin, addComponentsDir, addComponent } from '@nuxt/kit';
2
2
  import fs from 'node:fs';
3
+ import path from 'node:path';
3
4
 
4
5
  const defaultStyle = {
5
6
  "content-width": "1400px",
@@ -122,7 +123,7 @@ const readComponentsProps = (resolve, srcDir, options = {}) => {
122
123
  let files = fs.readdirSync(dirComponents, { recursive: true });
123
124
  files = files.filter((v) => v.indexOf("props.json") !== -1);
124
125
  for (let file of files) {
125
- const componentName = file.split("\\")[0];
126
+ const componentName = file.split(path.sep)[0];
126
127
  const propsJSON = fs.readFileSync(resolve(dirComponents, file), { encoding: "utf-8" });
127
128
  const props = JSON.parse(propsJSON);
128
129
  result[componentName] = props;
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <section class="component-ui-map">
3
- <component :is="mapEngine" @initialized="emit('initialized', $event)">
3
+ <component :is="mapEngines[props.engine]" @initialized="emit('initialized', $event)">
4
4
  <slot :store="store"></slot>
5
5
  <div class="slot-row">
6
6
  <slot name="row" :store="store"></slot>
@@ -18,6 +18,10 @@ import comProps from '#build/ui.map.mjs';
18
18
  const store = useMapStore();
19
19
  const emit = defineEmits('initialized');
20
20
 
21
+ const mapEngines = {
22
+ openlayers: defineAsyncComponent(() => import(`./openlayers/index.vue`))
23
+ };
24
+
21
25
  const props = defineProps({
22
26
  engine: {
23
27
  default: 'openlayers',
@@ -86,10 +90,6 @@ store.setMarkerDisabledImage(props.markerDisabledImage);
86
90
  watch(() => props.disabledMarkers, (v) => {
87
91
  store.setDisabledMarkers(v);
88
92
  }, {immediate: true});
89
-
90
- const mapEngine = computed(() => {
91
- return defineAsyncComponent(() => import(`./${props.engine}/index.vue`));
92
- });
93
93
  </script>
94
94
 
95
95
  <style lang="less">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@community-release/nx-ui",
3
- "version": "0.0.16",
3
+ "version": "0.0.18",
4
4
  "description": "nx-ui - Nuxt UI library",
5
5
  "repository": {
6
6
  "type": "git",