@onsvisual/svelte-components 1.1.53 → 1.1.54
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.
|
@@ -6,6 +6,11 @@
|
|
|
6
6
|
* @type {number}
|
|
7
7
|
*/
|
|
8
8
|
export let colspan = 1;
|
|
9
|
+
/**
|
|
10
|
+
* (Optional) override column class
|
|
11
|
+
* @type {string|null}
|
|
12
|
+
*/
|
|
13
|
+
export let cls = null;
|
|
9
14
|
|
|
10
15
|
const classes = {
|
|
11
16
|
narrow: {
|
|
@@ -46,11 +51,13 @@
|
|
|
46
51
|
const width = getContext("width") || "wide";
|
|
47
52
|
const colWidth = getContext("colWidth") || null;
|
|
48
53
|
const rowHeight = getContext("rowHeight") || null;
|
|
49
|
-
const colClass =
|
|
50
|
-
?
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
+
const colClass = cls
|
|
55
|
+
? cls
|
|
56
|
+
: colWidth
|
|
57
|
+
? calcSpans(classes?.[width]?.[colWidth] || [], colspan)
|
|
58
|
+
.map((c) => `ons-col-${c}`)
|
|
59
|
+
.join(" ")
|
|
60
|
+
: "";
|
|
54
61
|
</script>
|
|
55
62
|
|
|
56
63
|
{#if colWidth}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
/** @typedef {typeof __propDef.events} GridCellEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} GridCellSlots */
|
|
4
4
|
export default class GridCell extends SvelteComponentTyped<{
|
|
5
|
+
cls?: string | null | undefined;
|
|
5
6
|
colspan?: number | undefined;
|
|
6
7
|
}, {
|
|
7
8
|
[evt: string]: CustomEvent<any>;
|
|
@@ -15,6 +16,7 @@ export type GridCellSlots = typeof __propDef.slots;
|
|
|
15
16
|
import { SvelteComponentTyped } from "svelte";
|
|
16
17
|
declare const __propDef: {
|
|
17
18
|
props: {
|
|
19
|
+
cls?: string | null | undefined;
|
|
18
20
|
colspan?: number | undefined;
|
|
19
21
|
};
|
|
20
22
|
events: {
|