@ace-grid/svelte 1.0.7

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.
@@ -0,0 +1,5 @@
1
+ export * from "./svelte";
2
+ export * from "@ace-grid/core";
3
+ export declare function defineAceGridElement(...args: unknown[]): unknown;
4
+ export declare function defineAceGridUseGridElement(...args: unknown[]): unknown;
5
+ export interface AceGridUseGridElement extends HTMLElement {}
@@ -0,0 +1,18 @@
1
+ import { Grid as e, useGrid as r } from "@ace-grid/core";
2
+ export * from "@ace-grid/core";
3
+ import { r as E } from "./angularTier-BxO1uxwB.mjs";
4
+ import { d as m, a as A } from "./angularTier-BxO1uxwB.mjs";
5
+ import { ACE_GRID_SVELTE_COMMON_EVENTS as n, ACE_GRID_SVELTE_DEFAULT_TAG_NAME as f, ACE_GRID_SVELTE_EVENT_PREFIX as a, AceGridComponent as p, AceGridComponent as s } from "./svelte.js";
6
+ E(
7
+ e,
8
+ r
9
+ );
10
+ export {
11
+ n as ACE_GRID_SVELTE_COMMON_EVENTS,
12
+ f as ACE_GRID_SVELTE_DEFAULT_TAG_NAME,
13
+ a as ACE_GRID_SVELTE_EVENT_PREFIX,
14
+ p as AceGridComponent,
15
+ s as default,
16
+ m as defineAceGridElement,
17
+ A as defineAceGridUseGridElement
18
+ };
@@ -0,0 +1,5 @@
1
+ export * from "./svelte";
2
+ export * from "@ace-grid/enterprise";
3
+ export declare function defineAceGridElement(...args: unknown[]): unknown;
4
+ export declare function defineAceGridUseGridElement(...args: unknown[]): unknown;
5
+ export interface AceGridUseGridElement extends HTMLElement {}
@@ -0,0 +1,18 @@
1
+ import { Grid as e, useGrid as r } from "@ace-grid/enterprise";
2
+ export * from "@ace-grid/enterprise";
3
+ import { r as E } from "./angularTier-BxO1uxwB.mjs";
4
+ import { d as m, a as A } from "./angularTier-BxO1uxwB.mjs";
5
+ import { ACE_GRID_SVELTE_COMMON_EVENTS as n, ACE_GRID_SVELTE_DEFAULT_TAG_NAME as f, ACE_GRID_SVELTE_EVENT_PREFIX as a, AceGridComponent as p, AceGridComponent as s } from "./svelte.js";
6
+ E(
7
+ e,
8
+ r
9
+ );
10
+ export {
11
+ n as ACE_GRID_SVELTE_COMMON_EVENTS,
12
+ f as ACE_GRID_SVELTE_DEFAULT_TAG_NAME,
13
+ a as ACE_GRID_SVELTE_EVENT_PREFIX,
14
+ p as AceGridComponent,
15
+ s as default,
16
+ m as defineAceGridElement,
17
+ A as defineAceGridUseGridElement
18
+ };
@@ -0,0 +1,5 @@
1
+ export * from "./svelte";
2
+ export * from "@ace-grid/pro";
3
+ export declare function defineAceGridElement(...args: unknown[]): unknown;
4
+ export declare function defineAceGridUseGridElement(...args: unknown[]): unknown;
5
+ export interface AceGridUseGridElement extends HTMLElement {}
@@ -0,0 +1,18 @@
1
+ import { Grid as e, useGrid as r } from "@ace-grid/pro";
2
+ export * from "@ace-grid/pro";
3
+ import { r as E } from "./angularTier-BxO1uxwB.mjs";
4
+ import { d as m, a as A } from "./angularTier-BxO1uxwB.mjs";
5
+ import { ACE_GRID_SVELTE_COMMON_EVENTS as n, ACE_GRID_SVELTE_DEFAULT_TAG_NAME as f, ACE_GRID_SVELTE_EVENT_PREFIX as a, AceGridComponent as p, AceGridComponent as s } from "./svelte.js";
6
+ E(
7
+ e,
8
+ r
9
+ );
10
+ export {
11
+ n as ACE_GRID_SVELTE_COMMON_EVENTS,
12
+ f as ACE_GRID_SVELTE_DEFAULT_TAG_NAME,
13
+ a as ACE_GRID_SVELTE_EVENT_PREFIX,
14
+ p as AceGridComponent,
15
+ s as default,
16
+ m as defineAceGridElement,
17
+ A as defineAceGridUseGridElement
18
+ };
@@ -0,0 +1,17 @@
1
+ export interface AceGridSvelteReadyEvent {
2
+ element: HTMLElement;
3
+ }
4
+ export interface AceGridSvelteComponentProps {
5
+ props?: unknown;
6
+ hookOptions?: unknown;
7
+ templates?: Record<string, unknown> | null;
8
+ iconTemplates?: Record<string, unknown> | null;
9
+ elementClassName?: string;
10
+ customTagName?: string;
11
+ }
12
+ export declare const AceGridComponent: unknown;
13
+ declare const _default: typeof AceGridComponent;
14
+ export default _default;
15
+ export declare const ACE_GRID_SVELTE_COMMON_EVENTS: Record<string, string>;
16
+ export declare const ACE_GRID_SVELTE_DEFAULT_TAG_NAME: string;
17
+ export declare const ACE_GRID_SVELTE_EVENT_PREFIX: string;
package/dist/svelte.js ADDED
@@ -0,0 +1,176 @@
1
+ import "svelte/internal/disclose-version";
2
+ import "svelte/internal/flags/legacy";
3
+ import * as e from "svelte/internal/client";
4
+ import { createEventDispatcher as X, onMount as q, onDestroy as z, mount as J, unmount as K } from "svelte";
5
+ const G = "ace-grid", Q = "ace-grid-", i = {
6
+ cellChange: "ace-grid-cell-change",
7
+ rowAdd: "ace-grid-row-add",
8
+ rowDelete: "ace-grid-row-delete",
9
+ selectionChange: "ace-grid-selection-change",
10
+ selectionRangeChange: "ace-grid-selection-range-change",
11
+ sortChange: "ace-grid-sort-change",
12
+ sortModelChange: "ace-grid-sort-model-change",
13
+ filterChange: "ace-grid-filter-change"
14
+ };
15
+ var Y = e.from_html('<div class="ace-grid-svelte__container svelte-1dm50x4"></div>');
16
+ function Z(V, r) {
17
+ e.push(r, !1);
18
+ let p = e.prop(r, "customTagName", 8, G), d = e.prop(r, "props", 24, () => ({})), u = e.prop(r, "hookOptions", 8, null), m = e.prop(r, "templates", 8, null), c = e.prop(r, "iconTemplates", 12, null), _ = e.prop(r, "elementClassName", 8, ""), g = e.mutable_source(null), n = e.mutable_source(null), h = null;
19
+ const l = X(), E = (t) => (t ?? "").trim() || G, C = (t, o) => {
20
+ if (!e.get(g)) return;
21
+ const s = e.get(n)?.tagName.toLowerCase();
22
+ if (!e.get(n) || s !== t.toLowerCase()) {
23
+ T();
24
+ const a = document.createElement(t);
25
+ a.style.display = "block", a.style.width = "100%", a.style.height = "100%", a.className = o, e.get(g).replaceChildren(a), e.set(n, a), h = H(a), l("ready", { element: a });
26
+ return;
27
+ }
28
+ e.mutate(n, e.get(n).className = o);
29
+ }, b = (t, o, s, a) => {
30
+ e.get(n) && (e.mutate(n, e.get(n).props = t ?? {}), e.mutate(n, e.get(n).templates = F(s, x(a)) ?? {}), "hookOptions" in e.get(n) && e.mutate(n, e.get(n).hookOptions = o ?? {}));
31
+ }, j = (t) => {
32
+ l("customEvent", t);
33
+ const o = t.detail;
34
+ switch (t.type) {
35
+ case i.cellChange:
36
+ l("cellChange", o);
37
+ break;
38
+ case i.rowAdd:
39
+ l("rowAdd", o);
40
+ break;
41
+ case i.rowDelete:
42
+ l("rowDelete", o);
43
+ break;
44
+ case i.selectionChange:
45
+ l("selectionChange", o);
46
+ break;
47
+ case i.selectionRangeChange:
48
+ l("selectionRangeChange", o);
49
+ break;
50
+ case i.sortChange:
51
+ l("sortChange", o);
52
+ break;
53
+ case i.sortModelChange:
54
+ l("sortModelChange", o);
55
+ break;
56
+ case i.filterChange:
57
+ l("filterChange", o);
58
+ break;
59
+ }
60
+ }, H = (t) => {
61
+ const o = t.dispatchEvent.bind(t);
62
+ return t.dispatchEvent = (s) => (s.type.startsWith(Q) && j(s), o(s)), () => {
63
+ t.dispatchEvent = o;
64
+ };
65
+ }, T = () => {
66
+ h?.(), h = null, e.get(n)?.remove(), e.set(n, null);
67
+ };
68
+ function k() {
69
+ return e.get(n);
70
+ }
71
+ function v() {
72
+ e.get(n)?.rerender();
73
+ }
74
+ function w(t) {
75
+ e.get(n)?.setProps?.(t);
76
+ }
77
+ function y() {
78
+ return e.get(n)?.getProps?.() ?? null;
79
+ }
80
+ function A(t) {
81
+ e.get(n)?.setTemplates?.(t);
82
+ }
83
+ function O() {
84
+ return e.get(n)?.getTemplates?.() ?? null;
85
+ }
86
+ function R(t) {
87
+ c({ ...c() ?? {}, ...t });
88
+ }
89
+ function D() {
90
+ return c() ?? null;
91
+ }
92
+ function N(t) {
93
+ e.get(n)?.setHookOptions?.(t);
94
+ }
95
+ function I() {
96
+ return e.get(n)?.getHookOptions?.() ?? null;
97
+ }
98
+ function M() {
99
+ return e.get(n)?.getRows?.() ?? null;
100
+ }
101
+ function P() {
102
+ return e.get(n)?.getActions?.() ?? null;
103
+ }
104
+ function L() {
105
+ return e.get(n)?.getApi?.() ?? null;
106
+ }
107
+ q(() => {
108
+ const t = E(p());
109
+ C(t, _()), b(d(), u(), m(), c());
110
+ }), z(() => {
111
+ T();
112
+ });
113
+ function x(t) {
114
+ if (!t || Object.keys(t).length === 0)
115
+ return null;
116
+ const o = Object.entries(t).filter((s) => !!s[1]).map(([s, a]) => [
117
+ s,
118
+ ({ props: U }) => {
119
+ const f = document.createElement("span");
120
+ f.style.display = "contents";
121
+ const W = J(a, { target: f, props: U });
122
+ return {
123
+ node: f,
124
+ cleanup: () => {
125
+ K(W);
126
+ }
127
+ };
128
+ }
129
+ ]);
130
+ return { icons: Object.fromEntries(o) };
131
+ }
132
+ function F(t, o) {
133
+ return !t && !o ? null : {
134
+ ...t ?? {},
135
+ ...o ?? {},
136
+ icons: { ...t?.icons ?? {}, ...o?.icons ?? {} }
137
+ };
138
+ }
139
+ e.legacy_pre_effect(
140
+ () => (e.get(g), e.deep_read_state(p()), e.deep_read_state(_())),
141
+ () => {
142
+ e.get(g) && C(E(p()), _());
143
+ }
144
+ ), e.legacy_pre_effect(
145
+ () => (e.get(n), e.deep_read_state(d()), e.deep_read_state(u()), e.deep_read_state(m()), e.deep_read_state(c())),
146
+ () => {
147
+ e.get(n) && b(d(), u(), m(), c());
148
+ }
149
+ ), e.legacy_pre_effect_reset();
150
+ var B = {
151
+ getElement: k,
152
+ rerender: v,
153
+ setProps: w,
154
+ getProps: y,
155
+ setTemplates: A,
156
+ getTemplates: O,
157
+ setIconTemplates: R,
158
+ getIconTemplates: D,
159
+ setHookOptions: N,
160
+ getHookOptions: I,
161
+ getRows: M,
162
+ getActions: P,
163
+ getApi: L
164
+ };
165
+ e.init();
166
+ var S = Y();
167
+ return e.bind_this(S, (t) => e.set(g, t), () => e.get(g)), e.append(V, S), e.bind_prop(r, "getElement", k), e.bind_prop(r, "rerender", v), e.bind_prop(r, "setProps", w), e.bind_prop(r, "getProps", y), e.bind_prop(r, "setTemplates", A), e.bind_prop(r, "getTemplates", O), e.bind_prop(r, "setIconTemplates", R), e.bind_prop(r, "getIconTemplates", D), e.bind_prop(r, "setHookOptions", N), e.bind_prop(r, "getHookOptions", I), e.bind_prop(r, "getRows", M), e.bind_prop(r, "getActions", P), e.bind_prop(r, "getApi", L), e.pop(B);
168
+ }
169
+ const ne = Z;
170
+ export {
171
+ i as ACE_GRID_SVELTE_COMMON_EVENTS,
172
+ G as ACE_GRID_SVELTE_DEFAULT_TAG_NAME,
173
+ Q as ACE_GRID_SVELTE_EVENT_PREFIX,
174
+ ne as AceGridComponent,
175
+ ne as default
176
+ };
package/package.json ADDED
@@ -0,0 +1,84 @@
1
+ {
2
+ "name": "@ace-grid/svelte",
3
+ "version": "1.0.7",
4
+ "description": "Tier-neutral Svelte wrapper for Ace Grid Core, Pro, and Enterprise runtimes.",
5
+ "type": "module",
6
+ "svelte": "./dist/svelte.js",
7
+ "module": "./dist/svelte.js",
8
+ "types": "./dist/svelte.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/svelte.d.ts",
12
+ "svelte": "./dist/svelte.js",
13
+ "import": "./dist/svelte.js"
14
+ },
15
+ "./core": {
16
+ "types": "./dist/svelte-core.d.ts",
17
+ "svelte": "./dist/svelte-core.js",
18
+ "import": "./dist/svelte-core.js"
19
+ },
20
+ "./pro": {
21
+ "types": "./dist/svelte-pro.d.ts",
22
+ "svelte": "./dist/svelte-pro.js",
23
+ "import": "./dist/svelte-pro.js"
24
+ },
25
+ "./enterprise": {
26
+ "types": "./dist/svelte-enterprise.d.ts",
27
+ "svelte": "./dist/svelte-enterprise.js",
28
+ "import": "./dist/svelte-enterprise.js"
29
+ }
30
+ },
31
+ "scripts": {
32
+ "build": "vite build && tsc -p tsconfig.build.json && node ../../scripts/protect-wrapper-package.mjs svelte"
33
+ },
34
+ "publishConfig": {
35
+ "access": "public"
36
+ },
37
+ "files": [
38
+ "dist/svelte.js",
39
+ "dist/svelte.d.ts",
40
+ "dist/svelte-core.js",
41
+ "dist/svelte-core.d.ts",
42
+ "dist/svelte-pro.js",
43
+ "dist/svelte-pro.d.ts",
44
+ "dist/svelte-enterprise.js",
45
+ "dist/svelte-enterprise.d.ts",
46
+ "dist/angularTier-*.mjs",
47
+ "dist/*.css"
48
+ ],
49
+ "peerDependencies": {
50
+ "@ace-grid/core": ">=1.0.6 <2.0.0",
51
+ "@ace-grid/pro": ">=1.0.6 <2.0.0",
52
+ "@ace-grid/enterprise": ">=1.0.6 <2.0.0",
53
+ "react": "19.1.1",
54
+ "react-dom": "19.1.1",
55
+ "svelte": "^5.0.0"
56
+ },
57
+ "peerDependenciesMeta": {
58
+ "@ace-grid/core": {
59
+ "optional": true
60
+ },
61
+ "@ace-grid/pro": {
62
+ "optional": true
63
+ },
64
+ "@ace-grid/enterprise": {
65
+ "optional": true
66
+ }
67
+ },
68
+ "license": "MIT",
69
+ "repository": {
70
+ "type": "git",
71
+ "url": "git+https://github.com/Vitashev/gridix.git"
72
+ },
73
+ "bugs": {
74
+ "url": "https://github.com/Vitashev/gridix/issues"
75
+ },
76
+ "homepage": "https://ace-grid.com",
77
+ "keywords": [
78
+ "ace-grid",
79
+ "svelte",
80
+ "data-grid",
81
+ "spreadsheet",
82
+ "typescript"
83
+ ]
84
+ }