@community-release/nx-ui 0.0.9 → 0.0.11
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 +1 -1
- package/dist/module.mjs +6 -17
- package/dist/runtime/components/checkbox.vue +1 -1
- package/dist/runtime/components/map/device-zoom-switch.vue +1 -0
- package/dist/runtime/components/map/index.vue +1 -0
- package/dist/runtime/components/map/location/index.vue +3 -0
- package/dist/runtime/components/map/location/list.vue +1 -1
- package/dist/runtime/components/map/openlayers/index.vue +3 -1
- package/dist/runtime/components/notice/item.vue +1 -0
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,17 +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';
|
|
4
|
-
import { fileURLToPath } from 'node:url';
|
|
5
3
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
// -- Unbuild CommonJS Shims --
|
|
9
|
-
import __cjs_url__ from 'url';
|
|
10
|
-
import __cjs_path__ from 'path';
|
|
11
|
-
import __cjs_mod__ from 'module';
|
|
12
|
-
const __filename = __cjs_url__.fileURLToPath(import.meta.url);
|
|
13
|
-
const __dirname = __cjs_path__.dirname(__filename);
|
|
14
|
-
const require = __cjs_mod__.createRequire(import.meta.url);
|
|
15
4
|
const defaultStyle = {
|
|
16
5
|
"content-width": "1400px",
|
|
17
6
|
// website content width
|
|
@@ -127,15 +116,14 @@ const generateComponentsDefaults = (options) => {
|
|
|
127
116
|
return result;
|
|
128
117
|
};
|
|
129
118
|
|
|
130
|
-
const
|
|
131
|
-
const
|
|
132
|
-
const dirComponents = path.resolve(__dirname__, "../runtime/components/");
|
|
119
|
+
const readComponentsProps = (resolve, srcDir, options = {}) => {
|
|
120
|
+
const dirComponents = resolve(srcDir, "./runtime/components/");
|
|
133
121
|
const result = {};
|
|
134
122
|
let files = fs.readdirSync(dirComponents, { recursive: true });
|
|
135
123
|
files = files.filter((v) => v.indexOf("props.json") !== -1);
|
|
136
124
|
for (let file of files) {
|
|
137
125
|
const componentName = file.split("\\")[0];
|
|
138
|
-
const propsJSON = fs.readFileSync(
|
|
126
|
+
const propsJSON = fs.readFileSync(resolve(dirComponents, file), { encoding: "utf-8" });
|
|
139
127
|
const props = JSON.parse(propsJSON);
|
|
140
128
|
result[componentName] = props;
|
|
141
129
|
}
|
|
@@ -167,18 +155,19 @@ const module = defineNuxtModule({
|
|
|
167
155
|
defaults: {},
|
|
168
156
|
setup(options, nuxt) {
|
|
169
157
|
const { resolve } = createResolver(import.meta.url);
|
|
158
|
+
const srcDir = resolve("./");
|
|
170
159
|
addTemplate({
|
|
171
160
|
filename: "ui.style.mjs",
|
|
172
161
|
getContents: () => "export default " + JSON.stringify(generateStyle(options))
|
|
173
162
|
//write: true
|
|
174
163
|
});
|
|
175
164
|
addTemplate({
|
|
176
|
-
dst: resolve("
|
|
165
|
+
dst: resolve("./runtime/components/styles/components.less"),
|
|
177
166
|
write: true,
|
|
178
167
|
filename: "components.less",
|
|
179
168
|
getContents: () => generateComponentsDefaults(options)
|
|
180
169
|
});
|
|
181
|
-
const componentsProps = readComponentsProps(options);
|
|
170
|
+
const componentsProps = readComponentsProps(resolve, srcDir, options);
|
|
182
171
|
for (let componentName in componentsProps) {
|
|
183
172
|
addTemplate({
|
|
184
173
|
filename: `ui.${componentName}.mjs`,
|
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|
// import 'ol/ol.css';
|
|
10
10
|
|
|
11
11
|
// Imports
|
|
12
|
+
// Vue
|
|
13
|
+
import { ref, watch, onMounted } from 'vue';
|
|
14
|
+
|
|
12
15
|
// Pinia store
|
|
13
16
|
import { storeToRefs } from 'pinia';
|
|
14
17
|
import { useMapStore } from '../store';
|
|
@@ -27,7 +30,6 @@
|
|
|
27
30
|
import { Tile as TileLayer, Vector as VectorLayer } from 'ol/layer.js';
|
|
28
31
|
import { boundingExtent } from 'ol/extent.js';
|
|
29
32
|
|
|
30
|
-
|
|
31
33
|
import Map from 'ol/Map.js';
|
|
32
34
|
import View from 'ol/View.js';
|
|
33
35
|
import { fromLonLat } from 'ol/proj.js';
|