@sveltia/ui 0.1.2 → 0.1.4
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/composite/calendar.svelte +5 -5
- package/package/components/composite/calendar.svelte.d.ts +1 -8
- package/package/components/composite/checkbox-group.svelte.d.ts +1 -11
- package/package/components/composite/combobox.svelte +22 -4
- package/package/components/composite/combobox.svelte.d.ts +3 -18
- package/package/components/composite/disclosure.svelte.d.ts +2 -11
- package/package/components/composite/grid.svelte.d.ts +1 -10
- package/package/components/composite/listbox.svelte.d.ts +7 -20
- package/package/components/composite/menu-item-group.svelte.d.ts +2 -12
- package/package/components/composite/menu.svelte.d.ts +5 -14
- package/package/components/composite/radio-button-group.svelte +1 -0
- package/package/components/composite/radio-button-group.svelte.d.ts +1 -10
- package/package/components/composite/select-button-group.svelte +1 -0
- package/package/components/composite/select-button-group.svelte.d.ts +1 -14
- package/package/components/composite/select.svelte.d.ts +3 -15
- package/package/components/composite/tab-list.svelte.d.ts +10 -23
- package/package/components/core/button.svelte +18 -22
- package/package/components/core/button.svelte.d.ts +26 -61
- package/package/components/core/checkbox.svelte +4 -2
- package/package/components/core/checkbox.svelte.d.ts +1 -14
- package/package/components/core/dialog.svelte +4 -3
- package/package/components/core/dialog.svelte.d.ts +3 -31
- package/package/components/core/grid-cell.svelte.d.ts +1 -9
- package/package/components/core/group.svelte.d.ts +2 -12
- package/package/components/core/icon.svelte.d.ts +2 -9
- package/package/components/core/menu-button.svelte +10 -18
- package/package/components/core/menu-button.svelte.d.ts +9 -15
- package/package/components/core/menu-item-checkbox.svelte.d.ts +2 -12
- package/package/components/core/menu-item-radio.svelte.d.ts +2 -12
- package/package/components/core/menu-item.svelte +1 -1
- package/package/components/core/menu-item.svelte.d.ts +4 -19
- package/package/components/core/number-input.svelte +7 -6
- package/package/components/core/number-input.svelte.d.ts +3 -17
- package/package/components/core/option.svelte +3 -1
- package/package/components/core/option.svelte.d.ts +12 -21
- package/package/components/core/password-input.svelte +8 -3
- package/package/components/core/password-input.svelte.d.ts +4 -15
- package/package/components/core/radio-button.svelte +4 -2
- package/package/components/core/radio-button.svelte.d.ts +1 -11
- package/package/components/core/row-group.svelte.d.ts +1 -9
- package/package/components/core/row.svelte.d.ts +1 -11
- package/package/components/core/search-bar.svelte +3 -3
- package/package/components/core/search-bar.svelte.d.ts +12 -26
- package/package/components/core/select-button.svelte +2 -0
- package/package/components/core/select-button.svelte.d.ts +8 -13
- package/package/components/core/separator.svelte.d.ts +1 -7
- package/package/components/core/slider.svelte +270 -0
- package/package/components/core/slider.svelte.d.ts +35 -0
- package/package/components/core/spacer.svelte.d.ts +1 -7
- package/package/components/core/switch.svelte.d.ts +2 -12
- package/package/components/core/tab-panel.svelte.d.ts +1 -9
- package/package/components/core/tab.svelte +2 -0
- package/package/components/core/tab.svelte.d.ts +7 -9
- package/package/components/core/text-area.svelte.d.ts +12 -26
- package/package/components/core/text-input.svelte.d.ts +16 -34
- package/package/components/core/toolbar.svelte.d.ts +1 -10
- package/package/components/editor/markdown.svelte +4 -1
- package/package/components/editor/markdown.svelte.d.ts +1 -7
- package/package/components/helpers/popup.d.ts +2 -7
- package/package/components/helpers/popup.js +28 -16
- package/package/components/util/app-shell.svelte.d.ts +1 -11
- package/package/components/util/popup.svelte +24 -16
- package/package/components/util/popup.svelte.d.ts +10 -19
- package/package/components/util/portal.svelte.d.ts +1 -8
- package/package/index.d.ts +1 -0
- package/package/index.js +1 -0
- package/package.json +24 -16
|
@@ -5,25 +5,15 @@
|
|
|
5
5
|
* @see https://w3c.github.io/aria/#switch
|
|
6
6
|
* @see https://w3c.github.io/aria-practices/#switch
|
|
7
7
|
*/
|
|
8
|
-
export default class Switch
|
|
9
|
-
class?: string;
|
|
10
|
-
label?: string;
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
checked?: boolean;
|
|
13
|
-
}, {
|
|
14
|
-
[evt: string]: CustomEvent<any>;
|
|
15
|
-
}, {
|
|
16
|
-
default: {};
|
|
17
|
-
}> {
|
|
8
|
+
export default class Switch {
|
|
18
9
|
}
|
|
19
10
|
export type SwitchProps = typeof __propDef.props;
|
|
20
11
|
export type SwitchEvents = typeof __propDef.events;
|
|
21
12
|
export type SwitchSlots = typeof __propDef.slots;
|
|
22
|
-
import { SvelteComponentTyped } from "svelte";
|
|
23
13
|
declare const __propDef: {
|
|
24
14
|
props: {
|
|
25
|
-
class?: string;
|
|
26
15
|
label?: string;
|
|
16
|
+
class?: string;
|
|
27
17
|
disabled?: boolean;
|
|
28
18
|
checked?: boolean;
|
|
29
19
|
};
|
|
@@ -5,19 +5,11 @@
|
|
|
5
5
|
* @see https://w3c.github.io/aria/#tabpanel
|
|
6
6
|
* @see https://w3c.github.io/aria-practices/#tabpanel
|
|
7
7
|
*/
|
|
8
|
-
export default class TabPanel
|
|
9
|
-
[x: string]: any;
|
|
10
|
-
class?: string;
|
|
11
|
-
}, {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
}, {
|
|
14
|
-
default: {};
|
|
15
|
-
}> {
|
|
8
|
+
export default class TabPanel {
|
|
16
9
|
}
|
|
17
10
|
export type TabPanelProps = typeof __propDef.props;
|
|
18
11
|
export type TabPanelEvents = typeof __propDef.events;
|
|
19
12
|
export type TabPanelSlots = typeof __propDef.slots;
|
|
20
|
-
import { SvelteComponentTyped } from "svelte";
|
|
21
13
|
declare const __propDef: {
|
|
22
14
|
props: {
|
|
23
15
|
[x: string]: any;
|
|
@@ -5,19 +5,11 @@
|
|
|
5
5
|
* @see https://w3c.github.io/aria/#tab
|
|
6
6
|
* @see https://w3c.github.io/aria-practices/#tabpanel
|
|
7
7
|
*/
|
|
8
|
-
export default class Tab
|
|
9
|
-
[x: string]: any;
|
|
10
|
-
class?: string;
|
|
11
|
-
}, {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
}, {
|
|
14
|
-
default: {};
|
|
15
|
-
}> {
|
|
8
|
+
export default class Tab {
|
|
16
9
|
}
|
|
17
10
|
export type TabProps = typeof __propDef.props;
|
|
18
11
|
export type TabEvents = typeof __propDef.events;
|
|
19
12
|
export type TabSlots = typeof __propDef.slots;
|
|
20
|
-
import { SvelteComponentTyped } from "svelte";
|
|
21
13
|
declare const __propDef: {
|
|
22
14
|
props: {
|
|
23
15
|
[x: string]: any;
|
|
@@ -27,7 +19,13 @@ declare const __propDef: {
|
|
|
27
19
|
[evt: string]: CustomEvent<any>;
|
|
28
20
|
};
|
|
29
21
|
slots: {
|
|
22
|
+
'start-icon': {
|
|
23
|
+
slot: string;
|
|
24
|
+
};
|
|
30
25
|
default: {};
|
|
26
|
+
'end-icon': {
|
|
27
|
+
slot: string;
|
|
28
|
+
};
|
|
31
29
|
};
|
|
32
30
|
};
|
|
33
31
|
export {};
|
|
@@ -2,46 +2,32 @@
|
|
|
2
2
|
/** @typedef {typeof __propDef.events} TextAreaEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} TextAreaSlots */
|
|
4
4
|
/** @see https://w3c.github.io/aria/#textbox */
|
|
5
|
-
export default class TextArea
|
|
6
|
-
[x: string]: any;
|
|
7
|
-
class?: string;
|
|
8
|
-
name?: string;
|
|
9
|
-
element?: HTMLTextAreaElement;
|
|
10
|
-
value?: string;
|
|
11
|
-
autoResize?: boolean;
|
|
12
|
-
}, {
|
|
13
|
-
click: MouseEvent;
|
|
14
|
-
input: Event;
|
|
15
|
-
keypress: KeyboardEvent;
|
|
16
|
-
} & {
|
|
17
|
-
[evt: string]: CustomEvent<any>;
|
|
18
|
-
}, {}> {
|
|
5
|
+
export default class TextArea {
|
|
19
6
|
/**accessor*/
|
|
20
|
-
set class(arg:
|
|
21
|
-
get class():
|
|
7
|
+
set class(arg: any);
|
|
8
|
+
get class(): any;
|
|
22
9
|
/**accessor*/
|
|
23
|
-
set element(arg:
|
|
24
|
-
get element():
|
|
10
|
+
set element(arg: any);
|
|
11
|
+
get element(): any;
|
|
25
12
|
/**accessor*/
|
|
26
|
-
set name(arg:
|
|
27
|
-
get name():
|
|
13
|
+
set name(arg: any);
|
|
14
|
+
get name(): any;
|
|
28
15
|
/**accessor*/
|
|
29
|
-
set value(arg:
|
|
30
|
-
get value():
|
|
16
|
+
set value(arg: any);
|
|
17
|
+
get value(): any;
|
|
31
18
|
/**accessor*/
|
|
32
|
-
set autoResize(arg:
|
|
33
|
-
get autoResize():
|
|
19
|
+
set autoResize(arg: any);
|
|
20
|
+
get autoResize(): any;
|
|
34
21
|
}
|
|
35
22
|
export type TextAreaProps = typeof __propDef.props;
|
|
36
23
|
export type TextAreaEvents = typeof __propDef.events;
|
|
37
24
|
export type TextAreaSlots = typeof __propDef.slots;
|
|
38
|
-
import { SvelteComponentTyped } from "svelte";
|
|
39
25
|
declare const __propDef: {
|
|
40
26
|
props: {
|
|
41
27
|
[x: string]: any;
|
|
42
28
|
class?: string;
|
|
43
|
-
name?: string;
|
|
44
29
|
element?: (HTMLTextAreaElement | undefined);
|
|
30
|
+
name?: string;
|
|
45
31
|
value?: (string | undefined);
|
|
46
32
|
autoResize?: boolean;
|
|
47
33
|
};
|
|
@@ -2,58 +2,40 @@
|
|
|
2
2
|
/** @typedef {typeof __propDef.events} TextInputEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} TextInputSlots */
|
|
4
4
|
/** @see https://w3c.github.io/aria/#textbox */
|
|
5
|
-
export default class TextInput
|
|
6
|
-
[x: string]: any;
|
|
7
|
-
class?: string;
|
|
8
|
-
name?: string;
|
|
9
|
-
element?: HTMLInputElement;
|
|
10
|
-
role?: "textbox" | "searchbox" | "combobox" | "spinbutton";
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
value?: string;
|
|
13
|
-
readOnly?: boolean;
|
|
14
|
-
}, {
|
|
15
|
-
input: Event;
|
|
16
|
-
keydown: KeyboardEvent;
|
|
17
|
-
keyup: KeyboardEvent;
|
|
18
|
-
keypress: KeyboardEvent;
|
|
19
|
-
change: Event;
|
|
20
|
-
} & {
|
|
21
|
-
[evt: string]: CustomEvent<any>;
|
|
22
|
-
}, {}> {
|
|
5
|
+
export default class TextInput {
|
|
23
6
|
/**accessor*/
|
|
24
|
-
set class(arg:
|
|
25
|
-
get class():
|
|
7
|
+
set class(arg: any);
|
|
8
|
+
get class(): any;
|
|
26
9
|
/**accessor*/
|
|
27
|
-
set element(arg:
|
|
28
|
-
get element():
|
|
10
|
+
set element(arg: any);
|
|
11
|
+
get element(): any;
|
|
29
12
|
/**accessor*/
|
|
30
|
-
set role(arg:
|
|
31
|
-
get role():
|
|
13
|
+
set role(arg: any);
|
|
14
|
+
get role(): any;
|
|
32
15
|
/**accessor*/
|
|
33
|
-
set readOnly(arg:
|
|
34
|
-
get readOnly():
|
|
16
|
+
set readOnly(arg: any);
|
|
17
|
+
get readOnly(): any;
|
|
35
18
|
/**accessor*/
|
|
36
|
-
set disabled(arg:
|
|
37
|
-
get disabled():
|
|
19
|
+
set disabled(arg: any);
|
|
20
|
+
get disabled(): any;
|
|
38
21
|
/**accessor*/
|
|
39
|
-
set name(arg:
|
|
40
|
-
get name():
|
|
22
|
+
set name(arg: any);
|
|
23
|
+
get name(): any;
|
|
41
24
|
/**accessor*/
|
|
42
|
-
set value(arg:
|
|
43
|
-
get value():
|
|
25
|
+
set value(arg: any);
|
|
26
|
+
get value(): any;
|
|
44
27
|
}
|
|
45
28
|
export type TextInputProps = typeof __propDef.props;
|
|
46
29
|
export type TextInputEvents = typeof __propDef.events;
|
|
47
30
|
export type TextInputSlots = typeof __propDef.slots;
|
|
48
|
-
import { SvelteComponentTyped } from "svelte";
|
|
49
31
|
declare const __propDef: {
|
|
50
32
|
props: {
|
|
51
33
|
[x: string]: any;
|
|
52
34
|
class?: string;
|
|
53
|
-
name?: string;
|
|
54
35
|
element?: (HTMLInputElement | undefined);
|
|
55
36
|
role?: ('textbox' | 'searchbox' | 'combobox' | 'spinbutton');
|
|
56
37
|
disabled?: boolean;
|
|
38
|
+
name?: string;
|
|
57
39
|
value?: (string | undefined);
|
|
58
40
|
readOnly?: boolean;
|
|
59
41
|
};
|
|
@@ -5,20 +5,11 @@
|
|
|
5
5
|
* @see https://w3c.github.io/aria/#toolbar
|
|
6
6
|
* @see https://w3c.github.io/aria-practices/#toolbar
|
|
7
7
|
*/
|
|
8
|
-
export default class Toolbar
|
|
9
|
-
[x: string]: any;
|
|
10
|
-
class?: string;
|
|
11
|
-
orientation?: "vertical" | "horizontal";
|
|
12
|
-
}, {
|
|
13
|
-
[evt: string]: CustomEvent<any>;
|
|
14
|
-
}, {
|
|
15
|
-
default: {};
|
|
16
|
-
}> {
|
|
8
|
+
export default class Toolbar {
|
|
17
9
|
}
|
|
18
10
|
export type ToolbarProps = typeof __propDef.props;
|
|
19
11
|
export type ToolbarEvents = typeof __propDef.events;
|
|
20
12
|
export type ToolbarSlots = typeof __propDef.slots;
|
|
21
|
-
import { SvelteComponentTyped } from "svelte";
|
|
22
13
|
declare const __propDef: {
|
|
23
14
|
props: {
|
|
24
15
|
[x: string]: any;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
import { _ } from 'svelte-i18n';
|
|
3
3
|
import Button from '../core/button.svelte';
|
|
4
|
+
import Icon from '../core/icon.svelte';
|
|
4
5
|
import Separator from '../core/separator.svelte';
|
|
5
6
|
import TextArea from '../core/text-area.svelte';
|
|
6
7
|
import Toolbar from '../core/toolbar.svelte';
|
|
@@ -47,7 +48,9 @@
|
|
|
47
48
|
{#if separator}
|
|
48
49
|
<Separator />
|
|
49
50
|
{:else}
|
|
50
|
-
<Button {disabled}
|
|
51
|
+
<Button {disabled}>
|
|
52
|
+
<Icon slot="start-icon" name={icon} {label} />
|
|
53
|
+
</Button>
|
|
51
54
|
{/if}
|
|
52
55
|
{/each}
|
|
53
56
|
</Toolbar>
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
/** @typedef {typeof __propDef.props} MarkdownProps */
|
|
2
2
|
/** @typedef {typeof __propDef.events} MarkdownEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} MarkdownSlots */
|
|
4
|
-
export default class Markdown
|
|
5
|
-
disabled?: boolean;
|
|
6
|
-
value?: string;
|
|
7
|
-
}, {
|
|
8
|
-
[evt: string]: CustomEvent<any>;
|
|
9
|
-
}, {}> {
|
|
4
|
+
export default class Markdown {
|
|
10
5
|
}
|
|
11
6
|
export type MarkdownProps = typeof __propDef.props;
|
|
12
7
|
export type MarkdownEvents = typeof __propDef.events;
|
|
13
8
|
export type MarkdownSlots = typeof __propDef.slots;
|
|
14
|
-
import { SvelteComponentTyped } from "svelte";
|
|
15
9
|
declare const __propDef: {
|
|
16
10
|
props: {
|
|
17
11
|
disabled?: boolean;
|
|
@@ -11,13 +11,8 @@ declare class Popup {
|
|
|
11
11
|
* @param {PopupPosition} position
|
|
12
12
|
*/
|
|
13
13
|
constructor(anchorElement: HTMLElement, popupElement: HTMLElement, position: PopupPosition);
|
|
14
|
-
open:
|
|
15
|
-
style:
|
|
16
|
-
inset: any;
|
|
17
|
-
zIndex: any;
|
|
18
|
-
width: any;
|
|
19
|
-
height: any;
|
|
20
|
-
}>;
|
|
14
|
+
open: any;
|
|
15
|
+
style: any;
|
|
21
16
|
observer: IntersectionObserver;
|
|
22
17
|
anchorElement: HTMLElement;
|
|
23
18
|
popupElement: HTMLElement;
|
|
@@ -19,41 +19,53 @@ class Popup {
|
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
const
|
|
22
|
+
const contentHeight = this.popupElement.querySelector('.content').scrollHeight;
|
|
23
|
+
const bottomMargin = rootBounds.height - intersectionRect.bottom - 8;
|
|
24
|
+
let { position } = this;
|
|
25
|
+
|
|
26
|
+
// @todo Handle more overflow cases
|
|
27
|
+
if (contentHeight > bottomMargin) {
|
|
28
|
+
if (position.startsWith('bottom-')) {
|
|
29
|
+
position = position.replace('bottom-', 'top-');
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const top = position.startsWith('bottom-')
|
|
23
34
|
? `${Math.round(intersectionRect.bottom)}px`
|
|
24
|
-
:
|
|
35
|
+
: position.endsWith('-top')
|
|
25
36
|
? `${Math.round(intersectionRect.top)}px`
|
|
26
37
|
: 'auto';
|
|
27
38
|
|
|
28
|
-
const right =
|
|
39
|
+
const right = position.startsWith('left-')
|
|
29
40
|
? `${Math.round(rootBounds.width - intersectionRect.left)}px`
|
|
30
|
-
:
|
|
41
|
+
: position.endsWith('-right')
|
|
31
42
|
? `${Math.round(rootBounds.width - intersectionRect.right)}px`
|
|
32
43
|
: 'auto';
|
|
33
44
|
|
|
34
|
-
const bottom =
|
|
45
|
+
const bottom = position.startsWith('top-')
|
|
35
46
|
? `${Math.round(rootBounds.height - intersectionRect.top)}px`
|
|
36
|
-
:
|
|
47
|
+
: position.endsWith('-bottom')
|
|
37
48
|
? `${Math.round(rootBounds.height - intersectionRect.bottom)}px`
|
|
38
49
|
: 'auto';
|
|
39
50
|
|
|
40
|
-
const left =
|
|
51
|
+
const left = position.startsWith('right-')
|
|
41
52
|
? `${Math.round(intersectionRect.right)}px`
|
|
42
|
-
:
|
|
53
|
+
: position.endsWith('-left')
|
|
43
54
|
? `${Math.round(intersectionRect.left)}px`
|
|
44
55
|
: 'auto';
|
|
45
56
|
|
|
46
|
-
const width = `${Math.round(intersectionRect.width)}px`;
|
|
47
|
-
const height = `${Math.round(rootBounds.height - intersectionRect.bottom - 8)}px`;
|
|
48
57
|
const anchorPopup = this.anchorElement.closest('.popup');
|
|
49
58
|
|
|
50
|
-
|
|
51
|
-
this.style.set({
|
|
59
|
+
const style = {
|
|
52
60
|
inset: [top, right, bottom, left].join(' '),
|
|
53
61
|
zIndex: anchorPopup ? Number(anchorPopup.style.zIndex) + 1 : 1000,
|
|
54
|
-
width
|
|
55
|
-
height,
|
|
56
|
-
}
|
|
62
|
+
width: `${Math.round(intersectionRect.width)}px`,
|
|
63
|
+
height: `${Math.round(Math.max(bottomMargin, contentHeight))}px`,
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
if (JSON.stringify(style) !== JSON.stringify(get(this.style))) {
|
|
67
|
+
this.style.set(style);
|
|
68
|
+
}
|
|
57
69
|
});
|
|
58
70
|
});
|
|
59
71
|
|
|
@@ -104,7 +116,7 @@ class Popup {
|
|
|
104
116
|
this.open.subscribe((open) => {
|
|
105
117
|
if (open) {
|
|
106
118
|
this.checkPosition();
|
|
107
|
-
} else {
|
|
119
|
+
} else if (this.anchorElement.getAttribute('aria-expanded') === 'true') {
|
|
108
120
|
this.anchorElement.focus();
|
|
109
121
|
}
|
|
110
122
|
|
|
@@ -6,21 +6,11 @@
|
|
|
6
6
|
* dark/light mode switching. This component has to be placed directly under `<body>` (or
|
|
7
7
|
* `<div style="display:contents">` in a SvelteKit app).
|
|
8
8
|
*/
|
|
9
|
-
export default class AppShell
|
|
10
|
-
[x: string]: never;
|
|
11
|
-
}, {
|
|
12
|
-
dragover: DragEvent;
|
|
13
|
-
drop: DragEvent;
|
|
14
|
-
} & {
|
|
15
|
-
[evt: string]: CustomEvent<any>;
|
|
16
|
-
}, {
|
|
17
|
-
default: {};
|
|
18
|
-
}> {
|
|
9
|
+
export default class AppShell {
|
|
19
10
|
}
|
|
20
11
|
export type AppShellProps = typeof __propDef.props;
|
|
21
12
|
export type AppShellEvents = typeof __propDef.events;
|
|
22
13
|
export type AppShellSlots = typeof __propDef.slots;
|
|
23
|
-
import { SvelteComponentTyped } from "svelte";
|
|
24
14
|
declare const __propDef: {
|
|
25
15
|
props: {
|
|
26
16
|
[x: string]: never;
|
|
@@ -43,25 +43,33 @@
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
+
const openDialog = () => {
|
|
47
|
+
window.clearTimeout(closeDialogTimer);
|
|
48
|
+
(document.querySelector('.sui.app-shell') || document.body).appendChild(dialog);
|
|
49
|
+
showContent = true;
|
|
50
|
+
dialog.showModal();
|
|
51
|
+
|
|
52
|
+
window.requestAnimationFrame(() => {
|
|
53
|
+
showDialog = true;
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const closeDialog = () => {
|
|
58
|
+
showDialog = false;
|
|
59
|
+
|
|
60
|
+
closeDialogTimer = window.setTimeout(() => {
|
|
61
|
+
showContent = false;
|
|
62
|
+
dialog?.close();
|
|
63
|
+
dialog?.remove();
|
|
64
|
+
}, 500);
|
|
65
|
+
};
|
|
66
|
+
|
|
46
67
|
$: {
|
|
47
68
|
if (dialog) {
|
|
48
69
|
if ($open) {
|
|
49
|
-
|
|
50
|
-
(document.querySelector('.sui.app-shell') || document.body).appendChild(dialog);
|
|
51
|
-
showContent = true;
|
|
52
|
-
dialog.showModal();
|
|
53
|
-
|
|
54
|
-
window.requestAnimationFrame(() => {
|
|
55
|
-
showDialog = true;
|
|
56
|
-
});
|
|
70
|
+
openDialog();
|
|
57
71
|
} else {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
closeDialogTimer = window.setTimeout(() => {
|
|
61
|
-
showContent = false;
|
|
62
|
-
dialog?.close();
|
|
63
|
-
dialog?.remove();
|
|
64
|
-
}, 500);
|
|
72
|
+
closeDialog();
|
|
65
73
|
}
|
|
66
74
|
}
|
|
67
75
|
}
|
|
@@ -77,7 +85,7 @@
|
|
|
77
85
|
});
|
|
78
86
|
</script>
|
|
79
87
|
|
|
80
|
-
<dialog class="sui popup" bind:this={dialog} class:open={showDialog}>
|
|
88
|
+
<dialog class="sui popup" bind:this={dialog} class:open={showDialog} {...$$restProps}>
|
|
81
89
|
<!-- Prevent the first item in the slot, e.g. a menu item, from being focused by adding `tabindex`
|
|
82
90
|
to the container -->
|
|
83
91
|
<!-- svelte-ignore a11y-no-noninteractive-tabindex -->
|
|
@@ -2,39 +2,30 @@
|
|
|
2
2
|
/** @typedef {typeof __propDef.events} PopupEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} PopupSlots */
|
|
4
4
|
/** Generic popup helper. */
|
|
5
|
-
export default class Popup
|
|
6
|
-
dialog?: HTMLElement;
|
|
7
|
-
anchor?: HTMLElement;
|
|
8
|
-
position?: any;
|
|
9
|
-
open?: import("svelte/store").Writable<boolean>;
|
|
10
|
-
}, {
|
|
11
|
-
[evt: string]: CustomEvent<any>;
|
|
12
|
-
}, {
|
|
13
|
-
default: {};
|
|
14
|
-
}> {
|
|
5
|
+
export default class Popup {
|
|
15
6
|
/**accessor*/
|
|
16
|
-
set anchor(arg:
|
|
17
|
-
get anchor():
|
|
7
|
+
set anchor(arg: any);
|
|
8
|
+
get anchor(): any;
|
|
18
9
|
/**accessor*/
|
|
19
|
-
set dialog(arg:
|
|
20
|
-
get dialog():
|
|
10
|
+
set dialog(arg: any);
|
|
11
|
+
get dialog(): any;
|
|
21
12
|
/**accessor*/
|
|
22
13
|
set position(arg: any);
|
|
23
14
|
get position(): any;
|
|
24
15
|
/**accessor*/
|
|
25
|
-
set open(arg:
|
|
26
|
-
get open():
|
|
16
|
+
set open(arg: any);
|
|
17
|
+
get open(): any;
|
|
27
18
|
}
|
|
28
19
|
export type PopupProps = typeof __propDef.props;
|
|
29
20
|
export type PopupEvents = typeof __propDef.events;
|
|
30
21
|
export type PopupSlots = typeof __propDef.slots;
|
|
31
|
-
import { SvelteComponentTyped } from "svelte";
|
|
32
22
|
declare const __propDef: {
|
|
33
23
|
props: {
|
|
24
|
+
[x: string]: any;
|
|
34
25
|
dialog?: (HTMLElement | undefined);
|
|
35
|
-
anchor?: (HTMLElement | undefined);
|
|
36
26
|
position?: any;
|
|
37
|
-
|
|
27
|
+
anchor?: (HTMLElement | undefined);
|
|
28
|
+
open?: any;
|
|
38
29
|
};
|
|
39
30
|
events: {
|
|
40
31
|
[evt: string]: CustomEvent<any>;
|
|
@@ -2,18 +2,11 @@
|
|
|
2
2
|
/** @typedef {typeof __propDef.events} PortalEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} PortalSlots */
|
|
4
4
|
/** @see https://github.com/sveltejs/svelte/issues/3088 */
|
|
5
|
-
export default class Portal
|
|
6
|
-
class?: string;
|
|
7
|
-
}, {
|
|
8
|
-
[evt: string]: CustomEvent<any>;
|
|
9
|
-
}, {
|
|
10
|
-
default: {};
|
|
11
|
-
}> {
|
|
5
|
+
export default class Portal {
|
|
12
6
|
}
|
|
13
7
|
export type PortalProps = typeof __propDef.props;
|
|
14
8
|
export type PortalEvents = typeof __propDef.events;
|
|
15
9
|
export type PortalSlots = typeof __propDef.slots;
|
|
16
|
-
import { SvelteComponentTyped } from "svelte";
|
|
17
10
|
declare const __propDef: {
|
|
18
11
|
props: {
|
|
19
12
|
class?: string;
|
package/package/index.d.ts
CHANGED
|
@@ -29,6 +29,7 @@ export { default as Row } from "./components/core/row.svelte";
|
|
|
29
29
|
export { default as SearchBar } from "./components/core/search-bar.svelte";
|
|
30
30
|
export { default as SelectButton } from "./components/core/select-button.svelte";
|
|
31
31
|
export { default as Separator } from "./components/core/separator.svelte";
|
|
32
|
+
export { default as Slider } from "./components/core/slider.svelte";
|
|
32
33
|
export { default as Spacer } from "./components/core/spacer.svelte";
|
|
33
34
|
export { default as Switch } from "./components/core/switch.svelte";
|
|
34
35
|
export { default as TabPanel } from "./components/core/tab-panel.svelte";
|
package/package/index.js
CHANGED
|
@@ -54,6 +54,7 @@ export { default as Row } from './components/core/row.svelte';
|
|
|
54
54
|
export { default as SearchBar } from './components/core/search-bar.svelte';
|
|
55
55
|
export { default as SelectButton } from './components/core/select-button.svelte';
|
|
56
56
|
export { default as Separator } from './components/core/separator.svelte';
|
|
57
|
+
export { default as Slider } from './components/core/slider.svelte';
|
|
57
58
|
export { default as Spacer } from './components/core/spacer.svelte';
|
|
58
59
|
export { default as Switch } from './components/core/switch.svelte';
|
|
59
60
|
export { default as TabPanel } from './components/core/tab-panel.svelte';
|
package/package.json
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sveltia/ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public"
|
|
8
|
+
},
|
|
6
9
|
"scripts": {
|
|
7
10
|
"dev": "vite dev",
|
|
8
11
|
"build": "svelte-kit sync && svelte-package -o package",
|
|
9
12
|
"build:watch": "svelte-kit sync && svelte-package -o package --watch",
|
|
10
13
|
"preview": "vite preview",
|
|
11
|
-
"
|
|
14
|
+
"prepublishOnly": "vite build",
|
|
12
15
|
"check": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json",
|
|
13
16
|
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./jsconfig.json --watch",
|
|
14
17
|
"format": "prettier --plugin-search-dir . --write .",
|
|
@@ -24,34 +27,34 @@
|
|
|
24
27
|
"svelte": "^3.55.1"
|
|
25
28
|
},
|
|
26
29
|
"devDependencies": {
|
|
27
|
-
"@babel/core": "^7.21.
|
|
30
|
+
"@babel/core": "^7.21.4",
|
|
28
31
|
"@babel/eslint-parser": "^7.21.3",
|
|
29
|
-
"@playwright/test": "^1.
|
|
32
|
+
"@playwright/test": "^1.32.1",
|
|
30
33
|
"@sveltejs/adapter-auto": "2.0.0",
|
|
31
|
-
"@sveltejs/kit": "1.
|
|
34
|
+
"@sveltejs/kit": "1.15.0",
|
|
32
35
|
"@sveltejs/package": "^2.0.2",
|
|
33
|
-
"cspell": "^6.
|
|
34
|
-
"eslint": "^8.
|
|
36
|
+
"cspell": "^6.31.1",
|
|
37
|
+
"eslint": "^8.37.0",
|
|
35
38
|
"eslint-config-airbnb-base": "^15.0.0",
|
|
36
|
-
"eslint-config-prettier": "^8.
|
|
39
|
+
"eslint-config-prettier": "^8.8.0",
|
|
37
40
|
"eslint-plugin-import": "^2.27.5",
|
|
38
41
|
"eslint-plugin-svelte3": "^4.0.0",
|
|
39
42
|
"npm-run-all": "^4.1.5",
|
|
40
43
|
"postcss": "^8.4.21",
|
|
41
44
|
"postcss-html": "^1.5.0",
|
|
42
|
-
"prettier": "^2.8.
|
|
43
|
-
"prettier-plugin-svelte": "^2.
|
|
44
|
-
"sass": "^1.
|
|
45
|
-
"stylelint": "^15.
|
|
45
|
+
"prettier": "^2.8.7",
|
|
46
|
+
"prettier-plugin-svelte": "^2.10.0",
|
|
47
|
+
"sass": "^1.60.0",
|
|
48
|
+
"stylelint": "^15.4.0",
|
|
46
49
|
"stylelint-config-recommended-scss": "^9.0.1",
|
|
47
|
-
"stylelint-scss": "^4.
|
|
50
|
+
"stylelint-scss": "^4.6.0",
|
|
48
51
|
"svelte-check": "^3.1.4",
|
|
49
52
|
"svelte-i18n": "^3.6.0",
|
|
50
53
|
"svelte-migrate": "^1.1.3",
|
|
51
|
-
"svelte-preprocess": "^5.0.
|
|
54
|
+
"svelte-preprocess": "^5.0.3",
|
|
52
55
|
"tslib": "^2.5.0",
|
|
53
|
-
"vite": "^4.2.
|
|
54
|
-
"vitest": "^0.29.
|
|
56
|
+
"vite": "^4.2.1",
|
|
57
|
+
"vitest": "^0.29.8"
|
|
55
58
|
},
|
|
56
59
|
"exports": {
|
|
57
60
|
"./package.json": "./package.json",
|
|
@@ -210,6 +213,11 @@
|
|
|
210
213
|
"svelte": "./package/components/core/separator.svelte",
|
|
211
214
|
"default": "./package/components/core/separator.svelte"
|
|
212
215
|
},
|
|
216
|
+
"./components/core/slider.svelte": {
|
|
217
|
+
"types": "./package/components/core/slider.svelte.d.ts",
|
|
218
|
+
"svelte": "./package/components/core/slider.svelte",
|
|
219
|
+
"default": "./package/components/core/slider.svelte"
|
|
220
|
+
},
|
|
213
221
|
"./components/core/spacer.svelte": {
|
|
214
222
|
"types": "./package/components/core/spacer.svelte.d.ts",
|
|
215
223
|
"svelte": "./package/components/core/spacer.svelte",
|