cclkit4svelte 2.0.6 → 2.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.
- package/dist/Accordion.svelte +40 -29
- package/dist/Accordion.svelte.d.ts +31 -22
- package/dist/AccordionItem.svelte +120 -87
- package/dist/AccordionItem.svelte.d.ts +43 -34
- package/dist/Alert.svelte +111 -82
- package/dist/Alert.svelte.d.ts +38 -36
- package/dist/Badge.svelte +84 -0
- package/dist/Badge.svelte.d.ts +34 -0
- package/dist/BookCard.svelte +127 -88
- package/dist/BookCard.svelte.d.ts +47 -45
- package/dist/Breadcrumb.svelte +91 -0
- package/dist/Breadcrumb.svelte.d.ts +37 -0
- package/dist/Button.svelte +72 -35
- package/dist/Button.svelte.d.ts +33 -31
- package/dist/Card.svelte +110 -75
- package/dist/Card.svelte.d.ts +38 -36
- package/dist/Carousel.svelte +91 -66
- package/dist/Carousel.svelte.d.ts +26 -24
- package/dist/ChangeHistory.svelte +188 -150
- package/dist/ChangeHistory.svelte.d.ts +29 -27
- package/dist/Checkbox.svelte +120 -89
- package/dist/Checkbox.svelte.d.ts +41 -39
- package/dist/CommonHeader.svelte +51 -24
- package/dist/CommonHeader.svelte.d.ts +38 -36
- package/dist/DatePicker.svelte +239 -188
- package/dist/DatePicker.svelte.d.ts +40 -38
- package/dist/Dialog.svelte +224 -0
- package/dist/Dialog.svelte.d.ts +50 -0
- package/dist/Drawer.svelte +158 -0
- package/dist/Drawer.svelte.d.ts +40 -0
- package/dist/Footer.svelte +32 -16
- package/dist/Footer.svelte.d.ts +21 -19
- package/dist/FormGroup.svelte +67 -43
- package/dist/FormGroup.svelte.d.ts +46 -37
- package/dist/Header.svelte +108 -98
- package/dist/Header.svelte.d.ts +25 -23
- package/dist/Input.svelte +154 -99
- package/dist/Input.svelte.d.ts +62 -60
- package/dist/Pagination.svelte +257 -0
- package/dist/Pagination.svelte.d.ts +35 -0
- package/dist/ProgressBar.svelte +49 -44
- package/dist/ProgressBar.svelte.d.ts +25 -23
- package/dist/RadioButton.svelte +92 -62
- package/dist/RadioButton.svelte.d.ts +40 -38
- package/dist/Select.svelte +94 -53
- package/dist/Select.svelte.d.ts +49 -47
- package/dist/ServiceCard.svelte +71 -64
- package/dist/ServiceCard.svelte.d.ts +27 -25
- package/dist/Skeleton.svelte +96 -0
- package/dist/Skeleton.svelte.d.ts +24 -0
- package/dist/SlideMenu.svelte +157 -0
- package/dist/SlideMenu.svelte.d.ts +42 -0
- package/dist/Spinner.svelte +25 -23
- package/dist/Spinner.svelte.d.ts +20 -18
- package/dist/TabPanel.svelte +42 -21
- package/dist/TabPanel.svelte.d.ts +40 -31
- package/dist/Table.svelte +114 -73
- package/dist/Table.svelte.d.ts +33 -31
- package/dist/Tabs.svelte +78 -72
- package/dist/Tabs.svelte.d.ts +18 -16
- package/dist/Textarea.svelte +101 -52
- package/dist/Textarea.svelte.d.ts +57 -55
- package/dist/Thumbnail.svelte +33 -15
- package/dist/Thumbnail.svelte.d.ts +34 -32
- package/dist/Toaster.svelte +144 -0
- package/dist/Toaster.svelte.d.ts +26 -0
- package/dist/Toggle.svelte +85 -61
- package/dist/Toggle.svelte.d.ts +36 -34
- package/dist/Tooltip.svelte +126 -122
- package/dist/Tooltip.svelte.d.ts +30 -21
- package/dist/const/colorMap.d.ts +5 -0
- package/dist/const/colorMap.js +21 -0
- package/dist/const/variables.css +21 -21
- package/dist/index.d.ts +9 -0
- package/dist/index.js +8 -0
- package/dist/toast.d.ts +29 -0
- package/dist/toast.js +66 -0
- package/dist/types/breadcrumb.d.ts +4 -0
- package/dist/types/breadcrumb.js +1 -0
- package/dist/types/slide-menu.d.ts +5 -0
- package/dist/types/slide-menu.js +1 -0
- package/package.json +87 -87
package/dist/Table.svelte
CHANGED
|
@@ -1,86 +1,127 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { CCLPastelColor, CCLVividColor } from './const/config';
|
|
3
|
+
import { vividFor } from './const/colorMap';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* テーブルメインカラー
|
|
7
|
+
* CCLVividColorの中から指定する
|
|
8
|
+
* @default --strawberry-pink
|
|
9
|
+
* @type string
|
|
10
|
+
*/
|
|
11
|
+
export let tableColor: string;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* テーブルサブカラー
|
|
15
|
+
* CCLPasterColorの中から指定する
|
|
16
|
+
* @default --peach-pink
|
|
17
|
+
* @type string
|
|
18
|
+
*/
|
|
19
|
+
let bodyColor: string;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* テーブルのヘッダー
|
|
23
|
+
* 一次元配列で自由長、
|
|
24
|
+
* @type Array<string>
|
|
25
|
+
*/
|
|
26
|
+
export let dataHeader: string[];
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* テーブルにいれるデータ
|
|
30
|
+
* 2次元の配列で自由長
|
|
31
|
+
* @type Array<Array<string | number>>
|
|
32
|
+
*/
|
|
33
|
+
export let tableData: (string | number)[][];
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* テーブルカラーに応じた背景色を取得する関数
|
|
37
|
+
* @param tableColor - テーブルのメインカラー
|
|
38
|
+
* @returns 背景色
|
|
39
|
+
*/
|
|
40
|
+
function getBodyColor(tableColor: string): string {
|
|
41
|
+
switch (tableColor) {
|
|
42
|
+
case CCLVividColor.STRAWBERRY_PINK:
|
|
43
|
+
return CCLPastelColor.PEACH_PINK;
|
|
44
|
+
case CCLVividColor.PINEAPPLE_YELLOW:
|
|
45
|
+
return CCLPastelColor.LEMON_YELLOW;
|
|
46
|
+
case CCLVividColor.SODA_BLUE:
|
|
47
|
+
return CCLPastelColor.SUGAR_BLUE;
|
|
48
|
+
case CCLVividColor.MELON_GREEN:
|
|
49
|
+
return CCLPastelColor.MATCHA_GREEN;
|
|
50
|
+
case CCLVividColor.GRAPE_PURPLE:
|
|
51
|
+
return CCLPastelColor.AKEBI_PURPLE;
|
|
52
|
+
case CCLVividColor.WRAP_GREY:
|
|
53
|
+
return CCLPastelColor.CLOUD_GREY;
|
|
54
|
+
default:
|
|
55
|
+
return CCLPastelColor.PEACH_PINK;
|
|
56
|
+
}
|
|
22
57
|
}
|
|
23
|
-
|
|
24
|
-
|
|
58
|
+
|
|
59
|
+
// 背景色を取得
|
|
60
|
+
$: bodyColor = getBodyColor(tableColor);
|
|
61
|
+
// ヘッダの前景色(万一パステルが指定された場合に備える)
|
|
62
|
+
$: headerFg = vividFor(tableColor);
|
|
25
63
|
</script>
|
|
26
64
|
|
|
27
65
|
<!--汎用テーブル-->
|
|
28
66
|
<div class="table-wrapper">
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
67
|
+
<table>
|
|
68
|
+
<!--テーブルヘッダー-->
|
|
69
|
+
<thead
|
|
70
|
+
class="table-header"
|
|
71
|
+
style="--bgColor: var({tableColor}); {headerFg ? `--th-fg: var(${headerFg});` : ''}"
|
|
72
|
+
>
|
|
73
|
+
<tr>
|
|
74
|
+
{#each dataHeader as title}
|
|
75
|
+
<th>{title}</th>
|
|
76
|
+
{/each}
|
|
77
|
+
</tr>
|
|
78
|
+
</thead>
|
|
79
|
+
<tbody>
|
|
80
|
+
{#each tableData as row}
|
|
81
|
+
<tr class="table-body-style" style="--table-body-color: var({bodyColor})">
|
|
82
|
+
{#each row as data}
|
|
83
|
+
<td>{data}</td>
|
|
84
|
+
{/each}
|
|
85
|
+
</tr>
|
|
86
|
+
{/each}
|
|
87
|
+
</tbody>
|
|
88
|
+
</table>
|
|
48
89
|
</div>
|
|
49
90
|
|
|
50
91
|
<style>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
92
|
+
th {
|
|
93
|
+
padding: 5px 60px;
|
|
94
|
+
}
|
|
54
95
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
96
|
+
thead {
|
|
97
|
+
position: sticky;
|
|
98
|
+
top: 0;
|
|
99
|
+
left: 0;
|
|
100
|
+
white-space: nowrap;
|
|
101
|
+
}
|
|
61
102
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
103
|
+
table {
|
|
104
|
+
border-collapse: collapse;
|
|
105
|
+
width: 100%;
|
|
106
|
+
}
|
|
66
107
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
108
|
+
.table-wrapper {
|
|
109
|
+
overflow-y: auto;
|
|
110
|
+
max-width: 90%;
|
|
111
|
+
height: 200px;
|
|
112
|
+
-webkit-overflow-scrolling: touch;
|
|
113
|
+
}
|
|
73
114
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
115
|
+
.table-header {
|
|
116
|
+
background-color: var(--bgColor);
|
|
117
|
+
color: var(--th-fg, #ffffff);
|
|
118
|
+
}
|
|
119
|
+
.table-body-style {
|
|
120
|
+
text-align: center;
|
|
121
|
+
color: var(--wrap-grey);
|
|
122
|
+
white-space: nowrap;
|
|
123
|
+
}
|
|
124
|
+
.table-body-style:nth-child(odd) {
|
|
125
|
+
background-color: var(--table-body-color);
|
|
126
|
+
}
|
|
86
127
|
</style>
|
package/dist/Table.svelte.d.ts
CHANGED
|
@@ -1,33 +1,35 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
* テーブルのヘッダー
|
|
12
|
-
* 一次元配列で自由長、
|
|
13
|
-
* @type Array<string>
|
|
14
|
-
*/ dataHeader: string[];
|
|
15
|
-
/**
|
|
16
|
-
* テーブルにいれるデータ
|
|
17
|
-
* 2次元の配列で自由長
|
|
18
|
-
* @type Array<Array<string | number>>
|
|
19
|
-
*/ tableData: (string | number)[][];
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: Props & {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
20
11
|
};
|
|
21
|
-
|
|
22
|
-
[evt: string]: CustomEvent<any>;
|
|
23
|
-
};
|
|
24
|
-
slots: {};
|
|
25
|
-
exports?: {} | undefined;
|
|
26
|
-
bindings?: string | undefined;
|
|
27
|
-
};
|
|
28
|
-
export type TableProps = typeof __propDef.props;
|
|
29
|
-
export type TableEvents = typeof __propDef.events;
|
|
30
|
-
export type TableSlots = typeof __propDef.slots;
|
|
31
|
-
export default class Table extends SvelteComponent<TableProps, TableEvents, TableSlots> {
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
32
13
|
}
|
|
33
|
-
|
|
14
|
+
declare const Table: $$__sveltets_2_IsomorphicComponent<{
|
|
15
|
+
/**
|
|
16
|
+
* テーブルメインカラー
|
|
17
|
+
* CCLVividColorの中から指定する
|
|
18
|
+
* @default --strawberry-pink
|
|
19
|
+
* @type string
|
|
20
|
+
*/ tableColor: string;
|
|
21
|
+
/**
|
|
22
|
+
* テーブルのヘッダー
|
|
23
|
+
* 一次元配列で自由長、
|
|
24
|
+
* @type Array<string>
|
|
25
|
+
*/ dataHeader: string[];
|
|
26
|
+
/**
|
|
27
|
+
* テーブルにいれるデータ
|
|
28
|
+
* 2次元の配列で自由長
|
|
29
|
+
* @type Array<Array<string | number>>
|
|
30
|
+
*/ tableData: (string | number)[][];
|
|
31
|
+
}, {
|
|
32
|
+
[evt: string]: CustomEvent<any>;
|
|
33
|
+
}, {}, {}, string>;
|
|
34
|
+
type Table = InstanceType<typeof Table>;
|
|
35
|
+
export default Table;
|
package/dist/Tabs.svelte
CHANGED
|
@@ -1,85 +1,91 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { setContext } from 'svelte';
|
|
3
|
+
import { writable } from 'svelte/store';
|
|
4
|
+
|
|
5
|
+
import { TABS_CONTEXT_KEY } from './scripts/tabsContext';
|
|
6
|
+
|
|
7
|
+
const tabData = writable([]);
|
|
8
|
+
const activeTabLabel = writable('');
|
|
9
|
+
|
|
10
|
+
setContext(TABS_CONTEXT_KEY, {
|
|
11
|
+
addTab: (tab) => {
|
|
12
|
+
tabData.update((currentTabs) => {
|
|
13
|
+
const newTabs = [...currentTabs, tab];
|
|
14
|
+
// Set the first tab as active by default
|
|
15
|
+
if (newTabs.length === 1) {
|
|
16
|
+
activeTabLabel.set(tab.label);
|
|
17
|
+
}
|
|
18
|
+
return newTabs;
|
|
19
|
+
});
|
|
20
|
+
},
|
|
21
|
+
activeTabLabel
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
let activeColor = '--strawberry-pink';
|
|
25
|
+
$: {
|
|
26
|
+
const activeTab = $tabData.find((t) => t.label === $activeTabLabel);
|
|
27
|
+
activeColor = activeTab ? activeTab.color : '--strawberry-pink';
|
|
28
|
+
}
|
|
23
29
|
</script>
|
|
24
30
|
|
|
25
31
|
<div class="tabs-container">
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
32
|
+
<div role="tablist" class="tab-list">
|
|
33
|
+
{#each $tabData as tab}
|
|
34
|
+
<button
|
|
35
|
+
role="tab"
|
|
36
|
+
class="tab-button"
|
|
37
|
+
class:active={tab.label === $activeTabLabel}
|
|
38
|
+
aria-selected={tab.label === $activeTabLabel}
|
|
39
|
+
aria-controls={`tab-panel-${tab.label}`}
|
|
40
|
+
id={`tab-button-${tab.label}`}
|
|
41
|
+
on:click={() => activeTabLabel.set(tab.label)}
|
|
42
|
+
style="--active-color: var({tab.color});"
|
|
43
|
+
disabled={tab.disabled}
|
|
44
|
+
>
|
|
45
|
+
{tab.label}
|
|
46
|
+
</button>
|
|
47
|
+
{/each}
|
|
48
|
+
</div>
|
|
43
49
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
50
|
+
<div class="tab-content">
|
|
51
|
+
<slot />
|
|
52
|
+
</div>
|
|
47
53
|
</div>
|
|
48
54
|
|
|
49
55
|
<style>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
56
|
+
.tab-list {
|
|
57
|
+
display: flex;
|
|
58
|
+
border-bottom: 2px solid #eee;
|
|
59
|
+
}
|
|
54
60
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
.tab-button {
|
|
62
|
+
padding: 12px 24px;
|
|
63
|
+
cursor: pointer;
|
|
64
|
+
border: none;
|
|
65
|
+
background: none;
|
|
66
|
+
font-size: 1rem;
|
|
67
|
+
color: var(--wrap-grey);
|
|
68
|
+
border-bottom: 3px solid transparent;
|
|
69
|
+
margin-bottom: -2px; /* Overlap the container's border */
|
|
70
|
+
transition: border-color 0.2s ease-in-out;
|
|
71
|
+
}
|
|
66
72
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
73
|
+
.tab-button.active {
|
|
74
|
+
border-bottom-color: var(--active-color);
|
|
75
|
+
font-weight: bold;
|
|
76
|
+
color: black;
|
|
77
|
+
}
|
|
72
78
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
79
|
+
.tab-button:hover:not(.active) {
|
|
80
|
+
color: black;
|
|
81
|
+
}
|
|
76
82
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
83
|
+
.tab-content {
|
|
84
|
+
padding: 24px 8px;
|
|
85
|
+
}
|
|
80
86
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
87
|
+
.tab-button:disabled {
|
|
88
|
+
opacity: 0.6;
|
|
89
|
+
cursor: not-allowed;
|
|
90
|
+
}
|
|
85
91
|
</style>
|
package/dist/Tabs.svelte.d.ts
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
2
|
+
new (options: import('svelte').ComponentConstructorOptions<Props>): import('svelte').SvelteComponent<Props, Events, Slots> & {
|
|
3
|
+
$$bindings?: Bindings;
|
|
4
|
+
} & Exports;
|
|
5
|
+
(internal: unknown, props: {
|
|
6
|
+
$$events?: Events;
|
|
7
|
+
$$slots?: Slots;
|
|
8
|
+
}): Exports & {
|
|
9
|
+
$set?: any;
|
|
10
|
+
$on?: any;
|
|
6
11
|
};
|
|
7
|
-
|
|
8
|
-
default: {};
|
|
9
|
-
};
|
|
10
|
-
exports?: {} | undefined;
|
|
11
|
-
bindings?: string | undefined;
|
|
12
|
-
};
|
|
13
|
-
export type TabsProps = typeof __propDef.props;
|
|
14
|
-
export type TabsEvents = typeof __propDef.events;
|
|
15
|
-
export type TabsSlots = typeof __propDef.slots;
|
|
16
|
-
export default class Tabs extends SvelteComponent<TabsProps, TabsEvents, TabsSlots> {
|
|
12
|
+
z_$$bindings?: Bindings;
|
|
17
13
|
}
|
|
18
|
-
|
|
14
|
+
declare const Tabs: $$__sveltets_2_IsomorphicComponent<any, {
|
|
15
|
+
[evt: string]: CustomEvent<any>;
|
|
16
|
+
}, {
|
|
17
|
+
default: {};
|
|
18
|
+
}, {}, string>;
|
|
19
|
+
type Tabs = InstanceType<typeof Tabs>;
|
|
20
|
+
export default Tabs;
|
package/dist/Textarea.svelte
CHANGED
|
@@ -1,59 +1,108 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export let
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { CCLVividColor } from './const/config';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* ラベルのテキスト
|
|
6
|
+
* @default ''
|
|
7
|
+
* @type string
|
|
8
|
+
*/
|
|
9
|
+
export let label: string = '';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* 入力値
|
|
13
|
+
* @default ''
|
|
14
|
+
* @type string
|
|
15
|
+
*/
|
|
16
|
+
export let value: string = '';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* プレースホルダーのテキスト
|
|
20
|
+
* @default ''
|
|
21
|
+
* @type string
|
|
22
|
+
*/
|
|
23
|
+
export let placeholder: string = '';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* 枠線の色
|
|
27
|
+
* @default --strawberry-pink
|
|
28
|
+
* @type string
|
|
29
|
+
*/
|
|
30
|
+
export let borderColor: string = CCLVividColor.STRAWBERRY_PINK;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* 非活性状態にするか
|
|
34
|
+
* @default false
|
|
35
|
+
* @type boolean
|
|
36
|
+
*/
|
|
37
|
+
export let disabled: boolean = false;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* コンポーネントのID
|
|
41
|
+
* @default 'ccl-textarea'
|
|
42
|
+
* @type string
|
|
43
|
+
*/
|
|
44
|
+
export let id: string = 'ccl-textarea';
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* 行数
|
|
48
|
+
* @default 5
|
|
49
|
+
* @type number
|
|
50
|
+
*/
|
|
51
|
+
export let rows: number = 5;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* 列数
|
|
55
|
+
* @default 20
|
|
56
|
+
* @type number
|
|
57
|
+
*/
|
|
58
|
+
export let cols: number = 20;
|
|
10
59
|
</script>
|
|
11
60
|
|
|
12
61
|
<div class="textarea-wrapper">
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
62
|
+
{#if label}
|
|
63
|
+
<label for={id} class="textarea-label">{label}</label>
|
|
64
|
+
{/if}
|
|
65
|
+
<textarea
|
|
66
|
+
{id}
|
|
67
|
+
bind:value
|
|
68
|
+
{placeholder}
|
|
69
|
+
{disabled}
|
|
70
|
+
{rows}
|
|
71
|
+
{cols}
|
|
72
|
+
class="textarea-field"
|
|
73
|
+
style="--border-color: var({borderColor})"
|
|
74
|
+
/>
|
|
26
75
|
</div>
|
|
27
76
|
|
|
28
77
|
<style>
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
78
|
+
.textarea-wrapper {
|
|
79
|
+
display: flex;
|
|
80
|
+
flex-direction: column;
|
|
81
|
+
gap: 8px;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.textarea-label {
|
|
85
|
+
font-size: 14px;
|
|
86
|
+
color: var(--wrap-grey);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.textarea-field {
|
|
90
|
+
padding: 10px 15px;
|
|
91
|
+
border-radius: 8px;
|
|
92
|
+
border: 2px solid var(--border-color);
|
|
93
|
+
font-size: 16px;
|
|
94
|
+
outline: none;
|
|
95
|
+
transition: border-color 0.2s;
|
|
96
|
+
resize: vertical; /* 垂直方向のみリサイズ可能 */
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.textarea-field:focus {
|
|
100
|
+
border-color: var(--ccl-focus-color, var(--soda-blue)); /* フォーカス時の色を定義 */
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.textarea-field:disabled {
|
|
104
|
+
background-color: var(--cloud-grey);
|
|
105
|
+
cursor: not-allowed;
|
|
106
|
+
border-color: var(--cloud-grey);
|
|
107
|
+
}
|
|
59
108
|
</style>
|