@aurum-grid/vue 0.0.0-stage → 0.5.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.
- package/LICENSE.md +24 -0
- package/README.md +6 -2
- package/dist/index.d.ts +42 -0
- package/dist/index.js +79 -0
- package/dist/index.js.map +1 -0
- package/package.json +33 -3
package/LICENSE.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Aurum Grid Commercial License (draft template)
|
|
2
|
+
|
|
3
|
+
> This is a starting-point template, not legal advice. Have a lawyer review it before you sell licences.
|
|
4
|
+
|
|
5
|
+
Copyright (c) 2026 the Aurum Grid authors. All rights reserved.
|
|
6
|
+
|
|
7
|
+
## 1. Evaluation
|
|
8
|
+
You may install and use Aurum Grid ("the Software") free of charge for **30 days** to evaluate it. During and after
|
|
9
|
+
evaluation the Software runs unmodified; after 30 days without a valid licence key it displays an
|
|
10
|
+
"unlicensed" watermark and console notice.
|
|
11
|
+
|
|
12
|
+
## 2. Annual developer licence
|
|
13
|
+
A licence costs **USD 50 per developer per year**. Each licensed developer may use the Software to build an
|
|
14
|
+
unlimited number of applications and deploy them to an unlimited number of end users. The licence key must be
|
|
15
|
+
renewed every year to keep receiving updates and to keep the watermark removed in newly built versions.
|
|
16
|
+
|
|
17
|
+
## 3. Restrictions
|
|
18
|
+
You may not: (a) redistribute the Software as a standalone component library or competing product;
|
|
19
|
+
(b) remove, alter or circumvent the licence checks or watermark; (c) share licence keys between developers
|
|
20
|
+
beyond the purchased seat count.
|
|
21
|
+
|
|
22
|
+
## 4. No warranty
|
|
23
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
|
|
24
|
+
ANY CLAIM, DAMAGES OR OTHER LIABILITY ARISING FROM THE USE OF THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @aurum-grid/vue
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Aurum Grid Vue 3 adapter.
|
|
4
|
+
|
|
5
|
+
Part of **Aurum Grid** — the enterprise data grid. See the main documentation: https://github.com/YOUR_ORG/aurum-grid#readme
|
|
6
|
+
|
|
7
|
+
Licensing: 30-day evaluation, then $50 per developer per year. See LICENSE.md.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type Component, type PropType } from 'vue';
|
|
2
|
+
import { type CellRendererParams, type FrameworkRendererResult, type GridOptions, type ICellEditor, type ICellEditorParams } from '@aurum-grid/core';
|
|
3
|
+
/**
|
|
4
|
+
* <AurumGrid :options="gridOptions" @grid-ready="onReady" />
|
|
5
|
+
* Options are watched shallowly; replacing `rowData`, `columnDefs`, `theme`, etc. updates the grid.
|
|
6
|
+
*/
|
|
7
|
+
export declare const AurumGrid: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
8
|
+
options: {
|
|
9
|
+
type: PropType<GridOptions<any>>;
|
|
10
|
+
required: true;
|
|
11
|
+
};
|
|
12
|
+
height: {
|
|
13
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
14
|
+
default: string;
|
|
15
|
+
};
|
|
16
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
17
|
+
[key: string]: any;
|
|
18
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "grid-ready"[], "grid-ready", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
19
|
+
options: {
|
|
20
|
+
type: PropType<GridOptions<any>>;
|
|
21
|
+
required: true;
|
|
22
|
+
};
|
|
23
|
+
height: {
|
|
24
|
+
type: (StringConstructor | NumberConstructor)[];
|
|
25
|
+
default: string;
|
|
26
|
+
};
|
|
27
|
+
}>> & Readonly<{
|
|
28
|
+
"onGrid-ready"?: ((...args: any[]) => any) | undefined;
|
|
29
|
+
}>, {
|
|
30
|
+
height: string | number;
|
|
31
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
32
|
+
/** Use a Vue component as a cell renderer: `cellRenderer: vueCellRenderer(StatusBadge)`. */
|
|
33
|
+
export declare function vueCellRenderer(comp: Component): (params: CellRendererParams) => FrameworkRendererResult;
|
|
34
|
+
/**
|
|
35
|
+
* Use a Vue component as a cell editor: `cellEditor: vueCellEditor(AddressForm, { popup: true })`.
|
|
36
|
+
* The component receives `params` and `value`, and emits `update:value` with the new value
|
|
37
|
+
* (so `v-model:value` works inside your own wrappers) — or calls `params.stopEditing()`.
|
|
38
|
+
*/
|
|
39
|
+
export declare function vueCellEditor(comp: Component, opts?: {
|
|
40
|
+
popup?: boolean;
|
|
41
|
+
popupPosition?: 'over' | 'under';
|
|
42
|
+
}): (params: ICellEditorParams) => ICellEditor;
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { defineComponent, h, onBeforeUnmount, onMounted, ref, shallowRef, watch, render } from 'vue';
|
|
2
|
+
import { createGrid } from '@aurum-grid/core';
|
|
3
|
+
/**
|
|
4
|
+
* <AurumGrid :options="gridOptions" @grid-ready="onReady" />
|
|
5
|
+
* Options are watched shallowly; replacing `rowData`, `columnDefs`, `theme`, etc. updates the grid.
|
|
6
|
+
*/
|
|
7
|
+
export const AurumGrid = defineComponent({
|
|
8
|
+
name: 'AurumGrid',
|
|
9
|
+
props: {
|
|
10
|
+
options: { type: Object, required: true },
|
|
11
|
+
height: { type: [String, Number], default: '100%' },
|
|
12
|
+
},
|
|
13
|
+
emits: ['grid-ready'],
|
|
14
|
+
setup(props, { emit, expose }) {
|
|
15
|
+
const host = ref(null);
|
|
16
|
+
const api = shallowRef(null);
|
|
17
|
+
let prev = {};
|
|
18
|
+
onMounted(() => {
|
|
19
|
+
api.value = createGrid(host.value, { ...props.options });
|
|
20
|
+
prev = { ...props.options };
|
|
21
|
+
emit('grid-ready', api.value);
|
|
22
|
+
});
|
|
23
|
+
watch(() => ({ ...props.options }), (next) => {
|
|
24
|
+
if (!api.value)
|
|
25
|
+
return;
|
|
26
|
+
const patch = {};
|
|
27
|
+
for (const [k, v] of Object.entries(next))
|
|
28
|
+
if (prev[k] !== v)
|
|
29
|
+
patch[k] = v;
|
|
30
|
+
prev = { ...next };
|
|
31
|
+
if (Object.keys(patch).length)
|
|
32
|
+
api.value.updateGridOptions(patch);
|
|
33
|
+
});
|
|
34
|
+
onBeforeUnmount(() => {
|
|
35
|
+
api.value?.destroy();
|
|
36
|
+
api.value = null;
|
|
37
|
+
});
|
|
38
|
+
expose({ api });
|
|
39
|
+
return () => h('div', { ref: host, style: { height: typeof props.height === 'number' ? `${props.height}px` : props.height, width: '100%' } });
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
/** Use a Vue component as a cell renderer: `cellRenderer: vueCellRenderer(StatusBadge)`. */
|
|
43
|
+
export function vueCellRenderer(comp) {
|
|
44
|
+
return (params) => {
|
|
45
|
+
const el = document.createElement('span');
|
|
46
|
+
render(h(comp, { params }), el);
|
|
47
|
+
return {
|
|
48
|
+
element: el,
|
|
49
|
+
update: (p) => render(h(comp, { params: p }), el),
|
|
50
|
+
destroy: () => render(null, el),
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Use a Vue component as a cell editor: `cellEditor: vueCellEditor(AddressForm, { popup: true })`.
|
|
56
|
+
* The component receives `params` and `value`, and emits `update:value` with the new value
|
|
57
|
+
* (so `v-model:value` works inside your own wrappers) — or calls `params.stopEditing()`.
|
|
58
|
+
*/
|
|
59
|
+
export function vueCellEditor(comp, opts = {}) {
|
|
60
|
+
return (params) => {
|
|
61
|
+
const el = document.createElement('div');
|
|
62
|
+
el.className = 'agr-vue-editor';
|
|
63
|
+
let value = params.value;
|
|
64
|
+
const draw = () => render(h(comp, {
|
|
65
|
+
params, value,
|
|
66
|
+
'onUpdate:value': (v) => { value = v; params.onValueChange(v); draw(); },
|
|
67
|
+
}), el);
|
|
68
|
+
draw();
|
|
69
|
+
return {
|
|
70
|
+
getGui: () => el,
|
|
71
|
+
getValue: () => value,
|
|
72
|
+
isPopup: () => !!opts.popup,
|
|
73
|
+
getPopupPosition: () => opts.popupPosition ?? 'under',
|
|
74
|
+
afterGuiAttached: () => el.querySelector('[autofocus], input, select, textarea, button')?.focus(),
|
|
75
|
+
destroy: () => render(null, el),
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,eAAe,EAAE,SAAS,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAiC,MAAM,KAAK,CAAC;AACpI,OAAO,EAAE,UAAU,EAAgI,MAAM,kBAAkB,CAAC;AAE5K;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,eAAe,CAAC;IACvC,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE;QACL,OAAO,EAAE,EAAE,IAAI,EAAE,MAAoC,EAAE,QAAQ,EAAE,IAAI,EAAE;QACvE,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE;KACpD;IACD,KAAK,EAAE,CAAC,YAAY,CAAC;IACrB,KAAK,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE;QAC3B,MAAM,IAAI,GAAG,GAAG,CAAwB,IAAI,CAAC,CAAC;QAC9C,MAAM,GAAG,GAAG,UAAU,CAAmB,IAAI,CAAC,CAAC;QAC/C,IAAI,IAAI,GAA4B,EAAE,CAAC;QACvC,SAAS,CAAC,GAAG,EAAE;YACb,GAAG,CAAC,KAAK,GAAG,UAAU,CAAC,IAAI,CAAC,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C,EAAE;YAChB,QAAQ,EAAE,GAAG,EAAE,CAAC,KAAK;YACrB,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK;YAC3B,gBAAgB,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,aAAa,IAAI,OAAO;YACrD,gBAAgB,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,aAAa,CAAc,8CAA8C,CAAC,EAAE,KAAK,EAAE;YAC9G,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,CAAC;SAChC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,36 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aurum-grid/vue",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.5.2",
|
|
4
|
+
"description": "Aurum Grid Vue 3 adapter.",
|
|
5
|
+
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"dist",
|
|
17
|
+
"LICENSE.md",
|
|
18
|
+
"README.md"
|
|
19
|
+
],
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@aurum-grid/core": "0.5.2"
|
|
22
|
+
},
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"vue": ">=3.3"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"vue": "^3.5.12"
|
|
28
|
+
},
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public"
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "tsc -p tsconfig.json",
|
|
34
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
35
|
+
}
|
|
6
36
|
}
|