@ims360/svelte-ivory 0.4.5 → 0.4.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.
- package/dist/components/table/Column.svelte +17 -12
- package/dist/components/table/Column.svelte.d.ts.map +1 -1
- package/dist/components/table/columnController.svelte.d.ts.map +1 -1
- package/dist/components/table/columnController.svelte.js +3 -0
- package/package.json +29 -30
- package/src/lib/components/table/Column.svelte +17 -12
- package/src/lib/components/table/columnController.svelte.ts +2 -0
|
@@ -38,7 +38,23 @@
|
|
|
38
38
|
|
|
39
39
|
// Register the new column if this is the first table row that was rendered
|
|
40
40
|
const tableContext = getTableContext();
|
|
41
|
-
const column = tableContext.registerColumn({
|
|
41
|
+
const column = tableContext.registerColumn({
|
|
42
|
+
get id() {
|
|
43
|
+
return id;
|
|
44
|
+
},
|
|
45
|
+
get width() {
|
|
46
|
+
return width;
|
|
47
|
+
},
|
|
48
|
+
get minWidth() {
|
|
49
|
+
return minWidth;
|
|
50
|
+
},
|
|
51
|
+
get resizable() {
|
|
52
|
+
return resizable;
|
|
53
|
+
},
|
|
54
|
+
get header() {
|
|
55
|
+
return header;
|
|
56
|
+
}
|
|
57
|
+
});
|
|
42
58
|
const rowContext = getRowContext();
|
|
43
59
|
|
|
44
60
|
const finalOnClick = $derived(onclick || rowContext.onclick);
|
|
@@ -47,22 +63,11 @@
|
|
|
47
63
|
return href || rowContext.href;
|
|
48
64
|
});
|
|
49
65
|
|
|
50
|
-
// passes updated props to the column
|
|
51
|
-
$effect(() => {
|
|
52
|
-
column.updateConfig({ resizable, minWidth, id, header });
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
// this must be separate to the above effect, since otherwise the width would be reset on every scroll
|
|
56
|
-
$effect(() => {
|
|
57
|
-
if (!resizable && typeof width !== 'undefined') column.resize(width);
|
|
58
|
-
});
|
|
59
|
-
|
|
60
66
|
const widthStyle = $derived(
|
|
61
67
|
`calc(${column.width ?? 0}px - var(--spacing) * ${offsetNestingLevel * tableContext.nestingInset}) !important;`
|
|
62
68
|
);
|
|
63
69
|
</script>
|
|
64
70
|
|
|
65
|
-
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
66
71
|
<Element
|
|
67
72
|
{...props}
|
|
68
73
|
onclick={finalOnClick}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Column.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/table/Column.svelte.ts"],"names":[],"mappings":"AAKI,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAI9D,MAAM,WAAW,WAAY,SAAQ,YAAY;IAC7C,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,2EAA2E;IAC3E,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC/B;
|
|
1
|
+
{"version":3,"file":"Column.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/table/Column.svelte.ts"],"names":[],"mappings":"AAKI,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAElD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAI9D,MAAM,WAAW,WAAY,SAAQ,YAAY;IAC7C,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,2EAA2E;IAC3E,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2CAA2C;IAC3C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC/B;AA6DL,QAAA,MAAM,MAAM,iDAAwC,CAAC;AACrD,KAAK,MAAM,GAAG,UAAU,CAAC,OAAO,MAAM,CAAC,CAAC;AACxC,eAAe,MAAM,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"columnController.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/table/columnController.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAGtC,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAE5C,MAAM,WAAW,YAAY;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC;CAC5B;AAED,qBAAa,gBAAgB;IACzB,EAAE,SAAc;IAChB,MAAM,uBAAgC;IAGtC,KAAK,qBAAoB;IACzB,QAAQ,SAAyB;IACjC,QAAQ,UAAiB;IACzB,SAAS,UAAiB;IAC1B,QAAQ,UAAiB;gBAEb,IAAI,EAAE,YAAY;IAS9B,YAAY,CAAC,IAAI,EAAE,YAAY;
|
|
1
|
+
{"version":3,"file":"columnController.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/table/columnController.svelte.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AAGtC,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAE5C,MAAM,WAAW,YAAY;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC;CAC5B;AAED,qBAAa,gBAAgB;IACzB,EAAE,SAAc;IAChB,MAAM,uBAAgC;IAGtC,KAAK,qBAAoB;IACzB,QAAQ,SAAyB;IACjC,QAAQ,UAAiB;IACzB,SAAS,UAAiB;IAC1B,QAAQ,UAAiB;gBAEb,IAAI,EAAE,YAAY;IAS9B,YAAY,CAAC,IAAI,EAAE,YAAY;IAmB/B,MAAM,CAAC,QAAQ,CAAC,EAAE,MAAM;CAQ3B"}
|
|
@@ -23,6 +23,9 @@ export class ColumnController {
|
|
|
23
23
|
const newWidth = typeof conf.width === 'undefined' ? DEFAULT_WIDTH : conf.width;
|
|
24
24
|
this.width = newWidth;
|
|
25
25
|
}
|
|
26
|
+
else {
|
|
27
|
+
this.width = conf.width ?? this.width;
|
|
28
|
+
}
|
|
26
29
|
if (typeof conf.minWidth !== 'undefined') {
|
|
27
30
|
this.minWidth = conf.minWidth;
|
|
28
31
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ims360/svelte-ivory",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.7",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"svelte"
|
|
6
6
|
],
|
|
@@ -76,44 +76,43 @@
|
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
78
|
"@lucide/svelte": "^0.553.0",
|
|
79
|
-
"@
|
|
80
|
-
"@tailwindcss/forms": "^0.5.10",
|
|
79
|
+
"@tailwindcss/forms": "^0.5.11",
|
|
81
80
|
"@tailwindcss/typography": "^0.5.19",
|
|
82
|
-
"@tailwindcss/vite": "^4.1
|
|
81
|
+
"@tailwindcss/vite": "^4.2.1",
|
|
83
82
|
"clsx": "^2.1.1",
|
|
84
|
-
"dompurify": "^3.3.
|
|
85
|
-
"jsdom": "^27.
|
|
86
|
-
"marked": "^17.0.
|
|
87
|
-
"tailwind-merge": "^3.
|
|
88
|
-
"tailwindcss": "^4.1
|
|
83
|
+
"dompurify": "^3.3.1",
|
|
84
|
+
"jsdom": "^27.4.0",
|
|
85
|
+
"marked": "^17.0.4",
|
|
86
|
+
"tailwind-merge": "^3.5.0",
|
|
87
|
+
"tailwindcss": "^4.2.1"
|
|
89
88
|
},
|
|
90
89
|
"devDependencies": {
|
|
91
|
-
"@eslint/compat": "^
|
|
92
|
-
"@eslint/js": "^
|
|
93
|
-
"@sveltejs/adapter-auto": "^7.0.
|
|
94
|
-
"@sveltejs/package": "^2.5.
|
|
95
|
-
"@sveltejs/vite-plugin-svelte": "^6.2.
|
|
90
|
+
"@eslint/compat": "^2.0.2",
|
|
91
|
+
"@eslint/js": "^10.0.1",
|
|
92
|
+
"@sveltejs/adapter-auto": "^7.0.1",
|
|
93
|
+
"@sveltejs/package": "^2.5.7",
|
|
94
|
+
"@sveltejs/vite-plugin-svelte": "^6.2.4",
|
|
96
95
|
"@testing-library/jest-dom": "^6.9.1",
|
|
97
|
-
"@testing-library/svelte": "^5.
|
|
96
|
+
"@testing-library/svelte": "^5.3.1",
|
|
98
97
|
"@testing-library/user-event": "^14.6.1",
|
|
99
|
-
"@vitest/browser": "^4.0.
|
|
100
|
-
"@vitest/coverage-v8": "^4.0.
|
|
101
|
-
"@vitest/spy": "^4.0.
|
|
102
|
-
"eslint": "^
|
|
98
|
+
"@vitest/browser": "^4.0.18",
|
|
99
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
100
|
+
"@vitest/spy": "^4.0.18",
|
|
101
|
+
"eslint": "^10.0.2",
|
|
103
102
|
"eslint-config-prettier": "^10.1.8",
|
|
104
|
-
"eslint-plugin-svelte": "^3.
|
|
103
|
+
"eslint-plugin-svelte": "^3.15.0",
|
|
105
104
|
"globals": "^16.5.0",
|
|
106
|
-
"playwright": "^1.
|
|
107
|
-
"prettier": "^3.
|
|
108
|
-
"prettier-plugin-svelte": "^3.
|
|
109
|
-
"prettier-plugin-tailwindcss": "^0.7.
|
|
110
|
-
"publint": "^0.3.
|
|
111
|
-
"svelte-check": "^4.
|
|
105
|
+
"playwright": "^1.58.2",
|
|
106
|
+
"prettier": "^3.8.1",
|
|
107
|
+
"prettier-plugin-svelte": "^3.5.1",
|
|
108
|
+
"prettier-plugin-tailwindcss": "^0.7.2",
|
|
109
|
+
"publint": "^0.3.18",
|
|
110
|
+
"svelte-check": "^4.4.4",
|
|
112
111
|
"typescript": "^5.9.3",
|
|
113
|
-
"typescript-eslint": "^8.
|
|
114
|
-
"vite": "^7.
|
|
115
|
-
"vitest": "^4.0.
|
|
116
|
-
"zod": "^4.
|
|
112
|
+
"typescript-eslint": "^8.56.1",
|
|
113
|
+
"vite": "^7.3.1",
|
|
114
|
+
"vitest": "^4.0.18",
|
|
115
|
+
"zod": "^4.3.6"
|
|
117
116
|
},
|
|
118
117
|
"peerDependencies": {
|
|
119
118
|
"@skeletonlabs/skeleton": "^4.0.0",
|
|
@@ -38,7 +38,23 @@
|
|
|
38
38
|
|
|
39
39
|
// Register the new column if this is the first table row that was rendered
|
|
40
40
|
const tableContext = getTableContext();
|
|
41
|
-
const column = tableContext.registerColumn({
|
|
41
|
+
const column = tableContext.registerColumn({
|
|
42
|
+
get id() {
|
|
43
|
+
return id;
|
|
44
|
+
},
|
|
45
|
+
get width() {
|
|
46
|
+
return width;
|
|
47
|
+
},
|
|
48
|
+
get minWidth() {
|
|
49
|
+
return minWidth;
|
|
50
|
+
},
|
|
51
|
+
get resizable() {
|
|
52
|
+
return resizable;
|
|
53
|
+
},
|
|
54
|
+
get header() {
|
|
55
|
+
return header;
|
|
56
|
+
}
|
|
57
|
+
});
|
|
42
58
|
const rowContext = getRowContext();
|
|
43
59
|
|
|
44
60
|
const finalOnClick = $derived(onclick || rowContext.onclick);
|
|
@@ -47,22 +63,11 @@
|
|
|
47
63
|
return href || rowContext.href;
|
|
48
64
|
});
|
|
49
65
|
|
|
50
|
-
// passes updated props to the column
|
|
51
|
-
$effect(() => {
|
|
52
|
-
column.updateConfig({ resizable, minWidth, id, header });
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
// this must be separate to the above effect, since otherwise the width would be reset on every scroll
|
|
56
|
-
$effect(() => {
|
|
57
|
-
if (!resizable && typeof width !== 'undefined') column.resize(width);
|
|
58
|
-
});
|
|
59
|
-
|
|
60
66
|
const widthStyle = $derived(
|
|
61
67
|
`calc(${column.width ?? 0}px - var(--spacing) * ${offsetNestingLevel * tableContext.nestingInset}) !important;`
|
|
62
68
|
);
|
|
63
69
|
</script>
|
|
64
70
|
|
|
65
|
-
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
66
71
|
<Element
|
|
67
72
|
{...props}
|
|
68
73
|
onclick={finalOnClick}
|
|
@@ -36,6 +36,8 @@ export class ColumnController {
|
|
|
36
36
|
if (typeof this.width === 'undefined') {
|
|
37
37
|
const newWidth = typeof conf.width === 'undefined' ? DEFAULT_WIDTH : conf.width;
|
|
38
38
|
this.width = newWidth;
|
|
39
|
+
} else {
|
|
40
|
+
this.width = conf.width ?? this.width;
|
|
39
41
|
}
|
|
40
42
|
if (typeof conf.minWidth !== 'undefined') {
|
|
41
43
|
this.minWidth = conf.minWidth;
|