@abi-software/map-side-bar 2.2.0 → 2.2.1-alpha-2

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.
@@ -1,78 +1,78 @@
1
- <template>
2
- <div class="tab-container">
3
- <div class="title" v-for="title in tabTitles" :key="title.id">
4
- <div
5
- class="title-text-table"
6
- v-bind:class="{ highlightText: title.id == activeId }"
7
- v-on:click="titleClicked(title.id)"
8
- >
9
- <div class="title-text">
10
- {{ title.title }}
11
- </div>
12
- </div>
13
- </div>
14
- </div>
15
- </template>
16
-
17
- <script>
18
- /* eslint-disable no-alert, no-console */
19
-
20
- export default {
21
- name: 'Tabs',
22
- props: {
23
- tabTitles: {
24
- type: Array,
25
- default: () => [],
26
- },
27
- activeId: {
28
- type: Number,
29
- default: 1,
30
- },
31
- },
32
- methods: {
33
- titleClicked: function (id) {
34
- this.$emit('titleClicked', id)
35
- },
36
- },
37
- }
38
- </script>
39
-
40
- <style lang="scss" scoped>
41
- .tab-container {
42
- height: 28px;
43
- }
44
-
45
- .title {
46
- width: 101px;
47
- height: 28px;
48
- border: solid 1px $lineColor1;
49
- border-bottom: none;
50
- background-color: white;
51
- display: inline-block;
52
- }
53
-
54
- .title:hover {
55
- cursor: pointer;
56
- }
57
-
58
- .title-text {
59
- text-align: center;
60
- display: table-cell;
61
- vertical-align: middle;
62
- font-size: 14px;
63
- }
64
-
65
- .title-text-table {
66
- display: table;
67
- height: 100%;
68
- width: 100%;
69
- }
70
-
71
- .parent-dialog:hover .title-text {
72
- color: $app-primary-color;
73
- }
74
-
75
- .highlightText {
76
- color: $app-primary-color;
77
- }
78
- </style>
1
+ <template>
2
+ <div class="tab-container">
3
+ <div class="title" v-for="title in tabTitles" :key="title.id">
4
+ <div
5
+ class="title-text-table"
6
+ v-bind:class="{ highlightText: title.id == activeId }"
7
+ v-on:click="titleClicked(title.id)"
8
+ >
9
+ <div class="title-text">
10
+ {{ title.title }}
11
+ </div>
12
+ </div>
13
+ </div>
14
+ </div>
15
+ </template>
16
+
17
+ <script>
18
+ /* eslint-disable no-alert, no-console */
19
+
20
+ export default {
21
+ name: 'Tabs',
22
+ props: {
23
+ tabTitles: {
24
+ type: Array,
25
+ default: () => [],
26
+ },
27
+ activeId: {
28
+ type: Number,
29
+ default: 1,
30
+ },
31
+ },
32
+ methods: {
33
+ titleClicked: function (id) {
34
+ this.$emit('titleClicked', id)
35
+ },
36
+ },
37
+ }
38
+ </script>
39
+
40
+ <style lang="scss" scoped>
41
+ .tab-container {
42
+ height: 28px;
43
+ }
44
+
45
+ .title {
46
+ width: 101px;
47
+ height: 28px;
48
+ border: solid 1px $lineColor1;
49
+ border-bottom: none;
50
+ background-color: white;
51
+ display: inline-block;
52
+ }
53
+
54
+ .title:hover {
55
+ cursor: pointer;
56
+ }
57
+
58
+ .title-text {
59
+ text-align: center;
60
+ display: table-cell;
61
+ vertical-align: middle;
62
+ font-size: 14px;
63
+ }
64
+
65
+ .title-text-table {
66
+ display: table;
67
+ height: 100%;
68
+ width: 100%;
69
+ }
70
+
71
+ .parent-dialog:hover .title-text {
72
+ color: $app-primary-color;
73
+ }
74
+
75
+ .highlightText {
76
+ color: $app-primary-color;
77
+ }
78
+ </style>
@@ -1,8 +1,8 @@
1
- import SideBar from "./SideBar.vue"
2
-
3
- export {
4
- SideBar
5
- };
6
-
7
-
8
-
1
+ import SideBar from "./SideBar.vue"
2
+
3
+ export {
4
+ SideBar
5
+ };
6
+
7
+
8
+
@@ -1,8 +1,8 @@
1
- export default {
2
- 'homo sapiens': 'Human',
3
- 'rattus norvegicus': 'Rat',
4
- 'mus musculus': 'Mouse',
5
- 'sus scrofa domesticus': 'Pig',
6
- 'sus scrofa': 'Boar',
7
- 'felis catus': 'Cat'
8
- }
1
+ export default {
2
+ 'homo sapiens': 'Human',
3
+ 'rattus norvegicus': 'Rat',
4
+ 'mus musculus': 'Mouse',
5
+ 'sus scrofa domesticus': 'Pig',
6
+ 'sus scrofa': 'Boar',
7
+ 'felis catus': 'Cat'
8
+ }
package/src/main.js CHANGED
@@ -1,9 +1,9 @@
1
- import { createApp } from 'vue'
2
- import App from './App.vue'
3
- import MapSideBar from './components/SideBar.vue'
4
-
5
- const app = createApp(App);
6
-
7
- app.component('MapSideBar', MapSideBar)
8
-
9
- app.mount("#app");
1
+ import { createApp } from 'vue'
2
+ import App from './App.vue'
3
+ import MapSideBar from './components/SideBar.vue'
4
+
5
+ const app = createApp(App);
6
+
7
+ app.component('MapSideBar', MapSideBar)
8
+
9
+ app.mount("#app");
@@ -1,37 +1,37 @@
1
- <script>
2
- export default {
3
- name: "S3Bucket",
4
- data() {
5
- return {
6
- s3Bucket: undefined,
7
- s3Prefix: "",
8
- };
9
- },
10
- methods: {
11
- updateS3Bucket: function(s3uri) {
12
- this.s3Bucket = undefined;
13
- if (s3uri) {
14
- const substring = s3uri.split("//")[1];
15
- if (substring) {
16
- this.s3Bucket = substring.split("/")[0];
17
- const n = substring.indexOf('/');
18
- this.s3Prefix = substring.substring(n + 1);
19
- return;
20
- }
21
- }
22
- },
23
- getS3Args: function() {
24
- if (this.s3Bucket) {
25
- return `?s3BucketName=${this.s3Bucket}`
26
- }
27
- return "";
28
- },
29
- getS3Prefix: function() {
30
- return this.s3Prefix;
31
- }
32
- },
33
-
34
- };
35
- </script>
36
-
37
-
1
+ <script>
2
+ export default {
3
+ name: "S3Bucket",
4
+ data() {
5
+ return {
6
+ s3Bucket: undefined,
7
+ s3Prefix: "",
8
+ };
9
+ },
10
+ methods: {
11
+ updateS3Bucket: function(s3uri) {
12
+ this.s3Bucket = undefined;
13
+ if (s3uri) {
14
+ const substring = s3uri.split("//")[1];
15
+ if (substring) {
16
+ this.s3Bucket = substring.split("/")[0];
17
+ const n = substring.indexOf('/');
18
+ this.s3Prefix = substring.substring(n + 1);
19
+ return;
20
+ }
21
+ }
22
+ },
23
+ getS3Args: function() {
24
+ if (this.s3Bucket) {
25
+ return `?s3BucketName=${this.s3Bucket}`
26
+ }
27
+ return "";
28
+ },
29
+ getS3Prefix: function() {
30
+ return this.s3Prefix;
31
+ }
32
+ },
33
+
34
+ };
35
+ </script>
36
+
37
+
package/static.json CHANGED
@@ -1,7 +1,7 @@
1
- {
2
- "root": "dist",
3
- "clean_urls": true,
4
- "routes": {
5
- "/**": "index.html"
6
- }
1
+ {
2
+ "root": "dist",
3
+ "clean_urls": true,
4
+ "routes": {
5
+ "/**": "index.html"
6
+ }
7
7
  }
package/vite.config.js CHANGED
@@ -1,56 +1,56 @@
1
- import { resolve } from "node:path"
2
-
3
- import { defineConfig } from 'vite'
4
- import vue from '@vitejs/plugin-vue'
5
-
6
- import Components from 'unplugin-vue-components/vite'
7
- import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
8
-
9
- // https://vitejs.dev/config/
10
- export default defineConfig({
11
- server: {
12
- port: 8081,
13
- },
14
- plugins: [
15
- vue(),
16
- Components({
17
- // allow auto load markdown components under `./src/components/`
18
- extensions: ['vue', 'md'],
19
- // allow auto import and register components used in markdown
20
- include: [/\.vue$/, /\.vue\?vue/, /\.md$/],
21
- resolvers: [
22
- ElementPlusResolver({
23
- importStyle: 'sass',
24
- }),
25
- ],
26
- dts: './src/components.d.ts',
27
- }),
28
- ],
29
- resolve: {
30
- alias: {
31
- '@': resolve(__dirname, './src'),
32
- }
33
- },
34
- build: {
35
- lib: {
36
- entry: resolve(__dirname, "./src/components/index.js"),
37
- name: "MapSideBar",
38
- fileName: 'map-side-bar',
39
- },
40
- rollupOptions: {
41
- external: ["vue"],
42
- output: {
43
- globals: {
44
- vue: "Vue",
45
- },
46
- },
47
- },
48
- },
49
- css: {
50
- preprocessorOptions: {
51
- scss: {
52
- additionalData: `@use './src/assets/styles' as *;`
53
- }
54
- }
55
- }
1
+ import { resolve } from "node:path"
2
+
3
+ import { defineConfig } from 'vite'
4
+ import vue from '@vitejs/plugin-vue'
5
+
6
+ import Components from 'unplugin-vue-components/vite'
7
+ import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
8
+
9
+ // https://vitejs.dev/config/
10
+ export default defineConfig({
11
+ server: {
12
+ port: 8081,
13
+ },
14
+ plugins: [
15
+ vue(),
16
+ Components({
17
+ // allow auto load markdown components under `./src/components/`
18
+ extensions: ['vue', 'md'],
19
+ // allow auto import and register components used in markdown
20
+ include: [/\.vue$/, /\.vue\?vue/, /\.md$/],
21
+ resolvers: [
22
+ ElementPlusResolver({
23
+ importStyle: 'sass',
24
+ }),
25
+ ],
26
+ dts: './src/components.d.ts',
27
+ }),
28
+ ],
29
+ resolve: {
30
+ alias: {
31
+ '@': resolve(__dirname, './src'),
32
+ }
33
+ },
34
+ build: {
35
+ lib: {
36
+ entry: resolve(__dirname, "./src/components/index.js"),
37
+ name: "MapSideBar",
38
+ fileName: 'map-side-bar',
39
+ },
40
+ rollupOptions: {
41
+ external: ["vue"],
42
+ output: {
43
+ globals: {
44
+ vue: "Vue",
45
+ },
46
+ },
47
+ },
48
+ },
49
+ css: {
50
+ preprocessorOptions: {
51
+ scss: {
52
+ additionalData: `@use './src/assets/styles' as *;`
53
+ }
54
+ }
55
+ }
56
56
  })
@@ -1,65 +1,65 @@
1
- /**
2
- * Vuese Generator
3
- *
4
- * To generate markdown files from Vue components
5
- * To watch components changes for Vitepress on Dev Mode
6
- */
7
-
8
- import fs from 'fs'
9
- import path from 'path'
10
- import chokidar from 'chokidar'
11
- import { parser } from '@vuese/parser'
12
- import { Render } from '@vuese/markdown-render'
13
-
14
- const watchMode = process.argv.find((argv) => argv === 'watch')
15
-
16
- const componentsDir = 'src/components'
17
- const components = ['SideBar.vue']
18
- const outputDir = 'docs/components'
19
-
20
- function generateMarkdown(file) {
21
- const fileWithPath = `${componentsDir}/${file}`
22
- const fileContent = fs.readFileSync(fileWithPath, 'utf-8')
23
-
24
- try {
25
- const parserResult = parser(fileContent)
26
- const r = new Render(parserResult)
27
- const renderResult = r.render()
28
- const markdownResult = r.renderMarkdown()
29
- const markdownContent = markdownResult.content
30
- const componentName = path.basename(fileWithPath, '.vue')
31
-
32
- if (!fs.existsSync(outputDir)) {
33
- fs.mkdirSync(outputDir)
34
- }
35
-
36
- fs.writeFile(`${outputDir}/${componentName}.md`, markdownContent, (err) => {
37
- if (err) {
38
- console.error(`Error writing markdown file for ${componentName}`, err)
39
- } else {
40
- console.log(`Markdown file for ${componentName} is generated!`)
41
- }
42
- })
43
- } catch(e) {
44
- console.error(e)
45
- }
46
- }
47
-
48
- // To generate markdown files - one time
49
- components.forEach((component) => {
50
- console.log(`Write markdown file for ${component} on first load.`)
51
- generateMarkdown(component)
52
- })
53
-
54
- // To watch component changes and generate markdown files
55
- if (watchMode) {
56
- const watcher = chokidar.watch(components, {
57
- cwd: componentsDir,
58
- ignoreInitial: true,
59
- })
60
-
61
- watcher.on('change', (file) => {
62
- console.log(`The component ${file} has changed!`)
63
- generateMarkdown(file)
64
- })
65
- }
1
+ /**
2
+ * Vuese Generator
3
+ *
4
+ * To generate markdown files from Vue components
5
+ * To watch components changes for Vitepress on Dev Mode
6
+ */
7
+
8
+ import fs from 'fs'
9
+ import path from 'path'
10
+ import chokidar from 'chokidar'
11
+ import { parser } from '@vuese/parser'
12
+ import { Render } from '@vuese/markdown-render'
13
+
14
+ const watchMode = process.argv.find((argv) => argv === 'watch')
15
+
16
+ const componentsDir = 'src/components'
17
+ const components = ['SideBar.vue']
18
+ const outputDir = 'docs/components'
19
+
20
+ function generateMarkdown(file) {
21
+ const fileWithPath = `${componentsDir}/${file}`
22
+ const fileContent = fs.readFileSync(fileWithPath, 'utf-8')
23
+
24
+ try {
25
+ const parserResult = parser(fileContent)
26
+ const r = new Render(parserResult)
27
+ const renderResult = r.render()
28
+ const markdownResult = r.renderMarkdown()
29
+ const markdownContent = markdownResult.content
30
+ const componentName = path.basename(fileWithPath, '.vue')
31
+
32
+ if (!fs.existsSync(outputDir)) {
33
+ fs.mkdirSync(outputDir)
34
+ }
35
+
36
+ fs.writeFile(`${outputDir}/${componentName}.md`, markdownContent, (err) => {
37
+ if (err) {
38
+ console.error(`Error writing markdown file for ${componentName}`, err)
39
+ } else {
40
+ console.log(`Markdown file for ${componentName} is generated!`)
41
+ }
42
+ })
43
+ } catch(e) {
44
+ console.error(e)
45
+ }
46
+ }
47
+
48
+ // To generate markdown files - one time
49
+ components.forEach((component) => {
50
+ console.log(`Write markdown file for ${component} on first load.`)
51
+ generateMarkdown(component)
52
+ })
53
+
54
+ // To watch component changes and generate markdown files
55
+ if (watchMode) {
56
+ const watcher = chokidar.watch(components, {
57
+ cwd: componentsDir,
58
+ ignoreInitial: true,
59
+ })
60
+
61
+ watcher.on('change', (file) => {
62
+ console.log(`The component ${file} has changed!`)
63
+ generateMarkdown(file)
64
+ })
65
+ }