spark-grid-vue3 0.0.4 → 0.0.6

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.
Files changed (39) hide show
  1. package/package.json +10 -4
  2. package/src/assets/DataTable.ts +3 -3
  3. package/src/components/GridBody.vue +1 -1
  4. package/src/components/GridCheckbox.vue +1 -1
  5. package/src/components/GridContentWrapper.vue +1 -1
  6. package/src/components/GridFooter.vue +1 -1
  7. package/src/components/GridHeader.vue +1 -1
  8. package/src/components/GridHeaderCheckbox.vue +1 -1
  9. package/src/components/GridRadioButton.vue +1 -1
  10. package/src/components/GridRow.vue +1 -1
  11. package/src/components/GridSearchField.vue +1 -1
  12. package/src/components/GridSearchRow.vue +1 -1
  13. package/src/components/GridSummarizer.vue +1 -1
  14. package/src/index.ts +3 -3
  15. package/src/types/index.d.ts +3 -0
  16. package/src/{definition → types}/install.d.ts +1 -1
  17. package/src/{definition → types}/types.d.ts +2 -2
  18. package/src/utils/CellValueGetter.ts +1 -1
  19. package/src/utils/CheckboxSelectedMapper.ts +1 -1
  20. package/src/utils/DataFetcher.ts +1 -1
  21. package/src/utils/EventEmitter.ts +2 -2
  22. package/src/utils/EventHandler.ts +2 -2
  23. package/src/utils/GridStyler.ts +1 -1
  24. package/src/utils/RadioButtonSelectedMapper.ts +1 -1
  25. package/src/utils/UrlBuilder.ts +1 -1
  26. package/src/utils/UuidMapper.ts +1 -1
  27. package/src/{types.d.ts → vue-shim.d.ts} +1 -1
  28. package/index.html +0 -11
  29. package/jsconfig.json +0 -8
  30. package/playground/App.vue +0 -35
  31. package/playground/index.html +0 -13
  32. package/playground/main.ts +0 -17
  33. package/playground/vite.config.ts +0 -23
  34. package/public/favicon.ico +0 -0
  35. package/src/index.d.ts +0 -1
  36. package/tsconfig.json +0 -19
  37. package/vite.config.js +0 -16
  38. package/vite.config.ts +0 -29
  39. /package/src/{definition → types}/enums.ts +0 -0
package/package.json CHANGED
@@ -1,25 +1,31 @@
1
1
  {
2
2
  "name": "spark-grid-vue3",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "",
5
- "main": "index.ts",
6
- "types": "index.d.ts",
5
+ "files": [
6
+ "src"
7
+ ],
8
+ "main": "./src/index.ts",
9
+ "types": "./src/types/index.d.ts",
7
10
  "author": "",
8
11
  "license": "ISC",
9
12
  "dependencies": {
10
13
  "vue": "^3.4.37"
11
14
  },
12
15
  "scripts": {
13
- "build": "vite build",
16
+ "build": "vite build && tsc --noEmit",
14
17
  "playground": "vite --config playground/vite.config.ts"
15
18
  },
16
19
  "devDependencies": {
20
+ "@types/node": "^22.7.4",
17
21
  "@vitejs/plugin-vue": "^5.1.4",
18
22
  "@vue/compiler-sfc": "^3.5.10",
23
+ "@vue/tsconfig": "^0.5.1",
19
24
  "mitt": "^3.0.1",
20
25
  "rollup-plugin-typescript2": "^0.36.0",
21
26
  "sass": "^1.79.4",
22
27
  "sass-embedded": "^1.79.4",
28
+ "terser": "^5.34.1",
23
29
  "typescript": "^5.6.2",
24
30
  "vite": "^5.4.8"
25
31
  },
@@ -5,9 +5,9 @@ import GridBody from "../components/GridBody.vue"
5
5
  import GridContentWrapper from "../components/GridContentWrapper.vue"
6
6
  import GridSummarizer from "../components/GridSummarizer.vue"
7
7
  import type {Component} from "@vue/runtime-core"
8
- import type {SparkGridConfig, Props} from "../definition/types"
9
- import {DataFetcher} from "../utils/DataFetcher"
10
- import {EventHandler} from "../utils/EventHandler"
8
+ import type {Props, SparkGridConfig} from "@/types"
9
+ import {DataFetcher} from "@/utils/DataFetcher"
10
+ import {EventHandler} from "@/utils/EventHandler"
11
11
  // @ts-ignore
12
12
  import {v4 as uuidV4} from "uuid"
13
13
 
@@ -10,7 +10,7 @@
10
10
 
11
11
  <script setup lang="ts">
12
12
  import GridRow from "./GridRow.vue"
13
- import type {GridComponent} from "../definition/types"
13
+ import type {GridComponent} from "../types/types"
14
14
  import {computed} from "vue"
15
15
 
16
16
  const props = defineProps<{
@@ -18,7 +18,7 @@
18
18
 
19
19
  <script setup lang="ts">
20
20
  import {GridStyler} from "../utils/GridStyler"
21
- import type {Row} from "../definition/types"
21
+ import type {Row} from "../types/types"
22
22
 
23
23
  const props = defineProps<{
24
24
  row: Row,
@@ -5,7 +5,7 @@
5
5
  </template>
6
6
 
7
7
  <script setup lang="ts">
8
- import type {GridComponent} from "../definition/types"
8
+ import type {GridComponent} from "../types/types"
9
9
  import {computed} from "vue"
10
10
 
11
11
  const props = defineProps<{ grid: GridComponent }>()
@@ -43,7 +43,7 @@
43
43
  </template>
44
44
 
45
45
  <script setup lang="ts">
46
- import type {GridComponent} from "../definition/types"
46
+ import type {GridComponent} from "../types/types"
47
47
  import {computed} from "vue"
48
48
 
49
49
  const props = defineProps<{ grid: GridComponent }>()
@@ -35,7 +35,7 @@
35
35
  import RuntimeRenderer from "./RuntimeRenderer.vue"
36
36
  import GridHeaderCheckbox from "./GridHeaderCheckbox.vue"
37
37
  import {GridStyler} from "../utils/GridStyler"
38
- import type {Column, GridComponent} from "../definition/types"
38
+ import type {Column, GridComponent} from "../types/types"
39
39
  import {computed} from "vue"
40
40
 
41
41
  const props = defineProps<{ grid: GridComponent }>()
@@ -17,7 +17,7 @@
17
17
 
18
18
  <script setup lang="ts">
19
19
  import {GridStyler} from "../utils/GridStyler"
20
- import type {GridComponent, Row} from "../definition/types"
20
+ import type {GridComponent, Row} from "../types/types"
21
21
  import {computed} from "vue"
22
22
 
23
23
  const props = defineProps<{
@@ -19,7 +19,7 @@
19
19
 
20
20
  <script setup lang="ts">
21
21
  import {GridStyler} from "../utils/GridStyler"
22
- import type {Row, GridComponent} from "../definition/types"
22
+ import type {Row, GridComponent} from "../types/types"
23
23
 
24
24
  const props = defineProps<{
25
25
  row: Row,
@@ -41,7 +41,7 @@
41
41
  <script setup lang="ts">
42
42
  import GridCheckbox from "./GridCheckbox.vue"
43
43
  import RuntimeRenderer from "./RuntimeRenderer.vue"
44
- import type {Column, GridComponent, Row} from "../definition/types"
44
+ import type {Column, GridComponent, Row} from "../types/types"
45
45
  import {GridStyler} from "../utils/GridStyler"
46
46
  import {computed, onUnmounted} from "vue"
47
47
  import {CellValueGetter} from "../utils/CellValueGetter"
@@ -59,7 +59,7 @@
59
59
  <script setup lang="ts">
60
60
  import _ from "lodash"
61
61
  import {ref, watch, computed, onMounted, onUnmounted} from "vue"
62
- import {GridSearchType} from "../definition/enums"
62
+ import {GridSearchType} from "../types/enums"
63
63
  import {EventEmitter} from "../utils/EventEmitter";
64
64
 
65
65
  const filterValue = ref<any>(null)
@@ -24,7 +24,7 @@
24
24
  </template>
25
25
 
26
26
  <script setup lang="ts">
27
- import type {GridComponent, Column} from "../definition/types"
27
+ import type {GridComponent, Column} from "../types/types"
28
28
  import GridSearchField from "./GridSearchField.vue"
29
29
  import {computed} from "vue"
30
30
  import {GridStyler} from "../utils/GridStyler"
@@ -17,7 +17,7 @@
17
17
  </template>
18
18
 
19
19
  <script setup lang="ts">
20
- import type {GridComponent, Column} from "../definition/types"
20
+ import type {GridComponent, Column} from "../types/types"
21
21
  import {GridStyler} from "../utils/GridStyler"
22
22
  import RuntimeRenderer from "../components/RuntimeRenderer.vue"
23
23
 
package/src/index.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import type {App} from "vue";
2
- import DynaGrid from "./SparkGrid.vue";
3
- import type {InstallOptions} from "./definition/install";
2
+ import SparkGridComponent from "./SparkGrid.vue";
3
+ import type {InstallOptions} from "./types";
4
4
  import {EventEmitter} from "./utils/EventEmitter";
5
5
 
6
6
  export const SparkGrid: any = {
7
7
  install(app: App, options: InstallOptions) {
8
- app.component("SparkGrid", DynaGrid)
8
+ app.component("SparkGrid", SparkGridComponent)
9
9
  EventEmitter.eventProxy = options.eventProxy
10
10
  }
11
11
  }
@@ -0,0 +1,3 @@
1
+ export * from './types'
2
+ export * from './install'
3
+ export * from './enums'
@@ -1,4 +1,4 @@
1
- type EventReceived = (data: any) => void;
1
+ export type EventReceived = (data: any) => void;
2
2
 
3
3
  export type EventProxy = {
4
4
  emit: (name: string, data: any) => void,
@@ -1,6 +1,6 @@
1
1
  import type {Component} from "@vue/runtime-core"
2
- import {GridColumnType, GridSearchType} from "./enums"
3
2
  import {ComponentPublicInstance} from "@vue/runtime-core";
3
+ import {GridColumnType, GridSearchType} from "./enums"
4
4
 
5
5
  export type OrderBy = {
6
6
  name: string,
@@ -69,7 +69,7 @@ export type UniqueKeyIdentifier = (row: Row) => string
69
69
 
70
70
  export type SparkGridConfig = {
71
71
  url?: string | function,
72
- datasource: (params: any) => any[],
72
+ datasource?: (params: any) => any[],
73
73
  height?: number,
74
74
  rowsPerPage?: number,
75
75
  cellMinWidth?: number | string,
@@ -1,4 +1,4 @@
1
- import type {Row, Column, GridComponent} from "../definition/types"
1
+ import type {Row, Column, GridComponent} from "../types/types"
2
2
  // @ts-ignore
3
3
  import getValue from 'get-value'
4
4
 
@@ -1,4 +1,4 @@
1
- import type {Row, GridComponent} from "../definition/types"
1
+ import type {Row, GridComponent} from "../types/types"
2
2
 
3
3
  export class CheckboxSelectedMapper {
4
4
  static map(row: Row, grid: GridComponent) {
@@ -1,7 +1,7 @@
1
1
  import {EventEmitter} from "../utils/EventEmitter"
2
2
  import {UrlBuilder} from "../utils/UrlBuilder"
3
3
  import Axios from "axios"
4
- import type {GridComponent} from "../definition/types"
4
+ import type {GridComponent} from "../types/types"
5
5
 
6
6
  export class DataFetcher {
7
7
  static async fetch(this: GridComponent): Promise<void> {
@@ -1,5 +1,5 @@
1
- import type {GridComponent} from "../definition/types"
2
- import type {EventProxy, EventReceived} from "../definition/install";
1
+ import type {GridComponent} from "../types/types"
2
+ import type {EventProxy, EventReceived} from "../types/install";
3
3
 
4
4
  export class EventEmitter {
5
5
  static eventProxy: EventProxy|null|undefined = null;
@@ -1,10 +1,10 @@
1
- import type {Column, GridComponent, OrderBy, Row} from "../definition/types"
1
+ import type {Column, GridComponent, OrderBy, Row} from "../types/types"
2
2
  import {UuidMapper} from "./UuidMapper"
3
3
  // @ts-ignore
4
4
  import {v4 as uuid} from "uuid"
5
5
  import {isEmpty} from "./Conditionals"
6
6
  import {CheckboxSelectedMapper} from "./CheckboxSelectedMapper"
7
- import {GridColumnType} from "../definition/enums"
7
+ import {GridColumnType} from "../types/enums"
8
8
  // @ts-ignore
9
9
  import getValue from 'get-value'
10
10
  import type {ComponentPublicInstance} from "@vue/runtime-core";
@@ -1,4 +1,4 @@
1
- import type {Column, GridComponent} from "../definition/types"
1
+ import type {Column, GridComponent} from "../types/types"
2
2
 
3
3
  export class GridStyler {
4
4
  static getCheckboxColumnStyles(): object {
@@ -1,4 +1,4 @@
1
- import type {GridComponent, Row} from "../definition/types"
1
+ import type {GridComponent, Row} from "../types/types"
2
2
 
3
3
  export class RadioButtonSelectedMapper {
4
4
  static map(row: Row, grid: GridComponent) {
@@ -1,4 +1,4 @@
1
- import type {GridComponent} from "../definition/types"
1
+ import type {GridComponent} from "../types/types"
2
2
 
3
3
  export class UrlBuilder {
4
4
  static getParams(grid: GridComponent): any {
@@ -1,4 +1,4 @@
1
- import type {Row} from "../definition/types"
1
+ import type {Row} from "../types/types"
2
2
  // @ts-ignore
3
3
  import {v4 as uuidV4} from "uuid"
4
4
 
@@ -1,5 +1,5 @@
1
1
  declare module '*.vue' {
2
- import { DefineComponent } from 'vue';
2
+ import {DefineComponent} from 'vue';
3
3
  const component: DefineComponent<{}, {}, any>;
4
4
  export default component;
5
5
  }
package/index.html DELETED
@@ -1,11 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8"/>
5
- <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
7
- <title>Spark Grid - Vue3</title>
8
- </head>
9
- <body>
10
- </body>
11
- </html>
package/jsconfig.json DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "paths": {
4
- "@/*": ["./src/*"]
5
- }
6
- },
7
- "exclude": ["node_modules", "dist"]
8
- }
@@ -1,35 +0,0 @@
1
- <template>
2
- <DynaGrid
3
- :config="grid"
4
- />
5
- </template>
6
-
7
- <style scoped>
8
- #app {
9
- padding: 20px;
10
- }
11
- </style>
12
-
13
- <script lang="ts">
14
- import {Component} from "@vue/runtime-core";
15
- import type {SparkGridConfig} from "../src/definition/types";
16
-
17
- export default {
18
- computed: {
19
- grid(): SparkGridConfig {
20
- return {
21
- datasource: (params: any) => {
22
- return [
23
- {id: 1, name: "John Doe"},
24
- ]
25
- },
26
-
27
- columns: [
28
- {name: "id", label: "ID"}
29
- ]
30
- }
31
- }
32
- }
33
- } as Component
34
- </script>
35
-
@@ -1,13 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8"/>
5
- <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
7
- <title>Dyna Grid Playground</title>
8
- </head>
9
- <body>
10
- <div id="app"></div>
11
- <script type="module" src="./main.ts"></script>
12
- </body>
13
- </html>
@@ -1,17 +0,0 @@
1
- import {createApp} from 'vue';
2
- import App from './App.vue';
3
- import {DataTable} from '../src/index';
4
- import mitt from "mitt";
5
-
6
- const app = createApp(App);
7
- const emitter = mitt()
8
-
9
- app.use(DataTable, {
10
- eventProxy: {
11
- emit: emitter.emit,
12
- on: emitter.on,
13
- off: emitter.off,
14
- }
15
- })
16
-
17
- app.mount('#app');
@@ -1,23 +0,0 @@
1
- import {defineConfig} from 'vite';
2
- import vue from '@vitejs/plugin-vue';
3
- import path from 'path';
4
-
5
- export default defineConfig({
6
- root: path.resolve(__dirname), // Set the playground folder as the root
7
- plugins: [vue()],
8
- resolve: {
9
- alias: {
10
- // Alias to your plugin's src directory
11
- '@': path.resolve(__dirname, '../src')
12
- }
13
- },
14
- server: {
15
- open: true, // Automatically open the browser
16
- port: 3000 // Port for the playground server
17
- },
18
- build: {
19
- rollupOptions: {
20
- input: path.resolve(__dirname, 'index.html') // Specify the HTML entry
21
- }
22
- }
23
- });
Binary file
package/src/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from 'definition/types'
package/tsconfig.json DELETED
@@ -1,19 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ESNext",
4
- "module": "ESNext",
5
- "moduleResolution": "Node",
6
- "strict": true,
7
- "jsx": "preserve",
8
- "esModuleInterop": true,
9
- "skipLibCheck": true,
10
- "forceConsistentCasingInFileNames": true,
11
- "declaration": true,
12
- "declarationDir": "dist/types",
13
- "emitDeclarationOnly": true,
14
- "outDir": "dist"
15
- },
16
- "include": [
17
- "src"
18
- ]
19
- }
package/vite.config.js DELETED
@@ -1,16 +0,0 @@
1
- import { fileURLToPath, URL } from 'node:url'
2
-
3
- import { defineConfig } from 'vite'
4
- import vue from '@vitejs/plugin-vue'
5
-
6
- // https://vitejs.dev/config/
7
- export default defineConfig({
8
- plugins: [
9
- vue(),
10
- ],
11
- resolve: {
12
- alias: {
13
- '@': fileURLToPath(new URL('./src', import.meta.url))
14
- }
15
- }
16
- })
package/vite.config.ts DELETED
@@ -1,29 +0,0 @@
1
- import {defineConfig} from 'vite';
2
- import vue from '@vitejs/plugin-vue';
3
- import typescript from 'rollup-plugin-typescript2';
4
-
5
- export default defineConfig({
6
- plugins: [vue()],
7
- resolve: {
8
- alias: {
9
- // Alias to your plugin's src directory
10
- '@': path.resolve(__dirname, '../src')
11
- }
12
- },
13
- build: {
14
- lib: {
15
- entry: 'src/index.ts',
16
- name: 'DynaGrid',
17
- fileName: (format) => `dyna-grid.${format}.js`
18
- },
19
- rollupOptions: {
20
- external: ['vue'],
21
- output: {
22
- globals: {
23
- vue: 'Vue'
24
- }
25
- },
26
- plugins: [typescript()]
27
- }
28
- }
29
- });
File without changes