@kws3/ui 2.0.5 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.mdx +7 -0
- package/buttons/ConfirmButton.svelte +7 -6
- package/buttons/DeleteButton.svelte +14 -8
- package/buttons/ProcessButton.svelte +15 -9
- package/buttons/SubmitButton.svelte +11 -8
- package/canvas/Canvas.svelte +263 -0
- package/canvas/ESignature.svelte +101 -0
- package/canvas/PenControls.svelte +234 -0
- package/canvas/PenInput.svelte +152 -0
- package/charts/AreaChart.svelte +2 -2
- package/charts/BarChart.svelte +2 -2
- package/charts/Chart.svelte +16 -12
- package/charts/DonutChart.svelte +2 -2
- package/charts/LineChart.svelte +2 -2
- package/charts/MixedChart.svelte +2 -2
- package/charts/PieChart.svelte +2 -2
- package/charts/RadialChart.svelte +2 -2
- package/charts/utils.d.ts +553 -0
- package/charts/utils.d.ts.map +1 -0
- package/charts/utils.js +27 -4
- package/controls/Checkbox.svelte +7 -6
- package/controls/FileUpload.svelte +5 -4
- package/controls/NumberInput.svelte +5 -5
- package/controls/Radio.svelte +2 -2
- package/controls/RangeSlider.svelte +3 -3
- package/controls/Toggle.svelte +2 -2
- package/controls/ToggleButtons.svelte +1 -1
- package/datagrid/GridView/GridRow.svelte +4 -4
- package/datagrid/GridView/GridView.svelte +7 -4
- package/datagrid/Pagination/Pagination.svelte +12 -11
- package/form/index.d.ts +15 -0
- package/form/index.d.ts.map +1 -0
- package/forms/AutoComplete.svelte +5 -5
- package/forms/Datepicker.svelte +4 -3
- package/forms/PasswordInput.svelte +224 -0
- package/forms/PasswordValidator/validatePassword.d.ts +5 -0
- package/forms/PasswordValidator/validatePassword.d.ts.map +1 -0
- package/forms/SearchInput.svelte +10 -5
- package/forms/Timepicker.svelte +9 -6
- package/forms/actions.d.ts +9 -0
- package/forms/actions.d.ts.map +1 -0
- package/forms/actions.js +6 -0
- package/forms/colorpicker/Colorpicker.d.ts +3 -0
- package/forms/colorpicker/Colorpicker.d.ts.map +1 -0
- package/forms/colorpicker/Colorpicker.js +12 -2
- package/forms/colorpicker/Colorpicker.svelte +10 -3
- package/forms/select/MultiSelect.svelte +8 -9
- package/forms/select/SearchableSelect.svelte +10 -5
- package/helpers/CardModal.svelte +7 -2
- package/helpers/ClipboardCopier.svelte +3 -3
- package/helpers/Dialog/Dialog.svelte +9 -7
- package/helpers/Dialog/index.d.ts +42 -0
- package/helpers/Dialog/index.d.ts.map +1 -0
- package/helpers/Dialog/index.js +58 -19
- package/helpers/Divider.svelte +10 -4
- package/helpers/FloatingUI/Floatie.svelte +1 -1
- package/helpers/FloatingUI/index.d.ts +51 -0
- package/helpers/FloatingUI/index.d.ts.map +1 -0
- package/helpers/FloatingUI/index.js +13 -0
- package/helpers/Icon.svelte +14 -7
- package/helpers/Loader.svelte +5 -5
- package/helpers/Message.svelte +11 -6
- package/helpers/Modal.svelte +7 -2
- package/helpers/Notification.svelte +6 -2
- package/helpers/Popover.svelte +13 -6
- package/helpers/Skeleton.svelte +3 -3
- package/helpers/Timeline/Timeline.svelte +1 -1
- package/helpers/Timeline/TimelineItem.svelte +8 -4
- package/helpers/Tooltip.d.ts +19 -0
- package/helpers/Tooltip.d.ts.map +1 -0
- package/helpers/Tooltip.js +14 -1
- package/index.d.ts +69 -0
- package/index.d.ts.map +1 -0
- package/index.js +7 -0
- package/internal/DrawingPad.d.ts +86 -0
- package/internal/DrawingPad.d.ts.map +1 -0
- package/internal/DrawingPad.js +306 -0
- package/internal/UndoManager.d.ts +17 -0
- package/internal/UndoManager.d.ts.map +1 -0
- package/internal/UndoManager.js +84 -0
- package/internal/fuzzy.d.ts +24 -0
- package/internal/fuzzy.d.ts.map +1 -0
- package/internal/index.d.ts +16 -0
- package/internal/index.d.ts.map +1 -0
- package/internal/index.js +5 -1
- package/internal/scrollIntoActiveElement.d.ts +2 -0
- package/internal/scrollIntoActiveElement.d.ts.map +1 -0
- package/keyboard/index.d.ts +30 -0
- package/keyboard/index.d.ts.map +1 -0
- package/keyboard/index.js +1 -1
- package/package.json +6 -3
- package/resizeObserver/index.d.ts +8 -0
- package/resizeObserver/index.d.ts.map +1 -0
- package/search/index.d.ts +17 -0
- package/search/index.d.ts.map +1 -0
- package/settings.d.ts +22 -0
- package/settings.d.ts.map +1 -0
- package/settings.js +6 -1
- package/styles/Canvas.scss +100 -0
- package/transitions/components/getEasing.d.ts +2 -0
- package/transitions/components/getEasing.d.ts.map +1 -0
- package/tsconfig.json +33 -0
- package/types/index.d.ts +103 -9
- package/types/type-defs/index.d.ts +64 -0
- package/utils/index.d.ts +77 -0
- package/utils/index.d.ts.map +1 -0
- package/types/type-defs/index.ts +0 -14
package/controls/Radio.svelte
CHANGED
|
@@ -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 {
|
|
9
|
-
@param {
|
|
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 {
|
|
16
|
-
@param {
|
|
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`
|
|
26
|
+
- `input`
|
|
27
27
|
|
|
28
28
|
-->
|
|
29
29
|
<div class="kws-range-control">
|
package/controls/Toggle.svelte
CHANGED
|
@@ -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 {
|
|
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 {
|
|
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 {
|
|
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=[]] -
|
|
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 {
|
|
20
|
-
@param {
|
|
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 {
|
|
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 {
|
|
18
|
-
@param {
|
|
19
|
-
@param {
|
|
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 {
|
|
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] -
|
|
9
|
-
@param {number} [count=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
|
|
14
|
-
@param {boolean} [showPerPage=true] - Determines whether to
|
|
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 {
|
|
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=[]] -
|
|
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
|
-
*
|
|
155
|
+
* Number of items to be displayed per page
|
|
156
156
|
*/
|
|
157
157
|
limit = 0,
|
|
158
158
|
/**
|
|
159
|
-
*
|
|
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
|
|
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
|
|
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
|
-
*
|
|
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
|
|
package/form/index.d.ts
ADDED
|
@@ -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=
|
|
20
|
-
@param {
|
|
21
|
-
@param {
|
|
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 {
|
|
195
|
+
* @type {SizeOptions}
|
|
196
196
|
*/
|
|
197
197
|
export let size = "";
|
|
198
198
|
/**
|
|
199
199
|
* Color of the input
|
|
200
|
-
* @type {
|
|
200
|
+
* @type {ColorOptions}
|
|
201
201
|
*/
|
|
202
202
|
export let color = "";
|
|
203
203
|
/**
|
package/forms/Datepicker.svelte
CHANGED
|
@@ -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 {
|
|
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 {
|
|
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 {
|
|
99
|
+
* @type {ColorOptions}
|
|
99
100
|
*/
|
|
100
101
|
export let calendar_color = "primary";
|
|
101
102
|
/**
|
|
@@ -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 @@
|
|
|
1
|
+
{"version":3,"file":"validatePassword.d.ts","sourceRoot":"","sources":["validatePassword.js"],"names":[],"mappings":"AAAA;;;EAwCC"}
|
package/forms/SearchInput.svelte
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
@component
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
@param {
|
|
6
|
-
@param {
|
|
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=
|
|
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 {
|
|
59
|
+
* @type {SizeOptions}
|
|
55
60
|
*/
|
|
56
61
|
export let size = "small";
|
|
57
62
|
/**
|
|
58
63
|
* Color of the input
|
|
59
|
-
* @type {
|
|
64
|
+
* @type {ColorOptions}
|
|
60
65
|
*/
|
|
61
66
|
export let color = "";
|
|
62
67
|
/**
|
package/forms/Timepicker.svelte
CHANGED
|
@@ -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 {
|
|
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 {
|
|
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
|
-
|
|
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
|
-
|
|
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 {
|
|
89
|
+
* @type {ColorOptions}
|
|
87
90
|
*/
|
|
88
91
|
export let ui_color = "primary";
|
|
89
92
|
|
|
@@ -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 @@
|
|
|
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
|
-
|
|
3
|
-
|
|
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",
|