@kws3/ui 2.0.5 → 2.1.1

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 (108) hide show
  1. package/CHANGELOG.mdx +10 -0
  2. package/buttons/ConfirmButton.svelte +7 -6
  3. package/buttons/DeleteButton.svelte +14 -8
  4. package/buttons/ProcessButton.svelte +15 -9
  5. package/buttons/SubmitButton.svelte +11 -8
  6. package/canvas/Canvas.svelte +263 -0
  7. package/canvas/ESignature.svelte +101 -0
  8. package/canvas/PenControls.svelte +234 -0
  9. package/canvas/PenInput.svelte +152 -0
  10. package/charts/AreaChart.svelte +2 -2
  11. package/charts/BarChart.svelte +2 -2
  12. package/charts/Chart.svelte +16 -12
  13. package/charts/DonutChart.svelte +2 -2
  14. package/charts/LineChart.svelte +2 -2
  15. package/charts/MixedChart.svelte +2 -2
  16. package/charts/PieChart.svelte +2 -2
  17. package/charts/RadialChart.svelte +2 -2
  18. package/charts/utils.d.ts +553 -0
  19. package/charts/utils.d.ts.map +1 -0
  20. package/charts/utils.js +27 -4
  21. package/controls/Checkbox.svelte +7 -6
  22. package/controls/FileUpload.svelte +5 -4
  23. package/controls/NumberInput.svelte +5 -5
  24. package/controls/Radio.svelte +2 -2
  25. package/controls/RangeSlider.svelte +3 -3
  26. package/controls/Toggle.svelte +2 -2
  27. package/controls/ToggleButtons.svelte +1 -1
  28. package/datagrid/GridView/GridRow.svelte +4 -4
  29. package/datagrid/GridView/GridView.svelte +7 -4
  30. package/datagrid/Pagination/Pagination.svelte +12 -11
  31. package/form/index.d.ts +15 -0
  32. package/form/index.d.ts.map +1 -0
  33. package/forms/AutoComplete.svelte +5 -5
  34. package/forms/Datepicker.svelte +4 -3
  35. package/forms/MaskedInput.svelte +1 -1
  36. package/forms/PasswordInput.svelte +224 -0
  37. package/forms/PasswordValidator/validatePassword.d.ts +5 -0
  38. package/forms/PasswordValidator/validatePassword.d.ts.map +1 -0
  39. package/forms/SearchInput.svelte +10 -5
  40. package/forms/Timepicker.svelte +9 -6
  41. package/forms/actions.d.ts +9 -0
  42. package/forms/actions.d.ts.map +1 -0
  43. package/forms/actions.js +6 -0
  44. package/forms/colorpicker/Colorpicker.d.ts +3 -0
  45. package/forms/colorpicker/Colorpicker.d.ts.map +1 -0
  46. package/forms/colorpicker/Colorpicker.js +12 -2
  47. package/forms/colorpicker/Colorpicker.svelte +10 -3
  48. package/forms/select/MultiSelect.svelte +8 -9
  49. package/forms/select/SearchableSelect.svelte +10 -5
  50. package/helpers/CardModal.svelte +7 -2
  51. package/helpers/ClipboardCopier.svelte +3 -3
  52. package/helpers/Dialog/Dialog.svelte +9 -7
  53. package/helpers/Dialog/index.d.ts +42 -0
  54. package/helpers/Dialog/index.d.ts.map +1 -0
  55. package/helpers/Dialog/index.js +58 -19
  56. package/helpers/Divider.svelte +10 -4
  57. package/helpers/FloatingUI/Floatie.svelte +1 -1
  58. package/helpers/FloatingUI/index.d.ts +51 -0
  59. package/helpers/FloatingUI/index.d.ts.map +1 -0
  60. package/helpers/FloatingUI/index.js +13 -0
  61. package/helpers/Icon.svelte +14 -7
  62. package/helpers/Loader.svelte +5 -5
  63. package/helpers/Message.svelte +11 -6
  64. package/helpers/Modal.svelte +7 -2
  65. package/helpers/Notification.svelte +6 -2
  66. package/helpers/Popover.svelte +13 -6
  67. package/helpers/Skeleton.svelte +3 -3
  68. package/helpers/Timeline/Timeline.svelte +1 -1
  69. package/helpers/Timeline/TimelineItem.svelte +8 -4
  70. package/helpers/Tooltip.d.ts +19 -0
  71. package/helpers/Tooltip.d.ts.map +1 -0
  72. package/helpers/Tooltip.js +14 -1
  73. package/index.d.ts +69 -0
  74. package/index.d.ts.map +1 -0
  75. package/index.js +7 -0
  76. package/internal/DrawingPad.d.ts +86 -0
  77. package/internal/DrawingPad.d.ts.map +1 -0
  78. package/internal/DrawingPad.js +306 -0
  79. package/internal/UndoManager.d.ts +17 -0
  80. package/internal/UndoManager.d.ts.map +1 -0
  81. package/internal/UndoManager.js +84 -0
  82. package/internal/fuzzy.d.ts +24 -0
  83. package/internal/fuzzy.d.ts.map +1 -0
  84. package/internal/index.d.ts +16 -0
  85. package/internal/index.d.ts.map +1 -0
  86. package/internal/index.js +5 -1
  87. package/internal/scrollIntoActiveElement.d.ts +2 -0
  88. package/internal/scrollIntoActiveElement.d.ts.map +1 -0
  89. package/keyboard/index.d.ts +30 -0
  90. package/keyboard/index.d.ts.map +1 -0
  91. package/keyboard/index.js +1 -1
  92. package/package.json +7 -4
  93. package/resizeObserver/index.d.ts +8 -0
  94. package/resizeObserver/index.d.ts.map +1 -0
  95. package/search/index.d.ts +17 -0
  96. package/search/index.d.ts.map +1 -0
  97. package/settings.d.ts +22 -0
  98. package/settings.d.ts.map +1 -0
  99. package/settings.js +6 -1
  100. package/styles/Canvas.scss +100 -0
  101. package/transitions/components/getEasing.d.ts +2 -0
  102. package/transitions/components/getEasing.d.ts.map +1 -0
  103. package/tsconfig.json +33 -0
  104. package/types/index.d.ts +103 -9
  105. package/types/type-defs/index.d.ts +64 -0
  106. package/utils/index.d.ts +77 -0
  107. package/utils/index.d.ts.map +1 -0
  108. package/types/type-defs/index.ts +0 -14
@@ -2,7 +2,7 @@
2
2
  @component
3
3
 
4
4
 
5
- @param {'small'|'medium'|'large'} [size="small"] - Size of the modal, Default: `"small"`
5
+ @param {SizeOptions} [size=small] - Size of the modal, Default: `small`
6
6
  @param {boolean} [is_active=false] - Determines whether modal is displayed or not, Default: `false`
7
7
  @param {boolean} [closable=true] - If this is set to false, the modal cannot be closed using the UI
8
8
 
@@ -74,9 +74,14 @@ Only programmatic closing is possible, Default: `true`
74
74
  <script>
75
75
  import { fade, scale } from "svelte/transition";
76
76
  import { hasTransitions } from "../settings";
77
+
78
+ /**
79
+ * @typedef {import('@kws3/ui/types').SizeOptions} SizeOptions
80
+ */
81
+
77
82
  /**
78
83
  * Size of the modal
79
- * @type {import('@kws3/ui/types').SizeOptions}
84
+ * @type {SizeOptions}
80
85
  */
81
86
  export let size = "small",
82
87
  /**
@@ -2,7 +2,7 @@
2
2
  @component
3
3
 
4
4
 
5
- @param {''|'primary'|'success'|'warning'|'info'|'danger'|'light'|'dark'} [color="info"] - Color of the Notification box, Default: `"info"`
5
+ @param {ColorOptions} [color=info] - Color of the Notification box, Default: `info`
6
6
  @param {string} [style=""] - Inline CSS for notification content, Default: `""`
7
7
  @param {boolean} [light=false] - Inverted colors for notification box and contents, Default: `false`
8
8
  @param {boolean} [dismissable=false] - Determines whether close button is displayed or not, Default: `false`
@@ -33,9 +33,13 @@ The parent can then decide what to do with the component
33
33
  import { createEventDispatcher } from "svelte";
34
34
  const fire = createEventDispatcher();
35
35
 
36
+ /**
37
+ * @typedef {import('@kws3/ui/types').ColorOptions} ColorOptions
38
+ */
39
+
36
40
  /**
37
41
  * Color of the Notification box
38
- * @type {import('@kws3/ui/types').ColorOptions}
42
+ * @type {ColorOptions}
39
43
  */
40
44
  export let color = "info";
41
45
 
@@ -3,16 +3,16 @@
3
3
 
4
4
 
5
5
  @param {string} [icon="info-circle"] - Icon used when default slot has no content, Default: `"info-circle"`
6
- @param {string|''|'primary'|'success'|'warning'|'info'|'danger'|'dark'|'light'} [icon_color="primary"] - Colour of the trigger icon displayed when default slot has no content, Default: `"primary"`
7
- @param {string|''|'small'|'medium'|'large'} [icon_size="small"] - Size of the trigger icon displayed when default slot has no content, Default: `"small"`
6
+ @param {ExtendedColorOptions} [icon_color=primary] - Colour of the trigger icon displayed when default slot has no content, Default: `primary`
7
+ @param {SizeOptions} [icon_size=small] - Size of the trigger icon displayed when default slot has no content, Default: `small`
8
8
  @param {string} [trigger="click"] - Determines the events that cause the Popover to show. Multiple event names are separated by spaces.
9
9
 
10
10
  **Examples:** `click`, `mouseenter`, `mouseenter focus`
11
11
 
12
12
  If you would like to trigger the popover programatically only, you can use `manual`., Default: `"click"`
13
- @param {string} [placement="auto"] - Preferred placement of the Popover
13
+ @param {TippyPositions} [placement=auto] - Preferred placement of the Popover
14
14
 
15
- Available options: <a target="_blank" href="https://atomiks.github.io/tippyjs/v6/all-props/#placement">https://atomiks.github.io/tippyjs/v6/all-props/#placement</a>, Default: `"auto"`
15
+ Available options: <a target="_blank" href="https://atomiks.github.io/tippyjs/v6/all-props/#placement">https://atomiks.github.io/tippyjs/v6/all-props/#placement</a>, Default: `auto`
16
16
  @param {boolean} [interactive=false] - Allows you to interact with the Popover content, when turned on, Default: `false`
17
17
  @param {boolean} [hide_on_click=true] - Whether the popover should hide on clicking outside of it, Default: `true`
18
18
  @param {object} [external_target=null] - Specify a target node reference to use as the Popover content
@@ -79,18 +79,24 @@ It can be any CSS value associated with `max-width` property, including `"none"`
79
79
 
80
80
  const fire = createEventDispatcher();
81
81
 
82
+ /**
83
+ * @typedef {import('@kws3/ui/types').ExtendedColorOptions} ExtendedColorOptions
84
+ * @typedef {import('@kws3/ui/types').SizeOptions} SizeOptions
85
+ * @typedef {import('@kws3/ui/types').TippyPositions} TippyPositions
86
+ */
87
+
82
88
  /**
83
89
  * Icon used when default slot has no content
84
90
  */
85
91
  export let icon = "info-circle";
86
92
  /**
87
93
  * Colour of the trigger icon displayed when default slot has no content
88
- * @type {import('@kws3/ui/types').ColorOptions | 'grey'}
94
+ * @type {ExtendedColorOptions}
89
95
  */
90
96
  export let icon_color = "primary";
91
97
  /**
92
98
  * Size of the trigger icon displayed when default slot has no content
93
- * @type {import('@kws3/ui/types').SizeOptions}
99
+ * @type {SizeOptions}
94
100
  */
95
101
  export let icon_size = "small";
96
102
  /**
@@ -105,6 +111,7 @@ It can be any CSS value associated with `max-width` property, including `"none"`
105
111
  * Preferred placement of the Popover
106
112
  *
107
113
  * Available options: <a target="_blank" href="https://atomiks.github.io/tippyjs/v6/all-props/#placement">https://atomiks.github.io/tippyjs/v6/all-props/#placement</a>
114
+ * @type {TippyPositions}
108
115
  */
109
116
  export let placement = "auto";
110
117
  /**
@@ -11,7 +11,7 @@
11
11
  **Examples:** `10px` | `5rem`, Default: `"0px"`
12
12
  @param {boolean} [circle=false] - Whether the Skeleton should be rendered as a circle.
13
13
  If this is set to `true`, the `radius` property will be ignored., Default: `false`
14
- @param {'' | 'transparent' | 'warning' | 'info' | 'danger' | 'primary' | 'success' | 'link'} [color=""] - Color of the Skeleton lines, Default: `""`
14
+ @param {ColorOptions} [color=] - Color of the Skeleton lines, Default: ``
15
15
  @param {string} [class=""] - CSS class for Skeleton, Default: `""`
16
16
 
17
17
  -->
@@ -26,7 +26,7 @@ If this is set to `true`, the `radius` property will be ignored., Default: `fals
26
26
 
27
27
  <script>
28
28
  /**
29
- * @typedef {import('@kws3/ui/types').BGColorOptions} BGColorOptions
29
+ * @typedef {import('@kws3/ui/types').ColorOptions} ColorOptions
30
30
  */
31
31
  export let /**
32
32
  * Number of lines of text to display.
@@ -54,7 +54,7 @@ If this is set to `true`, the `radius` property will be ignored., Default: `fals
54
54
  circle = false,
55
55
  /**
56
56
  * Color of the Skeleton lines
57
- * @type {BGColorOptions}
57
+ * @type {ColorOptions}
58
58
  */
59
59
  color = "";
60
60
 
@@ -2,7 +2,7 @@
2
2
  @component
3
3
 
4
4
 
5
- @param {'left'|'center'|'right'} [align="left"] - Alignment of the Timeline child items, Default: `"left"`
5
+ @param {string|'left'|'center'|'right'} [align="left"] - Alignment of the Timeline child items, Default: `"left"`
6
6
  @param {string} [class=""] - CSS classes for the Timeline container, Default: `""`
7
7
 
8
8
  ### Slots
@@ -2,9 +2,9 @@
2
2
  @component
3
3
 
4
4
 
5
- @param {''|'dark' | 'light' | 'warning' | 'info' | 'danger' | 'primary' | 'success'} [color="primary"] - Color of marker and border, Default: `"primary"`
6
- @param {string} [marker_icon=""] - Any icon name accepted by the Icon component, icon will be placed inside the marker, Default: `"null"`
7
- @param {string} [marker_image=""] - Any image URL, the image will be placed inside the marker, Default: `"null"`
5
+ @param {ColorOptions} [color=primary] - Color of marker and border, Default: `primary`
6
+ @param {string} [marker_icon=""] - Any icon name accepted by the Icon component, icon will be placed inside the marker, Default: `""`
7
+ @param {string} [marker_image=""] - Any image URL, the image will be placed inside the marker, Default: `""`
8
8
  @param {string} [class=""] - CSS classes for the TimelineItem container, Default: `""`
9
9
 
10
10
  ### Slots
@@ -46,9 +46,13 @@
46
46
  <script>
47
47
  import { Icon } from "@kws3/ui";
48
48
 
49
+ /**
50
+ * @typedef {import('@kws3/ui/types').ColorOptions} ColorOptions
51
+ */
52
+
49
53
  /**
50
54
  * Color of marker and border
51
- * @type {import('@kws3/ui/types').ColorOptions}
55
+ * @type {ColorOptions}
52
56
  */
53
57
  export let color = "primary";
54
58
  /**
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @typedef {import('@kws3/ui/types').TippyPositions} TippyPositions
3
+ */
4
+ /**
5
+ * Activates tooltips via event delegation
6
+ * @param {string} container - CSS selector of container
7
+ * @param {object?} opts - tooltip options
8
+ */
9
+ export function activateTooltips(container: string, opts?: object | null): void;
10
+ /**
11
+ * @type {import("svelte/action").Action}
12
+ */
13
+ export let popover: import("svelte/action").Action;
14
+ /**
15
+ * @type {import("svelte/action").Action}
16
+ */
17
+ export let tooltip: import("svelte/action").Action;
18
+ export type TippyPositions = import('@kws3/ui/types').TippyPositions;
19
+ //# sourceMappingURL=Tooltip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["Tooltip.js"],"names":[],"mappings":"AAEA;;GAEG;AAEH;;;;GAIG;AACH,4CAHW,MAAM,SACN,MAAM,eAmBhB;AA8DD;;GAEG;AACH,oBAFU,OAAO,eAAe,EAAE,MAAM,CAkBrC;AAEH;;GAEG;AACH,oBAFU,OAAO,eAAe,EAAE,MAAM,CAWrC;6BAxHU,OAAO,gBAAgB,EAAE,cAAc"}
@@ -1,9 +1,13 @@
1
1
  import tippy, { delegate } from "tippy.js";
2
2
 
3
+ /**
4
+ * @typedef {import('@kws3/ui/types').TippyPositions} TippyPositions
5
+ */
6
+
3
7
  /**
4
8
  * Activates tooltips via event delegation
5
9
  * @param {string} container - CSS selector of container
6
- * @param {object} opts - tooltip options
10
+ * @param {object?} opts - tooltip options
7
11
  */
8
12
  export function activateTooltips(container, opts = {}) {
9
13
  let _opts = Object.assign(
@@ -84,6 +88,9 @@ function createTippyAction(defaultOpts) {
84
88
  };
85
89
  }
86
90
 
91
+ /**
92
+ * @type {import("svelte/action").Action}
93
+ */
87
94
  export let popover = createTippyAction({
88
95
  appendTo: () => document.body,
89
96
  hideOnClick: true,
@@ -92,6 +99,9 @@ export let popover = createTippyAction({
92
99
  allowHTML: true,
93
100
  inertia: true,
94
101
  touch: true,
102
+ /**
103
+ * @type {TippyPositions}
104
+ */
95
105
  placement: "auto",
96
106
  trigger: "click",
97
107
  offset: [0, 10],
@@ -99,6 +109,9 @@ export let popover = createTippyAction({
99
109
  maxWidth: "none",
100
110
  });
101
111
 
112
+ /**
113
+ * @type {import("svelte/action").Action}
114
+ */
102
115
  export let tooltip = createTippyAction({
103
116
  animation: "scale",
104
117
  content(el) {
package/index.d.ts ADDED
@@ -0,0 +1,69 @@
1
+ export { applySettings } from "./settings.js";
2
+ export { default as Popover } from "./helpers/Popover.svelte";
3
+ export { default as Icon } from "./helpers/Icon.svelte";
4
+ export { default as Message } from "./helpers/Message.svelte";
5
+ export { default as Modal } from "./helpers/Modal.svelte";
6
+ export { default as CardModal } from "./helpers/CardModal.svelte";
7
+ export { default as Panel } from "./helpers/Panel.svelte";
8
+ export { default as Notification } from "./helpers/Notification.svelte";
9
+ export { default as Loader } from "./helpers/Loader.svelte";
10
+ export { default as ActionSheet } from "./helpers/ActionSheet.svelte";
11
+ export { default as Skeleton } from "./helpers/Skeleton.svelte";
12
+ export { default as Divider } from "./helpers/Divider.svelte";
13
+ export { default as Timeline } from "./helpers/Timeline/Timeline.svelte";
14
+ export { default as TimelineItem } from "./helpers/Timeline/TimelineItem.svelte";
15
+ export { default as TimelineHeader } from "./helpers/Timeline/TimelineHeader.svelte";
16
+ export { default as Nl2br } from "./helpers/Nl2br.svelte";
17
+ export { default as ClipboardCopier } from "./helpers/ClipboardCopier.svelte";
18
+ export { default as ScrollableList } from "./helpers/ScrollableList.svelte";
19
+ export { default as FloatingUIOutput } from "./helpers/FloatingUI/FloatingUIOutput.svelte";
20
+ export { default as Floatie } from "./helpers/FloatingUI/Floatie.svelte";
21
+ export { default as ConfirmButton } from "./buttons/ConfirmButton.svelte";
22
+ export { default as DeleteButton } from "./buttons/DeleteButton.svelte";
23
+ export { default as SubmitButton } from "./buttons/SubmitButton.svelte";
24
+ export { default as ProcessButton } from "./buttons/ProcessButton.svelte";
25
+ export { default as Checkbox } from "./controls/Checkbox.svelte";
26
+ export { default as FileUpload } from "./controls/FileUpload.svelte";
27
+ export { default as NumberInput } from "./controls/NumberInput.svelte";
28
+ export { default as Radio } from "./controls/Radio.svelte";
29
+ export { default as Toggle } from "./controls/Toggle.svelte";
30
+ export { default as ToggleButtons } from "./controls/ToggleButtons.svelte";
31
+ export { default as ToggleControl } from "./controls/ToggleControl.svelte";
32
+ export { default as RangeSlider } from "./controls/RangeSlider.svelte";
33
+ export { default as Canvas } from "./canvas/Canvas.svelte";
34
+ export { default as ESignature } from "./canvas/ESignature.svelte";
35
+ export { default as PenControls } from "./canvas/PenControls.svelte";
36
+ export { default as PenInput } from "./canvas/PenInput.svelte";
37
+ export { default as Transition } from "./transitions/Transition.svelte";
38
+ export { default as SlidingPane } from "./sliding-panes/SlidingPane.svelte";
39
+ export { default as SlidingPaneSet } from "./sliding-panes/SlidingPaneSet.svelte";
40
+ export { default as AutoComplete } from "./forms/AutoComplete.svelte";
41
+ export { default as SearchableSelect } from "./forms/select/SearchableSelect.svelte";
42
+ export { default as MultiSelect } from "./forms/select/MultiSelect.svelte";
43
+ export { default as MaskedInput } from "./forms/MaskedInput.svelte";
44
+ export { default as PasswordInput } from "./forms/PasswordInput.svelte";
45
+ export { default as Colorpicker } from "./forms/colorpicker/Colorpicker.svelte";
46
+ export { default as Datepicker } from "./forms/Datepicker.svelte";
47
+ export { default as Timepicker } from "./forms/Timepicker.svelte";
48
+ export { default as SearchInput } from "./forms/SearchInput.svelte";
49
+ export { default as PasswordValidator } from "./forms/PasswordValidator/PasswordValidator.svelte";
50
+ export { default as GridView } from "./datagrid/GridView/GridView.svelte";
51
+ export { default as TileView } from "./datagrid/TileView/TileView.svelte";
52
+ export { default as DataSearch } from "./datagrid/DataSearch/DataSearch.svelte";
53
+ export { default as Pagination } from "./datagrid/Pagination/Pagination.svelte";
54
+ export { default as DataSort } from "./datagrid/DataSort/DataSort.svelte";
55
+ export { default as Chart } from "./charts/Chart.svelte";
56
+ export { default as DonutChart } from "./charts/DonutChart.svelte";
57
+ export { default as PieChart } from "./charts/PieChart.svelte";
58
+ export { default as MixedChart } from "./charts/MixedChart.svelte";
59
+ export { default as BarChart } from "./charts/BarChart.svelte";
60
+ export { default as LineChart } from "./charts/LineChart.svelte";
61
+ export { default as AreaChart } from "./charts/AreaChart.svelte";
62
+ export { default as RadialChart } from "./charts/RadialChart.svelte";
63
+ export { activateTooltips, tooltip, popover } from "./helpers/Tooltip.js";
64
+ export { alert, confirm, prompt, default as Dialog } from "./helpers/Dialog/index.js";
65
+ export { Notifications, Toasts, Snackbars, FloatiesStore } from "./helpers/FloatingUI/index.js";
66
+ export { portal, default as Portal } from "svelte-portal";
67
+ export { Pen, Eraser } from "./internal/DrawingPad.js";
68
+ export { datepicker as DatepickerAction, timepicker as TimepickerAction } from "./forms/actions.js";
69
+ //# sourceMappingURL=index.d.ts.map
package/index.d.ts.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":""}
package/index.js CHANGED
@@ -49,6 +49,12 @@ export { default as ToggleButtons } from "./controls/ToggleButtons.svelte";
49
49
  export { default as ToggleControl } from "./controls/ToggleControl.svelte";
50
50
  export { default as RangeSlider } from "./controls/RangeSlider.svelte";
51
51
 
52
+ export { default as Canvas } from "./canvas/Canvas.svelte";
53
+ export { default as ESignature } from "./canvas/ESignature.svelte";
54
+ export { default as PenControls } from "./canvas/PenControls.svelte";
55
+ export { default as PenInput } from "./canvas/PenInput.svelte";
56
+ export { Pen, Eraser } from "./internal/DrawingPad.js";
57
+
52
58
  export { default as Transition } from "./transitions/Transition.svelte";
53
59
 
54
60
  export { default as SlidingPane } from "./sliding-panes/SlidingPane.svelte";
@@ -58,6 +64,7 @@ export { default as AutoComplete } from "./forms/AutoComplete.svelte";
58
64
  export { default as SearchableSelect } from "./forms/select/SearchableSelect.svelte";
59
65
  export { default as MultiSelect } from "./forms/select/MultiSelect.svelte";
60
66
  export { default as MaskedInput } from "./forms/MaskedInput.svelte";
67
+ export { default as PasswordInput } from "./forms/PasswordInput.svelte";
61
68
  export { default as Colorpicker } from "./forms/colorpicker/Colorpicker.svelte";
62
69
  export { default as Datepicker } from "./forms/Datepicker.svelte";
63
70
  export { default as Timepicker } from "./forms/Timepicker.svelte";
@@ -0,0 +1,86 @@
1
+ export class DrawingPad {
2
+ /**
3
+ * DrawingPad constructor
4
+ * @param {{CANVAS:HTMLCanvasElement, fire:(string, object)=>void}} app
5
+ * @param {DrawingPadOptions} opts - Parameter description.
6
+ */
7
+ constructor(app: {
8
+ CANVAS: HTMLCanvasElement;
9
+ fire: (string: any, object: any) => void;
10
+ }, opts: DrawingPadOptions);
11
+ app: {
12
+ CANVAS: HTMLCanvasElement;
13
+ fire: (string: any, object: any) => void;
14
+ };
15
+ canvas: HTMLCanvasElement;
16
+ context: CanvasRenderingContext2D;
17
+ drawing: boolean;
18
+ currentPos: {
19
+ x: number;
20
+ y: number;
21
+ };
22
+ lastPos: {
23
+ x: number;
24
+ y: number;
25
+ };
26
+ scaleFactor: number;
27
+ drawingType: string;
28
+ penColor: string;
29
+ penWidth: number;
30
+ eraserWidth: number;
31
+ readonly: boolean;
32
+ image: string;
33
+ tools: import("@kws3/ui/types").DrawingTools;
34
+ undoManager: UndoManager;
35
+ prevState: ImageData;
36
+ START: any;
37
+ MOVE: any;
38
+ END: any;
39
+ RENDER: any;
40
+ prevent(e: any): void;
41
+ getPosition(e: any): {
42
+ x: number;
43
+ y: number;
44
+ };
45
+ render(): void;
46
+ draw(): void;
47
+ move(e: any): void;
48
+ end(e: any): void;
49
+ start(e: any): void;
50
+ addHistory(): void;
51
+ resetHistory(): void;
52
+ getImageData(): ImageData;
53
+ setImageData(data: any): void;
54
+ setImage(imgSrc: any, callBackFn: any): void;
55
+ fire(type: any): void;
56
+ canUndo(): boolean;
57
+ canRedo(): boolean;
58
+ init(): void;
59
+ is_readonly: boolean;
60
+ imageDataUrl: string;
61
+ syncImage(imgData: any): void;
62
+ addEvent(): void;
63
+ removeEvent(): void;
64
+ undo(): void;
65
+ redo(): void;
66
+ reset(): void;
67
+ setScaleFactor(f: any): void;
68
+ setTool(toolType: any): void;
69
+ setColor(color: any): void;
70
+ }
71
+ export namespace Pen {
72
+ const name: string;
73
+ const icon: string;
74
+ function draw(instance: any): void;
75
+ }
76
+ export namespace Eraser {
77
+ const name_1: string;
78
+ export { name_1 as name };
79
+ const icon_1: string;
80
+ export { icon_1 as icon };
81
+ export function draw_1(instance: any): void;
82
+ export { draw_1 as draw };
83
+ }
84
+ export type DrawingPadOptions = import('@kws3/ui/types').DrawingPadOptions;
85
+ import UndoManager from "./UndoManager";
86
+ //# sourceMappingURL=DrawingPad.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DrawingPad.d.ts","sourceRoot":"","sources":["DrawingPad.js"],"names":[],"mappings":"AAoBA;IACE;;;;OAIG;IACH;gBAHmB,iBAAiB;4CAAyB,IAAI;aACtD,iBAAiB,EA8B3B;IA3BC;gBAJiB,iBAAiB;4CAAyB,IAAI;MAIjD;IACd,0BAA6B;IAC7B,kCAA2C;IAC3C,iBAAoB;IACpB;;;MAAgC;IAChC;;;MAA8B;IAC9B,oBAAoC;IACpC,oBAAwB;IAExB,iBAA6B;IAC7B,iBAA6B;IAC7B,oBAAmC;IACnC,kBAA6B;IAC7B,cAAuB;IACvB,6CAAuB;IAMvB,yBAAoC;IACpC,qBAAqB;IAErB,WAAkC;IAClC,UAAgC;IAChC,SAA8B;IAC9B,YAAoC;IAGtC,sBAIC;IAED;;;MAeC;IAED,eAMC;IAED,aASC;IAED,mBAGC;IAED,kBAYC;IAED,oBAcC;IAED,mBAWC;IAED,qBAEC;IAED,0BAOC;IAED,8BAMC;IAED,6CAuBC;IAED,sBAUC;IAED,mBAEC;IAED,mBAEC;IAED,aASC;IARC,qBAAyC;IACzC,qBAAoC;IAStC,8BASC;IAED,iBAKC;IAED,oBAGC;IAED,aAKC;IAED,aAKC;IAED,cAKC;IAED,6BAEC;IAED,6BAEC;IAED,2BAEC;CACF;;;;IAKO,mCAQL;;;;;;;IAMK,4CAOL;;;gCA7SU,OAAO,gBAAgB,EAAE,iBAAiB;wBAH/B,eAAe"}