@gandalan/weblibs 0.0.27 → 0.0.28

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.
@@ -30,6 +30,25 @@
30
30
  export let clickExpand = null;
31
31
  /** @type {function | null} */
32
32
  export let clickCell = null;
33
+
34
+ // CSS Classes
35
+ export let classNameTable = "border-2 border-collapse my-4";
36
+ export let classNameThead = "";
37
+ export let classNameTbody = "";
38
+ export let classNameSelect = "";
39
+ export let classNameInput = "";
40
+ export let classNameRow = "border-2 border-collapse odd:bg-gray-100 hover:bg-gray-300";
41
+ export let classNameCell = "";
42
+ export let classNameRowSelected = "!bg-gray-400";
43
+ export let classNameRowExpanded = "bg-gray-400";
44
+ export let classNameExpandedContent = "";
45
+ export let classNameCellExpand = "";
46
+
47
+ const asStringArray = v =>
48
+ []
49
+ .concat(v)
50
+ .filter(v => v !== null && typeof v === "string" && v !== "")
51
+ .join(" ");
33
52
  </script>
34
53
 
35
54
  <SvelteTable
@@ -47,17 +66,17 @@
47
66
  on:clickRow={clickRow}
48
67
  on:clickExpand={clickExpand}
49
68
  on:clickCell={clickCell}
50
- classNameTable="gan-table border-2 border-collapse mt-4 mb-4"
51
- classNameThead="gan-thead"
52
- classNameTbody="gan-tbody"
53
- classNameSelect="custom-select"
54
- classNameInput="custom-input"
55
- classNameRow="gan-row border-2 border-collapse cursor-pointer odd:bg-gray-100 hover:bg-gray-300"
56
- classNameCell="gan-cell pr-4"
57
- classNameRowSelected="row-selected !bg-gray-400"
58
- classNameRowExpanded="row-expanded bg-gray-400"
59
- classNameExpandedContent="expanded-content"
60
- classNameCellExpand="cell-expand">
69
+ classNameTable={asStringArray(["gan-table", classNameTable])}
70
+ classNameThead={asStringArray(["gan-thead", classNameThead])}
71
+ classNameTbody={asStringArray(["gan-tbody", classNameTbody])}
72
+ classNameSelect={asStringArray(["custom-select", classNameSelect])}
73
+ classNameInput={asStringArray(["custom-input", classNameInput])}
74
+ classNameRow={asStringArray(["gan-row", classNameRow])}
75
+ classNameCell={asStringArray(["gan-cell", classNameCell])}
76
+ classNameRowSelected={asStringArray(["row-selected", classNameRowSelected])}
77
+ classNameRowExpanded={asStringArray(["row-expanded", classNameRowExpanded])}
78
+ classNameExpandedContent={asStringArray(["expanded-content", classNameExpandedContent])}
79
+ classNameCellExpand={asStringArray(["cell-expand", classNameCellExpand])}>
61
80
 
62
81
  <!-- Wait for better workaround. See: https://github.com/sveltejs/svelte/issues/5604 -->
63
82
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gandalan/weblibs",
3
- "version": "0.0.27",
3
+ "version": "0.0.28",
4
4
  "description": "WebLibs for Gandalan JS/TS/Svelte projects",
5
5
  "author": "Philipp Reif",
6
6
  "license": "ISC",