@14ch/svelte-ui 0.0.16 → 0.0.17
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/optional/reset.scss +4 -4
- package/dist/assets/styles/variables.scss +80 -15
- package/dist/components/Button.svelte +10 -12
- package/dist/components/Checkbox.svelte +8 -14
- package/dist/components/ColorPicker.svelte +29 -18
- package/dist/components/ColorPicker.svelte.d.ts +4 -0
- package/dist/components/Combobox.svelte +33 -15
- package/dist/components/Combobox.svelte.d.ts +3 -2
- package/dist/components/ConfirmDialog.svelte +3 -4
- package/dist/components/ConfirmDialog.svelte.d.ts +1 -0
- package/dist/components/Datepicker.svelte +47 -22
- package/dist/components/Datepicker.svelte.d.ts +5 -3
- package/dist/components/Dialog.svelte +1 -5
- package/dist/components/Drawer.svelte +2 -3
- package/dist/components/Fab.svelte +7 -8
- package/dist/components/FileUploader.svelte +2 -1
- package/dist/components/IconButton.svelte +18 -13
- package/dist/components/Input.svelte +46 -45
- package/dist/components/Input.svelte.d.ts +0 -1
- package/dist/components/Pagination.svelte +3 -3
- package/dist/components/Popup.svelte +3 -4
- package/dist/components/PopupMenuButton.svelte +6 -4
- package/dist/components/Radio.svelte +7 -6
- package/dist/components/SegmentedControl.svelte +5 -1
- package/dist/components/Select.svelte +9 -6
- package/dist/components/Select.svelte.d.ts +1 -0
- package/dist/components/Slider.svelte +5 -1
- package/dist/components/Slider.svelte.d.ts +1 -0
- package/dist/components/Snackbar.svelte +3 -4
- package/dist/components/SnackbarItem.svelte +9 -4
- package/dist/components/Switch.svelte +8 -6
- package/dist/components/Tab.svelte +28 -13
- package/dist/components/TabItem.svelte +89 -40
- package/dist/components/TabItem.svelte.d.ts +4 -3
- package/dist/components/Textarea.svelte +39 -37
- package/dist/components/Textarea.svelte.d.ts +1 -1
- package/dist/i18n/index.d.ts +72 -0
- package/dist/i18n/locales/de.d.ts +12 -0
- package/dist/i18n/locales/de.js +12 -0
- package/dist/i18n/locales/en.d.ts +12 -0
- package/dist/i18n/locales/en.js +12 -0
- package/dist/i18n/locales/es.d.ts +12 -0
- package/dist/i18n/locales/es.js +12 -0
- package/dist/i18n/locales/fr.d.ts +12 -0
- package/dist/i18n/locales/fr.js +12 -0
- package/dist/i18n/locales/ja.d.ts +12 -0
- package/dist/i18n/locales/ja.js +12 -0
- package/dist/i18n/locales/zh-cn.d.ts +12 -0
- package/dist/i18n/locales/zh-cn.js +12 -0
- package/dist/types/menuItem.d.ts +1 -0
- package/dist/utils/snackbar.svelte.d.ts +2 -0
- package/package.json +1 -1
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
// 基本プロパティ
|
|
37
37
|
value: Date | { start: Date; end: Date } | undefined;
|
|
38
38
|
format?: string;
|
|
39
|
-
|
|
39
|
+
placeholder?: string;
|
|
40
40
|
locale?: 'en' | 'ja' | 'fr' | 'de' | 'es' | 'zh-cn';
|
|
41
41
|
rangeSeparator?: string;
|
|
42
42
|
|
|
@@ -48,6 +48,9 @@
|
|
|
48
48
|
inline?: boolean;
|
|
49
49
|
focusStyle?: FocusStyle;
|
|
50
50
|
fullWidth?: boolean;
|
|
51
|
+
width?: string | number | null;
|
|
52
|
+
minWidth?: string | number | null;
|
|
53
|
+
maxWidth?: string | number | null;
|
|
51
54
|
rounded?: boolean;
|
|
52
55
|
|
|
53
56
|
// アイコン関連
|
|
@@ -60,10 +63,9 @@
|
|
|
60
63
|
|
|
61
64
|
// 状態/動作
|
|
62
65
|
disabled?: boolean;
|
|
66
|
+
readonly?: boolean;
|
|
63
67
|
mode?: DatepickerMode;
|
|
64
|
-
/** テキスト入力を有効にするか */
|
|
65
68
|
enableTextInput?: boolean;
|
|
66
|
-
/** クリック時にポップアップを開くかどうかを有効にするか */
|
|
67
69
|
enableClickToOpen?: boolean;
|
|
68
70
|
minDate?: Date;
|
|
69
71
|
maxDate?: Date;
|
|
@@ -105,7 +107,7 @@
|
|
|
105
107
|
// 基本プロパティ
|
|
106
108
|
value = $bindable(),
|
|
107
109
|
format,
|
|
108
|
-
|
|
110
|
+
placeholder = '',
|
|
109
111
|
locale,
|
|
110
112
|
rangeSeparator = ' - ',
|
|
111
113
|
|
|
@@ -117,6 +119,9 @@
|
|
|
117
119
|
inline = false,
|
|
118
120
|
focusStyle = 'outline',
|
|
119
121
|
fullWidth = false,
|
|
122
|
+
width,
|
|
123
|
+
minWidth,
|
|
124
|
+
maxWidth,
|
|
120
125
|
rounded = false,
|
|
121
126
|
|
|
122
127
|
// アイコン関連
|
|
@@ -129,6 +134,7 @@
|
|
|
129
134
|
|
|
130
135
|
// 状態/動作
|
|
131
136
|
disabled = false,
|
|
137
|
+
readonly = false,
|
|
132
138
|
mode = 'single',
|
|
133
139
|
enableTextInput = false,
|
|
134
140
|
enableClickToOpen = true,
|
|
@@ -264,7 +270,7 @@
|
|
|
264
270
|
// =========================================================================
|
|
265
271
|
const handleChange = () => {
|
|
266
272
|
// スクリーンリーダーアナウンス
|
|
267
|
-
if (value) {
|
|
273
|
+
if (value && !readonly) {
|
|
268
274
|
if (mode === 'range' && typeof value === 'object' && 'start' in value && 'end' in value) {
|
|
269
275
|
const startDate = dayjs(value.start).locale(resolvedLocale).format(finalFormat);
|
|
270
276
|
const endDate = dayjs(value.end).locale(resolvedLocale).format(finalFormat);
|
|
@@ -275,7 +281,9 @@
|
|
|
275
281
|
}
|
|
276
282
|
}
|
|
277
283
|
|
|
278
|
-
|
|
284
|
+
if (!readonly) {
|
|
285
|
+
onchange(value);
|
|
286
|
+
}
|
|
279
287
|
|
|
280
288
|
// 単一日付選択時、または範囲選択時の終了日選択時にポップアップを閉じる
|
|
281
289
|
if (
|
|
@@ -292,7 +300,7 @@
|
|
|
292
300
|
};
|
|
293
301
|
|
|
294
302
|
const handleClick = (event: MouseEvent) => {
|
|
295
|
-
if (disabled) return;
|
|
303
|
+
if (disabled || readonly) return;
|
|
296
304
|
if (enableClickToOpen) {
|
|
297
305
|
const isOpen = popupRef?.getIsOpen && popupRef.getIsOpen();
|
|
298
306
|
if (isOpen) {
|
|
@@ -306,7 +314,7 @@
|
|
|
306
314
|
};
|
|
307
315
|
|
|
308
316
|
const handleKeyDown = (event: KeyboardEvent) => {
|
|
309
|
-
if (disabled) return;
|
|
317
|
+
if (disabled || readonly) return;
|
|
310
318
|
onkeydown(event);
|
|
311
319
|
|
|
312
320
|
// enableTextInput のときは、カーソルキー系は Input 内のキャレット移動に使わせたいので、
|
|
@@ -363,18 +371,18 @@
|
|
|
363
371
|
};
|
|
364
372
|
|
|
365
373
|
const handleKeyup = (event: KeyboardEvent) => {
|
|
366
|
-
if (disabled) return;
|
|
374
|
+
if (disabled || readonly) return;
|
|
367
375
|
onkeyup(event);
|
|
368
376
|
};
|
|
369
377
|
|
|
370
378
|
const handleInput = (inputValue: string | number) => {
|
|
371
|
-
if (disabled) return;
|
|
379
|
+
if (disabled || readonly) return;
|
|
372
380
|
oninput?.(String(inputValue));
|
|
373
381
|
};
|
|
374
382
|
|
|
375
383
|
// マウスイベント
|
|
376
384
|
const handleMouseDown = (event: MouseEvent) => {
|
|
377
|
-
if (disabled) return;
|
|
385
|
+
if (disabled || readonly) return;
|
|
378
386
|
// 入力もクリックによるオープンも無効な場合は、クリックでフォーカススタイルが出ないようにする
|
|
379
387
|
if (!enableTextInput && !enableClickToOpen) {
|
|
380
388
|
event.preventDefault();
|
|
@@ -383,12 +391,12 @@
|
|
|
383
391
|
};
|
|
384
392
|
|
|
385
393
|
const handleMouseUp = (event: MouseEvent) => {
|
|
386
|
-
if (disabled) return;
|
|
394
|
+
if (disabled || readonly) return;
|
|
387
395
|
onmouseup?.(event);
|
|
388
396
|
};
|
|
389
397
|
|
|
390
398
|
const handleMouseEnter = (event: MouseEvent) => {
|
|
391
|
-
if (disabled) return;
|
|
399
|
+
if (disabled || readonly) return;
|
|
392
400
|
onmouseenter?.(event);
|
|
393
401
|
};
|
|
394
402
|
|
|
@@ -470,15 +478,11 @@
|
|
|
470
478
|
};
|
|
471
479
|
|
|
472
480
|
const handlePopupOpen = () => {
|
|
473
|
-
// DatepickerCalendarのイベントハンドラーを有効にする
|
|
474
481
|
datapickerCalendarRef?.handlePopupOpen();
|
|
475
|
-
// キーボードで開いた場合は、最初のキーボード操作時にフォーカス表示が有効になる
|
|
476
482
|
};
|
|
477
483
|
|
|
478
484
|
const handlePopupClose = () => {
|
|
479
|
-
// DatepickerCalendarのイベントハンドラーを無効にする
|
|
480
485
|
datapickerCalendarRef?.handlePopupClose();
|
|
481
|
-
// 状態をリセット
|
|
482
486
|
openedViaKeyboard = false;
|
|
483
487
|
};
|
|
484
488
|
|
|
@@ -595,8 +599,8 @@
|
|
|
595
599
|
);
|
|
596
600
|
const placeholderText = $derived(
|
|
597
601
|
enableTextInput
|
|
598
|
-
?
|
|
599
|
-
:
|
|
602
|
+
? placeholder || currentLocaleConfig.directInputPlaceholder
|
|
603
|
+
: placeholder || currentLocaleConfig.notSelected
|
|
600
604
|
);
|
|
601
605
|
</script>
|
|
602
606
|
|
|
@@ -612,9 +616,12 @@
|
|
|
612
616
|
{inline}
|
|
613
617
|
{focusStyle}
|
|
614
618
|
{fullWidth}
|
|
619
|
+
{width}
|
|
620
|
+
{minWidth}
|
|
621
|
+
{maxWidth}
|
|
615
622
|
{rounded}
|
|
616
623
|
{disabled}
|
|
617
|
-
readonly={!enableTextInput}
|
|
624
|
+
readonly={readonly || !enableTextInput}
|
|
618
625
|
placeholder={placeholderText}
|
|
619
626
|
rightIcon={hasIcon ? (mode === 'range' ? 'date_range' : 'calendar_today') : undefined}
|
|
620
627
|
{iconFilled}
|
|
@@ -622,7 +629,6 @@
|
|
|
622
629
|
{iconGrade}
|
|
623
630
|
{iconOpticalSize}
|
|
624
631
|
{iconVariant}
|
|
625
|
-
onRightIconClick={handleClick}
|
|
626
632
|
onclick={handleClick}
|
|
627
633
|
onfocus={handleFocus}
|
|
628
634
|
onblur={handleBlur}
|
|
@@ -652,6 +658,14 @@
|
|
|
652
658
|
{inputAttributes}
|
|
653
659
|
{...restProps}
|
|
654
660
|
/>
|
|
661
|
+
{#if !enableTextInput && !disabled && enableClickToOpen}
|
|
662
|
+
<button
|
|
663
|
+
type="button"
|
|
664
|
+
class="datepicker__trigger-overlay"
|
|
665
|
+
aria-label={currentLocaleConfig.selectDateLabel}
|
|
666
|
+
onclick={handleClick}
|
|
667
|
+
></button>
|
|
668
|
+
{/if}
|
|
655
669
|
</div>
|
|
656
670
|
<Popup
|
|
657
671
|
bind:this={popupRef}
|
|
@@ -685,5 +699,16 @@
|
|
|
685
699
|
width: 100%;
|
|
686
700
|
}
|
|
687
701
|
|
|
702
|
+
.datepicker__trigger-overlay {
|
|
703
|
+
position: absolute;
|
|
704
|
+
inset: 0;
|
|
705
|
+
z-index: 1;
|
|
706
|
+
padding: 0;
|
|
707
|
+
margin: 0;
|
|
708
|
+
border: none;
|
|
709
|
+
background: transparent;
|
|
710
|
+
cursor: pointer;
|
|
711
|
+
}
|
|
712
|
+
|
|
688
713
|
/* Datepicker uses a readonly Input when allowDirectInput is false.
|
|
689
|
-
*
|
|
714
|
+
* Clicks are handled by the overlay above, not by modifying Input. */</style>
|
|
@@ -14,7 +14,7 @@ export type DatepickerProps = {
|
|
|
14
14
|
end: Date;
|
|
15
15
|
} | undefined;
|
|
16
16
|
format?: string;
|
|
17
|
-
|
|
17
|
+
placeholder?: string;
|
|
18
18
|
locale?: 'en' | 'ja' | 'fr' | 'de' | 'es' | 'zh-cn';
|
|
19
19
|
rangeSeparator?: string;
|
|
20
20
|
id?: string;
|
|
@@ -22,6 +22,9 @@ export type DatepickerProps = {
|
|
|
22
22
|
inline?: boolean;
|
|
23
23
|
focusStyle?: FocusStyle;
|
|
24
24
|
fullWidth?: boolean;
|
|
25
|
+
width?: string | number | null;
|
|
26
|
+
minWidth?: string | number | null;
|
|
27
|
+
maxWidth?: string | number | null;
|
|
25
28
|
rounded?: boolean;
|
|
26
29
|
hasIcon?: boolean;
|
|
27
30
|
iconFilled?: boolean;
|
|
@@ -30,10 +33,9 @@ export type DatepickerProps = {
|
|
|
30
33
|
iconOpticalSize?: IconOpticalSize;
|
|
31
34
|
iconVariant?: IconVariant;
|
|
32
35
|
disabled?: boolean;
|
|
36
|
+
readonly?: boolean;
|
|
33
37
|
mode?: DatepickerMode;
|
|
34
|
-
/** テキスト入力を有効にするか */
|
|
35
38
|
enableTextInput?: boolean;
|
|
36
|
-
/** クリック時にポップアップを開くかどうかを有効にするか */
|
|
37
39
|
enableClickToOpen?: boolean;
|
|
38
40
|
minDate?: Date;
|
|
39
41
|
maxDate?: Date;
|
|
@@ -197,7 +197,7 @@
|
|
|
197
197
|
.dialog__body {
|
|
198
198
|
flex-shrink: 1;
|
|
199
199
|
position: relative;
|
|
200
|
-
padding: var(--svelte-ui-dialog-body-padding);
|
|
200
|
+
padding: 0 var(--svelte-ui-dialog-body-padding) var(--svelte-ui-dialog-body-padding);
|
|
201
201
|
}
|
|
202
202
|
|
|
203
203
|
.dialog__footer {
|
|
@@ -232,10 +232,6 @@
|
|
|
232
232
|
overflow: auto;
|
|
233
233
|
}
|
|
234
234
|
|
|
235
|
-
.dialog:not(.dialog--scrollable) .dialog__body {
|
|
236
|
-
padding-top: 0;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
235
|
.dialog--scrollable .dialog__footer {
|
|
240
236
|
border-top: solid var(--svelte-ui-border-width, 1px) var(--svelte-ui-border-weak-color);
|
|
241
237
|
}</style>
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
|
|
72
72
|
// 状態/動作
|
|
73
73
|
isOpen = $bindable(false),
|
|
74
|
-
scrollable =
|
|
74
|
+
scrollable = false,
|
|
75
75
|
closeIfClickOutside = true,
|
|
76
76
|
restoreFocus = false,
|
|
77
77
|
|
|
@@ -315,7 +315,6 @@
|
|
|
315
315
|
justify-content: stretch;
|
|
316
316
|
min-height: var(--svelte-ui-drawer-header-height);
|
|
317
317
|
padding: var(--svelte-ui-drawer-header-padding);
|
|
318
|
-
margin-bottom: calc(0px - var(--svelte-ui-drawer-body-padding));
|
|
319
318
|
}
|
|
320
319
|
.drawer__header .drawer__title {
|
|
321
320
|
flex-grow: 1;
|
|
@@ -327,7 +326,7 @@
|
|
|
327
326
|
.drawer__body {
|
|
328
327
|
flex-shrink: 1;
|
|
329
328
|
position: relative;
|
|
330
|
-
padding: var(--svelte-ui-drawer-body-padding);
|
|
329
|
+
padding: 0 var(--svelte-ui-drawer-body-padding) var(--svelte-ui-drawer-body-padding);
|
|
331
330
|
flex-grow: 1;
|
|
332
331
|
}
|
|
333
332
|
|
|
@@ -400,7 +400,7 @@
|
|
|
400
400
|
.fab > * {
|
|
401
401
|
z-index: 1;
|
|
402
402
|
}
|
|
403
|
-
.fab
|
|
403
|
+
.fab::before {
|
|
404
404
|
content: "";
|
|
405
405
|
display: block;
|
|
406
406
|
position: absolute;
|
|
@@ -415,7 +415,7 @@
|
|
|
415
415
|
z-index: 0;
|
|
416
416
|
}
|
|
417
417
|
@media (hover: hover) {
|
|
418
|
-
.fab:hover:before {
|
|
418
|
+
.fab:hover:not(:disabled)::before {
|
|
419
419
|
opacity: 1;
|
|
420
420
|
}
|
|
421
421
|
}
|
|
@@ -426,7 +426,9 @@
|
|
|
426
426
|
.fab:disabled {
|
|
427
427
|
opacity: var(--svelte-ui-button-disabled-opacity);
|
|
428
428
|
cursor: not-allowed;
|
|
429
|
-
|
|
429
|
+
}
|
|
430
|
+
.fab:disabled * {
|
|
431
|
+
cursor: not-allowed;
|
|
430
432
|
}
|
|
431
433
|
.fab.fab--outlined {
|
|
432
434
|
box-shadow: inset 0 0 0 var(--svelte-ui-border-width) currentColor;
|
|
@@ -455,10 +457,7 @@
|
|
|
455
457
|
.fab.fab--outlined.fab--shadow:active {
|
|
456
458
|
box-shadow: inset 0 0 0 var(--svelte-ui-border-width) currentColor, 0px 7px 8px -4px rgba(0, 0, 0, 0.2), 0px 12px 17px 2px rgba(0, 0, 0, 0.14), 0px 5px 22px 4px rgba(0, 0, 0, 0.12);
|
|
457
459
|
}
|
|
458
|
-
.fab.fab--
|
|
459
|
-
cursor: wait;
|
|
460
|
-
}
|
|
461
|
-
.fab.fab--no-motion, .fab.fab--no-motion:before {
|
|
460
|
+
.fab.fab--no-motion, .fab.fab--no-motion::before {
|
|
462
461
|
transition-duration: 0.01s;
|
|
463
462
|
}
|
|
464
463
|
.fab .fab__icon {
|
|
@@ -504,7 +503,7 @@
|
|
|
504
503
|
/* Reduced motion */
|
|
505
504
|
@media (prefers-reduced-motion: reduce) {
|
|
506
505
|
.fab,
|
|
507
|
-
.fab
|
|
506
|
+
.fab::before {
|
|
508
507
|
transition-duration: 0.01s;
|
|
509
508
|
}
|
|
510
509
|
}
|
|
@@ -415,6 +415,10 @@
|
|
|
415
415
|
width: fit-content;
|
|
416
416
|
}
|
|
417
417
|
|
|
418
|
+
.icon-button:has(.icon-button__button:disabled) {
|
|
419
|
+
cursor: not-allowed;
|
|
420
|
+
}
|
|
421
|
+
|
|
418
422
|
.icon-button__button {
|
|
419
423
|
display: flex;
|
|
420
424
|
justify-content: center;
|
|
@@ -445,7 +449,7 @@
|
|
|
445
449
|
-webkit-backdrop-filter: var(--svelte-ui-glass-blur);
|
|
446
450
|
}
|
|
447
451
|
|
|
448
|
-
.icon-button__button
|
|
452
|
+
.icon-button__button::before {
|
|
449
453
|
content: '';
|
|
450
454
|
display: block;
|
|
451
455
|
position: absolute;
|
|
@@ -461,7 +465,7 @@
|
|
|
461
465
|
}
|
|
462
466
|
|
|
463
467
|
@media (hover: hover) {
|
|
464
|
-
.icon-button__button:hover:before {
|
|
468
|
+
.icon-button__button:hover:not(:disabled)::before {
|
|
465
469
|
opacity: 1;
|
|
466
470
|
}
|
|
467
471
|
}
|
|
@@ -475,18 +479,17 @@
|
|
|
475
479
|
transform: scale(0.95);
|
|
476
480
|
}
|
|
477
481
|
|
|
478
|
-
.icon-button__button--pressed
|
|
482
|
+
.icon-button__button--pressed::before {
|
|
479
483
|
opacity: 0.12;
|
|
480
484
|
}
|
|
481
485
|
|
|
482
486
|
.icon-button__button:disabled {
|
|
483
487
|
opacity: var(--svelte-ui-button-disabled-opacity);
|
|
484
488
|
cursor: not-allowed;
|
|
485
|
-
pointer-events: none;
|
|
486
489
|
}
|
|
487
490
|
|
|
488
|
-
.icon-button__button
|
|
489
|
-
cursor:
|
|
491
|
+
.icon-button__button:disabled * {
|
|
492
|
+
cursor: not-allowed;
|
|
490
493
|
}
|
|
491
494
|
|
|
492
495
|
.icon-button__button > * {
|
|
@@ -517,8 +520,6 @@
|
|
|
517
520
|
|
|
518
521
|
.icon-button__badge {
|
|
519
522
|
position: absolute;
|
|
520
|
-
top: -2px;
|
|
521
|
-
right: -2px;
|
|
522
523
|
display: flex;
|
|
523
524
|
align-items: center;
|
|
524
525
|
justify-content: center;
|
|
@@ -531,20 +532,24 @@
|
|
|
531
532
|
}
|
|
532
533
|
|
|
533
534
|
.icon-button__badge--dot {
|
|
535
|
+
top: 0;
|
|
536
|
+
right: 0;
|
|
534
537
|
width: 8px;
|
|
535
538
|
height: 8px;
|
|
536
539
|
min-width: unset;
|
|
537
540
|
}
|
|
538
541
|
|
|
539
542
|
.icon-button__badge--count {
|
|
540
|
-
|
|
541
|
-
|
|
543
|
+
top: -5px;
|
|
544
|
+
right: -5px;
|
|
545
|
+
min-width: 18px;
|
|
546
|
+
height: 18px;
|
|
542
547
|
padding: 0 4px;
|
|
543
|
-
border-radius:
|
|
548
|
+
border-radius: 9px;
|
|
544
549
|
}
|
|
545
550
|
|
|
546
551
|
.icon-button__button--no-motion,
|
|
547
|
-
.icon-button__button--no-motion
|
|
552
|
+
.icon-button__button--no-motion::before,
|
|
548
553
|
.icon-button__button--no-motion .icon-button__icon {
|
|
549
554
|
transition-duration: 0.01s;
|
|
550
555
|
}
|
|
@@ -555,7 +560,7 @@
|
|
|
555
560
|
|
|
556
561
|
@media (prefers-reduced-motion: reduce) {
|
|
557
562
|
.icon-button__button,
|
|
558
|
-
.icon-button__button
|
|
563
|
+
.icon-button__button::before,
|
|
559
564
|
.icon-button__icon {
|
|
560
565
|
transition-duration: 0.01s;
|
|
561
566
|
}
|
|
@@ -35,7 +35,6 @@
|
|
|
35
35
|
min?: number | null;
|
|
36
36
|
max?: number | null;
|
|
37
37
|
step?: number | null;
|
|
38
|
-
size?: number | null;
|
|
39
38
|
decimalPlaces?: number | null;
|
|
40
39
|
enableThousandsSeparator?: boolean;
|
|
41
40
|
autocomplete?: HTMLInputElement['autocomplete'] | null;
|
|
@@ -146,7 +145,6 @@
|
|
|
146
145
|
min = null,
|
|
147
146
|
max = null,
|
|
148
147
|
step = null,
|
|
149
|
-
size = null,
|
|
150
148
|
decimalPlaces = null,
|
|
151
149
|
enableThousandsSeparator = false,
|
|
152
150
|
autocomplete = null,
|
|
@@ -158,7 +156,7 @@
|
|
|
158
156
|
focusStyle = 'outline',
|
|
159
157
|
fullWidth = false,
|
|
160
158
|
width = null,
|
|
161
|
-
minWidth = inline ? null :
|
|
159
|
+
minWidth = inline ? null : 200,
|
|
162
160
|
maxWidth = null,
|
|
163
161
|
rounded = false,
|
|
164
162
|
customStyle = '',
|
|
@@ -503,7 +501,7 @@
|
|
|
503
501
|
value !== null && value !== undefined && !(typeof value === 'string' && value === '')
|
|
504
502
|
);
|
|
505
503
|
const displayValue = $derived.by(() => {
|
|
506
|
-
if (!hasDisplayValue) return inline ? ' ' : '';
|
|
504
|
+
if (!hasDisplayValue) return placeholder ? convertToHtml(placeholder) : inline ? ' ' : '';
|
|
507
505
|
if (type === 'number' && typeof value === 'number') {
|
|
508
506
|
const options = {
|
|
509
507
|
useGrouping: enableThousandsSeparator,
|
|
@@ -678,7 +676,10 @@
|
|
|
678
676
|
>
|
|
679
677
|
<!-- 表示用テキスト -->
|
|
680
678
|
<div class="input__display-text" style={customStyle}>
|
|
681
|
-
<div
|
|
679
|
+
<div
|
|
680
|
+
class="input__display-text-content"
|
|
681
|
+
class:input__display-text-content--placeholder={!hasDisplayValue}
|
|
682
|
+
>
|
|
682
683
|
{@html displayValue}
|
|
683
684
|
{#if type === 'number' && unit !== '' && hasDisplayValue}
|
|
684
685
|
<span class="input__unit-text">
|
|
@@ -707,7 +708,6 @@
|
|
|
707
708
|
{readonly}
|
|
708
709
|
{required}
|
|
709
710
|
{tabindex}
|
|
710
|
-
{size}
|
|
711
711
|
{spellcheck}
|
|
712
712
|
onchange={handleChange}
|
|
713
713
|
oninput={handleInput}
|
|
@@ -858,6 +858,9 @@
|
|
|
858
858
|
height: 100%;
|
|
859
859
|
padding: inherit;
|
|
860
860
|
border: none;
|
|
861
|
+
border-radius: var(--svelte-ui-input-border-radius);
|
|
862
|
+
background-color: var(--svelte-ui-input-bg);
|
|
863
|
+
box-shadow: 0 0 0 var(--svelte-ui-border-width) inset var(--svelte-ui-input-border-color);
|
|
861
864
|
font-size: inherit;
|
|
862
865
|
font-weight: inherit;
|
|
863
866
|
color: inherit;
|
|
@@ -874,8 +877,7 @@
|
|
|
874
877
|
min-width: 1em;
|
|
875
878
|
min-height: var(--svelte-ui-input-height);
|
|
876
879
|
padding: var(--svelte-ui-input-padding);
|
|
877
|
-
background-color:
|
|
878
|
-
box-shadow: 0 0 0 var(--svelte-ui-border-width) inset var(--svelte-ui-input-border-color);
|
|
880
|
+
background-color: transparent;
|
|
879
881
|
border: none;
|
|
880
882
|
border-radius: var(--svelte-ui-input-border-radius);
|
|
881
883
|
font-size: inherit;
|
|
@@ -934,11 +936,9 @@
|
|
|
934
936
|
/* =============================================
|
|
935
937
|
* 表示制御
|
|
936
938
|
* ============================================= */
|
|
937
|
-
/* 非フォーカス時: input
|
|
939
|
+
/* 非フォーカス時: input要素自体を不可視化(枠線・背景はラッパーにあるため display-text のみ表示) */
|
|
938
940
|
.input:not(.input--focused) input {
|
|
939
|
-
|
|
940
|
-
caret-color: transparent;
|
|
941
|
-
text-shadow: none;
|
|
941
|
+
opacity: 0;
|
|
942
942
|
}
|
|
943
943
|
|
|
944
944
|
/* フォーカス時: display-textを非表示 */
|
|
@@ -950,7 +950,8 @@
|
|
|
950
950
|
* プレースホルダー・テキスト表示
|
|
951
951
|
* ============================================= */
|
|
952
952
|
input::placeholder,
|
|
953
|
-
.input__display-text:empty::before
|
|
953
|
+
.input__display-text:empty::before,
|
|
954
|
+
.input__display-text-content--placeholder {
|
|
954
955
|
color: var(--svelte-ui-input-placeholder-color);
|
|
955
956
|
}
|
|
956
957
|
|
|
@@ -962,8 +963,11 @@
|
|
|
962
963
|
outline-offset: var(--svelte-ui-focus-outline-offset-inner);
|
|
963
964
|
}
|
|
964
965
|
|
|
965
|
-
.input--focus-background
|
|
966
|
+
.input--focus-background.input--focused .input__wrapper {
|
|
966
967
|
background: var(--svelte-ui-hover-overlay);
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
.input--focus-background input:focus {
|
|
967
971
|
outline: none;
|
|
968
972
|
}
|
|
969
973
|
|
|
@@ -974,34 +978,33 @@
|
|
|
974
978
|
/* =============================================
|
|
975
979
|
* 状態管理(disabled, readonly等)
|
|
976
980
|
* ============================================= */
|
|
981
|
+
input[readonly] {
|
|
982
|
+
cursor: default;
|
|
983
|
+
pointer-events: none;
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
/* disabled */
|
|
977
987
|
.input--disabled {
|
|
978
988
|
opacity: var(--svelte-ui-input-disabled-opacity);
|
|
979
|
-
|
|
989
|
+
cursor: not-allowed;
|
|
980
990
|
|
|
981
|
-
|
|
982
|
-
.
|
|
983
|
-
|
|
991
|
+
input,
|
|
992
|
+
.input__display-text,
|
|
993
|
+
.input__link-text {
|
|
994
|
+
cursor: not-allowed;
|
|
984
995
|
}
|
|
985
|
-
}
|
|
986
996
|
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
cursor:
|
|
997
|
+
.input__icon-left,
|
|
998
|
+
.input__icon-right {
|
|
999
|
+
cursor: not-allowed;
|
|
1000
|
+
pointer-events: none;
|
|
990
1001
|
}
|
|
991
1002
|
}
|
|
992
1003
|
|
|
993
1004
|
input:disabled {
|
|
994
|
-
opacity: var(--svelte-ui-button-disabled-opacity);
|
|
995
1005
|
cursor: not-allowed;
|
|
996
1006
|
}
|
|
997
1007
|
|
|
998
|
-
input[readonly] {
|
|
999
|
-
/* Keep cursor behavior but do not add a special background.
|
|
1000
|
-
* In this library, filled backgrounds are used to indicate editable fields,
|
|
1001
|
-
* so readonly inputs intentionally have no extra background color. */
|
|
1002
|
-
cursor: default;
|
|
1003
|
-
}
|
|
1004
|
-
|
|
1005
1008
|
/* =============================================
|
|
1006
1009
|
* 機能バリエーション
|
|
1007
1010
|
* ============================================= */
|
|
@@ -1135,9 +1138,7 @@
|
|
|
1135
1138
|
.input--type-password {
|
|
1136
1139
|
/* inputを常に表示(表示制御の非フォーカス時の不可視化を上書き) */
|
|
1137
1140
|
&:not(.input--focused) input {
|
|
1138
|
-
|
|
1139
|
-
caret-color: inherit;
|
|
1140
|
-
text-shadow: inherit;
|
|
1141
|
+
opacity: 1;
|
|
1141
1142
|
}
|
|
1142
1143
|
|
|
1143
1144
|
/* display-textは常に非表示 */
|
|
@@ -1150,22 +1151,22 @@
|
|
|
1150
1151
|
* デザインバリエーション
|
|
1151
1152
|
* ============================================= */
|
|
1152
1153
|
/* rounded */
|
|
1153
|
-
.input--rounded
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
}
|
|
1154
|
+
.input--rounded .input__wrapper,
|
|
1155
|
+
.input--rounded input {
|
|
1156
|
+
border-radius: var(--svelte-ui-input-border-radius-rounded);
|
|
1157
1157
|
}
|
|
1158
1158
|
|
|
1159
1159
|
/* inline */
|
|
1160
|
-
.input--inline
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1160
|
+
.input--inline .input__wrapper,
|
|
1161
|
+
.input--inline input {
|
|
1162
|
+
min-height: inherit;
|
|
1163
|
+
background-color: transparent;
|
|
1164
|
+
box-shadow: none;
|
|
1165
|
+
border: inherit;
|
|
1166
|
+
border-radius: 0;
|
|
1167
|
+
}
|
|
1168
1168
|
|
|
1169
|
+
.input--inline {
|
|
1169
1170
|
input,
|
|
1170
1171
|
.input__display-text,
|
|
1171
1172
|
.input__link-text {
|
|
@@ -219,7 +219,7 @@
|
|
|
219
219
|
color: var(--svelte-ui-pagination-button-text-color);
|
|
220
220
|
transition-duration: 0s;
|
|
221
221
|
}
|
|
222
|
-
.pagination__button
|
|
222
|
+
.pagination__button::before {
|
|
223
223
|
content: '';
|
|
224
224
|
display: block;
|
|
225
225
|
position: absolute;
|
|
@@ -235,7 +235,7 @@
|
|
|
235
235
|
}
|
|
236
236
|
|
|
237
237
|
@media (hover: hover) {
|
|
238
|
-
.pagination__button:hover
|
|
238
|
+
.pagination__button:hover::before {
|
|
239
239
|
opacity: 1;
|
|
240
240
|
}
|
|
241
241
|
}
|
|
@@ -252,7 +252,7 @@
|
|
|
252
252
|
pointer-events: none;
|
|
253
253
|
}
|
|
254
254
|
|
|
255
|
-
.pagination__button:disabled
|
|
255
|
+
.pagination__button:disabled::before {
|
|
256
256
|
opacity: 0;
|
|
257
257
|
}
|
|
258
258
|
|