@kws3/ui 1.9.1 → 2.0.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 +76 -48
- package/buttons/ConfirmButton.svelte +11 -3
- package/buttons/DeleteButton.svelte +2 -3
- package/buttons/ProcessButton.svelte +3 -4
- package/buttons/SubmitButton.svelte +11 -3
- package/charts/AreaChart.svelte +1 -1
- package/charts/BarChart.svelte +1 -1
- package/charts/Chart.svelte +1 -0
- package/charts/DonutChart.svelte +1 -1
- package/charts/LineChart.svelte +1 -1
- package/charts/MixedChart.svelte +1 -1
- package/charts/PieChart.svelte +1 -1
- package/charts/RadialChart.svelte +1 -1
- package/charts/utils.js +1 -0
- package/controls/Checkbox.svelte +10 -4
- package/controls/FileUpload.svelte +14 -8
- package/controls/NumberInput.svelte +19 -10
- package/controls/Radio.svelte +8 -2
- package/controls/RangeSlider.svelte +8 -2
- package/controls/Toggle.svelte +9 -2
- package/controls/ToggleButtons.svelte +10 -3
- package/datagrid/DataSearch/DataSearch.svelte +1 -1
- package/datagrid/GridView/GridCell.svelte +3 -0
- package/datagrid/GridView/GridRow.svelte +15 -0
- package/datagrid/GridView/GridView.svelte +21 -3
- package/datagrid/Pagination/Pagination.svelte +3 -3
- package/datagrid/TileView/TileView.svelte +46 -5
- package/datagrid/TileView/TileViewItem.svelte +4 -0
- package/form/index.js +160 -0
- package/forms/AutoComplete.svelte +126 -76
- package/forms/Datepicker.svelte +22 -5
- package/forms/PasswordValidator/PasswordValidator.svelte +8 -8
- package/forms/PasswordValidator/validatePassword.js +13 -2
- package/forms/SearchInput.svelte +180 -0
- package/forms/Timepicker.svelte +69 -4
- package/forms/actions.js +21 -15
- package/forms/colorpicker/Colorpicker.js +28 -3
- package/forms/colorpicker/Colorpicker.svelte +2 -2
- package/forms/select/MultiSelect.svelte +103 -46
- package/forms/select/SearchableSelect.svelte +6 -5
- package/helpers/CardModal.svelte +2 -1
- package/helpers/ClipboardCopier.svelte +4 -1
- package/helpers/Dialog/Dialog.svelte +13 -8
- package/helpers/Dialog/index.js +6 -0
- package/helpers/Divider.svelte +2 -2
- package/helpers/FloatingUI/Floatie.svelte +6 -6
- package/helpers/FloatingUI/index.js +2 -1
- package/helpers/Icon.svelte +25 -9
- package/helpers/Loader.svelte +10 -3
- package/helpers/Message.svelte +2 -2
- package/helpers/Modal.svelte +2 -1
- package/helpers/Notification.svelte +1 -1
- package/helpers/Popover.svelte +4 -4
- package/helpers/ScrollableList.svelte +12 -8
- package/helpers/Skeleton.svelte +4 -1
- package/helpers/Timeline/Timeline.svelte +1 -1
- package/helpers/Timeline/TimelineItem.svelte +5 -5
- package/helpers/Tooltip.js +1 -1
- package/index.js +10 -4
- package/internal/fuzzy.js +116 -0
- package/internal/index.js +27 -0
- package/internal/scrollIntoActiveElement.js +22 -0
- package/keyboard/index.js +94 -0
- package/package.json +6 -4
- package/{utils/resizeObserver.js → resizeObserver/index.js} +0 -0
- package/search/index.js +52 -0
- package/settings.js +1 -1
- package/sliding-panes/SlidingPane.svelte +1 -4
- package/styles/AutoComplete.scss +2 -1
- package/styles/Datepicker.scss +1 -1
- package/styles/Grid.scss +14 -0
- package/styles/Select.scss +2 -1
- package/transitions/components/Scale.svelte +1 -0
- package/transitions/components/getEasing.js +18 -5
- package/types/ambient.d.ts +16 -0
- package/types/index.d.ts +46 -0
- package/types/type-defs/index.ts +14 -0
- package/utils/index.js +110 -9
- package/utils/fuzzysearch.js +0 -20
- package/utils/keyboard-events.js +0 -32
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* fuzzy.js v0.1.0
|
|
3
|
+
* (c) 2016 Ben Ripkens
|
|
4
|
+
* @license: MIT
|
|
5
|
+
* @params
|
|
6
|
+
* term : haystack
|
|
7
|
+
* query : needle
|
|
8
|
+
* opts: {
|
|
9
|
+
* analyzeSubTerms,
|
|
10
|
+
* analyzeSubTermDepth
|
|
11
|
+
* highlighting
|
|
12
|
+
* }
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
* Adapted from fuzzy.js for @kws3/ui to work with vite prebundling
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/*
|
|
20
|
+
* Whether or not fuzzy.js should analyze sub-terms, i.e. also
|
|
21
|
+
* check term starting positions != 0.
|
|
22
|
+
*
|
|
23
|
+
* Example:
|
|
24
|
+
* Given the term 'Halleluja' and query 'luja'
|
|
25
|
+
*
|
|
26
|
+
* Fuzzy.js scores this combination with an 8, when analyzeSubTerms is
|
|
27
|
+
* set to false, as the following matching string will be calculated:
|
|
28
|
+
* Ha[l]lel[uja]
|
|
29
|
+
*
|
|
30
|
+
* If you activate sub temr analysis though, the query will reach a score
|
|
31
|
+
* of 10, as the matching string looks as following:
|
|
32
|
+
* Halle[luja]
|
|
33
|
+
*
|
|
34
|
+
* Naturally, the second version is more expensive than the first one.
|
|
35
|
+
* You should therefore configure how many sub terms you which to analyse.
|
|
36
|
+
* This can be configured through opts.analyzeSubTermDepth = 10.
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
export function fuzzy(term, query, opts = {}) {
|
|
40
|
+
let analyzeSubTerms = opts.analyzeSubTerms ? opts.analyzeSubTerms : false;
|
|
41
|
+
let analyzeSubTermDepth = opts.analyzeSubTermDepth
|
|
42
|
+
? opts.analyzeSubTermDepth
|
|
43
|
+
: 10;
|
|
44
|
+
let highlighting = opts.highlighting
|
|
45
|
+
? opts.highlighting
|
|
46
|
+
: {
|
|
47
|
+
before: "<em>",
|
|
48
|
+
after: "</em>",
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
let max = calcFuzzyScore(term, query, highlighting);
|
|
52
|
+
let termLength = term.length;
|
|
53
|
+
|
|
54
|
+
if (analyzeSubTerms) {
|
|
55
|
+
for (let i = 1; i < termLength && i < analyzeSubTermDepth; i++) {
|
|
56
|
+
let subTerm = term.substring(i);
|
|
57
|
+
let score = calcFuzzyScore(subTerm, query, highlighting);
|
|
58
|
+
if (score.score > max.score) {
|
|
59
|
+
// we need to correct 'term' and 'matchedTerm', as calcFuzzyScore
|
|
60
|
+
// does not now that it operates on a substring. Doing it only for
|
|
61
|
+
// new maximum score to save some performance.
|
|
62
|
+
score.term = term;
|
|
63
|
+
score.highlightedTerm = term.substring(0, i) + score.highlightedTerm;
|
|
64
|
+
max = score;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return max;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
function calcFuzzyScore(term, query, highlighting) {
|
|
73
|
+
let score = 0;
|
|
74
|
+
let termLength = term.length;
|
|
75
|
+
let queryLength = query.length;
|
|
76
|
+
let _highlighting = "";
|
|
77
|
+
let ti = 0;
|
|
78
|
+
// -1 would not work as this would break the calculations of bonus
|
|
79
|
+
// points for subsequent character matches. Something like
|
|
80
|
+
// Number.MIN_VALUE would be more appropriate, but unfortunately
|
|
81
|
+
// Number.MIN_VALUE + 1 equals 1...
|
|
82
|
+
let previousMatchingCharacter = -2;
|
|
83
|
+
|
|
84
|
+
for (let qi = 0; qi < queryLength && ti < termLength; qi++) {
|
|
85
|
+
let qc = query.charAt(qi);
|
|
86
|
+
let lowerQc = qc.toLowerCase();
|
|
87
|
+
|
|
88
|
+
for (; ti < termLength; ti++) {
|
|
89
|
+
let tc = term.charAt(ti);
|
|
90
|
+
|
|
91
|
+
if (lowerQc === tc.toLowerCase()) {
|
|
92
|
+
score++;
|
|
93
|
+
|
|
94
|
+
if (previousMatchingCharacter + 1 === ti) {
|
|
95
|
+
score += 2;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
_highlighting += highlighting.before + tc + highlighting.after;
|
|
99
|
+
previousMatchingCharacter = ti;
|
|
100
|
+
ti++;
|
|
101
|
+
break;
|
|
102
|
+
} else {
|
|
103
|
+
_highlighting += tc;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
_highlighting += term.substring(ti, term.length);
|
|
109
|
+
|
|
110
|
+
return {
|
|
111
|
+
score: score,
|
|
112
|
+
term: term,
|
|
113
|
+
query: query,
|
|
114
|
+
highlightedTerm: _highlighting,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export { scrollIntoActiveElement } from "./scrollIntoActiveElement";
|
|
2
|
+
export { fuzzy } from "./fuzzy.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Detect whether a user has pressed Enter.
|
|
6
|
+
* @param {object} [e=[]] - Event object., Default: `[]`
|
|
7
|
+
*/
|
|
8
|
+
export function isEnterKey(e) {
|
|
9
|
+
return e.keyCode && e.keyCode === 13;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Detect whether a user has pressed Escape key.
|
|
14
|
+
* @param {object} [e=[]] - Event object., Default: `[]`
|
|
15
|
+
*/
|
|
16
|
+
export function isEscKey(e) {
|
|
17
|
+
return e.keyCode && e.keyCode === 27;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const IS_MAC =
|
|
21
|
+
"navigator" in window
|
|
22
|
+
? /mac/i.test(
|
|
23
|
+
window.navigator.userAgentData
|
|
24
|
+
? window.navigator.userAgentData.platform
|
|
25
|
+
: window.navigator.platform
|
|
26
|
+
)
|
|
27
|
+
: false;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export function scrollIntoActiveElement(listElement, activeElelement) {
|
|
2
|
+
if (listElement && activeElelement) {
|
|
3
|
+
const dropdownRect = listElement.getBoundingClientRect();
|
|
4
|
+
const activeElemRect = activeElelement.getBoundingClientRect();
|
|
5
|
+
const overScroll = activeElelement.offsetHeight / 3;
|
|
6
|
+
|
|
7
|
+
if (activeElemRect.bottom + overScroll > dropdownRect.bottom) {
|
|
8
|
+
listElement.scrollTop = Math.min(
|
|
9
|
+
activeElelement.offsetTop +
|
|
10
|
+
activeElelement.clientHeight -
|
|
11
|
+
listElement.offsetHeight +
|
|
12
|
+
overScroll,
|
|
13
|
+
listElement.scrollHeight
|
|
14
|
+
);
|
|
15
|
+
} else if (activeElemRect.top - overScroll < dropdownRect.top) {
|
|
16
|
+
listElement.scrollTop = Math.max(
|
|
17
|
+
activeElelement.offsetTop - overScroll,
|
|
18
|
+
0
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { IS_MAC } from "../internal";
|
|
2
|
+
const ctrlKeys = {
|
|
3
|
+
ctrl: "ctrlKey",
|
|
4
|
+
meta: "metaKey",
|
|
5
|
+
shift: "shiftKey",
|
|
6
|
+
alt: "altKey",
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @param {string | number} definition - can be a string like 'Enter', 'Tab' or number as keyCode, also allow combination key like 'ctrl+d', 'ctrl+alt+x'
|
|
11
|
+
* @param {boolean} CommandKey - if true, in mac 'ctrl' key binding will be shift on 'command' key.
|
|
12
|
+
* @returns {function} .
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
export function makeKeyDefinition(definition, CommandKey = false) {
|
|
16
|
+
let def = definition;
|
|
17
|
+
let keys = [];
|
|
18
|
+
|
|
19
|
+
if (typeof def === "number") {
|
|
20
|
+
keys = [def];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (typeof def === "string") {
|
|
24
|
+
if (CommandKey) {
|
|
25
|
+
if (IS_MAC) {
|
|
26
|
+
def = def.replace("ctrl", "meta");
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
keys = def.split("+");
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return function (node, fire) {
|
|
33
|
+
function keydownHandler(event) {
|
|
34
|
+
event.preventDefault();
|
|
35
|
+
let firedCount = 0;
|
|
36
|
+
let which = event.which || event.keyCode;
|
|
37
|
+
keys.forEach((key) => {
|
|
38
|
+
if (event[ctrlKeys[key]]) {
|
|
39
|
+
firedCount++;
|
|
40
|
+
}
|
|
41
|
+
if (
|
|
42
|
+
key === event.key ||
|
|
43
|
+
("key" + key).toLowerCase() === event.code.toLowerCase()
|
|
44
|
+
) {
|
|
45
|
+
firedCount++;
|
|
46
|
+
}
|
|
47
|
+
if (key === which) {
|
|
48
|
+
firedCount++;
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
let valid = false;
|
|
53
|
+
if (keys.length === firedCount) {
|
|
54
|
+
valid = true;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (valid) {
|
|
58
|
+
fire(event);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
node.addEventListener("keydown", keydownHandler, false);
|
|
63
|
+
|
|
64
|
+
return {
|
|
65
|
+
destroy() {
|
|
66
|
+
node.removeEventListener("keydown", keydownHandler, false);
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export let enter = makeKeyDefinition("Enter");
|
|
73
|
+
export let tab = makeKeyDefinition("Tab");
|
|
74
|
+
export let escape = makeKeyDefinition("Escape");
|
|
75
|
+
export let space = makeKeyDefinition(" ");
|
|
76
|
+
export let leftarrow = makeKeyDefinition("ArrowLeft");
|
|
77
|
+
export let rightarrow = makeKeyDefinition("ArrowRight");
|
|
78
|
+
export let downarrow = makeKeyDefinition("ArrowDown");
|
|
79
|
+
export let uparrow = makeKeyDefinition("ArrowUp");
|
|
80
|
+
export let backspace = makeKeyDefinition("Backspace");
|
|
81
|
+
export let del = makeKeyDefinition("Delete");
|
|
82
|
+
|
|
83
|
+
export default {
|
|
84
|
+
enter,
|
|
85
|
+
tab,
|
|
86
|
+
escape,
|
|
87
|
+
space,
|
|
88
|
+
leftarrow,
|
|
89
|
+
rightarrow,
|
|
90
|
+
downarrow,
|
|
91
|
+
uparrow,
|
|
92
|
+
backspace,
|
|
93
|
+
del,
|
|
94
|
+
};
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kws3/ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "UI components for use with Svelte v3 applications.",
|
|
5
5
|
"main": "index.js",
|
|
6
|
+
"svelte": "index.js",
|
|
6
7
|
"scripts": {
|
|
7
8
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
9
|
},
|
|
@@ -17,18 +18,19 @@
|
|
|
17
18
|
"contributors": [
|
|
18
19
|
"Sharif Ahmed <me.sharifahmed@gmail.com>",
|
|
19
20
|
"Sabir <sabirveli@gmail.com>",
|
|
20
|
-
"Suneesh S K <suneeshsk3@gmail.com>"
|
|
21
|
+
"Suneesh S K <suneeshsk3@gmail.com>",
|
|
22
|
+
"Nikeeta <nikeetaa231@gmail.com>"
|
|
21
23
|
],
|
|
22
24
|
"publishConfig": {
|
|
23
25
|
"access": "public"
|
|
24
26
|
},
|
|
27
|
+
"types": "types/index.d.ts",
|
|
25
28
|
"dependencies": {
|
|
26
29
|
"apexcharts": "3.33.2",
|
|
27
30
|
"flatpickr": "^4.5.2",
|
|
28
|
-
"fuzzy.js": "^0.1.0",
|
|
29
31
|
"svelte-portal": "^2.1.2",
|
|
30
32
|
"text-mask-core": "^5.1.2",
|
|
31
33
|
"tippy.js": "^6.3.1"
|
|
32
34
|
},
|
|
33
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "9606d798a4c6d550863290f2c0b6baac3a61a09e"
|
|
34
36
|
}
|
|
File without changes
|
package/search/index.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { fuzzy } from "../internal";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @typedef {import('@kws3/ui/types').SearchOptions} SearchOptions - contains search options and fuzzy lib options
|
|
5
|
+
* @typedef {import('@kws3/ui/types').SearchHelper} SearchHelper - returned search helper function which take unction take params `needle` and `haystack`.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @param {SearchOptions} opts
|
|
10
|
+
*/
|
|
11
|
+
export function makeSearchEngine(opts) {
|
|
12
|
+
let search_key = opts.search_key ? opts.search_key : "value";
|
|
13
|
+
let scoreThreshold = opts.scoreThreshold ? opts.scoreThreshold : 5;
|
|
14
|
+
let fuzzyOpts = opts.fuzzyOpts ? opts.fuzzyOpts : {};
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @param {string} needle
|
|
18
|
+
* @param {array} haystack
|
|
19
|
+
* @returns {array}
|
|
20
|
+
*/
|
|
21
|
+
return function (needle, haystack) {
|
|
22
|
+
let OPTS = haystack.map((option) => {
|
|
23
|
+
let item = { ...option };
|
|
24
|
+
item.original = { ...option };
|
|
25
|
+
if (typeof item === "object") {
|
|
26
|
+
if (!Array.isArray(search_key)) {
|
|
27
|
+
search_key = [search_key];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
search_key.forEach((s_key) => {
|
|
31
|
+
if (`${s_key}` in item) {
|
|
32
|
+
let output = fuzzy(option[s_key], needle, fuzzyOpts);
|
|
33
|
+
item.original[s_key] = output.highlightedTerm;
|
|
34
|
+
item.score =
|
|
35
|
+
!item.score || (item.score && item.score < output.score)
|
|
36
|
+
? output.score
|
|
37
|
+
: item.score || 0;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return item;
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
let maxScore = Math.max(...OPTS.map((i) => i.score));
|
|
45
|
+
let calculatedLimit = maxScore - scoreThreshold;
|
|
46
|
+
|
|
47
|
+
OPTS = OPTS.filter(
|
|
48
|
+
(r) => r.score > (calculatedLimit > 0 ? calculatedLimit : 0)
|
|
49
|
+
);
|
|
50
|
+
return OPTS.map((i) => i.original);
|
|
51
|
+
};
|
|
52
|
+
}
|
package/settings.js
CHANGED
|
@@ -40,7 +40,7 @@ export {
|
|
|
40
40
|
* - `hasTransitions`: `true` - Transitions are applied
|
|
41
41
|
* - `defaultChartColors`: `["#284BED", "#ED6134", "#1DAFEC", "#EDB405", "#11EDB7", "#77ED11"]` - default colors for charts
|
|
42
42
|
*
|
|
43
|
-
* @param {*}
|
|
43
|
+
* @param {*} obj containing all settings
|
|
44
44
|
*/
|
|
45
45
|
export function applySettings(obj) {
|
|
46
46
|
Object.entries(obj).forEach(([k, v]) => {
|
|
@@ -54,10 +54,7 @@ This will work only when `track_height` is set to `true`
|
|
|
54
54
|
<script>
|
|
55
55
|
import { onMount, createEventDispatcher } from "svelte";
|
|
56
56
|
import { debounce } from "@kws3/ui/utils";
|
|
57
|
-
import {
|
|
58
|
-
resizeObserver,
|
|
59
|
-
hasResizeObserver,
|
|
60
|
-
} from "@kws3/ui/utils/resizeObserver";
|
|
57
|
+
import { resizeObserver, hasResizeObserver } from "@kws3/ui/resizeObserver";
|
|
61
58
|
|
|
62
59
|
const fire = createEventDispatcher();
|
|
63
60
|
|
package/styles/AutoComplete.scss
CHANGED
|
@@ -14,6 +14,7 @@ $kws-autocomplete-selecting-background: $primary !default;
|
|
|
14
14
|
$kws-autocomplete-text-matches-color: currentColor !default;
|
|
15
15
|
$kws-autocomplete-text-matches-background: transparent !default;
|
|
16
16
|
$kws-autocomplete-text-matches-font-weight: $weight-bold !default;
|
|
17
|
+
$kws-autocomplete-options-background: $scheme-main-ter !default;
|
|
17
18
|
|
|
18
19
|
$__modal-z: 41 !default;
|
|
19
20
|
@if $modal-z {
|
|
@@ -65,7 +66,7 @@ $kws-autocomplete-options-z-index: $__modal-z + 1 !default;
|
|
|
65
66
|
padding: 0;
|
|
66
67
|
cursor: pointer;
|
|
67
68
|
overflow: auto;
|
|
68
|
-
background:
|
|
69
|
+
background: $kws-autocomplete-options-background;
|
|
69
70
|
border: 1px solid $kws-autocomplete-border-color;
|
|
70
71
|
box-shadow: $kws-autocomplete-box-shadow;
|
|
71
72
|
position: relative;
|
package/styles/Datepicker.scss
CHANGED
package/styles/Grid.scss
CHANGED
|
@@ -13,6 +13,9 @@ $kws-gridview-checked-row-background: $primary-light !default;
|
|
|
13
13
|
color: $kws-gridview-th-color;
|
|
14
14
|
vertical-align: middle;
|
|
15
15
|
}
|
|
16
|
+
td {
|
|
17
|
+
vertical-align: middle;
|
|
18
|
+
}
|
|
16
19
|
&.is-bordered {
|
|
17
20
|
tr {
|
|
18
21
|
th:last-child,
|
|
@@ -54,4 +57,15 @@ $kws-gridview-checked-row-background: $primary-light !default;
|
|
|
54
57
|
color: findColorInvert($kws-gridview-checked-row-background) !important;
|
|
55
58
|
}
|
|
56
59
|
}
|
|
60
|
+
|
|
61
|
+
&.is-narrow {
|
|
62
|
+
th {
|
|
63
|
+
font-size: 0.9rem;
|
|
64
|
+
line-height: 1.2;
|
|
65
|
+
}
|
|
66
|
+
td,
|
|
67
|
+
th {
|
|
68
|
+
padding: 0.25rem 0.4rem;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
57
71
|
}
|
package/styles/Select.scss
CHANGED
|
@@ -10,6 +10,7 @@ $kws-select-selecting-color: $primary-invert !default;
|
|
|
10
10
|
$kws-select-selecting-background: $primary !default;
|
|
11
11
|
$kws-select-selected-color: $primary-dark !default;
|
|
12
12
|
$kws-select-selected-background: $primary-light !default;
|
|
13
|
+
$kws-select-options-background: $scheme-main-ter !default;
|
|
13
14
|
|
|
14
15
|
$__modal-z: 41 !default;
|
|
15
16
|
@if $modal-z {
|
|
@@ -96,7 +97,7 @@ $kws-select-options-z-index: $__modal-z + 1 !default;
|
|
|
96
97
|
cursor: pointer;
|
|
97
98
|
border-radius: 0 0 $kws-select-radius $kws-select-radius;
|
|
98
99
|
overflow: auto;
|
|
99
|
-
background:
|
|
100
|
+
background: $kws-select-options-background;
|
|
100
101
|
box-shadow: 0 3px 9px rgba(0, 0, 0, 0.4);
|
|
101
102
|
position: relative;
|
|
102
103
|
z-index: 4;
|
|
@@ -1,9 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
sineOut,
|
|
3
|
+
elasticOut,
|
|
4
|
+
expoOut,
|
|
5
|
+
cubicOut,
|
|
6
|
+
circOut,
|
|
7
|
+
bounceOut,
|
|
8
|
+
backOut,
|
|
9
|
+
} from "svelte/easing";
|
|
2
10
|
|
|
3
11
|
export default function getEasing(easing) {
|
|
4
12
|
let eases = {
|
|
5
|
-
sineOut,
|
|
6
|
-
|
|
13
|
+
sineOut,
|
|
14
|
+
elasticOut,
|
|
15
|
+
expoOut,
|
|
16
|
+
cubicOut,
|
|
17
|
+
circOut,
|
|
18
|
+
bounceOut,
|
|
19
|
+
backOut,
|
|
7
20
|
};
|
|
8
|
-
return easing ?
|
|
9
|
-
}
|
|
21
|
+
return easing ? eases[easing] || sineOut : sineOut;
|
|
22
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare namespace svelte.JSX {
|
|
2
|
+
interface HTMLAttributes<T> {
|
|
3
|
+
onshowing?: (event: any) => any;
|
|
4
|
+
onshown?: (event: any) => any;
|
|
5
|
+
onhiding?: (event: any) => any;
|
|
6
|
+
onhidden?: (event: any) => any;
|
|
7
|
+
ontriggered?: (event: any) => any;
|
|
8
|
+
onclose?: (event: any) => any;
|
|
9
|
+
ontimeChange?: (event: any) => any;
|
|
10
|
+
onready?: (event: any) => any;
|
|
11
|
+
onopen?: (event: any) => any;
|
|
12
|
+
ondateChange?: (event: any) => any;
|
|
13
|
+
onmonthChange?: (event: any) => any;
|
|
14
|
+
onyearChange?: (event: any) => any;
|
|
15
|
+
}
|
|
16
|
+
}
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Colors, BGColors, SpinnerColors, Sizes } from "./type-defs.ts";
|
|
2
|
+
export type SearchOptions = {
|
|
3
|
+
search_key: Array<string> | string;
|
|
4
|
+
scoreThreshold: number;
|
|
5
|
+
fuzzyOpts: {
|
|
6
|
+
analyzeSubTerms: boolean;
|
|
7
|
+
analyzeSubTermDepth: number;
|
|
8
|
+
highlighting: {
|
|
9
|
+
after: string;
|
|
10
|
+
before: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type SearchHelper = (needle: string, haystack: array) => array;
|
|
16
|
+
|
|
17
|
+
export type ValidatePasswordOptions = {
|
|
18
|
+
name: string;
|
|
19
|
+
text: string;
|
|
20
|
+
identifier: string;
|
|
21
|
+
regex: RegExp;
|
|
22
|
+
passed: boolean;
|
|
23
|
+
active: boolean;
|
|
24
|
+
value?: string;
|
|
25
|
+
negate?: boolean;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
declare global {
|
|
29
|
+
interface Navigator {
|
|
30
|
+
readonly userAgentData: {
|
|
31
|
+
platform: string;
|
|
32
|
+
};
|
|
33
|
+
readonly platform: string;
|
|
34
|
+
}
|
|
35
|
+
interface Window {
|
|
36
|
+
ApexCharts: Object;
|
|
37
|
+
readonly navigator: Navigator;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export type Options<T> = T;
|
|
42
|
+
|
|
43
|
+
export type ColorOptions = Options<Colors>;
|
|
44
|
+
export type SizeOptions = Options<Sizes>;
|
|
45
|
+
export type SpinnerColorOptions = Options<Colors | SpinnerColors>;
|
|
46
|
+
export type BGColorOptions = Options<Colors | BGColors>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type Colors =
|
|
2
|
+
| ""
|
|
3
|
+
| "primary"
|
|
4
|
+
| "success"
|
|
5
|
+
| "warning"
|
|
6
|
+
| "info"
|
|
7
|
+
| "danger"
|
|
8
|
+
| "dark"
|
|
9
|
+
| "light";
|
|
10
|
+
|
|
11
|
+
export type BGColors = "" | "transparent" | "link";
|
|
12
|
+
export type SpinnerColors = "" | "grey";
|
|
13
|
+
|
|
14
|
+
export type Sizes = "" | "small" | "medium" | "large";
|