@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
@@ -5,8 +5,8 @@
5
5
  @param {object} [value=null] - Value of radio button, Default: `null`
6
6
  @param {string} [style=""] - Inline CSS for the Radio button, Default: `""`
7
7
  @param {string} [label_style=""] - Inline CSS for Radio label, Default: `""`
8
- @param {''|'small'|'medium'|'large'} [size=""] - Size of the Radio Button, Default: `""`
9
- @param {''|'primary'|'warning'|'success'|'info'|'danger'|'dark'|'light'} [color=""] - Color of the Radio button when selected, Default: `""`
8
+ @param {SizeOptions} [size=] - Size of the Radio Button, Default: ``
9
+ @param {ColorOptions} [color=] - Color of the Radio button when selected, Default: ``
10
10
  @param {boolean} [inverted=false] - Inverts the Radio colour theme, Default: `false`
11
11
  @param {boolean} [circle=false] - Circular Radio button instead of the default square, Default: `false`
12
12
  @param {boolean} [disabled=false] - Disables Radio button, Default: `false`
@@ -12,8 +12,8 @@ This property can be bound to, to fetch the current value
12
12
  This will be overridden if `min` is higher, or `max` is lower, Default: `0`
13
13
  @param {boolean} [output=false] - Displays the current value, Default: `false`
14
14
  @param {boolean} [disabled=false] - Disables the Slider, Default: `false`
15
- @param {''|'small'|'medium'|'large'} [size=""] - Size of the Slider, Default: `""`
16
- @param {''|'primary'|'warning'|'success'|'info'|'danger'|'dark'|'light'} [color=""] - Colour of the Slider, Default: `""`
15
+ @param {SizeOptions} [size=] - Size of the Slider, Default: ``
16
+ @param {ColorOptions} [color=] - Colour of the Slider, Default: ``
17
17
  @param {string} [style=""] - Inline CSS for the Slider, Default: `""`
18
18
  @param {boolean} [circle=false] - Uses a round slider thumb instead of the default square, Default: `false`
19
19
  @param {boolean} [tooltip=false] - Displays the current value of the Slider as a tooltip
@@ -23,7 +23,7 @@ This will be overridden if `min` is higher, or `max` is lower, Default: `0`
23
23
 
24
24
  ### Events
25
25
  - `change` - Native input change event
26
- - `input` - Native input event
26
+ - `input`
27
27
 
28
28
  -->
29
29
  <div class="kws-range-control">
@@ -6,10 +6,10 @@
6
6
 
7
7
  This property can be bound to, to fetch the current value, Default: `false`
8
8
  @param {boolean} [disabled=false] - Disables the Toggle, Default: `false`
9
- @param {''|'primary'|'warning'|'success'|'info'|'danger'|'dark'|'light'} [color=""] - Color of the Toggle, Default: `""`
9
+ @param {ColorOptions} [color=] - Color of the Toggle, Default: ``
10
10
  @param {string} [on_text=""] - Text displayed on the Toggle when ON, Default: `""`
11
11
  @param {string} [off_text=""] - Text displayed on the Toggle when OFF, Default: `""`
12
- @param {''|'small'|'medium'|'large'} [size=""] - Size of the Toggle, Default: `""`
12
+ @param {SizeOptions} [size=] - Size of the Toggle, Default: ``
13
13
  @param {string} [cy=""] - data-cy attribute for cypress, Default: `""`
14
14
  @param {string} [class=""] - CSS classes for the Toggle, Default: `""`
15
15
 
@@ -19,7 +19,7 @@ This property can be bound to, to fetch the current value, Default: `null`
19
19
  @param {string} [inner_class=""] - CSS classes for Button `.control` wrapper, Default: `""`
20
20
  @param {string} [active_class="is-primary"] - CSS classes to apply when a button is active (pressed), Default: `"is-primary"`
21
21
  @param {string} [inactive_class="is-outlined"] - CSS classes to apply when a button is inactive (not pressed), Default: `"is-outlined"`
22
- @param {''|'small'|'medium'|'large'} [size=""] - Size of the Toggle Buttons, Default: `""`
22
+ @param {SizeOptions} [size=] - Size of the Toggle Buttons, Default: ``
23
23
  @param {boolean} [fullwidth=false] - Expand all buttons so that they occupy full width of wrapping element, Default: `false`
24
24
  @param {string} [class=""] - CSS classes for the Button container, Default: `""`
25
25
 
@@ -12,12 +12,12 @@
12
12
  @param {object} [classNames={}] - Contails all CSS class for each column, Default: `{}`
13
13
  @param {boolean} [transition=false] - Determines whether the row has transition effect or not, Default: `false`
14
14
  @param {object} [styles={}] - Contains all CSS styles for each column, Default: `{}`
15
- @param {array} [column_keys=[]] - Column_keys property, Default: `[]`
15
+ @param {array} [column_keys=[]] - Column keys, Default: `[]`
16
16
  @param {boolean} [bulk_actions=false] - Determines if selecting multiple rows and doing multiple actions is allowed, Default: `false`
17
17
  @param {boolean} [checked=false] - Determines whether the checkbox is checked or not, Default: `false`
18
18
  @param {array} [selectedIds=[]] - List of unique IDs of all the selected rows, Default: `[]`
19
- @param {string} [selectCheckboxColor="info"] - Selected checkbox color, Default: `"info"`
20
- @param {string} [selectCheckboxSize="medium"] - selected checkbox size, Default: `"medium"`
19
+ @param {ColorOptions} [selectCheckboxColor=info] - Selected checkbox color, Default: `info`
20
+ @param {SizeOptions} [selectCheckboxSize=medium] - selected checkbox size, Default: `medium`
21
21
  @param {function} [cellComponent()] - Custom cell component for a column
22
22
 
23
23
  ### Events
@@ -166,7 +166,7 @@
166
166
  selectedIds = [],
167
167
  /**
168
168
  * Selected checkbox color
169
- * @type {Exclude<ColorOptions, 'success'>}
169
+ * @type {ColorOptions}
170
170
  */
171
171
  selectCheckboxColor = "info",
172
172
  /**
@@ -14,9 +14,9 @@
14
14
  @param {boolean} [bulk_actions=false] - Determines if selecting multiple rows and doing multiple actions is allowed, Default: `false`
15
15
  @param {boolean} [selectAll=false] - Determines if all rows are selected, Default: `false`
16
16
  @param {array} [selectedIds=[]] - List of unique IDs of all the selected rows, Default: `[]`
17
- @param {string} [selectAllCheckboxColor="primary"] - Colour of the `select all` checkbox, Default: `"primary"`
18
- @param {string} [selectCheckboxColor="info"] - Color of the checkbox on each row, Default: `"info"`
19
- @param {string} [selectCheckboxSize="medium"] - Size of the checkbox, Default: `"medium"`
17
+ @param {ColorOptions} [selectAllCheckboxColor=primary] - Colour of the `select all` checkbox, Default: `primary`
18
+ @param {ColorOptions} [selectCheckboxColor=info] - Color of the checkbox on each row, Default: `info`
19
+ @param {SizeOptions} [selectCheckboxSize=medium] - Size of the checkbox, Default: `medium`
20
20
  @param {object} [valueTransformers={}] - Contains all custom values for each column, Default: `{}`
21
21
  @param {object} [classTransformers={}] - CSS classes for each column, Default: `{}`
22
22
  @param {object} [styleTransformers={}] - CSS styles for each column, Default: `{}`
@@ -95,6 +95,7 @@
95
95
 
96
96
  /**
97
97
  * @typedef {import('@kws3/ui/types').ColorOptions} ColorOptions
98
+ * @typedef {import('@kws3/ui/types').SizeOptions} SizeOptions
98
99
  */
99
100
 
100
101
  /**
@@ -149,15 +150,17 @@
149
150
  selectedIds = [],
150
151
  /**
151
152
  * Colour of the `select all` checkbox
152
- * @type {Exclude<ColorOptions, 'success'>}
153
+ * @type {ColorOptions}
153
154
  */
154
155
  selectAllCheckboxColor = "primary",
155
156
  /**
156
157
  * Color of the checkbox on each row
158
+ * @type {ColorOptions}
157
159
  */
158
160
  selectCheckboxColor = "info",
159
161
  /**
160
162
  * Size of the checkbox
163
+ * @type {SizeOptions}
161
164
  */
162
165
  selectCheckboxSize = "medium",
163
166
  /**
@@ -5,20 +5,20 @@
5
5
  @param {object} [meta={}] - Object containing `total`, `count`, `limit` and `offset` values
6
6
 
7
7
  **DEPRECATED**: Use `total`, `count`, `limit` and `offset` props instead, Default: `{}`
8
- @param {number} [limit=0] - How many items are meant to be per page, Default: `0`
9
- @param {number} [count=0] - How many items are actually in this page, Default: `0`
8
+ @param {number} [limit=0] - Number of items to be displayed per page, Default: `0`
9
+ @param {number} [count=0] - Number of items being displayed in this page, Default: `0`
10
10
  @param {number} [total=0] - Total number of items available, Default: `0`
11
11
  @param {number} [offset=0] - Offset of the first item in this page, Default: `0`
12
12
  @param {boolean} [showTotal=true] - Determines whether to show total or not, Default: `true`
13
- @param {boolean} [showCurrent=true] - Determines whether to show current page details, Default: `true`
14
- @param {boolean} [showPerPage=true] - Determines whether to show per page options, Default: `true`
13
+ @param {boolean} [showCurrent=true] - Determines whether to display a breakdown of the range of items currently being displayed in a page, Default: `true`
14
+ @param {boolean} [showPerPage=true] - Determines whether to display the UI that allows user to choose the number of items to be displayed per page, Default: `true`
15
15
  @param {number} [maxVisiblePages=10] - Maximum number of consecutive pages to show in pagination after which a break is introduced in between them, Default: `10`
16
16
  @param {string} [entityName="entries"] - String to display total entries, Default: `"entries"`
17
- @param {''|'small'|'medium'|'large'} [size="small"] - Size of the pagination elements, Default: `"small"`
17
+ @param {SizeOptions} [size=small] - Size of the pagination elements, Default: `small`
18
18
  @param {boolean} [frame=false] - Determines whether to show pagination frame or not, Default: `false`
19
19
  @param {string} [iconRight="chevron-right"] - Right navigation icon, Default: `"chevron-right"`
20
20
  @param {string} [iconLeft="chevron-left"] - Left navigation icon, Default: `"chevron-left"`
21
- @param {array} [perPageOptions=[]] - Displays the options for how many items to show per page, Default: `[]`
21
+ @param {array} [perPageOptions=[]] - Available options given to the user, to choose the number of items displayed per page, Default: `[]`
22
22
  @method `goto(targetPage)` - Go to an arbitrary page number
23
23
  @method `prev()` - Go to the previous page
24
24
  @method `next()` - Go to the next page
@@ -152,11 +152,11 @@
152
152
  offset: 0,
153
153
  },
154
154
  /**
155
- * How many items are meant to be per page
155
+ * Number of items to be displayed per page
156
156
  */
157
157
  limit = 0,
158
158
  /**
159
- * How many items are actually in this page
159
+ * Number of items being displayed in this page
160
160
  */
161
161
  count = 0,
162
162
  /**
@@ -172,11 +172,11 @@
172
172
  */
173
173
  showTotal = true,
174
174
  /**
175
- * Determines whether to show current page details
175
+ * Determines whether to display a breakdown of the range of items currently being displayed in a page
176
176
  */
177
177
  showCurrent = true,
178
178
  /**
179
- * Determines whether to show per page options
179
+ * Determines whether to display the UI that allows user to choose the number of items to be displayed per page
180
180
  */
181
181
  showPerPage = true,
182
182
  /**
@@ -189,6 +189,7 @@
189
189
  entityName = "entries",
190
190
  /**
191
191
  * Size of the pagination elements
192
+ *
192
193
  * @type {import('@kws3/ui/types').SizeOptions}
193
194
  */
194
195
  size = "small",
@@ -205,7 +206,7 @@
205
206
  */
206
207
  iconLeft = "chevron-left",
207
208
  /**
208
- * Displays the options for how many items to show per page
209
+ * Available options given to the user, to choose the number of items displayed per page
209
210
  */
210
211
  perPageOptions = [20, 50, 100, 150, 200, 250];
211
212
 
@@ -0,0 +1,15 @@
1
+ export function makeForms(items: any): any[] | {
2
+ formData: import("svelte/store").Writable<any>;
3
+ errors: import("svelte/store").Readable<any>;
4
+ touched: import("svelte/store").Readable<any>;
5
+ isValid: import("svelte/store").Readable<boolean>;
6
+ isTouched: import("svelte/store").Readable<any>;
7
+ tracker: import("svelte/store").Writable<any>;
8
+ update: (newData: any) => void;
9
+ reset: (e: any) => void;
10
+ setValidators: (newValidators: any) => void;
11
+ };
12
+ export function notEmpty(v: any): boolean;
13
+ export function noDigits(v: any): boolean;
14
+ export function withMsg(msg: any, fn: any): (v: any, otherFields: any) => any;
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAGA;;;;;;;;;;EAWC;AA2ID,0CAA4C;AAE5C,0CAAqC;AAErC,8EAA8E"}
@@ -16,9 +16,9 @@ Only send this prop if you want to fetch `options` asynchronously.
16
16
  Fuzzy match will not work if `search` function is set, as the backend service is meant to do the matching., Default: `"fuzzy"`
17
17
  @param {boolean} [highlighted_results=true] - Whether to show the highlighted or plain results in the dropdown., Default: `true`
18
18
  @param {number} [score_threshold=5] - Score threshold for fuzzy search strategy, setting high score gives more fuzzy matches., Default: `5`
19
- @param {number} [scoreThreshold=5] - (deprecated) Score threshold for fuzzy search strategy, setting high score gives more fuzzy matches., Default: `5`
20
- @param {string|''|'small'|'medium'|'large'} [size=""] - Size of the input, Default: `""`
21
- @param {string|''|'primary'|'success'|'warning'|'info'|'danger'|'dark'|'light'} [color=""] - Color of the input, Default: `""`
19
+ @param {number} [scoreThreshold=undefined] - (deprecated) Score threshold for fuzzy search strategy, setting high score gives more fuzzy matches., Default: `undefined`
20
+ @param {SizeOptions} [size=] - Size of the input, Default: ``
21
+ @param {ColorOptions} [color=] - Color of the input, Default: ``
22
22
  @param {string} [style=""] - Inline CSS for input container, Default: `""`
23
23
  @param {boolean} [readonly=false] - Marks component as read-only, Default: `false`
24
24
  @param {boolean} [disabled=false] - Disables the component, Default: `false`
@@ -192,12 +192,12 @@ Default value: `<span>{option.label}</span>`
192
192
  export let scoreThreshold = score_threshold;
193
193
  /**
194
194
  * Size of the input
195
- * @type {import('@kws3/ui/types').SizeOptions}
195
+ * @type {SizeOptions}
196
196
  */
197
197
  export let size = "";
198
198
  /**
199
199
  * Color of the input
200
- * @type {import('@kws3/ui/types').ColorOptions}
200
+ * @type {ColorOptions}
201
201
  */
202
202
  export let color = "";
203
203
  /**
@@ -8,10 +8,11 @@ In `range_mode`, the expected format is `yyyy-mm-dd to yyyy-mm-dd`
8
8
 
9
9
  This property can be bound to, to fetch the selected date or date range. Output is in the same format as input., Default: `""`
10
10
  @param {string} [style=""] - Inline CSS for the input, Default: `""`
11
- @param {string|''|'primary'|'warning'|'info'|'danger'|'dark'|'light'} [color=""] - Colour of the Date picker input, Default: `""`
11
+ @param {ColorOptions} [color=] - Colour of the Date picker input, Default: ``
12
12
  @param {boolean} [disabled=false] - Disables the component, Default: `false`
13
+ @param {boolean} [readonly=false] - Make input value read-only, Default: `false`
13
14
  @param {string} [placeholder="Select Date.."] - Placeholder text for the input, Default: `"Select Date.."`
14
- @param {string|'primary'|'warning'|'info'|'danger'|'dark'|'light'} [calendar_color="primary"] - Colour of the Calendar, Default: `"primary"`
15
+ @param {ColorOptions} [calendar_color=primary] - Colour of the Calendar, Default: `primary`
15
16
  @param {any} [min_date=null] - Set earliest selectable date as an object or string
16
17
 
17
18
  **Example:** `"2021-06-06"` or `"(new Date('2021-01-01'))"`, Default: `null`
@@ -95,7 +96,7 @@ See: https://flatpickr.js.org/options/, Default: `{}`
95
96
  export let placeholder = "Select Date..";
96
97
  /**
97
98
  * Colour of the Calendar
98
- * @type {Exclude<ColorOptions, ''>}
99
+ * @type {ColorOptions}
99
100
  */
100
101
  export let calendar_color = "primary";
101
102
  /**
@@ -36,7 +36,7 @@ Requires `guide` to be `true`, Default: `false`
36
36
  import {
37
37
  createTextMaskInputElement,
38
38
  conformToMask,
39
- } from "text-mask-core/src";
39
+ } from "@kws3/text-mask-core";
40
40
  /**
41
41
  * Mask array
42
42
  *
@@ -0,0 +1,224 @@
1
+ <!--
2
+ @component
3
+
4
+
5
+ @param {boolean} [show_field_icon=true] - whether to show field icon or not, Default: `true`
6
+ @param {string} [field_icon="lock"] - field icon name, Default: `"lock"`
7
+ @param {FontFamilies} [field_icon_family=fa] - Icon family to be used
8
+
9
+ Defaults to global family set via `Icon.setDefaultIconType()`
10
+
11
+ Ultimately defaults to `fa`, if family is not set anywhere, Default: `fa`
12
+ @param {boolean} [show_visibility_switch=true] - whether has visibility feature or not, Default: `true`
13
+ @param {FontFamilies} [visibility_switch_icon_family=fa] - Icon family to be used
14
+
15
+ Defaults to global family set via `Icon.setDefaultIconType()`
16
+
17
+ Ultimately defaults to `fa`, if family is not set anywhere, Default: `fa`
18
+ @param {string} [visibility_switch_on_icon="eye"] - visibility switch on icon name, Default: `"eye"`
19
+ @param {string} [visibility_switch_off_icon="eye-slash"] - visibility switch off icon icon name, Default: `"eye-slash"`
20
+ @param {ExtendedColorOptions} [visibility_switch_on_color=grey] - visibility switch on icon color, Default: `grey`
21
+ @param {ExtendedColorOptions} [visibility_switch_off_color=grey] - visibility switch off icon color, Default: `grey`
22
+ @param {?string} [value=] - Value of the Input
23
+
24
+ This property can be bound to, to fetch the current value, Default: ``
25
+ @param {SizeOptions} [size=] - Size of the PasswordInput, Default: ``
26
+ @param {ColorOptions} [color=] - Colour of the PasswordInput, Default: ``
27
+ @param {string} [style=""] - Inline CSS for the PasswordInput, Default: `""`
28
+ @param {boolean} [disabled=false] - Disables the PasswordInput, Default: `false`
29
+ @param {string} [placeholder=""] - Input placeholder, Default: `""`
30
+ @param {string} [class=""] - CSS classes of the PasswordInput, Default: `""`
31
+
32
+ ### Events
33
+ - `focus`
34
+ - `blur`
35
+ - `change`
36
+ - `input`
37
+ - `keyup`
38
+ - `keydown`
39
+ - `paste`
40
+
41
+ -->
42
+
43
+ <div class="field is-marginless">
44
+ <p class="control has-icons-left has-icons-right is-marginless">
45
+ <input
46
+ type="password"
47
+ bind:this={PASSWORD_INPUT}
48
+ {style}
49
+ bind:value
50
+ class="input is-{size} is-{color} {klass} {style}"
51
+ on:focus
52
+ on:blur
53
+ on:change
54
+ on:input
55
+ on:keyup
56
+ on:keydown
57
+ on:paste
58
+ {placeholder}
59
+ {disabled} />
60
+ {#if show_field_icon}
61
+ <span class="icon is-left">
62
+ <Icon
63
+ family={field_icon_family}
64
+ icon={field_icon}
65
+ size={iconSizes[size]} />
66
+ </span>
67
+ {/if}
68
+
69
+ {#if show_visibility_switch}
70
+ <span
71
+ class="icon is-right visibility-btn"
72
+ on:click={() => {
73
+ visibility = !visibility;
74
+ }}>
75
+ <Icon
76
+ family={visibility_switch_icon_family}
77
+ color={visibility
78
+ ? visibility_switch_on_color
79
+ : visibility_switch_off_color}
80
+ icon={visibility
81
+ ? visibility_switch_on_icon
82
+ : visibility_switch_off_icon}
83
+ size={iconSizes[size]} />
84
+ </span>
85
+ {/if}
86
+ </p>
87
+ </div>
88
+
89
+ <style lang="scss">
90
+ .visibility-btn {
91
+ pointer-events: fill !important;
92
+ cursor: pointer;
93
+ }
94
+ </style>
95
+
96
+ <script>
97
+ import { Icon } from "@kws3/ui";
98
+ /**
99
+ *
100
+ * @typedef {import('@kws3/ui/types').ColorOptions} ColorOptions
101
+ * @typedef {import('@kws3/ui/types').ExtendedColorOptions} ExtendedColorOptions
102
+ * @typedef {import('@kws3/ui/types').SizeOptions} SizeOptions
103
+ * @typedef {import('@kws3/ui/types').FontFamilies} FontFamilies
104
+ *
105
+ */
106
+ let visibility = false;
107
+ let PASSWORD_INPUT;
108
+
109
+ /**
110
+ * whether to show field icon or not
111
+ * @type {boolean}
112
+ */
113
+ export let show_field_icon = true;
114
+
115
+ /**
116
+ * field icon name
117
+ * @type {string}
118
+ */
119
+ export let field_icon = "lock";
120
+
121
+ /**
122
+ * Icon family to be used
123
+ *
124
+ * Defaults to global family set via `Icon.setDefaultIconType()`
125
+ *
126
+ * Ultimately defaults to `fa`, if family is not set anywhere
127
+ *
128
+ * @type {FontFamilies}
129
+ */
130
+ export let field_icon_family = "fa";
131
+
132
+ /**
133
+ * whether has visibility feature or not
134
+ * @type {boolean}
135
+ */
136
+ export let show_visibility_switch = true;
137
+ /**
138
+ * Icon family to be used
139
+ *
140
+ * Defaults to global family set via `Icon.setDefaultIconType()`
141
+ *
142
+ * Ultimately defaults to `fa`, if family is not set anywhere
143
+ *
144
+ * @type {FontFamilies}
145
+ */
146
+ export let visibility_switch_icon_family = "fa";
147
+ /**
148
+ * visibility switch on icon name
149
+ * @type {string}
150
+ */
151
+ export let visibility_switch_on_icon = "eye";
152
+ /**
153
+ * visibility switch off icon icon name
154
+ * @type {string}
155
+ */
156
+ export let visibility_switch_off_icon = "eye-slash";
157
+ /**
158
+ * visibility switch on icon color
159
+ * @type {ExtendedColorOptions}
160
+ */
161
+ export let visibility_switch_on_color = "grey";
162
+ /**
163
+ * visibility switch off icon color
164
+ * @type {ExtendedColorOptions}
165
+ */
166
+ export let visibility_switch_off_color = "grey";
167
+
168
+ /**
169
+ * Value of the Input
170
+ *
171
+ * This property can be bound to, to fetch the current value
172
+ * @type {?string}
173
+ */
174
+ export let value = "";
175
+
176
+ /**
177
+ * Size of the PasswordInput
178
+ * @type {SizeOptions}
179
+ */
180
+ export let size = "";
181
+ /**
182
+ * Colour of the PasswordInput
183
+ * @type {ColorOptions}
184
+ */
185
+ export let color = "";
186
+ /**
187
+ * Inline CSS for the PasswordInput
188
+ * @type {string}
189
+ */
190
+ export let style = "";
191
+ /**
192
+ * Disables the PasswordInput
193
+ * @type {boolean}
194
+ */
195
+ export let disabled = false;
196
+ /**
197
+ * Input placeholder
198
+ * @type {string}
199
+ */
200
+ export let placeholder = "";
201
+
202
+ /**
203
+ * CSS classes of the PasswordInput
204
+ * @type {string}
205
+ */
206
+ let klass = "";
207
+ export { klass as class };
208
+
209
+ // function onInput(event) {
210
+ // value = event.target.value;
211
+ // }
212
+
213
+ let iconSizes = {
214
+ large: "medium",
215
+ };
216
+
217
+ $: visibility, setInputType();
218
+
219
+ function setInputType() {
220
+ if (PASSWORD_INPUT) {
221
+ PASSWORD_INPUT.type = visibility ? "text" : "password";
222
+ }
223
+ }
224
+ </script>
@@ -0,0 +1,5 @@
1
+ export default function _default(password: any, options: any): {
2
+ items: any[];
3
+ overall: boolean;
4
+ };
5
+ //# sourceMappingURL=validatePassword.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validatePassword.d.ts","sourceRoot":"","sources":["validatePassword.js"],"names":[],"mappings":"AAAA;;;EAwCC"}
@@ -2,8 +2,8 @@
2
2
  @component
3
3
 
4
4
 
5
- @param {string|''|'small'|'medium'|'large'} [size="small"] - Size of the input, Default: `"small"`
6
- @param {string|''|'primary'|'success'|'warning'|'info'|'danger'|'dark'|'light'} [color=""] - Color of the input, Default: `""`
5
+ @param {SizeOptions} [size=small] - Size of the input, Default: `small`
6
+ @param {ColorOptions} [color=] - Color of the input, Default: ``
7
7
  @param {string} [placeholder="Search"] - Placeholder text for the input, Default: `"Search"`
8
8
  @param {boolean} [readonly=false] - Marks component as read-only, Default: `false`
9
9
  @param {boolean} [disabled=false] - Disables the component, Default: `false`
@@ -11,7 +11,7 @@
11
11
  @param {array} [searchableKeys=[]] - array of object properties to search in., Default: `[]`
12
12
  @param {boolean} [highlighted_results=true] - Whether to show the highlighted or plain results in the dropdown., Default: `true`
13
13
  @param {number} [score_threshold=2] - Score threshold for fuzzy search strategy, setting high score gives more fuzzy matches., Default: `2`
14
- @param {number} [scoreThreshold=2] - (deprecated) Score threshold for fuzzy search strategy, setting high score gives more fuzzy matches., Default: `2`
14
+ @param {number} [scoreThreshold=undefined] - (deprecated) Score threshold for fuzzy search strategy, setting high score gives more fuzzy matches., Default: `undefined`
15
15
  @param {boolean} [word_match=false] - Whether to match against each word seperatly or whole sentence in flow., Default: `false`
16
16
  @param {string} [style=""] - Inline CSS for the input, Default: `""`
17
17
  @param {string} [class=""] - CSS classes for the input, Default: `""`
@@ -49,14 +49,19 @@
49
49
  import { onDestroy, onMount } from "svelte";
50
50
  import { makeSearchEngine } from "@kws3/ui/search";
51
51
 
52
+ /**
53
+ * @typedef {import('@kws3/ui/types').ColorOptions} ColorOptions
54
+ * @typedef {import('@kws3/ui/types').SizeOptions} SizeOptions
55
+ */
56
+
52
57
  /**
53
58
  * Size of the input
54
- * @type {import('@kws3/ui/types').SizeOptions} size
59
+ * @type {SizeOptions}
55
60
  */
56
61
  export let size = "small";
57
62
  /**
58
63
  * Color of the input
59
- * @type {import('@kws3/ui/types').ColorOptions} color
64
+ * @type {ColorOptions}
60
65
  */
61
66
  export let color = "";
62
67
  /**
@@ -8,18 +8,21 @@ Where `H` is in 24hr format
8
8
 
9
9
  This property can be bound to, to fetch the selected time. Output is in the same format as input., Default: `""`
10
10
  @param {string} [style=""] - Inline CSS for the input, Default: `""`
11
- @param {''|'primary'|'warning'|'info'|'danger'|'dark'|'light'} [color=""] - Colour of the Time picker input, Default: `""`
11
+ @param {ColorOptions} [color=] - Colour of the Time picker input, Default: ``
12
12
  @param {boolean} [disabled=false] - Disables the component, Default: `false`
13
13
  @param {string} [placeholder="Select Time.."] - Placeholder text for the input, Default: `"Select Time.."`
14
- @param {'primary'|'warning'|'info'|'danger'|'dark'|'light'} [ui_color="primary"] - Colour of popup time selection UI, Default: `"primary"`
14
+ @param {ColorOptions} [ui_color=primary] - Colour of popup time selection UI, Default: `primary`
15
15
  @param {boolean} [time_24hr=false] - Display time selection UI in 24hr format, Default: `false`
16
- @param {object} [options={}] - Extended set of options as supported by Flatpicker
17
16
  @param {any} [min_time=null] - Set earliest selectable time as string
18
- **Example:** `"12:00 PM"` Default: `null`
17
+
18
+ **Example:** `"01:00 PM"` or "13:00"`, Default: `null`
19
19
  @param {any} [max_time=null] - Set latest selectable time as string
20
- **Example:** `"12:00 AM"` Default: `null`
20
+
21
+ **Example:** `"03:00 PM"` or "15:00"`, Default: `null`
22
+ @param {object} [options={}] - Extended set of options as supported by Flatpicker
21
23
 
22
24
  See: https://flatpickr.js.org/options/, Default: `{}`
25
+ @param {boolean} [readonly=false] - Make input value read-only, Default: `false`
23
26
  @param {string} [class=""] - CSS classes for the input, Default: `""`
24
27
 
25
28
  ### Events
@@ -83,7 +86,7 @@ See: https://flatpickr.js.org/options/, Default: `{}`
83
86
  export let placeholder = "Select Time..";
84
87
  /**
85
88
  * Colour of popup time selection UI
86
- * @type {Exclude<ColorOptions, ''>}
89
+ * @type {ColorOptions}
87
90
  */
88
91
  export let ui_color = "primary";
89
92
 
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @type {import("svelte/action").Action}
3
+ */
4
+ export let datepicker: import("svelte/action").Action;
5
+ /**
6
+ * @type {import("svelte/action").Action}
7
+ */
8
+ export let timepicker: import("svelte/action").Action;
9
+ //# sourceMappingURL=actions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["actions.js"],"names":[],"mappings":"AAiHA;;GAEG;AACH,uBAFU,OAAO,eAAe,EAAE,MAAM,CAUtC;AAEF;;GAEG;AACH,uBAFU,OAAO,eAAe,EAAE,MAAM,CAYtC"}
package/forms/actions.js CHANGED
@@ -111,6 +111,9 @@ function createFlatpickrAction(defaultOpts, hooks, type) {
111
111
  };
112
112
  }
113
113
 
114
+ /**
115
+ * @type {import("svelte/action").Action}
116
+ */
114
117
  export let datepicker = createFlatpickrAction(
115
118
  {
116
119
  altInput: true,
@@ -121,6 +124,9 @@ export let datepicker = createFlatpickrAction(
121
124
  "date"
122
125
  );
123
126
 
127
+ /**
128
+ * @type {import("svelte/action").Action}
129
+ */
124
130
  export let timepicker = createFlatpickrAction(
125
131
  {
126
132
  altInput: true,
@@ -0,0 +1,3 @@
1
+ declare const _default: any;
2
+ export default _default;
3
+ //# sourceMappingURL=Colorpicker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Colorpicker.d.ts","sourceRoot":"","sources":["Colorpicker.js"],"names":[],"mappings":""}
@@ -1,6 +1,16 @@
1
+ /**
2
+ *
3
+ * @param {window} win
4
+ * @param {document} doc
5
+ * @returns {any}
6
+ */
1
7
  function initialize(win, doc) {
2
- var CP,
3
- instance = "__instance__",
8
+ /**
9
+ * @type {any}
10
+ */
11
+ var CP;
12
+
13
+ var instance = "__instance__",
4
14
  first = "firstChild",
5
15
  scroll_left = "scrollLeft",
6
16
  scroll_top = "scrollTop",