@14ch/svelte-ui 0.0.12 → 0.0.14
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/assets/styles/variables.scss +2 -8
- package/dist/components/Button.svelte +104 -76
- package/dist/components/Button.svelte.d.ts +7 -5
- package/dist/components/Checkbox.svelte +80 -80
- package/dist/components/Checkbox.svelte.d.ts +4 -4
- package/dist/components/CheckboxGroup.svelte +48 -29
- package/dist/components/CheckboxGroup.svelte.d.ts +3 -3
- package/dist/components/ColorPicker.svelte +65 -64
- package/dist/components/ColorPicker.svelte.d.ts +5 -5
- package/dist/components/Combobox.svelte +97 -83
- package/dist/components/Combobox.svelte.d.ts +3 -3
- package/dist/components/ConfirmDialog.svelte +26 -28
- package/dist/components/ConfirmDialog.svelte.d.ts +3 -3
- package/dist/components/Datepicker.svelte +201 -97
- package/dist/components/Datepicker.svelte.d.ts +10 -7
- package/dist/components/DatepickerCalendar.svelte +24 -19
- package/dist/components/DatepickerCalendar.svelte.d.ts +3 -3
- package/dist/components/Dialog.svelte +30 -28
- package/dist/components/Dialog.svelte.d.ts +2 -2
- package/dist/components/Drawer.svelte +32 -30
- package/dist/components/Drawer.svelte.d.ts +2 -2
- package/dist/components/Fab.svelte +81 -62
- package/dist/components/Fab.svelte.d.ts +10 -6
- package/dist/components/FileUploader.svelte +52 -50
- package/dist/components/FileUploader.svelte.d.ts +3 -3
- package/dist/components/Icon.svelte +29 -27
- package/dist/components/Icon.svelte.d.ts +2 -2
- package/dist/components/IconButton.svelte +83 -80
- package/dist/components/IconButton.svelte.d.ts +6 -5
- package/dist/components/ImageUploader.svelte +54 -52
- package/dist/components/ImageUploader.svelte.d.ts +3 -3
- package/dist/components/ImageUploaderPreview.svelte +33 -20
- package/dist/components/ImageUploaderPreview.svelte.d.ts +2 -2
- package/dist/components/Input.svelte +100 -94
- package/dist/components/Input.svelte.d.ts +6 -5
- package/dist/components/LoadingSpinner.svelte +14 -13
- package/dist/components/LoadingSpinner.svelte.d.ts +2 -2
- package/dist/components/Modal.svelte +26 -24
- package/dist/components/Modal.svelte.d.ts +2 -2
- package/dist/components/Pagination.svelte +20 -28
- package/dist/components/Pagination.svelte.d.ts +2 -2
- package/dist/components/Popup.svelte +111 -124
- package/dist/components/Popup.svelte.d.ts +6 -6
- package/dist/components/PopupMenu.svelte +109 -125
- package/dist/components/PopupMenu.svelte.d.ts +5 -5
- package/dist/components/PopupMenuButton.svelte +67 -80
- package/dist/components/PopupMenuButton.svelte.d.ts +7 -6
- package/dist/components/Radio.svelte +65 -64
- package/dist/components/Radio.svelte.d.ts +3 -3
- package/dist/components/RadioGroup.svelte +39 -27
- package/dist/components/RadioGroup.svelte.d.ts +3 -3
- package/dist/components/SegmentedControl.svelte +72 -71
- package/dist/components/SegmentedControl.svelte.d.ts +4 -4
- package/dist/components/Select.svelte +66 -66
- package/dist/components/Select.svelte.d.ts +3 -3
- package/dist/components/Slider.svelte +67 -67
- package/dist/components/Slider.svelte.d.ts +5 -5
- package/dist/components/Snackbar.svelte +11 -9
- package/dist/components/Snackbar.svelte.d.ts +5 -4
- package/dist/components/SnackbarItem.svelte +29 -28
- package/dist/components/SnackbarItem.svelte.d.ts +6 -5
- package/dist/components/Switch.svelte +64 -66
- package/dist/components/Switch.svelte.d.ts +4 -4
- package/dist/components/Tab.svelte +31 -20
- package/dist/components/Tab.svelte.d.ts +3 -2
- package/dist/components/TabItem.svelte +22 -21
- package/dist/components/TabItem.svelte.d.ts +2 -2
- package/dist/components/Textarea.svelte +94 -92
- package/dist/components/Textarea.svelte.d.ts +8 -7
- package/dist/components/skeleton/Skeleton.svelte +16 -14
- package/dist/components/skeleton/Skeleton.svelte.d.ts +2 -2
- package/dist/components/skeleton/SkeletonAvatar.svelte +30 -36
- package/dist/components/skeleton/SkeletonAvatar.svelte.d.ts +8 -4
- package/dist/components/skeleton/SkeletonBox.svelte +11 -11
- package/dist/components/skeleton/SkeletonBox.svelte.d.ts +2 -2
- package/dist/components/skeleton/SkeletonButton.svelte +26 -19
- package/dist/components/skeleton/SkeletonButton.svelte.d.ts +7 -4
- package/dist/components/skeleton/SkeletonHeading.svelte +17 -23
- package/dist/components/skeleton/SkeletonHeading.svelte.d.ts +5 -4
- package/dist/components/skeleton/SkeletonMedia.svelte +37 -45
- package/dist/components/skeleton/SkeletonMedia.svelte.d.ts +10 -4
- package/dist/components/skeleton/SkeletonText.svelte +18 -24
- package/dist/components/skeleton/SkeletonText.svelte.d.ts +6 -4
- package/dist/i18n/index.d.ts +143 -5
- package/dist/i18n/index.js +20 -32
- package/dist/i18n/locales/de.d.ts +35 -0
- package/dist/i18n/locales/de.js +35 -0
- package/dist/i18n/locales/es.d.ts +35 -0
- package/dist/i18n/locales/es.js +35 -0
- package/dist/i18n/locales/fr.d.ts +35 -0
- package/dist/i18n/locales/fr.js +35 -0
- package/dist/i18n/locales/zh-cn.d.ts +35 -0
- package/dist/i18n/locales/zh-cn.js +35 -0
- package/dist/index.d.ts +46 -2
- package/dist/index.js +1 -0
- package/dist/types/menuItem.d.ts +1 -1
- package/dist/types/propOptions.d.ts +54 -0
- package/dist/types/propOptions.js +5 -0
- package/dist/utils/formatText.js +4 -1
- package/dist/utils/popupManager.d.ts +26 -0
- package/dist/utils/popupManager.js +34 -0
- package/package.json +1 -1
- /package/dist/types/{eventHandlers.d.ts → callbackHandlers.d.ts} +0 -0
- /package/dist/types/{eventHandlers.js → callbackHandlers.js} +0 -0
|
@@ -20,6 +20,36 @@
|
|
|
20
20
|
// =========================================================================
|
|
21
21
|
// Props, States & Constants
|
|
22
22
|
// =========================================================================
|
|
23
|
+
export type DrawerProps = {
|
|
24
|
+
// Snippet
|
|
25
|
+
header?: Snippet;
|
|
26
|
+
children?: Snippet;
|
|
27
|
+
footer?: Snippet;
|
|
28
|
+
|
|
29
|
+
// 基本プロパティ
|
|
30
|
+
title?: string;
|
|
31
|
+
description?: string;
|
|
32
|
+
|
|
33
|
+
// HTML属性
|
|
34
|
+
id?: string;
|
|
35
|
+
|
|
36
|
+
// スタイル/レイアウト
|
|
37
|
+
width?: string | number;
|
|
38
|
+
position?: 'left' | 'right';
|
|
39
|
+
bodyStyle?: string;
|
|
40
|
+
noPadding?: boolean;
|
|
41
|
+
|
|
42
|
+
// 状態/動作
|
|
43
|
+
isOpen?: boolean;
|
|
44
|
+
scrollable?: boolean;
|
|
45
|
+
closeIfClickOutside?: boolean;
|
|
46
|
+
restoreFocus?: boolean;
|
|
47
|
+
|
|
48
|
+
// ARIA/アクセシビリティ
|
|
49
|
+
ariaLabel?: string;
|
|
50
|
+
ariaDescribedby?: string;
|
|
51
|
+
};
|
|
52
|
+
|
|
23
53
|
let {
|
|
24
54
|
// Snippet
|
|
25
55
|
header,
|
|
@@ -48,35 +78,7 @@
|
|
|
48
78
|
// ARIA/アクセシビリティ
|
|
49
79
|
ariaLabel = 'Drawer',
|
|
50
80
|
ariaDescribedby
|
|
51
|
-
}:
|
|
52
|
-
// Snippet
|
|
53
|
-
header?: Snippet;
|
|
54
|
-
children?: Snippet;
|
|
55
|
-
footer?: Snippet;
|
|
56
|
-
|
|
57
|
-
// 基本プロパティ
|
|
58
|
-
title?: string;
|
|
59
|
-
description?: string;
|
|
60
|
-
|
|
61
|
-
// HTML属性
|
|
62
|
-
id?: string;
|
|
63
|
-
|
|
64
|
-
// スタイル/レイアウト
|
|
65
|
-
width?: string | number;
|
|
66
|
-
position?: 'left' | 'right';
|
|
67
|
-
bodyStyle?: string;
|
|
68
|
-
noPadding?: boolean;
|
|
69
|
-
|
|
70
|
-
// 状態/動作
|
|
71
|
-
isOpen?: boolean;
|
|
72
|
-
scrollable?: boolean;
|
|
73
|
-
closeIfClickOutside?: boolean;
|
|
74
|
-
restoreFocus?: boolean;
|
|
75
|
-
|
|
76
|
-
// ARIA/アクセシビリティ
|
|
77
|
-
ariaLabel?: string;
|
|
78
|
-
ariaDescribedby?: string;
|
|
79
|
-
} = $props();
|
|
81
|
+
}: DrawerProps = $props();
|
|
80
82
|
|
|
81
83
|
let modalRef: Modal;
|
|
82
84
|
|
|
@@ -308,7 +310,7 @@
|
|
|
308
310
|
align-items: center;
|
|
309
311
|
justify-content: stretch;
|
|
310
312
|
min-height: var(--svelte-ui-drawer-header-height);
|
|
311
|
-
padding: var(--svelte-ui-drawer-padding);
|
|
313
|
+
padding: var(--svelte-ui-drawer-header-padding);
|
|
312
314
|
margin-bottom: calc(0px - var(--svelte-ui-drawer-body-padding));
|
|
313
315
|
}
|
|
314
316
|
.drawer__header .drawer__title {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* This prevents state synchronization bugs and ensures consistent behavior.
|
|
12
12
|
*/
|
|
13
13
|
import type { Snippet } from 'svelte';
|
|
14
|
-
type
|
|
14
|
+
export type DrawerProps = {
|
|
15
15
|
header?: Snippet;
|
|
16
16
|
children?: Snippet;
|
|
17
17
|
footer?: Snippet;
|
|
@@ -29,7 +29,7 @@ type $$ComponentProps = {
|
|
|
29
29
|
ariaLabel?: string;
|
|
30
30
|
ariaDescribedby?: string;
|
|
31
31
|
};
|
|
32
|
-
declare const Drawer: import("svelte").Component
|
|
32
|
+
declare const Drawer: import("svelte").Component<DrawerProps, {
|
|
33
33
|
open: () => void;
|
|
34
34
|
close: () => void;
|
|
35
35
|
toggle: () => void;
|
|
@@ -4,19 +4,79 @@
|
|
|
4
4
|
import type { Snippet } from 'svelte';
|
|
5
5
|
import type { HTMLButtonAttributes } from 'svelte/elements';
|
|
6
6
|
import type { IconVariant, IconWeight, IconGrade, IconOpticalSize } from '../types/icon';
|
|
7
|
-
import Icon from './Icon.svelte';
|
|
8
|
-
import LoadingSpinner from './LoadingSpinner.svelte';
|
|
9
7
|
import type {
|
|
10
8
|
FocusHandler,
|
|
11
9
|
KeyboardHandler,
|
|
12
10
|
MouseHandler,
|
|
13
11
|
TouchHandler,
|
|
14
12
|
PointerHandler
|
|
15
|
-
} from '../types/
|
|
13
|
+
} from '../types/callbackHandlers';
|
|
14
|
+
import type { ButtonVariant, FabPosition } from '../types/propOptions';
|
|
15
|
+
import Icon from './Icon.svelte';
|
|
16
|
+
import LoadingSpinner from './LoadingSpinner.svelte';
|
|
17
|
+
import { getStyleFromNumber } from '../utils/style';
|
|
16
18
|
|
|
17
19
|
// =========================================================================
|
|
18
20
|
// Props, States & Constants
|
|
19
21
|
// =========================================================================
|
|
22
|
+
export type FabProps = {
|
|
23
|
+
children?: Snippet;
|
|
24
|
+
buttonAttributes?: HTMLButtonAttributes | undefined;
|
|
25
|
+
type?: HTMLButtonAttributes['type'];
|
|
26
|
+
customStyle?: HTMLButtonAttributes['style'];
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
loading?: boolean;
|
|
29
|
+
icon?: string;
|
|
30
|
+
iconFilled?: boolean;
|
|
31
|
+
iconWeight?: IconWeight;
|
|
32
|
+
iconGrade?: IconGrade;
|
|
33
|
+
iconOpticalSize?: IconOpticalSize;
|
|
34
|
+
iconVariant?: IconVariant;
|
|
35
|
+
color?: string;
|
|
36
|
+
variant?: ButtonVariant;
|
|
37
|
+
position?: FabPosition;
|
|
38
|
+
bottomOffset?: string | number;
|
|
39
|
+
sideOffset?: string | number;
|
|
40
|
+
useSafeArea?: boolean;
|
|
41
|
+
shadow?: boolean;
|
|
42
|
+
reducedMotion?: boolean;
|
|
43
|
+
ariaLabel?: string;
|
|
44
|
+
ariaDescribedby?: string;
|
|
45
|
+
// フォーカスイベント
|
|
46
|
+
onfocus?: FocusHandler;
|
|
47
|
+
onblur?: FocusHandler;
|
|
48
|
+
|
|
49
|
+
// キーボードイベント
|
|
50
|
+
onkeydown?: KeyboardHandler;
|
|
51
|
+
onkeyup?: KeyboardHandler;
|
|
52
|
+
|
|
53
|
+
// マウスイベント
|
|
54
|
+
onclick?: MouseHandler;
|
|
55
|
+
onmousedown?: MouseHandler;
|
|
56
|
+
onmouseup?: MouseHandler;
|
|
57
|
+
onmouseenter?: MouseHandler;
|
|
58
|
+
onmouseleave?: MouseHandler;
|
|
59
|
+
onmouseover?: MouseHandler;
|
|
60
|
+
onmouseout?: MouseHandler;
|
|
61
|
+
oncontextmenu?: MouseHandler;
|
|
62
|
+
onauxclick?: MouseHandler;
|
|
63
|
+
|
|
64
|
+
// タッチイベント
|
|
65
|
+
ontouchstart?: TouchHandler;
|
|
66
|
+
ontouchend?: TouchHandler;
|
|
67
|
+
ontouchmove?: TouchHandler;
|
|
68
|
+
ontouchcancel?: TouchHandler;
|
|
69
|
+
|
|
70
|
+
// ポインターイベント
|
|
71
|
+
onpointerdown?: PointerHandler;
|
|
72
|
+
onpointerup?: PointerHandler;
|
|
73
|
+
onpointerenter?: PointerHandler;
|
|
74
|
+
onpointerleave?: PointerHandler;
|
|
75
|
+
onpointermove?: PointerHandler;
|
|
76
|
+
onpointercancel?: PointerHandler;
|
|
77
|
+
[key: string]: any;
|
|
78
|
+
};
|
|
79
|
+
|
|
20
80
|
let {
|
|
21
81
|
// Snippet
|
|
22
82
|
children,
|
|
@@ -30,7 +90,10 @@
|
|
|
30
90
|
color,
|
|
31
91
|
variant = 'filled',
|
|
32
92
|
position = 'right',
|
|
33
|
-
|
|
93
|
+
bottomOffset = 24,
|
|
94
|
+
sideOffset = 24,
|
|
95
|
+
useSafeArea = true,
|
|
96
|
+
shadow = false,
|
|
34
97
|
|
|
35
98
|
// アイコン関連
|
|
36
99
|
icon = '',
|
|
@@ -84,60 +147,7 @@
|
|
|
84
147
|
|
|
85
148
|
// その他
|
|
86
149
|
...restProps
|
|
87
|
-
}:
|
|
88
|
-
children?: Snippet;
|
|
89
|
-
buttonAttributes?: HTMLButtonAttributes | undefined;
|
|
90
|
-
type?: HTMLButtonAttributes['type'];
|
|
91
|
-
customStyle?: HTMLButtonAttributes['style'];
|
|
92
|
-
disabled?: boolean;
|
|
93
|
-
loading?: boolean;
|
|
94
|
-
icon?: string;
|
|
95
|
-
iconFilled?: boolean;
|
|
96
|
-
iconWeight?: IconWeight;
|
|
97
|
-
iconGrade?: IconGrade;
|
|
98
|
-
iconOpticalSize?: IconOpticalSize;
|
|
99
|
-
iconVariant?: IconVariant;
|
|
100
|
-
color?: string;
|
|
101
|
-
variant?: 'ghost' | 'filled' | 'outlined' | 'glass';
|
|
102
|
-
position?: 'left' | 'center' | 'right';
|
|
103
|
-
hasShadow?: boolean;
|
|
104
|
-
reducedMotion?: boolean;
|
|
105
|
-
ariaLabel?: string;
|
|
106
|
-
ariaDescribedby?: string;
|
|
107
|
-
// フォーカスイベント
|
|
108
|
-
onfocus?: FocusHandler;
|
|
109
|
-
onblur?: FocusHandler;
|
|
110
|
-
|
|
111
|
-
// キーボードイベント
|
|
112
|
-
onkeydown?: KeyboardHandler;
|
|
113
|
-
onkeyup?: KeyboardHandler;
|
|
114
|
-
|
|
115
|
-
// マウスイベント
|
|
116
|
-
onclick?: MouseHandler;
|
|
117
|
-
onmousedown?: MouseHandler;
|
|
118
|
-
onmouseup?: MouseHandler;
|
|
119
|
-
onmouseenter?: MouseHandler;
|
|
120
|
-
onmouseleave?: MouseHandler;
|
|
121
|
-
onmouseover?: MouseHandler;
|
|
122
|
-
onmouseout?: MouseHandler;
|
|
123
|
-
oncontextmenu?: MouseHandler;
|
|
124
|
-
onauxclick?: MouseHandler;
|
|
125
|
-
|
|
126
|
-
// タッチイベント
|
|
127
|
-
ontouchstart?: TouchHandler;
|
|
128
|
-
ontouchend?: TouchHandler;
|
|
129
|
-
ontouchmove?: TouchHandler;
|
|
130
|
-
ontouchcancel?: TouchHandler;
|
|
131
|
-
|
|
132
|
-
// ポインターイベント
|
|
133
|
-
onpointerdown?: PointerHandler;
|
|
134
|
-
onpointerup?: PointerHandler;
|
|
135
|
-
onpointerenter?: PointerHandler;
|
|
136
|
-
onpointerleave?: PointerHandler;
|
|
137
|
-
onpointermove?: PointerHandler;
|
|
138
|
-
onpointercancel?: PointerHandler;
|
|
139
|
-
[key: string]: any;
|
|
140
|
-
} = $props();
|
|
150
|
+
}: FabProps = $props();
|
|
141
151
|
|
|
142
152
|
// =========================================================================
|
|
143
153
|
// Methods
|
|
@@ -275,6 +285,9 @@
|
|
|
275
285
|
});
|
|
276
286
|
|
|
277
287
|
const hasLabel = $derived(children !== undefined);
|
|
288
|
+
|
|
289
|
+
const bottomOffsetStyle = $derived(getStyleFromNumber(bottomOffset));
|
|
290
|
+
const sideOffsetStyle = $derived(getStyleFromNumber(sideOffset));
|
|
278
291
|
</script>
|
|
279
292
|
|
|
280
293
|
<button
|
|
@@ -290,10 +303,13 @@
|
|
|
290
303
|
class:fab--left={position === 'left'}
|
|
291
304
|
class:fab--center={position === 'center'}
|
|
292
305
|
class:fab--right={position === 'right'}
|
|
293
|
-
class:fab--
|
|
306
|
+
class:fab--safe-area={useSafeArea}
|
|
307
|
+
class:fab--shadow={shadow}
|
|
294
308
|
class:fab--loading={loading}
|
|
295
309
|
class:fab--no-motion={reducedMotion}
|
|
296
310
|
style="color: {textColors[variant]}; background-color: {backgroundColors[variant]};
|
|
311
|
+
--fab-bottom: {bottomOffsetStyle};
|
|
312
|
+
--fab-side: {sideOffsetStyle};
|
|
297
313
|
{customStyle ?? ''};"
|
|
298
314
|
onclick={handleClick}
|
|
299
315
|
onfocus={handleFocus}
|
|
@@ -352,7 +368,7 @@
|
|
|
352
368
|
justify-content: center;
|
|
353
369
|
align-items: center;
|
|
354
370
|
position: fixed;
|
|
355
|
-
bottom:
|
|
371
|
+
bottom: var(--fab-bottom, 24px);
|
|
356
372
|
height: 56px;
|
|
357
373
|
padding: 0 20px;
|
|
358
374
|
background-color: transparent;
|
|
@@ -369,14 +385,17 @@
|
|
|
369
385
|
transition-duration: var(--svelte-ui-transition-duration);
|
|
370
386
|
}
|
|
371
387
|
.fab.fab--left {
|
|
372
|
-
left: 24px;
|
|
388
|
+
left: var(--fab-side, 24px);
|
|
373
389
|
}
|
|
374
390
|
.fab.fab--center {
|
|
375
391
|
left: 50%;
|
|
376
392
|
transform: translateX(-50%);
|
|
377
393
|
}
|
|
378
394
|
.fab.fab--right {
|
|
379
|
-
right: 24px;
|
|
395
|
+
right: var(--fab-side, 24px);
|
|
396
|
+
}
|
|
397
|
+
.fab.fab--safe-area {
|
|
398
|
+
bottom: calc(var(--fab-bottom, 24px) + env(safe-area-inset-bottom, 0px));
|
|
380
399
|
}
|
|
381
400
|
.fab > * {
|
|
382
401
|
z-index: 1;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
2
|
import type { HTMLButtonAttributes } from 'svelte/elements';
|
|
3
3
|
import type { IconVariant, IconWeight, IconGrade, IconOpticalSize } from '../types/icon';
|
|
4
|
-
import type { FocusHandler, KeyboardHandler, MouseHandler, TouchHandler, PointerHandler } from '../types/
|
|
5
|
-
type
|
|
4
|
+
import type { FocusHandler, KeyboardHandler, MouseHandler, TouchHandler, PointerHandler } from '../types/callbackHandlers';
|
|
5
|
+
import type { ButtonVariant, FabPosition } from '../types/propOptions';
|
|
6
|
+
export type FabProps = {
|
|
6
7
|
children?: Snippet;
|
|
7
8
|
buttonAttributes?: HTMLButtonAttributes | undefined;
|
|
8
9
|
type?: HTMLButtonAttributes['type'];
|
|
@@ -16,9 +17,12 @@ type $$ComponentProps = {
|
|
|
16
17
|
iconOpticalSize?: IconOpticalSize;
|
|
17
18
|
iconVariant?: IconVariant;
|
|
18
19
|
color?: string;
|
|
19
|
-
variant?:
|
|
20
|
-
position?:
|
|
21
|
-
|
|
20
|
+
variant?: ButtonVariant;
|
|
21
|
+
position?: FabPosition;
|
|
22
|
+
bottomOffset?: string | number;
|
|
23
|
+
sideOffset?: string | number;
|
|
24
|
+
useSafeArea?: boolean;
|
|
25
|
+
shadow?: boolean;
|
|
22
26
|
reducedMotion?: boolean;
|
|
23
27
|
ariaLabel?: string;
|
|
24
28
|
ariaDescribedby?: string;
|
|
@@ -47,6 +51,6 @@ type $$ComponentProps = {
|
|
|
47
51
|
onpointercancel?: PointerHandler;
|
|
48
52
|
[key: string]: any;
|
|
49
53
|
};
|
|
50
|
-
declare const Fab: import("svelte").Component
|
|
54
|
+
declare const Fab: import("svelte").Component<FabProps, {}, "">;
|
|
51
55
|
type Fab = ReturnType<typeof Fab>;
|
|
52
56
|
export default Fab;
|
|
@@ -14,11 +14,61 @@
|
|
|
14
14
|
MouseHandler,
|
|
15
15
|
TouchHandler,
|
|
16
16
|
PointerHandler
|
|
17
|
-
} from '../types/
|
|
17
|
+
} from '../types/callbackHandlers';
|
|
18
18
|
|
|
19
19
|
// =========================================================================
|
|
20
20
|
// Props, States & Constants
|
|
21
21
|
// =========================================================================
|
|
22
|
+
export type FileUploaderProps = {
|
|
23
|
+
// 基本プロパティ
|
|
24
|
+
value: FileList | null | undefined;
|
|
25
|
+
multiple?: boolean;
|
|
26
|
+
maxFileSize?: number;
|
|
27
|
+
placeholder?: string;
|
|
28
|
+
|
|
29
|
+
// HTML属性系
|
|
30
|
+
id?: string;
|
|
31
|
+
accept?: string;
|
|
32
|
+
|
|
33
|
+
// スタイル/レイアウト
|
|
34
|
+
width?: string | number;
|
|
35
|
+
height?: string | number;
|
|
36
|
+
rounded?: boolean;
|
|
37
|
+
|
|
38
|
+
// アイコン系
|
|
39
|
+
icon?: string;
|
|
40
|
+
iconSize?: number;
|
|
41
|
+
iconFilled?: boolean;
|
|
42
|
+
iconWeight?: IconWeight;
|
|
43
|
+
iconGrade?: IconGrade;
|
|
44
|
+
iconOpticalSize?: IconOpticalSize;
|
|
45
|
+
iconVariant?: IconVariant;
|
|
46
|
+
removeFileAriaLabel?: string;
|
|
47
|
+
|
|
48
|
+
// 入力イベント
|
|
49
|
+
onchange?: BivariantValueHandler<FileList | null | undefined>;
|
|
50
|
+
|
|
51
|
+
// フォーカスイベント
|
|
52
|
+
onfocus?: FocusHandler;
|
|
53
|
+
onblur?: FocusHandler;
|
|
54
|
+
|
|
55
|
+
// キーボードイベント
|
|
56
|
+
onkeydown?: KeyboardHandler;
|
|
57
|
+
onkeyup?: KeyboardHandler;
|
|
58
|
+
|
|
59
|
+
// マウスイベント
|
|
60
|
+
onmouseenter?: MouseHandler;
|
|
61
|
+
onmouseleave?: MouseHandler;
|
|
62
|
+
|
|
63
|
+
// タッチイベント
|
|
64
|
+
ontouchstart?: TouchHandler;
|
|
65
|
+
ontouchend?: TouchHandler;
|
|
66
|
+
|
|
67
|
+
// ポインターイベント
|
|
68
|
+
onpointerenter?: PointerHandler;
|
|
69
|
+
onpointerleave?: PointerHandler;
|
|
70
|
+
};
|
|
71
|
+
|
|
22
72
|
let {
|
|
23
73
|
// 基本プロパティ
|
|
24
74
|
value = $bindable(),
|
|
@@ -67,55 +117,7 @@
|
|
|
67
117
|
// ポインターイベント
|
|
68
118
|
onpointerenter = () => {}, // No params for type inference
|
|
69
119
|
onpointerleave = () => {} // No params for type inference
|
|
70
|
-
}:
|
|
71
|
-
// 基本プロパティ
|
|
72
|
-
value: FileList | null | undefined;
|
|
73
|
-
multiple?: boolean;
|
|
74
|
-
maxFileSize?: number;
|
|
75
|
-
placeholder?: string;
|
|
76
|
-
|
|
77
|
-
// HTML属性系
|
|
78
|
-
id?: string;
|
|
79
|
-
accept?: string;
|
|
80
|
-
|
|
81
|
-
// スタイル/レイアウト
|
|
82
|
-
width?: string | number;
|
|
83
|
-
height?: string | number;
|
|
84
|
-
rounded?: boolean;
|
|
85
|
-
|
|
86
|
-
// アイコン系
|
|
87
|
-
icon?: string;
|
|
88
|
-
iconSize?: number;
|
|
89
|
-
iconFilled?: boolean;
|
|
90
|
-
iconWeight?: IconWeight;
|
|
91
|
-
iconGrade?: IconGrade;
|
|
92
|
-
iconOpticalSize?: IconOpticalSize;
|
|
93
|
-
iconVariant?: IconVariant;
|
|
94
|
-
removeFileAriaLabel?: string;
|
|
95
|
-
|
|
96
|
-
// 入力イベント
|
|
97
|
-
onchange?: BivariantValueHandler<FileList | null | undefined>;
|
|
98
|
-
|
|
99
|
-
// フォーカスイベント
|
|
100
|
-
onfocus?: FocusHandler;
|
|
101
|
-
onblur?: FocusHandler;
|
|
102
|
-
|
|
103
|
-
// キーボードイベント
|
|
104
|
-
onkeydown?: KeyboardHandler;
|
|
105
|
-
onkeyup?: KeyboardHandler;
|
|
106
|
-
|
|
107
|
-
// マウスイベント
|
|
108
|
-
onmouseenter?: MouseHandler;
|
|
109
|
-
onmouseleave?: MouseHandler;
|
|
110
|
-
|
|
111
|
-
// タッチイベント
|
|
112
|
-
ontouchstart?: TouchHandler;
|
|
113
|
-
ontouchend?: TouchHandler;
|
|
114
|
-
|
|
115
|
-
// ポインターイベント
|
|
116
|
-
onpointerenter?: PointerHandler;
|
|
117
|
-
onpointerleave?: PointerHandler;
|
|
118
|
-
} = $props();
|
|
120
|
+
}: FileUploaderProps = $props();
|
|
119
121
|
|
|
120
122
|
let dropAreaRef: HTMLButtonElement;
|
|
121
123
|
let fileInputRef: HTMLInputElement;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { IconVariant, IconWeight, IconGrade, IconOpticalSize } from '../types/icon';
|
|
2
|
-
import type { BivariantValueHandler, FocusHandler, KeyboardHandler, MouseHandler, TouchHandler, PointerHandler } from '../types/
|
|
3
|
-
type
|
|
2
|
+
import type { BivariantValueHandler, FocusHandler, KeyboardHandler, MouseHandler, TouchHandler, PointerHandler } from '../types/callbackHandlers';
|
|
3
|
+
export type FileUploaderProps = {
|
|
4
4
|
value: FileList | null | undefined;
|
|
5
5
|
multiple?: boolean;
|
|
6
6
|
maxFileSize?: number;
|
|
@@ -30,7 +30,7 @@ type $$ComponentProps = {
|
|
|
30
30
|
onpointerenter?: PointerHandler;
|
|
31
31
|
onpointerleave?: PointerHandler;
|
|
32
32
|
};
|
|
33
|
-
declare const FileUploader: import("svelte").Component
|
|
33
|
+
declare const FileUploader: import("svelte").Component<FileUploaderProps, {
|
|
34
34
|
reset: () => void;
|
|
35
35
|
}, "value">;
|
|
36
36
|
type FileUploader = ReturnType<typeof FileUploader>;
|
|
@@ -8,6 +8,34 @@
|
|
|
8
8
|
// =========================================================================
|
|
9
9
|
// Props, States & Constants
|
|
10
10
|
// =========================================================================
|
|
11
|
+
export type IconProps = {
|
|
12
|
+
// Snippet
|
|
13
|
+
children: Snippet;
|
|
14
|
+
|
|
15
|
+
// 基本プロパティ
|
|
16
|
+
title?: string;
|
|
17
|
+
fallbackText?: string;
|
|
18
|
+
|
|
19
|
+
// スタイル/レイアウト
|
|
20
|
+
size?: number;
|
|
21
|
+
color?: string;
|
|
22
|
+
customStyle?: string;
|
|
23
|
+
|
|
24
|
+
// アイコン関連
|
|
25
|
+
filled?: boolean;
|
|
26
|
+
weight?: IconWeight;
|
|
27
|
+
grade?: IconGrade;
|
|
28
|
+
opticalSize?: IconOpticalSize;
|
|
29
|
+
variant?: IconVariant;
|
|
30
|
+
|
|
31
|
+
// ARIA/アクセシビリティ
|
|
32
|
+
ariaLabel?: string;
|
|
33
|
+
decorative?: boolean;
|
|
34
|
+
|
|
35
|
+
// その他
|
|
36
|
+
[key: string]: any;
|
|
37
|
+
};
|
|
38
|
+
|
|
11
39
|
let {
|
|
12
40
|
// Snippet
|
|
13
41
|
children,
|
|
@@ -34,33 +62,7 @@
|
|
|
34
62
|
|
|
35
63
|
// その他
|
|
36
64
|
...restProps
|
|
37
|
-
}:
|
|
38
|
-
// Snippet
|
|
39
|
-
children: Snippet;
|
|
40
|
-
|
|
41
|
-
// 基本プロパティ
|
|
42
|
-
title?: string;
|
|
43
|
-
fallbackText?: string;
|
|
44
|
-
|
|
45
|
-
// スタイル/レイアウト
|
|
46
|
-
size?: number;
|
|
47
|
-
color?: string;
|
|
48
|
-
customStyle?: string;
|
|
49
|
-
|
|
50
|
-
// アイコン関連
|
|
51
|
-
filled?: boolean;
|
|
52
|
-
weight?: IconWeight;
|
|
53
|
-
grade?: IconGrade;
|
|
54
|
-
opticalSize?: IconOpticalSize;
|
|
55
|
-
variant?: IconVariant;
|
|
56
|
-
|
|
57
|
-
// ARIA/アクセシビリティ
|
|
58
|
-
ariaLabel?: string;
|
|
59
|
-
decorative?: boolean;
|
|
60
|
-
|
|
61
|
-
// その他
|
|
62
|
-
[key: string]: any;
|
|
63
|
-
} = $props();
|
|
65
|
+
}: IconProps = $props();
|
|
64
66
|
|
|
65
67
|
// =========================================================================
|
|
66
68
|
// $derived
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Snippet } from 'svelte';
|
|
2
2
|
import type { IconVariant, IconWeight, IconGrade, IconOpticalSize } from '../types/icon';
|
|
3
|
-
type
|
|
3
|
+
export type IconProps = {
|
|
4
4
|
children: Snippet;
|
|
5
5
|
title?: string;
|
|
6
6
|
fallbackText?: string;
|
|
@@ -16,6 +16,6 @@ type $$ComponentProps = {
|
|
|
16
16
|
decorative?: boolean;
|
|
17
17
|
[key: string]: any;
|
|
18
18
|
};
|
|
19
|
-
declare const Icon: import("svelte").Component
|
|
19
|
+
declare const Icon: import("svelte").Component<IconProps, {}, "">;
|
|
20
20
|
type Icon = ReturnType<typeof Icon>;
|
|
21
21
|
export default Icon;
|