@kws3/ui 1.1.0 → 1.2.2
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/buttons/SubmitButton.svelte +4 -4
- package/controls/NumberInput.svelte +4 -1
- package/datagrid/DataSearch/DataSearch.svelte +45 -11
- package/datagrid/DataSearch/SearchFilter.svelte +82 -19
- package/datagrid/DataSort/DataSort.svelte +16 -6
- package/datagrid/GridView/GridCell.svelte +23 -7
- package/datagrid/GridView/GridRow.svelte +60 -15
- package/datagrid/GridView/GridView.svelte +79 -19
- package/datagrid/Pagination/Pagination.svelte +8 -2
- package/datagrid/TileView/TileView.svelte +64 -16
- package/datagrid/TileView/TileViewItem.svelte +36 -9
- package/forms/Datepicker.svelte +4 -4
- package/forms/select/MultiSelect.svelte +581 -0
- package/forms/select/SearchableSelect.svelte +149 -0
- package/helpers/ClipboardCopier.svelte +2 -2
- package/helpers/FloatingUI/Floatie.svelte +141 -0
- package/helpers/FloatingUI/FloatingUIOutput.svelte +34 -0
- package/helpers/FloatingUI/index.js +156 -0
- package/helpers/Icon.svelte +2 -2
- package/index.js +8 -1
- package/package.json +2 -2
- package/settings.js +15 -3
- package/styles/FloatingUI.scss +163 -0
- package/styles/Panel.scss +2 -3
- package/styles/Select.scss +203 -0
- package/forms/SearchableSelect.svelte +0 -438
- package/styles/SearchableSelect.scss +0 -128
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
@component
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
@param {string} [iteration_key="id"] -
|
|
6
|
-
@param {array} [data=[]] -
|
|
7
|
-
@param {boolean} [transition=false] -
|
|
8
|
-
@param {object} [tileItemComponent=null] -
|
|
9
|
-
@param {number} [per_row=3] -
|
|
10
|
-
@param {string} [columns=""] -
|
|
11
|
-
@param {boolean} [clickableRows=false] -
|
|
12
|
-
@param {boolean} [bulk_actions=false] -
|
|
13
|
-
@param {boolean} [selectAll=false] -
|
|
14
|
-
@param {array} [selectedIds=[]] -
|
|
15
|
-
@param {string} [selectCheckboxColor="info"] -
|
|
16
|
-
@param {string} [selectCheckboxSize="medium"] -
|
|
17
|
-
@param {object} [valueTransformers={}] -
|
|
18
|
-
@param {object} [classTransformers={}] -
|
|
19
|
-
@param {object} [styleTransformers={}] -
|
|
20
|
-
@param {object} [visibilityMap={}] -
|
|
5
|
+
@param {string} [iteration_key="id"] - Iteration key, Default: `"id"`
|
|
6
|
+
@param {array} [data=[]] - Contains all the results to be listed, Default: `[]`
|
|
7
|
+
@param {boolean} [transition=false] - Determines if a transition effect is used, Default: `false`
|
|
8
|
+
@param {object} [tileItemComponent=null] - Contains a custom component, Default: `null`
|
|
9
|
+
@param {number} [per_row=3] - Sets how many items to display in a row, Default: `3`
|
|
10
|
+
@param {string} [columns=""] - Column names for the displayed table {db_field_name: column_name}, Default: `""`
|
|
11
|
+
@param {boolean} [clickableRows=false] - Determines whether rows are clickable or not, Default: `false`
|
|
12
|
+
@param {boolean} [bulk_actions=false] - Determines if selecting multiple rows and doing multiple actions is allowed, Default: `false`
|
|
13
|
+
@param {boolean} [selectAll=false] - Determines if all rows are selected, Default: `false`
|
|
14
|
+
@param {array} [selectedIds=[]] - List of unique IDs of all the selected rows, Default: `[]`
|
|
15
|
+
@param {string} [selectCheckboxColor="info"] - Color of the `select all` checkbox, Default: `"info"`
|
|
16
|
+
@param {string} [selectCheckboxSize="medium"] - Size of each checkbox, Default: `"medium"`
|
|
17
|
+
@param {object} [valueTransformers={}] - Contains all custom values for each column, Default: `{}`
|
|
18
|
+
@param {object} [classTransformers={}] - CSS class names for each column, Default: `{}`
|
|
19
|
+
@param {object} [styleTransformers={}] - CSS styles for each column, Default: `{}`
|
|
20
|
+
@param {object} [visibilityMap={}] - Contains list of columns which can be visible or not, Default: `{}`
|
|
21
21
|
|
|
22
22
|
### Events
|
|
23
23
|
- `rowClick`
|
|
@@ -56,21 +56,69 @@
|
|
|
56
56
|
import { Transition } from "@kws3/ui";
|
|
57
57
|
import TileViewItem from "./TileViewItem.svelte";
|
|
58
58
|
|
|
59
|
+
/**
|
|
60
|
+
* Iteration key
|
|
61
|
+
*/
|
|
59
62
|
export let iteration_key = "id",
|
|
63
|
+
/**
|
|
64
|
+
* Contains all the results to be listed
|
|
65
|
+
*/
|
|
60
66
|
data = [],
|
|
67
|
+
/**
|
|
68
|
+
* Determines if a transition effect is used
|
|
69
|
+
*/
|
|
61
70
|
transition = false,
|
|
71
|
+
/**
|
|
72
|
+
* Contains a custom component
|
|
73
|
+
*/
|
|
62
74
|
tileItemComponent = null,
|
|
75
|
+
/**
|
|
76
|
+
* Sets how many items to display in a row
|
|
77
|
+
*/
|
|
63
78
|
per_row = 3,
|
|
79
|
+
/**
|
|
80
|
+
* Column names for the displayed table {db_field_name: column_name}
|
|
81
|
+
*/
|
|
64
82
|
columns = "",
|
|
83
|
+
/**
|
|
84
|
+
* Determines whether rows are clickable or not
|
|
85
|
+
*/
|
|
65
86
|
clickableRows = false,
|
|
87
|
+
/**
|
|
88
|
+
* Determines if selecting multiple rows and doing multiple actions is allowed
|
|
89
|
+
*/
|
|
66
90
|
bulk_actions = false,
|
|
91
|
+
/**
|
|
92
|
+
*Determines if all rows are selected
|
|
93
|
+
*/
|
|
67
94
|
selectAll = false,
|
|
95
|
+
/**
|
|
96
|
+
* List of unique IDs of all the selected rows
|
|
97
|
+
*/
|
|
68
98
|
selectedIds = [],
|
|
99
|
+
/**
|
|
100
|
+
* Color of the `select all` checkbox
|
|
101
|
+
*/
|
|
69
102
|
selectCheckboxColor = "info",
|
|
103
|
+
/**
|
|
104
|
+
* Size of each checkbox
|
|
105
|
+
*/
|
|
70
106
|
selectCheckboxSize = "medium",
|
|
107
|
+
/**
|
|
108
|
+
* Contains all custom values for each column
|
|
109
|
+
*/
|
|
71
110
|
valueTransformers = {},
|
|
111
|
+
/**
|
|
112
|
+
* CSS class names for each column
|
|
113
|
+
*/
|
|
72
114
|
classTransformers = {},
|
|
115
|
+
/**
|
|
116
|
+
* CSS styles for each column
|
|
117
|
+
*/
|
|
73
118
|
styleTransformers = {},
|
|
119
|
+
/**
|
|
120
|
+
* Contains list of columns which can be visible or not
|
|
121
|
+
*/
|
|
74
122
|
visibilityMap = {};
|
|
75
123
|
|
|
76
124
|
$: mainTileComponent = tileItemComponent ? tileItemComponent : TileViewItem;
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
@component
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
@param {object} [row={}] -
|
|
6
|
-
@param {boolean} [rowActive=false] -
|
|
7
|
-
@param {boolean} [clickableRows=false] -
|
|
8
|
-
@param {function} [isVisible()] -
|
|
9
|
-
@param {function} [transforms()] -
|
|
10
|
-
@param {function} [classNames()] -
|
|
11
|
-
@param {function} [styles()] -
|
|
12
|
-
@param {array} [column_keys=[]] -
|
|
5
|
+
@param {object} [row={}] - List of all values in a row, Default: `{}`
|
|
6
|
+
@param {boolean} [rowActive=false] - Determines whether the row is selected or not, Default: `false`
|
|
7
|
+
@param {boolean} [clickableRows=false] - Determines whether the row is clickable or not, Default: `false`
|
|
8
|
+
@param {function} [isVisible()] - Returns whether a column can be visible or not
|
|
9
|
+
@param {function} [transforms()] - Returns column custom value
|
|
10
|
+
@param {function} [classNames()] - Returns column custom CSS class
|
|
11
|
+
@param {function} [styles()] - Returns column custom CSS styles
|
|
12
|
+
@param {array} [column_keys=[]] - Contains all the column key names, Default: `[]`
|
|
13
13
|
|
|
14
14
|
### Events
|
|
15
|
-
- `rowClick`
|
|
15
|
+
- `rowClick` - Fires an event when a row is clicked
|
|
16
16
|
|
|
17
17
|
-->
|
|
18
18
|
<div
|
|
@@ -33,18 +33,45 @@
|
|
|
33
33
|
|
|
34
34
|
const fire = createEventDispatcher();
|
|
35
35
|
|
|
36
|
+
/**
|
|
37
|
+
* List of all values in a row
|
|
38
|
+
*/
|
|
36
39
|
export let row = {},
|
|
40
|
+
/**
|
|
41
|
+
* Determines whether the row is selected or not
|
|
42
|
+
*/
|
|
37
43
|
rowActive = false,
|
|
44
|
+
/**
|
|
45
|
+
* Determines whether the row is clickable or not
|
|
46
|
+
*/
|
|
38
47
|
clickableRows = false,
|
|
48
|
+
/**
|
|
49
|
+
* Returns whether a column can be visible or not
|
|
50
|
+
*/
|
|
39
51
|
isVisible = function () {},
|
|
52
|
+
/**
|
|
53
|
+
* Returns column custom value
|
|
54
|
+
*/
|
|
40
55
|
transforms = function () {},
|
|
56
|
+
/**
|
|
57
|
+
* Returns column custom CSS class
|
|
58
|
+
*/
|
|
41
59
|
classNames = function () {},
|
|
60
|
+
/**
|
|
61
|
+
* Returns column custom CSS styles
|
|
62
|
+
*/
|
|
42
63
|
styles = function () {},
|
|
64
|
+
/**
|
|
65
|
+
* Contains all the column key names
|
|
66
|
+
*/
|
|
43
67
|
column_keys = [];
|
|
44
68
|
|
|
45
69
|
function rowClick() {
|
|
46
70
|
if (clickableRows) {
|
|
47
71
|
rowActive = true;
|
|
72
|
+
/**
|
|
73
|
+
* Fires an event when a row is clicked
|
|
74
|
+
*/
|
|
48
75
|
fire("rowClick", { row });
|
|
49
76
|
}
|
|
50
77
|
}
|
package/forms/Datepicker.svelte
CHANGED
|
@@ -14,10 +14,10 @@ This property can be bound to, to fetch the selected date or date range. Output
|
|
|
14
14
|
@param {'primary'|'warning'|'info'|'danger'|'dark'|'light'} [calendar_color="primary"] - Colour of the Calendar, Default: `"primary"`
|
|
15
15
|
@param {any} [min_date=null] - Set earliest selectable date as an object or string
|
|
16
16
|
|
|
17
|
-
**Example:** `
|
|
17
|
+
**Example:** `"2021-06-06"` or `"(new Date('2021-01-01'))"`, Default: `null`
|
|
18
18
|
@param {any} [max_date=null] - Set latest selectable date as an object or string
|
|
19
19
|
|
|
20
|
-
**Example:** `
|
|
20
|
+
**Example:** `"2021-06-06"` or `"(new Date('2021-01-01'))"`, Default: `null`
|
|
21
21
|
@param {array} [enable_dates=[]] - Enables a range of dates and disables all others, Default: `[]`
|
|
22
22
|
@param {array} [disable_dates=[]] - Disables a range of dates and enables all others, Default: `[]`
|
|
23
23
|
@param {boolean} [range_mode=false] - Allows selecting a date range, Default: `false`
|
|
@@ -93,14 +93,14 @@ See: https://flatpickr.js.org/options/, Default: `{}`
|
|
|
93
93
|
/**
|
|
94
94
|
* Set earliest selectable date as an object or string
|
|
95
95
|
*
|
|
96
|
-
* **Example:** `
|
|
96
|
+
* **Example:** `"2021-06-06"` or `"(new Date('2021-01-01'))"`
|
|
97
97
|
* @type {any}
|
|
98
98
|
*/
|
|
99
99
|
export let min_date = null;
|
|
100
100
|
/**
|
|
101
101
|
* Set latest selectable date as an object or string
|
|
102
102
|
*
|
|
103
|
-
* **Example:** `
|
|
103
|
+
* **Example:** `"2021-06-06"` or `"(new Date('2021-01-01'))"`
|
|
104
104
|
* @type {any}
|
|
105
105
|
*/
|
|
106
106
|
export let max_date = null;
|