cclkit4svelte 0.2.5 → 0.2.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.
@@ -1,7 +1,7 @@
1
1
  <script>import "./const/variables.css";
2
+ import { getYear } from "./scripts/date";
2
3
  export let bgColor;
3
- const date = /* @__PURE__ */ new Date();
4
- const year = date.getFullYear();
4
+ const year = getYear();
5
5
  </script>
6
6
 
7
7
  <!--汎用フッター-->
package/dist/Table.svelte CHANGED
@@ -30,16 +30,17 @@ export let tableData;
30
30
  </script>
31
31
 
32
32
  <!--汎用テーブル-->
33
- <table class="table-wrapper">
34
- <!--テーブルヘッダー-->
35
- <thead class="table-header" style="--bgColor: var({tableColor})">
36
- <tr>
37
- {#each dataHeader as title, index}
38
- <th>{title}</th>
39
- {/each}
40
- </tr>
41
- </thead>
42
- <tbody>
33
+ <div class="table-wrapper">
34
+ <table>
35
+ <!--テーブルヘッダー-->
36
+ <thead class="table-header" style="--bgColor: var({tableColor})">
37
+ <tr>
38
+ {#each dataHeader as title, index}
39
+ <th>{title}</th>
40
+ {/each}
41
+ </tr>
42
+ </thead>
43
+ <tbody>
43
44
  {#each tableData as row}
44
45
  <tr class="table-body-style" style="--table-body-color: var({bodyColor})">
45
46
  {#each row as data}
@@ -47,17 +48,34 @@ export let tableData;
47
48
  {/each}
48
49
  </tr>
49
50
  {/each}
50
- </tbody>
51
- </table>
51
+ </tbody>
52
+ </table>
53
+ </div>
52
54
 
53
55
  <style>
54
56
  th {
55
57
  padding: 5px 60px;
56
58
  }
57
59
 
58
- .table-wrapper {
60
+ thead {
61
+ position: sticky;
62
+ top: 0;
63
+ left: 0;
64
+ white-space: nowrap;
65
+ }
66
+
67
+ table {
59
68
  border-collapse: collapse;
69
+ width: 100%;
60
70
  }
71
+
72
+ .table-wrapper {
73
+ overflow-y: auto;
74
+ max-width: 90%;
75
+ height: 200px;
76
+ -webkit-overflow-scrolling: touch;
77
+ }
78
+
61
79
  .table-header {
62
80
  background-color: var(--bgColor);
63
81
  color: #ffffff;
@@ -65,6 +83,7 @@ export let tableData;
65
83
  .table-body-style {
66
84
  text-align: center;
67
85
  color: var(--wrap-grey);
86
+ white-space: nowrap;
68
87
  }
69
88
  .table-body-style:nth-child(odd) {
70
89
  background-color: var(--table-body-color);
@@ -16,7 +16,7 @@ declare const CCLPastelColor: {
16
16
  };
17
17
  declare const HeaderHeight: {
18
18
  WIDE: string;
19
- NOMAL: string;
19
+ NORMAL: string;
20
20
  NALLOW: string;
21
21
  };
22
22
  export { CCLVividColor, CCLPastelColor, HeaderHeight };
@@ -16,7 +16,7 @@ const CCLPastelColor = {
16
16
  };
17
17
  const HeaderHeight = {
18
18
  WIDE: '--hd-wide',
19
- NOMAL: '--hd-nomal',
19
+ NORMAL: '--hd-normal',
20
20
  NALLOW: '--hd-nallow'
21
21
  };
22
22
  export { CCLVividColor, CCLPastelColor, HeaderHeight };
@@ -18,6 +18,6 @@
18
18
  --hd-height: var(--hd-nomal);
19
19
  /*header height*/
20
20
  --hd-wide: 130px;
21
- --hd-nomal: 80px;
21
+ --hd-normal: 80px;
22
22
  --hd-nallow: 60px;
23
23
  }
@@ -0,0 +1,2 @@
1
+ declare const getYear: () => number;
2
+ export { getYear };
@@ -0,0 +1,5 @@
1
+ import { DateTime } from 'luxon';
2
+ const getYear = () => {
3
+ return DateTime.now().year;
4
+ };
5
+ export { getYear };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cclkit4svelte",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "author": "reiji1020 <sk@reiji1020.info>",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -26,7 +26,12 @@
26
26
  "format": "prettier --write .",
27
27
  "storybook": "storybook dev -p 6006",
28
28
  "build-storybook": "storybook build -o ./public/storybook",
29
- "chromatic": "chromatic"
29
+ "chromatic": "chromatic",
30
+ "test": "jest",
31
+ "test-sb": "test-storybook"
32
+ },
33
+ "jest": {
34
+ "preset": "jest-playwright-preset"
30
35
  },
31
36
  "exports": {
32
37
  ".": {
@@ -47,9 +52,11 @@
47
52
  "@storybook/svelte": "^8.0.5",
48
53
  "@storybook/sveltekit": "^8.0.5",
49
54
  "@storybook/test": "^8.0.5",
55
+ "@storybook/test-runner": "^0.17.0",
50
56
  "@sveltejs/adapter-auto": "^2.1.1",
51
57
  "@sveltejs/kit": "^1.30.4",
52
58
  "@sveltejs/package": "^2.3.0",
59
+ "@types/luxon": "^3.4.2",
53
60
  "@typescript-eslint/eslint-plugin": "^6.21.0",
54
61
  "@typescript-eslint/parser": "^6.21.0",
55
62
  "chromatic": "^11.3.0",
@@ -57,6 +64,10 @@
57
64
  "eslint-config-prettier": "^9.1.0",
58
65
  "eslint-plugin-storybook": "^0.6.15",
59
66
  "eslint-plugin-svelte": "^2.35.1",
67
+ "jest": "^29.7.0",
68
+ "jest-playwright-preset": "^4.0.0",
69
+ "luxon": "^3.4.4",
70
+ "playwright": "^1.43.0",
60
71
  "prettier": "^3.2.5",
61
72
  "prettier-plugin-svelte": "^3.2.2",
62
73
  "react": "^18.2.0",