treeselectjs 0.12.0 → 0.12.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.
- package/README.md +5 -4
- package/dist/treeselectjs.d.ts +11 -1
- package/dist/treeselectjs.mjs +509 -573
- package/dist/treeselectjs.umd.js +1 -1
- package/package.json +74 -74
package/README.md
CHANGED
|
@@ -9,8 +9,8 @@ A multi-select js component with nested options.
|
|
|
9
9
|
- Typescript support
|
|
10
10
|
|
|
11
11
|
Build data:
|
|
12
|
-
- treeselectjs.mjs
|
|
13
|
-
- treeselectjs.umd.js
|
|
12
|
+
- treeselectjs.mjs 48.50 kB │ gzip: 10.97 kB
|
|
13
|
+
- treeselectjs.umd.js 39.65 kB │ gzip: 9.98 kB
|
|
14
14
|
- treeselectjs.css 6.93 kB │ gzip: 1.38 kB
|
|
15
15
|
|
|
16
16
|
**Live Demo:** https://dipson88.github.io/treeselectjs/
|
|
@@ -30,8 +30,8 @@ import Treeselect from 'treeselectjs'
|
|
|
30
30
|
|
|
31
31
|
Import treeselectjs (UMD)
|
|
32
32
|
```
|
|
33
|
-
<script src="https://cdn.jsdelivr.net/npm/treeselectjs@0.12.
|
|
34
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/treeselectjs@0.12.
|
|
33
|
+
<script src="https://cdn.jsdelivr.net/npm/treeselectjs@0.12.1/dist/treeselectjs.umd.js"></script>
|
|
34
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/treeselectjs@0.12.1/dist/treeselectjs.css" />
|
|
35
35
|
...
|
|
36
36
|
<script>
|
|
37
37
|
...
|
|
@@ -150,6 +150,7 @@ Name | Type (default) | Description
|
|
|
150
150
|
------------- | ------------- | -------------
|
|
151
151
|
**showTags** | Boolean (true) | Selected values look like tags. The false value shows results as '{count} elements selected'. You can change text if you use `tagsCountText` prop. For one selected element, you will see a name of this element.
|
|
152
152
|
**tagsCountText** | String ('elements selected') | This text will be shown if you use 'showTags'. This text will be inserted after the count of the selected elements - ```'{count} {tagsCountText}'```.
|
|
153
|
+
**tagsSortFn** | `(a: TagsSortItem, b: TagsSortItem) => number` \| `null` (null) | Defines the sorting order for tags in the input field.<br>`TagsSortItem` - `{ value: ValueOptionType, name: string }`.
|
|
153
154
|
**clearable** | Boolean (true) | Clear icon is available.
|
|
154
155
|
**searchable** | Boolean (true) | Search is available.
|
|
155
156
|
**placeholder** | String ('Search...') | Placeholder text.
|
package/dist/treeselectjs.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ declare interface ITreeselect {
|
|
|
20
20
|
alwaysOpen: boolean;
|
|
21
21
|
showTags: boolean;
|
|
22
22
|
tagsCountText: string;
|
|
23
|
+
tagsSortFn: TagsSortFnType;
|
|
23
24
|
clearable: boolean;
|
|
24
25
|
searchable: boolean;
|
|
25
26
|
placeholder: string;
|
|
@@ -67,6 +68,7 @@ export declare interface ITreeselectParams {
|
|
|
67
68
|
alwaysOpen?: boolean;
|
|
68
69
|
showTags?: boolean;
|
|
69
70
|
tagsCountText?: string;
|
|
71
|
+
tagsSortFn?: TagsSortFnType;
|
|
70
72
|
clearable?: boolean;
|
|
71
73
|
searchable?: boolean;
|
|
72
74
|
placeholder?: string;
|
|
@@ -104,6 +106,13 @@ export declare type OptionType = {
|
|
|
104
106
|
children: OptionType[];
|
|
105
107
|
};
|
|
106
108
|
|
|
109
|
+
declare type TagsSortFnType = ((itemA: TagsSortItem, itemB: TagsSortItem) => number) | null;
|
|
110
|
+
|
|
111
|
+
declare type TagsSortItem = {
|
|
112
|
+
value: ValueOptionType;
|
|
113
|
+
name: string;
|
|
114
|
+
};
|
|
115
|
+
|
|
107
116
|
declare class Treeselect implements ITreeselect {
|
|
108
117
|
#private;
|
|
109
118
|
parentHtmlContainer: HTMLElement;
|
|
@@ -114,6 +123,7 @@ declare class Treeselect implements ITreeselect {
|
|
|
114
123
|
alwaysOpen: boolean;
|
|
115
124
|
showTags: boolean;
|
|
116
125
|
tagsCountText: string;
|
|
126
|
+
tagsSortFn: TagsSortFnType;
|
|
117
127
|
clearable: boolean;
|
|
118
128
|
searchable: boolean;
|
|
119
129
|
placeholder: string;
|
|
@@ -147,7 +157,7 @@ declare class Treeselect implements ITreeselect {
|
|
|
147
157
|
isListOpened: boolean;
|
|
148
158
|
selectedName: string;
|
|
149
159
|
srcElement: HTMLElement | null;
|
|
150
|
-
constructor({ parentHtmlContainer, value, options, openLevel, appendToBody, alwaysOpen, showTags, tagsCountText, clearable, searchable, placeholder, grouped, isGroupedValue, listSlotHtmlComponent, disabled, emptyText, staticList, id, ariaLabel, isSingleSelect, showCount, disabledBranchNode, direction, expandSelected, saveScrollPosition, isIndependentNodes, rtl, listClassName, iconElements, inputCallback, openCallback, closeCallback, nameChangeCallback, searchCallback, openCloseGroupCallback }: ITreeselectParams);
|
|
160
|
+
constructor({ parentHtmlContainer, value, options, openLevel, appendToBody, alwaysOpen, showTags, tagsCountText, tagsSortFn, clearable, searchable, placeholder, grouped, isGroupedValue, listSlotHtmlComponent, disabled, emptyText, staticList, id, ariaLabel, isSingleSelect, showCount, disabledBranchNode, direction, expandSelected, saveScrollPosition, isIndependentNodes, rtl, listClassName, iconElements, inputCallback, openCallback, closeCallback, nameChangeCallback, searchCallback, openCloseGroupCallback }: ITreeselectParams);
|
|
151
161
|
mount(): void;
|
|
152
162
|
updateValue(newValue: ValueInputType): void;
|
|
153
163
|
destroy(): void;
|