@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.
Files changed (67) hide show
  1. package/package/components/composite/calendar.svelte +5 -5
  2. package/package/components/composite/calendar.svelte.d.ts +1 -8
  3. package/package/components/composite/checkbox-group.svelte.d.ts +1 -11
  4. package/package/components/composite/combobox.svelte +22 -4
  5. package/package/components/composite/combobox.svelte.d.ts +3 -18
  6. package/package/components/composite/disclosure.svelte.d.ts +2 -11
  7. package/package/components/composite/grid.svelte.d.ts +1 -10
  8. package/package/components/composite/listbox.svelte.d.ts +7 -20
  9. package/package/components/composite/menu-item-group.svelte.d.ts +2 -12
  10. package/package/components/composite/menu.svelte.d.ts +5 -14
  11. package/package/components/composite/radio-button-group.svelte +1 -0
  12. package/package/components/composite/radio-button-group.svelte.d.ts +1 -10
  13. package/package/components/composite/select-button-group.svelte +1 -0
  14. package/package/components/composite/select-button-group.svelte.d.ts +1 -14
  15. package/package/components/composite/select.svelte.d.ts +3 -15
  16. package/package/components/composite/tab-list.svelte.d.ts +10 -23
  17. package/package/components/core/button.svelte +18 -22
  18. package/package/components/core/button.svelte.d.ts +26 -61
  19. package/package/components/core/checkbox.svelte +4 -2
  20. package/package/components/core/checkbox.svelte.d.ts +1 -14
  21. package/package/components/core/dialog.svelte +4 -3
  22. package/package/components/core/dialog.svelte.d.ts +3 -31
  23. package/package/components/core/grid-cell.svelte.d.ts +1 -9
  24. package/package/components/core/group.svelte.d.ts +2 -12
  25. package/package/components/core/icon.svelte.d.ts +2 -9
  26. package/package/components/core/menu-button.svelte +10 -18
  27. package/package/components/core/menu-button.svelte.d.ts +9 -15
  28. package/package/components/core/menu-item-checkbox.svelte.d.ts +2 -12
  29. package/package/components/core/menu-item-radio.svelte.d.ts +2 -12
  30. package/package/components/core/menu-item.svelte +1 -1
  31. package/package/components/core/menu-item.svelte.d.ts +4 -19
  32. package/package/components/core/number-input.svelte +7 -6
  33. package/package/components/core/number-input.svelte.d.ts +3 -17
  34. package/package/components/core/option.svelte +3 -1
  35. package/package/components/core/option.svelte.d.ts +12 -21
  36. package/package/components/core/password-input.svelte +8 -3
  37. package/package/components/core/password-input.svelte.d.ts +4 -15
  38. package/package/components/core/radio-button.svelte +4 -2
  39. package/package/components/core/radio-button.svelte.d.ts +1 -11
  40. package/package/components/core/row-group.svelte.d.ts +1 -9
  41. package/package/components/core/row.svelte.d.ts +1 -11
  42. package/package/components/core/search-bar.svelte +3 -3
  43. package/package/components/core/search-bar.svelte.d.ts +12 -26
  44. package/package/components/core/select-button.svelte +2 -0
  45. package/package/components/core/select-button.svelte.d.ts +8 -13
  46. package/package/components/core/separator.svelte.d.ts +1 -7
  47. package/package/components/core/slider.svelte +270 -0
  48. package/package/components/core/slider.svelte.d.ts +35 -0
  49. package/package/components/core/spacer.svelte.d.ts +1 -7
  50. package/package/components/core/switch.svelte.d.ts +2 -12
  51. package/package/components/core/tab-panel.svelte.d.ts +1 -9
  52. package/package/components/core/tab.svelte +2 -0
  53. package/package/components/core/tab.svelte.d.ts +7 -9
  54. package/package/components/core/text-area.svelte.d.ts +12 -26
  55. package/package/components/core/text-input.svelte.d.ts +16 -34
  56. package/package/components/core/toolbar.svelte.d.ts +1 -10
  57. package/package/components/editor/markdown.svelte +4 -1
  58. package/package/components/editor/markdown.svelte.d.ts +1 -7
  59. package/package/components/helpers/popup.d.ts +2 -7
  60. package/package/components/helpers/popup.js +28 -16
  61. package/package/components/util/app-shell.svelte.d.ts +1 -11
  62. package/package/components/util/popup.svelte +24 -16
  63. package/package/components/util/popup.svelte.d.ts +10 -19
  64. package/package/components/util/portal.svelte.d.ts +1 -8
  65. package/package/index.d.ts +1 -0
  66. package/package/index.js +1 -0
  67. package/package.json +24 -16
@@ -5,82 +5,46 @@
5
5
  * @see https://w3c.github.io/aria/#button
6
6
  * @see https://w3c.github.io/aria-practices/#button
7
7
  */
8
- export default class Button extends SvelteComponentTyped<{
9
- [x: string]: any;
10
- class?: string;
11
- label?: string;
12
- element?: HTMLButtonElement;
13
- type?: "button" | "submit" | "reset";
14
- role?: string;
15
- size?: "small" | "medium" | "large";
16
- hidden?: boolean;
17
- disabled?: boolean;
18
- pressed?: string | boolean;
19
- iconName?: string;
20
- iconLabel?: string;
21
- iconPosition?: "start" | "end";
22
- }, {
23
- mouseenter: MouseEvent;
24
- mouseleave: MouseEvent;
25
- click: MouseEvent;
26
- dragover: DragEvent;
27
- dragleave: DragEvent;
28
- dragend: DragEvent;
29
- drop: DragEvent;
30
- keydown: KeyboardEvent;
31
- keyup: KeyboardEvent;
32
- keypress: KeyboardEvent;
33
- } & {
34
- [evt: string]: CustomEvent<any>;
35
- }, {
36
- default: {};
37
- }> {
8
+ export default class Button {
38
9
  /**accessor*/
39
- set class(arg: string);
40
- get class(): string;
10
+ set class(arg: any);
11
+ get class(): any;
41
12
  /**accessor*/
42
- set element(arg: HTMLButtonElement);
43
- get element(): HTMLButtonElement;
13
+ set element(arg: any);
14
+ get element(): any;
44
15
  /**accessor*/
45
- set type(arg: "button" | "submit" | "reset");
46
- get type(): "button" | "submit" | "reset";
16
+ set type(arg: any);
17
+ get type(): any;
47
18
  /**accessor*/
48
- set role(arg: string);
49
- get role(): string;
19
+ set role(arg: any);
20
+ get role(): any;
50
21
  /**accessor*/
51
- set size(arg: "small" | "medium" | "large");
52
- get size(): "small" | "medium" | "large";
22
+ set size(arg: any);
23
+ get size(): any;
53
24
  /**accessor*/
54
- set hidden(arg: boolean);
55
- get hidden(): boolean;
25
+ set hidden(arg: any);
26
+ get hidden(): any;
56
27
  /**accessor*/
57
- set disabled(arg: boolean);
58
- get disabled(): boolean;
28
+ set disabled(arg: any);
29
+ get disabled(): any;
59
30
  /**accessor*/
60
- set pressed(arg: string | boolean);
61
- get pressed(): string | boolean;
31
+ set pressed(arg: any);
32
+ get pressed(): any;
62
33
  /**accessor*/
63
- set label(arg: string);
64
- get label(): string;
34
+ set label(arg: any);
35
+ get label(): any;
65
36
  /**accessor*/
66
- set iconName(arg: string);
67
- get iconName(): string;
68
- /**accessor*/
69
- set iconLabel(arg: string);
70
- get iconLabel(): string;
71
- /**accessor*/
72
- set iconPosition(arg: "start" | "end");
73
- get iconPosition(): "start" | "end";
37
+ set popupPosition(arg: any);
38
+ get popupPosition(): any;
74
39
  }
75
40
  export type ButtonProps = typeof __propDef.props;
76
41
  export type ButtonEvents = typeof __propDef.events;
77
42
  export type ButtonSlots = typeof __propDef.slots;
78
- import { SvelteComponentTyped } from "svelte";
79
43
  declare const __propDef: {
80
44
  props: {
81
45
  [x: string]: any;
82
- class?: string;
83
46
  label?: string;
47
+ class?: string;
84
48
  element?: (HTMLButtonElement | undefined);
85
49
  type?: ('button' | 'submit' | 'reset');
86
50
  role?: string;
@@ -88,9 +52,7 @@ declare const __propDef: {
88
52
  hidden?: boolean;
89
53
  disabled?: boolean;
90
54
  pressed?: (boolean | string | undefined);
91
- iconName?: string;
92
- iconLabel?: string;
93
- iconPosition?: ('start' | 'end');
55
+ popupPosition?: any;
94
56
  };
95
57
  events: {
96
58
  mouseenter: MouseEvent;
@@ -107,7 +69,10 @@ declare const __propDef: {
107
69
  [evt: string]: CustomEvent<any>;
108
70
  };
109
71
  slots: {
72
+ 'start-icon': {};
110
73
  default: {};
74
+ 'end-icon': {};
75
+ popup: {};
111
76
  };
112
77
  };
113
78
  export {};
@@ -7,6 +7,7 @@
7
7
  import { createEventDispatcher } from 'svelte';
8
8
  import { getRandomId } from '../helpers/util';
9
9
  import Button from './button.svelte';
10
+ import Icon from './icon.svelte';
10
11
 
11
12
  /**
12
13
  * CSS class name on the button.
@@ -53,7 +54,6 @@
53
54
  >
54
55
  <Button
55
56
  {id}
56
- iconName={indeterminate ? 'remove' : 'check'}
57
57
  role="checkbox"
58
58
  aria-checked={indeterminate ? 'mixed' : checked}
59
59
  aria-labelledby="{id}-label"
@@ -64,7 +64,9 @@
64
64
  checked = indeterminate ? true : !checked;
65
65
  indeterminate = false;
66
66
  }}
67
- />
67
+ >
68
+ <Icon slot="start-icon" name={indeterminate ? 'remove' : 'check'} />
69
+ </Button>
68
70
  {#if $$slots.default}
69
71
  <label id="{id}-label">
70
72
  <slot />
@@ -5,24 +5,11 @@
5
5
  * @see https://w3c.github.io/aria/#checkbox
6
6
  * @see https://w3c.github.io/aria-practices/#checkbox
7
7
  */
8
- export default class Checkbox extends SvelteComponentTyped<{
9
- class?: string;
10
- name?: string;
11
- value?: string;
12
- checked?: string | boolean;
13
- indeterminate?: boolean;
14
- }, {
15
- change: CustomEvent<any>;
16
- } & {
17
- [evt: string]: CustomEvent<any>;
18
- }, {
19
- default: {};
20
- }> {
8
+ export default class Checkbox {
21
9
  }
22
10
  export type CheckboxProps = typeof __propDef.props;
23
11
  export type CheckboxEvents = typeof __propDef.events;
24
12
  export type CheckboxSlots = typeof __propDef.slots;
25
- import { SvelteComponentTyped } from "svelte";
26
13
  declare const __propDef: {
27
14
  props: {
28
15
  class?: string;
@@ -7,6 +7,7 @@
7
7
  import { createEventDispatcher, onMount } from 'svelte';
8
8
  import { _ } from 'svelte-i18n';
9
9
  import Button from './button.svelte';
10
+ import Icon from './icon.svelte';
10
11
  import Spacer from './spacer.svelte';
11
12
 
12
13
  /**
@@ -134,13 +135,13 @@
134
135
  {#if showClose}
135
136
  <Button
136
137
  class="ternary iconic"
137
- iconName="close"
138
- iconLabel={$_('sui._.close')}
139
138
  on:click={() => {
140
139
  dialog.returnValue = 'close';
141
140
  open = false;
142
141
  }}
143
- />
142
+ >
143
+ <Icon slot="start-icon" name="close" label={$_('sui._.close')} />
144
+ </Button>
144
145
  {/if}
145
146
  {/if}
146
147
  </div>
@@ -5,45 +5,17 @@
5
5
  * @see https://w3c.github.io/aria/#dialog
6
6
  * @see https://w3c.github.io/aria-practices/#dialog_modal
7
7
  */
8
- export default class Dialog extends SvelteComponentTyped<{
9
- class?: string;
10
- size?: "small" | "medium" | "large";
11
- title?: string;
12
- open?: boolean;
13
- modal?: boolean;
14
- showCancel?: boolean;
15
- showOk?: boolean;
16
- showClose?: boolean;
17
- okLabel?: string;
18
- okDisabled?: boolean;
19
- cancelLabel?: string;
20
- cancelDisabled?: boolean;
21
- closeOnBackdropClick?: boolean;
22
- }, {
23
- submit: SubmitEvent;
24
- ok: CustomEvent<any>;
25
- cancel: CustomEvent<any>;
26
- close: CustomEvent<any>;
27
- } & {
28
- [evt: string]: CustomEvent<any>;
29
- }, {
30
- header: {};
31
- 'header-extra': {};
32
- default: {};
33
- footer: {};
34
- 'footer-extra': {};
35
- }> {
8
+ export default class Dialog {
36
9
  }
37
10
  export type DialogProps = typeof __propDef.props;
38
11
  export type DialogEvents = typeof __propDef.events;
39
12
  export type DialogSlots = typeof __propDef.slots;
40
- import { SvelteComponentTyped } from "svelte";
41
13
  declare const __propDef: {
42
14
  props: {
43
- class?: string;
44
- size?: ('small' | 'medium' | 'large');
45
15
  title?: string;
46
16
  open?: boolean;
17
+ class?: string;
18
+ size?: ('small' | 'medium' | 'large');
47
19
  modal?: boolean;
48
20
  showCancel?: boolean;
49
21
  showOk?: boolean;
@@ -1,19 +1,11 @@
1
1
  /** @typedef {typeof __propDef.props} GridCellProps */
2
2
  /** @typedef {typeof __propDef.events} GridCellEvents */
3
3
  /** @typedef {typeof __propDef.slots} GridCellSlots */
4
- export default class GridCell extends SvelteComponentTyped<{
5
- [x: string]: any;
6
- class?: string;
7
- }, {
8
- [evt: string]: CustomEvent<any>;
9
- }, {
10
- default: {};
11
- }> {
4
+ export default class GridCell {
12
5
  }
13
6
  export type GridCellProps = typeof __propDef.props;
14
7
  export type GridCellEvents = typeof __propDef.events;
15
8
  export type GridCellSlots = typeof __propDef.slots;
16
- import { SvelteComponentTyped } from "svelte";
17
9
  declare const __propDef: {
18
10
  props: {
19
11
  [x: string]: any;
@@ -1,26 +1,16 @@
1
1
  /** @typedef {typeof __propDef.props} GroupProps */
2
2
  /** @typedef {typeof __propDef.events} GroupEvents */
3
3
  /** @typedef {typeof __propDef.slots} GroupSlots */
4
- export default class Group extends SvelteComponentTyped<{
5
- [x: string]: any;
6
- class?: string;
7
- title?: string;
8
- ariaLabel?: string;
9
- }, {
10
- [evt: string]: CustomEvent<any>;
11
- }, {
12
- default: {};
13
- }> {
4
+ export default class Group {
14
5
  }
15
6
  export type GroupProps = typeof __propDef.props;
16
7
  export type GroupEvents = typeof __propDef.events;
17
8
  export type GroupSlots = typeof __propDef.slots;
18
- import { SvelteComponentTyped } from "svelte";
19
9
  declare const __propDef: {
20
10
  props: {
21
11
  [x: string]: any;
22
- class?: string;
23
12
  title?: string;
13
+ class?: string;
24
14
  ariaLabel?: string;
25
15
  };
26
16
  events: {
@@ -1,23 +1,16 @@
1
1
  /** @typedef {typeof __propDef.props} IconProps */
2
2
  /** @typedef {typeof __propDef.events} IconEvents */
3
3
  /** @typedef {typeof __propDef.slots} IconSlots */
4
- export default class Icon extends SvelteComponentTyped<{
5
- class?: string;
6
- name?: string;
7
- label?: string;
8
- }, {
9
- [evt: string]: CustomEvent<any>;
10
- }, {}> {
4
+ export default class Icon {
11
5
  }
12
6
  export type IconProps = typeof __propDef.props;
13
7
  export type IconEvents = typeof __propDef.events;
14
8
  export type IconSlots = typeof __propDef.slots;
15
- import { SvelteComponentTyped } from "svelte";
16
9
  declare const __propDef: {
17
10
  props: {
11
+ label?: string;
18
12
  class?: string;
19
13
  name?: string;
20
- label?: string;
21
14
  };
22
15
  events: {
23
16
  [evt: string]: CustomEvent<any>;
@@ -3,7 +3,6 @@
3
3
  @see https://w3c.github.io/aria-practices/#menubutton
4
4
  -->
5
5
  <script>
6
- import Menu from '../composite/menu.svelte';
7
6
  import Popup from '../util/popup.svelte';
8
7
  import Button from './button.svelte';
9
8
 
@@ -19,25 +18,17 @@
19
18
  * Where to show the dropdown menu.
20
19
  * @type {PopupPosition}
21
20
  */
22
- export let position = 'bottom-left';
23
-
24
- /**
25
- * Whether to show an arrow icon next to the label, if `iconName` is not given. The default is
26
- * `true`.
27
- */
28
- export let showArrow = true;
21
+ export let popupPosition = 'bottom-left';
29
22
 
30
23
  /** @type {?Button} */
31
24
  let buttonComponent;
32
- /** @type {?Menu} */
33
- let menuComponent;
25
+ /** @type {?Popup} */
26
+ let popupComponent;
34
27
  </script>
35
28
 
36
29
  <Button
37
30
  class="sui menu-button {className}"
38
31
  aria-haspopup="menu"
39
- iconName={$$props.iconName || (showArrow ? 'arrow_drop_down' : undefined)}
40
- iconPosition="end"
41
32
  {...$$restProps}
42
33
  bind:this={buttonComponent}
43
34
  on:keydown={(event) => {
@@ -47,7 +38,7 @@
47
38
  event.preventDefault();
48
39
 
49
40
  const members = [
50
- ...menuComponent.element.querySelectorAll('[role^="menuitem"]:not([aria-disabled="true"])'),
41
+ ...popupComponent.dialog.querySelectorAll('[role^="menuitem"]:not([aria-disabled="true"])'),
51
42
  ];
52
43
 
53
44
  if (members.length) {
@@ -56,10 +47,11 @@
56
47
  }
57
48
  }}
58
49
  >
59
- <slot name="button" />
50
+ <slot name="start-icon" slot="start-icon" />
51
+ <slot />
52
+ <slot name="end-icon" slot="end-icon" />
60
53
  </Button>
61
- <Popup anchor={buttonComponent?.element} {position}>
62
- <Menu bind:this={menuComponent}>
63
- <slot />
64
- </Menu>
54
+
55
+ <Popup anchor={buttonComponent?.element} position={popupPosition} bind:this={popupComponent}>
56
+ <slot name="popup" />
65
57
  </Popup>
@@ -2,35 +2,29 @@
2
2
  /** @typedef {typeof __propDef.events} MenuButtonEvents */
3
3
  /** @typedef {typeof __propDef.slots} MenuButtonSlots */
4
4
  /** @see https://w3c.github.io/aria-practices/#menubutton */
5
- export default class MenuButton extends SvelteComponentTyped<{
6
- [x: string]: any;
7
- class?: string;
8
- position?: any;
9
- showArrow?: boolean;
10
- }, {
11
- [evt: string]: CustomEvent<any>;
12
- }, {
13
- button: {};
14
- default: {};
15
- }> {
5
+ export default class MenuButton {
16
6
  }
17
7
  export type MenuButtonProps = typeof __propDef.props;
18
8
  export type MenuButtonEvents = typeof __propDef.events;
19
9
  export type MenuButtonSlots = typeof __propDef.slots;
20
- import { SvelteComponentTyped } from "svelte";
21
10
  declare const __propDef: {
22
11
  props: {
23
12
  [x: string]: any;
24
13
  class?: string;
25
- position?: any;
26
- showArrow?: boolean;
14
+ popupPosition?: any;
27
15
  };
28
16
  events: {
29
17
  [evt: string]: CustomEvent<any>;
30
18
  };
31
19
  slots: {
32
- button: {};
20
+ 'start-icon': {
21
+ slot: string;
22
+ };
33
23
  default: {};
24
+ 'end-icon': {
25
+ slot: string;
26
+ };
27
+ popup: {};
34
28
  };
35
29
  };
36
30
  export {};
@@ -2,28 +2,18 @@
2
2
  /** @typedef {typeof __propDef.events} MenuItemCheckboxEvents */
3
3
  /** @typedef {typeof __propDef.slots} MenuItemCheckboxSlots */
4
4
  /** @see https://w3c.github.io/aria/#menuitemcheckbox */
5
- export default class MenuItemCheckbox extends SvelteComponentTyped<{
6
- [x: string]: any;
7
- class?: string;
8
- }, {
9
- click: MouseEvent;
10
- } & {
11
- [evt: string]: CustomEvent<any>;
12
- }, {
13
- default: {};
14
- }> {
5
+ export default class MenuItemCheckbox {
15
6
  }
16
7
  export type MenuItemCheckboxProps = typeof __propDef.props;
17
8
  export type MenuItemCheckboxEvents = typeof __propDef.events;
18
9
  export type MenuItemCheckboxSlots = typeof __propDef.slots;
19
- import { SvelteComponentTyped } from "svelte";
20
10
  declare const __propDef: {
21
11
  props: {
22
12
  [x: string]: any;
23
13
  class?: string;
24
14
  };
25
15
  events: {
26
- click: MouseEvent;
16
+ click: any;
27
17
  } & {
28
18
  [evt: string]: CustomEvent<any>;
29
19
  };
@@ -2,28 +2,18 @@
2
2
  /** @typedef {typeof __propDef.events} MenuItemRadioEvents */
3
3
  /** @typedef {typeof __propDef.slots} MenuItemRadioSlots */
4
4
  /** @see https://w3c.github.io/aria/#menuitemradio */
5
- export default class MenuItemRadio extends SvelteComponentTyped<{
6
- [x: string]: any;
7
- class?: string;
8
- }, {
9
- click: MouseEvent;
10
- } & {
11
- [evt: string]: CustomEvent<any>;
12
- }, {
13
- default: {};
14
- }> {
5
+ export default class MenuItemRadio {
15
6
  }
16
7
  export type MenuItemRadioProps = typeof __propDef.props;
17
8
  export type MenuItemRadioEvents = typeof __propDef.events;
18
9
  export type MenuItemRadioSlots = typeof __propDef.slots;
19
- import { SvelteComponentTyped } from "svelte";
20
10
  declare const __propDef: {
21
11
  props: {
22
12
  [x: string]: any;
23
13
  class?: string;
24
14
  };
25
15
  events: {
26
- click: MouseEvent;
16
+ click: any;
27
17
  } & {
28
18
  [evt: string]: CustomEvent<any>;
29
19
  };
@@ -48,7 +48,7 @@
48
48
  }}
49
49
  >
50
50
  {#if iconName}
51
- <Icon name={iconName} label={iconLabel} />
51
+ <Icon slot="start-icon" name={iconName} label={iconLabel} />
52
52
  {/if}
53
53
  {#if label}
54
54
  <span class="label">{label}</span>
@@ -2,38 +2,23 @@
2
2
  /** @typedef {typeof __propDef.events} MenuItemEvents */
3
3
  /** @typedef {typeof __propDef.slots} MenuItemSlots */
4
4
  /** @see https://w3c.github.io/aria/#menuitem */
5
- export default class MenuItem extends SvelteComponentTyped<{
6
- [x: string]: any;
7
- class?: string;
8
- label?: string;
9
- role?: "menuitem" | "menuitemcheckbox" | "menuitemradio";
10
- iconName?: string;
11
- iconLabel?: string;
12
- checked?: boolean;
13
- }, {
14
- click: MouseEvent;
15
- } & {
16
- [evt: string]: CustomEvent<any>;
17
- }, {
18
- default: {};
19
- }> {
5
+ export default class MenuItem {
20
6
  }
21
7
  export type MenuItemProps = typeof __propDef.props;
22
8
  export type MenuItemEvents = typeof __propDef.events;
23
9
  export type MenuItemSlots = typeof __propDef.slots;
24
- import { SvelteComponentTyped } from "svelte";
25
10
  declare const __propDef: {
26
11
  props: {
27
12
  [x: string]: any;
28
- class?: string;
29
13
  label?: string;
14
+ class?: string;
30
15
  role?: ('menuitem' | 'menuitemcheckbox' | 'menuitemradio');
16
+ checked?: boolean;
31
17
  iconName?: string;
32
18
  iconLabel?: string;
33
- checked?: boolean;
34
19
  };
35
20
  events: {
36
- click: MouseEvent;
21
+ click: any;
37
22
  } & {
38
23
  [evt: string]: CustomEvent<any>;
39
24
  };
@@ -5,6 +5,7 @@
5
5
  <script>
6
6
  import { _ } from 'svelte-i18n';
7
7
  import Button from './button.svelte';
8
+ import Icon from './icon.svelte';
8
9
  import TextInput from './text-input.svelte';
9
10
 
10
11
  /**
@@ -70,21 +71,21 @@
70
71
  <Button
71
72
  class="iconic"
72
73
  disabled={disabled || Number.isNaN(Number(value))}
73
- iconLabel={$_('sui.number_input.decrease')}
74
- iconName={'arrow_downward'}
75
74
  on:click={() => {
76
75
  decrease();
77
76
  }}
78
- />
77
+ >
78
+ <Icon slot="start-icon" name="arrow_downward" label={$_('sui.number_input.decrease')} />
79
+ </Button>
79
80
  <Button
80
81
  class="iconic"
81
82
  disabled={disabled || Number.isNaN(Number(value))}
82
- iconLabel={$_('sui.number_input.increase')}
83
- iconName={'arrow_upward'}
84
83
  on:click={() => {
85
84
  increase();
86
85
  }}
87
- />
86
+ >
87
+ <Icon slot="start-icon" name={'arrow_upward'} label={$_('sui.number_input.increase')} />
88
+ </Button>
88
89
  </div>
89
90
 
90
91
  <style>.number-input {
@@ -2,25 +2,11 @@
2
2
  /** @typedef {typeof __propDef.events} NumberInputEvents */
3
3
  /** @typedef {typeof __propDef.slots} NumberInputSlots */
4
4
  /** @see https://w3c.github.io/aria/#textbox */
5
- export default class NumberInput extends SvelteComponentTyped<{
6
- [x: string]: any;
7
- class?: string;
8
- disabled?: boolean;
9
- value?: string;
10
- min?: any;
11
- max?: any;
12
- step?: number;
13
- }, {
14
- keypress: KeyboardEvent;
15
- input: Event;
16
- } & {
17
- [evt: string]: CustomEvent<any>;
18
- }, {}> {
5
+ export default class NumberInput {
19
6
  }
20
7
  export type NumberInputProps = typeof __propDef.props;
21
8
  export type NumberInputEvents = typeof __propDef.events;
22
9
  export type NumberInputSlots = typeof __propDef.slots;
23
- import { SvelteComponentTyped } from "svelte";
24
10
  declare const __propDef: {
25
11
  props: {
26
12
  [x: string]: any;
@@ -32,8 +18,8 @@ declare const __propDef: {
32
18
  step?: number;
33
19
  };
34
20
  events: {
35
- keypress: KeyboardEvent;
36
- input: Event;
21
+ keypress: any;
22
+ input: any;
37
23
  } & {
38
24
  [evt: string]: CustomEvent<any>;
39
25
  };
@@ -28,10 +28,12 @@
28
28
  on:dragend
29
29
  on:drop
30
30
  >
31
- <slot />
32
31
  {#if selected}
33
32
  <Icon class="check" name="check" />
34
33
  {/if}
34
+ <slot name="start-icon" slot="start-icon" />
35
+ <slot />
36
+ <slot name="end-icon" slot="end-icon" />
35
37
  </Button>
36
38
  </div>
37
39