@sveltia/ui 0.8.3 → 0.10.0
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/package/components/alert/alert.svelte +2 -4
- package/package/components/alert/alert.svelte.d.ts +2 -2
- package/package/components/button/button.svelte +78 -26
- package/package/components/button/button.svelte.d.ts +73 -63
- package/package/components/button/select-button-group.svelte +6 -1
- package/package/components/button/select-button-group.svelte.d.ts +13 -13
- package/package/components/button/select-button.svelte +2 -1
- package/package/components/button/select-button.svelte.d.ts +19 -19
- package/package/components/button/split-button.svelte +111 -0
- package/package/components/button/split-button.svelte.d.ts +69 -0
- package/package/components/calendar/calendar.svelte +2 -2
- package/package/components/calendar/calendar.svelte.d.ts +2 -2
- package/package/components/checkbox/checkbox-group.svelte.d.ts +7 -7
- package/package/components/checkbox/checkbox.svelte +8 -6
- package/package/components/checkbox/checkbox.svelte.d.ts +22 -16
- package/package/components/dialog/alert-dialog.svelte.d.ts +6 -6
- package/package/components/dialog/confirmation-dialog.svelte.d.ts +8 -8
- package/package/components/dialog/dialog.svelte +17 -15
- package/package/components/dialog/dialog.svelte.d.ts +30 -24
- package/package/components/dialog/prompt-dialog.svelte +1 -1
- package/package/components/dialog/prompt-dialog.svelte.d.ts +12 -12
- package/package/components/disclosure/disclosure.svelte +6 -1
- package/package/components/disclosure/disclosure.svelte.d.ts +29 -19
- package/package/components/divider/divider.svelte.d.ts +5 -5
- package/package/components/divider/spacer.svelte.d.ts +4 -4
- package/package/components/drawer/drawer.svelte +34 -16
- package/package/components/drawer/drawer.svelte.d.ts +22 -16
- package/package/components/grid/grid-body.svelte.d.ts +4 -4
- package/package/components/grid/grid-cell.svelte.d.ts +2 -2
- package/package/components/grid/grid-col-header.svelte.d.ts +2 -2
- package/package/components/grid/grid-foot.svelte.d.ts +2 -2
- package/package/components/grid/grid-head.svelte.d.ts +2 -2
- package/package/components/grid/grid-row-header.svelte.d.ts +2 -2
- package/package/components/grid/grid-row.svelte +10 -2
- package/package/components/grid/grid-row.svelte.d.ts +8 -8
- package/package/components/grid/grid.svelte +7 -2
- package/package/components/grid/grid.svelte.d.ts +8 -8
- package/package/components/icon/icon.svelte.d.ts +4 -4
- package/package/components/listbox/listbox.svelte +11 -5
- package/package/components/listbox/listbox.svelte.d.ts +15 -15
- package/package/components/listbox/option-group.svelte.d.ts +7 -7
- package/package/components/listbox/option.svelte +4 -2
- package/package/components/listbox/option.svelte.d.ts +15 -13
- package/package/components/menu/menu-button.svelte +18 -2
- package/package/components/menu/menu-button.svelte.d.ts +20 -16
- package/package/components/menu/menu-item-checkbox.svelte +1 -1
- package/package/components/menu/menu-item-checkbox.svelte.d.ts +16 -16
- package/package/components/menu/menu-item-group.svelte +1 -1
- package/package/components/menu/menu-item-group.svelte.d.ts +7 -7
- package/package/components/menu/menu-item-radio.svelte +1 -1
- package/package/components/menu/menu-item-radio.svelte.d.ts +16 -16
- package/package/components/menu/menu-item.svelte +32 -19
- package/package/components/menu/menu-item.svelte.d.ts +32 -18
- package/package/components/menu/menu.svelte +13 -7
- package/package/components/menu/menu.svelte.d.ts +7 -7
- package/package/components/radio/radio-group.svelte +6 -1
- package/package/components/radio/radio-group.svelte.d.ts +15 -15
- package/package/components/radio/radio.svelte +1 -1
- package/package/components/radio/radio.svelte.d.ts +14 -14
- package/package/components/select/combobox.svelte +10 -8
- package/package/components/select/combobox.svelte.d.ts +22 -16
- package/package/components/select/select.svelte.d.ts +12 -12
- package/package/components/slider/slider.svelte +26 -22
- package/package/components/slider/slider.svelte.d.ts +23 -23
- package/package/components/switch/switch.svelte +5 -0
- package/package/components/switch/switch.svelte.d.ts +18 -14
- package/package/components/table/table-body.svelte.d.ts +4 -4
- package/package/components/table/table-cell.svelte.d.ts +2 -2
- package/package/components/table/table-col-header.svelte.d.ts +2 -2
- package/package/components/table/table-foot.svelte.d.ts +2 -2
- package/package/components/table/table-head.svelte.d.ts +2 -2
- package/package/components/table/table-row-header.svelte.d.ts +2 -2
- package/package/components/table/table-row.svelte.d.ts +2 -2
- package/package/components/table/table.svelte.d.ts +2 -2
- package/package/components/tabs/tab-box.svelte +30 -0
- package/package/components/tabs/tab-box.svelte.d.ts +33 -0
- package/package/components/tabs/tab-list.svelte +105 -22
- package/package/components/tabs/tab-list.svelte.d.ts +10 -10
- package/package/components/tabs/tab-panel.svelte +6 -2
- package/package/components/tabs/tab-panel.svelte.d.ts +2 -2
- package/package/components/tabs/tab-panels.svelte +32 -0
- package/package/components/tabs/tab-panels.svelte.d.ts +31 -0
- package/package/components/tabs/tab.svelte.d.ts +11 -11
- package/package/components/text-field/markdown-editor.svelte.d.ts +12 -12
- package/package/components/text-field/number-input.svelte +11 -4
- package/package/components/text-field/number-input.svelte.d.ts +40 -20
- package/package/components/text-field/password-input.svelte +7 -3
- package/package/components/text-field/password-input.svelte.d.ts +30 -18
- package/package/components/text-field/search-bar.svelte +7 -3
- package/package/components/text-field/search-bar.svelte.d.ts +46 -36
- package/package/components/text-field/text-area.svelte +4 -2
- package/package/components/text-field/text-area.svelte.d.ts +25 -21
- package/package/components/text-field/text-input.svelte +17 -2
- package/package/components/text-field/text-input.svelte.d.ts +53 -53
- package/package/components/toast/toast.svelte +16 -12
- package/package/components/toast/toast.svelte.d.ts +8 -8
- package/package/components/toolbar/toolbar.svelte.d.ts +8 -8
- package/package/components/util/app-shell.svelte +162 -74
- package/package/components/util/app-shell.svelte.d.ts +2 -0
- package/package/components/util/group.svelte.d.ts +5 -5
- package/package/components/util/modal.svelte +26 -9
- package/package/components/util/modal.svelte.d.ts +34 -34
- package/package/components/util/popup.svelte +58 -32
- package/package/components/util/popup.svelte.d.ts +34 -24
- package/package/components/util/portal.svelte +5 -3
- package/package/components/util/portal.svelte.d.ts +2 -2
- package/package/index.d.ts +6 -3
- package/package/index.js +7 -4
- package/package/locales/en.d.ts +4 -0
- package/package/locales/en.js +4 -0
- package/package/locales/ja.d.ts +4 -0
- package/package/locales/ja.js +4 -0
- package/package/services/events.d.ts +1 -1
- package/package/services/events.js +11 -8
- package/package/services/group.js +73 -30
- package/package/services/popup.d.ts +28 -11
- package/package/services/popup.js +27 -10
- package/package/services/util.d.ts +2 -2
- package/package/services/util.js +5 -5
- package/package/styles/core.scss +1 -0
- package/package/styles/variables.scss +24 -4
- package/package.json +49 -25
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
@component
|
|
3
|
+
A combination of a normal `<Button>` (default action) and an arrow-only `<MenuButton>` (different
|
|
4
|
+
actions). For example, Microsoft Word has the Paste button along with the Keep Source Formatting,
|
|
5
|
+
Match Formatting and Keep Text Only options.
|
|
6
|
+
@see https://www.google.com/search?q=split+button&tbm=isch
|
|
7
|
+
-->
|
|
8
|
+
<script>
|
|
9
|
+
import { _ } from 'svelte-i18n';
|
|
10
|
+
import Icon from '../icon/icon.svelte';
|
|
11
|
+
import MenuButton from '../menu/menu-button.svelte';
|
|
12
|
+
import Button from './button.svelte';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* The `class` attribute on the `<button>` element.
|
|
16
|
+
* @type {string}
|
|
17
|
+
*/
|
|
18
|
+
let className = '';
|
|
19
|
+
export { className as class };
|
|
20
|
+
/**
|
|
21
|
+
* Whether to hide the widget. An alias of the `aria-hidden` attribute.
|
|
22
|
+
* @type {boolean | undefined}
|
|
23
|
+
*/
|
|
24
|
+
export let hidden = undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Whether to disable the widget. An alias of the `aria-disabled` attribute.
|
|
27
|
+
* @type {boolean}
|
|
28
|
+
*/
|
|
29
|
+
export let disabled = false;
|
|
30
|
+
/**
|
|
31
|
+
* Text label displayed on the button.
|
|
32
|
+
* @type {string}
|
|
33
|
+
*/
|
|
34
|
+
export let label = '';
|
|
35
|
+
/**
|
|
36
|
+
* The style variant of the button.
|
|
37
|
+
* @type {'primary' | 'secondary' | 'tertiary' | 'ghost' | undefined}
|
|
38
|
+
*/
|
|
39
|
+
export let variant = undefined;
|
|
40
|
+
/**
|
|
41
|
+
* The size of the button.
|
|
42
|
+
* @type {'small' | 'medium' | 'large' | undefined}
|
|
43
|
+
*/
|
|
44
|
+
export let size = 'medium';
|
|
45
|
+
/**
|
|
46
|
+
* Where to show the dropdown menu.
|
|
47
|
+
* @type {PopupPosition}
|
|
48
|
+
*/
|
|
49
|
+
export let popupPosition = 'bottom-left';
|
|
50
|
+
/**
|
|
51
|
+
* Whether to show the backdrop for the popup.
|
|
52
|
+
* @type {boolean}
|
|
53
|
+
*/
|
|
54
|
+
export let showPopupBackdrop = false;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* @type {HTMLElement | undefined}
|
|
58
|
+
*/
|
|
59
|
+
let wrapper;
|
|
60
|
+
</script>
|
|
61
|
+
|
|
62
|
+
<div
|
|
63
|
+
role="group"
|
|
64
|
+
class="sui split-button"
|
|
65
|
+
hidden={hidden || undefined}
|
|
66
|
+
aria-hidden={hidden}
|
|
67
|
+
aria-disabled={disabled}
|
|
68
|
+
aria-label={$_('_sui.split_button.x_options', { values: { name: label } })}
|
|
69
|
+
bind:this={wrapper}
|
|
70
|
+
>
|
|
71
|
+
<Button class={className} {hidden} {disabled} {label} {variant} {size} {...$$restProps} on:click>
|
|
72
|
+
<slot name="start-icon" slot="start-icon" />
|
|
73
|
+
</Button>
|
|
74
|
+
<MenuButton
|
|
75
|
+
iconic
|
|
76
|
+
{hidden}
|
|
77
|
+
{disabled}
|
|
78
|
+
{variant}
|
|
79
|
+
{size}
|
|
80
|
+
aria-label={$_('_sui.split_button.more_options')}
|
|
81
|
+
{popupPosition}
|
|
82
|
+
popupPositionBaseElement={wrapper}
|
|
83
|
+
{showPopupBackdrop}
|
|
84
|
+
>
|
|
85
|
+
<slot name="chevron-icon" slot="end-icon">
|
|
86
|
+
<Icon name="arrow_drop_down" />
|
|
87
|
+
</slot>
|
|
88
|
+
<slot name="popup" slot="popup" />
|
|
89
|
+
</MenuButton>
|
|
90
|
+
</div>
|
|
91
|
+
|
|
92
|
+
<style>.split-button {
|
|
93
|
+
display: inline-flex;
|
|
94
|
+
margin: var(--sui-focus-ring-width);
|
|
95
|
+
}
|
|
96
|
+
.split-button :global(button) {
|
|
97
|
+
margin: 0;
|
|
98
|
+
}
|
|
99
|
+
.split-button :global(button):not(.menu-button) {
|
|
100
|
+
border-top-right-radius: 0;
|
|
101
|
+
border-bottom-right-radius: 0;
|
|
102
|
+
}
|
|
103
|
+
.split-button :global(button):is(.menu-button) {
|
|
104
|
+
border-left-width: 0;
|
|
105
|
+
border-top-left-radius: 0;
|
|
106
|
+
border-bottom-left-radius: 0;
|
|
107
|
+
aspect-ratio: 3/4;
|
|
108
|
+
}
|
|
109
|
+
.split-button :global(button):is(.menu-button) :global(.icon) {
|
|
110
|
+
font-size: 20px;
|
|
111
|
+
}</style>
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} SplitButtonProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} SplitButtonEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} SplitButtonSlots */
|
|
4
|
+
/**
|
|
5
|
+
* A combination of a normal `<Button>` (default action) and an arrow-only `<MenuButton>` (different
|
|
6
|
+
* actions). For example, Microsoft Word has the Paste button along with the Keep Source Formatting,
|
|
7
|
+
* Match Formatting and Keep Text Only options.
|
|
8
|
+
* @see https://www.google.com/search?q=split+button&tbm=isch
|
|
9
|
+
*/
|
|
10
|
+
export default class SplitButton extends SvelteComponent<{
|
|
11
|
+
[x: string]: any;
|
|
12
|
+
class?: string | undefined;
|
|
13
|
+
label?: string | undefined;
|
|
14
|
+
disabled?: boolean | undefined;
|
|
15
|
+
size?: "small" | "medium" | "large" | undefined;
|
|
16
|
+
hidden?: boolean | undefined;
|
|
17
|
+
variant?: "primary" | "secondary" | "tertiary" | "ghost" | undefined;
|
|
18
|
+
popupPosition?: PopupPosition | undefined;
|
|
19
|
+
showPopupBackdrop?: boolean | undefined;
|
|
20
|
+
}, {
|
|
21
|
+
click: MouseEvent;
|
|
22
|
+
} & {
|
|
23
|
+
[evt: string]: CustomEvent<any>;
|
|
24
|
+
}, {
|
|
25
|
+
'start-icon': {
|
|
26
|
+
slot: string;
|
|
27
|
+
};
|
|
28
|
+
'chevron-icon': {
|
|
29
|
+
slot: string;
|
|
30
|
+
};
|
|
31
|
+
popup: {
|
|
32
|
+
slot: string;
|
|
33
|
+
};
|
|
34
|
+
}> {
|
|
35
|
+
}
|
|
36
|
+
export type SplitButtonProps = typeof __propDef.props;
|
|
37
|
+
export type SplitButtonEvents = typeof __propDef.events;
|
|
38
|
+
export type SplitButtonSlots = typeof __propDef.slots;
|
|
39
|
+
import { SvelteComponent } from "svelte";
|
|
40
|
+
declare const __propDef: {
|
|
41
|
+
props: {
|
|
42
|
+
[x: string]: any;
|
|
43
|
+
class?: string | undefined;
|
|
44
|
+
label?: string | undefined;
|
|
45
|
+
disabled?: boolean | undefined;
|
|
46
|
+
size?: 'small' | 'medium' | 'large' | undefined;
|
|
47
|
+
hidden?: boolean | undefined;
|
|
48
|
+
variant?: 'primary' | 'secondary' | 'tertiary' | 'ghost' | undefined;
|
|
49
|
+
popupPosition?: PopupPosition | undefined;
|
|
50
|
+
showPopupBackdrop?: boolean | undefined;
|
|
51
|
+
};
|
|
52
|
+
events: {
|
|
53
|
+
click: MouseEvent;
|
|
54
|
+
} & {
|
|
55
|
+
[evt: string]: CustomEvent<any>;
|
|
56
|
+
};
|
|
57
|
+
slots: {
|
|
58
|
+
'start-icon': {
|
|
59
|
+
slot: string;
|
|
60
|
+
};
|
|
61
|
+
'chevron-icon': {
|
|
62
|
+
slot: string;
|
|
63
|
+
};
|
|
64
|
+
popup: {
|
|
65
|
+
slot: string;
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
export {};
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import Spacer from '../divider/spacer.svelte';
|
|
10
10
|
import Icon from '../icon/icon.svelte';
|
|
11
11
|
|
|
12
|
-
/** @type {string
|
|
12
|
+
/** @type {string | undefined} */
|
|
13
13
|
export let value = undefined;
|
|
14
14
|
|
|
15
15
|
/** @type {{ day: Date }[]} */
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
$: firstDay = new Date(firstDayOfMonth);
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* Populate {@link weeks} as per the current {@link firstDay}.
|
|
27
27
|
*/
|
|
28
28
|
const getWeeks = () => {
|
|
29
29
|
const cursor = new Date(firstDay);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/** @typedef {typeof __propDef.slots} CalendarSlots */
|
|
4
4
|
/** A calendar (date picker) widget. */
|
|
5
5
|
export default class Calendar extends SvelteComponent<{
|
|
6
|
-
value?: string;
|
|
6
|
+
value?: string | undefined;
|
|
7
7
|
}, {
|
|
8
8
|
click: MouseEvent;
|
|
9
9
|
} & {
|
|
@@ -16,7 +16,7 @@ export type CalendarSlots = typeof __propDef.slots;
|
|
|
16
16
|
import { SvelteComponent } from "svelte";
|
|
17
17
|
declare const __propDef: {
|
|
18
18
|
props: {
|
|
19
|
-
value?: string |
|
|
19
|
+
value?: string | undefined;
|
|
20
20
|
};
|
|
21
21
|
events: {
|
|
22
22
|
click: MouseEvent;
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
/** The layout container of `<Checkbox>`es. */
|
|
5
5
|
export default class CheckboxGroup extends SvelteComponent<{
|
|
6
6
|
[x: string]: any;
|
|
7
|
-
class?: string;
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
hidden?: boolean;
|
|
10
|
-
orientation?: "vertical" | "horizontal";
|
|
7
|
+
class?: string | undefined;
|
|
8
|
+
disabled?: boolean | undefined;
|
|
9
|
+
hidden?: boolean | undefined;
|
|
10
|
+
orientation?: "vertical" | "horizontal" | undefined;
|
|
11
11
|
}, {
|
|
12
12
|
[evt: string]: CustomEvent<any>;
|
|
13
13
|
}, {
|
|
@@ -21,10 +21,10 @@ import { SvelteComponent } from "svelte";
|
|
|
21
21
|
declare const __propDef: {
|
|
22
22
|
props: {
|
|
23
23
|
[x: string]: any;
|
|
24
|
-
class?: string;
|
|
25
|
-
disabled?: boolean;
|
|
24
|
+
class?: string | undefined;
|
|
25
|
+
disabled?: boolean | undefined;
|
|
26
26
|
hidden?: boolean | undefined;
|
|
27
|
-
orientation?:
|
|
27
|
+
orientation?: "vertical" | "horizontal" | undefined;
|
|
28
28
|
};
|
|
29
29
|
events: {
|
|
30
30
|
[evt: string]: CustomEvent<any>;
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
hidden={hidden || undefined}
|
|
87
87
|
on:click|preventDefault|stopPropagation={(event) => {
|
|
88
88
|
if (!(/** @type {HTMLElement} */ (event.target).matches('button'))) {
|
|
89
|
-
buttonComponent
|
|
89
|
+
buttonComponent?.element?.click();
|
|
90
90
|
}
|
|
91
91
|
}}
|
|
92
92
|
>
|
|
@@ -116,7 +116,9 @@
|
|
|
116
116
|
}
|
|
117
117
|
}}
|
|
118
118
|
>
|
|
119
|
-
<
|
|
119
|
+
<slot name="check-icon" slot="start-icon">
|
|
120
|
+
<Icon name={indeterminate ? 'remove' : 'check'} />
|
|
121
|
+
</slot>
|
|
120
122
|
</Button>
|
|
121
123
|
{#if $$slots.default || label}
|
|
122
124
|
<label id="{id}-label">
|
|
@@ -160,7 +162,7 @@
|
|
|
160
162
|
justify-content: center;
|
|
161
163
|
overflow: hidden;
|
|
162
164
|
margin: 0 !important;
|
|
163
|
-
border-width: 1.5px;
|
|
165
|
+
border-width: var(--sui-checkbox-border-width, 1.5px);
|
|
164
166
|
border-color: var(--sui-checkbox-border-color);
|
|
165
167
|
border-radius: var(--sui-checkbox-border-radius);
|
|
166
168
|
padding: 0;
|
|
@@ -174,9 +176,9 @@
|
|
|
174
176
|
font-size: calc(var(--sui-checkbox-height) - 2px);
|
|
175
177
|
}
|
|
176
178
|
.checkbox :global(button[aria-checked="true"]) {
|
|
177
|
-
border-color: var(--sui-primary-accent-color);
|
|
178
|
-
color: var(--sui-primary-accent-color-inverted);
|
|
179
|
-
background-color: var(--sui-primary-accent-color);
|
|
179
|
+
border-color: var(--sui-checkbox-border-color-checked, var(--sui-primary-accent-color));
|
|
180
|
+
color: var(--sui-checkbox-foreground-color-checked, var(--sui-primary-accent-color-inverted));
|
|
181
|
+
background-color: var(--sui-checkbox-background-color-checked, var(--sui-primary-accent-color));
|
|
180
182
|
}
|
|
181
183
|
.checkbox :global(button[aria-checked="false"]) {
|
|
182
184
|
color: transparent;
|
|
@@ -9,21 +9,24 @@
|
|
|
9
9
|
*/
|
|
10
10
|
export default class Checkbox extends SvelteComponent<{
|
|
11
11
|
[x: string]: any;
|
|
12
|
-
class?: string;
|
|
13
|
-
name?: string;
|
|
14
|
-
invalid?: boolean;
|
|
15
|
-
label?: string;
|
|
16
|
-
checked?: boolean | "mixed";
|
|
17
|
-
disabled?: boolean;
|
|
18
|
-
required?: boolean;
|
|
19
|
-
value?: string;
|
|
20
|
-
hidden?: boolean;
|
|
21
|
-
readonly?: boolean;
|
|
12
|
+
class?: string | undefined;
|
|
13
|
+
name?: string | undefined;
|
|
14
|
+
invalid?: boolean | undefined;
|
|
15
|
+
label?: string | undefined;
|
|
16
|
+
checked?: boolean | "mixed" | undefined;
|
|
17
|
+
disabled?: boolean | undefined;
|
|
18
|
+
required?: boolean | undefined;
|
|
19
|
+
value?: string | undefined;
|
|
20
|
+
hidden?: boolean | undefined;
|
|
21
|
+
readonly?: boolean | undefined;
|
|
22
22
|
}, {
|
|
23
23
|
change: CustomEvent<any>;
|
|
24
24
|
} & {
|
|
25
25
|
[evt: string]: CustomEvent<any>;
|
|
26
26
|
}, {
|
|
27
|
+
'check-icon': {
|
|
28
|
+
slot: string;
|
|
29
|
+
};
|
|
27
30
|
default: {};
|
|
28
31
|
}> {
|
|
29
32
|
}
|
|
@@ -34,16 +37,16 @@ import { SvelteComponent } from "svelte";
|
|
|
34
37
|
declare const __propDef: {
|
|
35
38
|
props: {
|
|
36
39
|
[x: string]: any;
|
|
37
|
-
class?: string;
|
|
40
|
+
class?: string | undefined;
|
|
38
41
|
name?: string | undefined;
|
|
39
|
-
invalid?: boolean;
|
|
42
|
+
invalid?: boolean | undefined;
|
|
40
43
|
label?: string | undefined;
|
|
41
|
-
checked?: boolean |
|
|
42
|
-
disabled?: boolean;
|
|
43
|
-
required?: boolean;
|
|
44
|
+
checked?: boolean | "mixed" | undefined;
|
|
45
|
+
disabled?: boolean | undefined;
|
|
46
|
+
required?: boolean | undefined;
|
|
44
47
|
value?: string | undefined;
|
|
45
48
|
hidden?: boolean | undefined;
|
|
46
|
-
readonly?: boolean;
|
|
49
|
+
readonly?: boolean | undefined;
|
|
47
50
|
};
|
|
48
51
|
events: {
|
|
49
52
|
change: CustomEvent<any>;
|
|
@@ -51,6 +54,9 @@ declare const __propDef: {
|
|
|
51
54
|
[evt: string]: CustomEvent<any>;
|
|
52
55
|
};
|
|
53
56
|
slots: {
|
|
57
|
+
'check-icon': {
|
|
58
|
+
slot: string;
|
|
59
|
+
};
|
|
54
60
|
default: {};
|
|
55
61
|
};
|
|
56
62
|
};
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
export default class AlertDialog extends SvelteComponent<{
|
|
11
11
|
[x: string]: any;
|
|
12
12
|
title: string;
|
|
13
|
-
class?: string;
|
|
14
|
-
open?: boolean;
|
|
15
|
-
okLabel?: string;
|
|
13
|
+
class?: string | undefined;
|
|
14
|
+
open?: boolean | undefined;
|
|
15
|
+
okLabel?: string | undefined;
|
|
16
16
|
}, {
|
|
17
17
|
opening: CustomEvent<any>;
|
|
18
18
|
open: CustomEvent<any>;
|
|
@@ -34,9 +34,9 @@ declare const __propDef: {
|
|
|
34
34
|
props: {
|
|
35
35
|
[x: string]: any;
|
|
36
36
|
title: string;
|
|
37
|
-
class?: string;
|
|
38
|
-
open?: boolean;
|
|
39
|
-
okLabel?: string;
|
|
37
|
+
class?: string | undefined;
|
|
38
|
+
open?: boolean | undefined;
|
|
39
|
+
okLabel?: string | undefined;
|
|
40
40
|
};
|
|
41
41
|
events: {
|
|
42
42
|
opening: CustomEvent<any>;
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
export default class ConfirmationDialog extends SvelteComponent<{
|
|
11
11
|
[x: string]: any;
|
|
12
12
|
title: string;
|
|
13
|
-
class?: string;
|
|
14
|
-
open?: boolean;
|
|
15
|
-
okLabel?: string;
|
|
16
|
-
cancelLabel?: string;
|
|
13
|
+
class?: string | undefined;
|
|
14
|
+
open?: boolean | undefined;
|
|
15
|
+
okLabel?: string | undefined;
|
|
16
|
+
cancelLabel?: string | undefined;
|
|
17
17
|
}, {
|
|
18
18
|
opening: CustomEvent<any>;
|
|
19
19
|
open: CustomEvent<any>;
|
|
@@ -35,10 +35,10 @@ declare const __propDef: {
|
|
|
35
35
|
props: {
|
|
36
36
|
[x: string]: any;
|
|
37
37
|
title: string;
|
|
38
|
-
class?: string;
|
|
39
|
-
open?: boolean;
|
|
40
|
-
okLabel?: string;
|
|
41
|
-
cancelLabel?: string;
|
|
38
|
+
class?: string | undefined;
|
|
39
|
+
open?: boolean | undefined;
|
|
40
|
+
okLabel?: string | undefined;
|
|
41
|
+
cancelLabel?: string | undefined;
|
|
42
42
|
};
|
|
43
43
|
events: {
|
|
44
44
|
opening: CustomEvent<any>;
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
*/
|
|
86
86
|
const id = getRandomId('dialog');
|
|
87
87
|
/**
|
|
88
|
-
*
|
|
88
|
+
* A reference to the modal component.
|
|
89
89
|
* @type {Modal}
|
|
90
90
|
*/
|
|
91
91
|
let modal;
|
|
@@ -133,7 +133,9 @@
|
|
|
133
133
|
modal.close('close');
|
|
134
134
|
}}
|
|
135
135
|
>
|
|
136
|
-
<
|
|
136
|
+
<slot name="close-icon" slot="start-icon">
|
|
137
|
+
<Icon name="close" />
|
|
138
|
+
</slot>
|
|
137
139
|
</Button>
|
|
138
140
|
{/if}
|
|
139
141
|
{/if}
|
|
@@ -181,12 +183,12 @@
|
|
|
181
183
|
position: relative;
|
|
182
184
|
display: flex;
|
|
183
185
|
flex-direction: column;
|
|
184
|
-
border-radius: 4px;
|
|
185
|
-
max-width: calc(100dvw -
|
|
186
|
-
background-color: var(--sui-secondary-background-color-translucent);
|
|
187
|
-
box-shadow: 0 8px 16px var(--sui-popup-shadow-color);
|
|
188
|
-
-webkit-backdrop-filter: blur(16px);
|
|
189
|
-
backdrop-filter: blur(16px);
|
|
186
|
+
border-radius: var(--sui-dialog-content-border-radius, 4px);
|
|
187
|
+
max-width: calc(100dvw - var(--sui-dialog-content-margin, 16px) * 2);
|
|
188
|
+
background-color: var(--sui-dialog-content-background-color, var(--sui-secondary-background-color-translucent));
|
|
189
|
+
box-shadow: var(--sui-dialog-content-box-shadow, 0 8px 16px var(--sui-popup-shadow-color));
|
|
190
|
+
-webkit-backdrop-filter: var(--sui-dialog-content-backdrop-filter, blur(16px));
|
|
191
|
+
backdrop-filter: var(--sui-dialog-content-backdrop-filter, blur(16px));
|
|
190
192
|
transition-property: transform;
|
|
191
193
|
}
|
|
192
194
|
:global(dialog.open) .content {
|
|
@@ -243,23 +245,23 @@
|
|
|
243
245
|
|
|
244
246
|
.header {
|
|
245
247
|
box-sizing: content-box;
|
|
246
|
-
margin: 0 16px;
|
|
247
|
-
border-width: 0 0 1px;
|
|
248
|
-
border-color: var(--sui-secondary-border-color);
|
|
249
|
-
padding: 16px 8px;
|
|
250
|
-
height: 32px;
|
|
248
|
+
margin: var(--sui-dialog-header-margin, 0 16px);
|
|
249
|
+
border-width: var(--sui-dialog-header-border-width, 0 0 1px);
|
|
250
|
+
border-color: var(--sui-dialog-header-border-color, var(--sui-secondary-border-color));
|
|
251
|
+
padding: var(--sui-dialog-header-padding, 16px 8px);
|
|
252
|
+
height: var(--sui-dialog-header-height, 32px);
|
|
251
253
|
}
|
|
252
254
|
.header .title {
|
|
253
255
|
font-size: var(--sui-font-size-large);
|
|
254
256
|
}
|
|
255
257
|
|
|
256
258
|
.footer {
|
|
257
|
-
margin: 0 24px 24px;
|
|
259
|
+
margin: var(--sui-dialog-footer-margin, 0 24px 24px);
|
|
258
260
|
}
|
|
259
261
|
|
|
260
262
|
.body {
|
|
261
263
|
overflow: auto;
|
|
262
|
-
margin: 24px 24px;
|
|
264
|
+
margin: var(--sui-dialog-body-margin, 24px 24px);
|
|
263
265
|
white-space: normal;
|
|
264
266
|
line-height: var(--sui-line-height-compact);
|
|
265
267
|
}</style>
|
|
@@ -9,18 +9,18 @@
|
|
|
9
9
|
export default class Dialog extends SvelteComponent<{
|
|
10
10
|
[x: string]: any;
|
|
11
11
|
title: string;
|
|
12
|
-
class?: string;
|
|
13
|
-
size?: "small" | "medium" | "large" | "x-large";
|
|
14
|
-
role?: "dialog" | "alertdialog";
|
|
15
|
-
open?: boolean;
|
|
16
|
-
lightDismiss?: boolean;
|
|
17
|
-
showClose?: boolean;
|
|
18
|
-
showOk?: boolean;
|
|
19
|
-
okLabel?: string;
|
|
20
|
-
okDisabled?: boolean;
|
|
21
|
-
showCancel?: boolean;
|
|
22
|
-
cancelLabel?: string;
|
|
23
|
-
cancelDisabled?: boolean;
|
|
12
|
+
class?: string | undefined;
|
|
13
|
+
size?: "small" | "medium" | "large" | "x-large" | undefined;
|
|
14
|
+
role?: "dialog" | "alertdialog" | undefined;
|
|
15
|
+
open?: boolean | undefined;
|
|
16
|
+
lightDismiss?: boolean | undefined;
|
|
17
|
+
showClose?: boolean | undefined;
|
|
18
|
+
showOk?: boolean | undefined;
|
|
19
|
+
okLabel?: string | undefined;
|
|
20
|
+
okDisabled?: boolean | undefined;
|
|
21
|
+
showCancel?: boolean | undefined;
|
|
22
|
+
cancelLabel?: string | undefined;
|
|
23
|
+
cancelDisabled?: boolean | undefined;
|
|
24
24
|
}, {
|
|
25
25
|
opening: CustomEvent<any>;
|
|
26
26
|
open: CustomEvent<any>;
|
|
@@ -33,6 +33,9 @@ export default class Dialog extends SvelteComponent<{
|
|
|
33
33
|
}, {
|
|
34
34
|
header: {};
|
|
35
35
|
'header-extra': {};
|
|
36
|
+
'close-icon': {
|
|
37
|
+
slot: string;
|
|
38
|
+
};
|
|
36
39
|
default: {};
|
|
37
40
|
footer: {};
|
|
38
41
|
'footer-extra': {};
|
|
@@ -46,18 +49,18 @@ declare const __propDef: {
|
|
|
46
49
|
props: {
|
|
47
50
|
[x: string]: any;
|
|
48
51
|
title: string;
|
|
49
|
-
class?: string;
|
|
50
|
-
size?:
|
|
51
|
-
role?:
|
|
52
|
-
open?: boolean;
|
|
53
|
-
lightDismiss?: boolean;
|
|
54
|
-
showClose?: boolean;
|
|
55
|
-
showOk?: boolean;
|
|
56
|
-
okLabel?: string;
|
|
57
|
-
okDisabled?: boolean;
|
|
58
|
-
showCancel?: boolean;
|
|
59
|
-
cancelLabel?: string;
|
|
60
|
-
cancelDisabled?: boolean;
|
|
52
|
+
class?: string | undefined;
|
|
53
|
+
size?: "small" | "medium" | "large" | "x-large" | undefined;
|
|
54
|
+
role?: "dialog" | "alertdialog" | undefined;
|
|
55
|
+
open?: boolean | undefined;
|
|
56
|
+
lightDismiss?: boolean | undefined;
|
|
57
|
+
showClose?: boolean | undefined;
|
|
58
|
+
showOk?: boolean | undefined;
|
|
59
|
+
okLabel?: string | undefined;
|
|
60
|
+
okDisabled?: boolean | undefined;
|
|
61
|
+
showCancel?: boolean | undefined;
|
|
62
|
+
cancelLabel?: string | undefined;
|
|
63
|
+
cancelDisabled?: boolean | undefined;
|
|
61
64
|
};
|
|
62
65
|
events: {
|
|
63
66
|
opening: CustomEvent<any>;
|
|
@@ -72,6 +75,9 @@ declare const __propDef: {
|
|
|
72
75
|
slots: {
|
|
73
76
|
header: {};
|
|
74
77
|
'header-extra': {};
|
|
78
|
+
'close-icon': {
|
|
79
|
+
slot: string;
|
|
80
|
+
};
|
|
75
81
|
default: {};
|
|
76
82
|
footer: {};
|
|
77
83
|
'footer-extra': {};
|
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
export default class PromptDialog extends SvelteComponent<{
|
|
12
12
|
[x: string]: any;
|
|
13
13
|
title: string;
|
|
14
|
-
class?: string;
|
|
15
|
-
value?: string;
|
|
16
|
-
open?: boolean;
|
|
17
|
-
okLabel?: string;
|
|
18
|
-
cancelLabel?: string;
|
|
19
|
-
textboxAttrs?: object;
|
|
14
|
+
class?: string | undefined;
|
|
15
|
+
value?: string | undefined;
|
|
16
|
+
open?: boolean | undefined;
|
|
17
|
+
okLabel?: string | undefined;
|
|
18
|
+
cancelLabel?: string | undefined;
|
|
19
|
+
textboxAttrs?: object | undefined;
|
|
20
20
|
}, {
|
|
21
21
|
opening: CustomEvent<any>;
|
|
22
22
|
open: CustomEvent<any>;
|
|
@@ -43,12 +43,12 @@ declare const __propDef: {
|
|
|
43
43
|
props: {
|
|
44
44
|
[x: string]: any;
|
|
45
45
|
title: string;
|
|
46
|
-
class?: string;
|
|
47
|
-
value?: string;
|
|
48
|
-
open?: boolean;
|
|
49
|
-
okLabel?: string;
|
|
50
|
-
cancelLabel?: string;
|
|
51
|
-
textboxAttrs?: object;
|
|
46
|
+
class?: string | undefined;
|
|
47
|
+
value?: string | undefined;
|
|
48
|
+
open?: boolean | undefined;
|
|
49
|
+
okLabel?: string | undefined;
|
|
50
|
+
cancelLabel?: string | undefined;
|
|
51
|
+
textboxAttrs?: object | undefined;
|
|
52
52
|
};
|
|
53
53
|
events: {
|
|
54
54
|
opening: CustomEvent<any>;
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
<svelte:options accessors={true} />
|
|
8
8
|
|
|
9
9
|
<script>
|
|
10
|
+
import { createEventDispatcher } from 'svelte';
|
|
10
11
|
import { getRandomId } from '../../services/util';
|
|
11
12
|
import Button from '../button/button.svelte';
|
|
12
13
|
import Icon from '../icon/icon.svelte';
|
|
@@ -38,6 +39,7 @@
|
|
|
38
39
|
*/
|
|
39
40
|
export let label = '';
|
|
40
41
|
|
|
42
|
+
const dispatch = createEventDispatcher();
|
|
41
43
|
const id = getRandomId('disclosure');
|
|
42
44
|
</script>
|
|
43
45
|
|
|
@@ -61,9 +63,12 @@
|
|
|
61
63
|
aria-expanded={expanded}
|
|
62
64
|
on:click={() => {
|
|
63
65
|
expanded = !expanded;
|
|
66
|
+
dispatch('change', { expanded });
|
|
64
67
|
}}
|
|
65
68
|
>
|
|
66
|
-
<
|
|
69
|
+
<slot name="chevron-icon" slot="start-icon">
|
|
70
|
+
<Icon name="expand_more" />
|
|
71
|
+
</slot>
|
|
67
72
|
{label}
|
|
68
73
|
</Button>
|
|
69
74
|
<div class="content" id="{id}-content" hidden={!expanded}>
|