treeselectjs 0.9.2 → 0.9.3
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 +14 -5
- package/dist/treeselectjs.d.ts +4 -1
- package/dist/treeselectjs.mjs +263 -257
- package/dist/treeselectjs.umd.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# Treeselect JS component
|
|
1
|
+
# Treeselect JS component
|
|
2
2
|
|
|
3
3
|
A multi-select js component with nested options.
|
|
4
4
|
|
|
@@ -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 50.
|
|
13
|
-
- treeselectjs.umd.js 40.
|
|
12
|
+
- treeselectjs.mjs 50.48 kB │ gzip: 11.43 kB
|
|
13
|
+
- treeselectjs.umd.js 40.99 kB │ gzip: 10.43 kB
|
|
14
14
|
- treeselectjs.css 6.41 kB │ gzip: 1.27 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.9.
|
|
34
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/treeselectjs@0.9.
|
|
33
|
+
<script src="https://cdn.jsdelivr.net/npm/treeselectjs@0.9.3/dist/treeselectjs.umd.js"></script>
|
|
34
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/treeselectjs@0.9.3/dist/treeselectjs.css" />
|
|
35
35
|
...
|
|
36
36
|
<script>
|
|
37
37
|
...
|
|
@@ -154,6 +154,8 @@ Name | Type (default) | Description
|
|
|
154
154
|
**grouped** | Boolean (true) | Show groups in the input and group leafs if all group selected.
|
|
155
155
|
|
|
156
156
|
#### Callback props
|
|
157
|
+
Check [Emits](#Emits) section for more info.
|
|
158
|
+
|
|
157
159
|
Name | Type (default) | Description
|
|
158
160
|
------------- | ------------- | -------------
|
|
159
161
|
**inputCallback** | (value) => void (undefined) | Callback method for `input` if you don't want to to eventListener.
|
|
@@ -161,6 +163,7 @@ Name | Type (default) | Description
|
|
|
161
163
|
**closeCallback** | (value) => void (undefined) | Callback method for `close` if you don't want to use eventListener.
|
|
162
164
|
**nameChangeCallback** | (name) => void (undefined) | Callback method for `name-change` if you don't want to use eventListener.
|
|
163
165
|
**searchCallback** | (value) => void (undefined) | Callback method for `search` if you don't want to use eventListener.
|
|
166
|
+
**openCloseGroupCallback** | (groupId: ValueOptionType, isClosed: boolean) => void (undefined) | Callback method for `open-close-group` if you don't want to use eventListener.
|
|
164
167
|
|
|
165
168
|
#### Additional props
|
|
166
169
|
Name | Type (default) | Description
|
|
@@ -189,6 +192,7 @@ Name | Return Type | Description
|
|
|
189
192
|
**close** | Array[String \| Number] | Returns selected values, action is triggered on closing the list. Add `eventListener` or use `closeCallback` prop to get value.
|
|
190
193
|
**name-change** | String | Returns selected name inside the input, action is triggered on on change the list. Add `eventListener` or use `nameChangeCallback` prop to get name.
|
|
191
194
|
**search** | String | Returns entered search value, action is triggered on change search value during the typing. Add `eventListener` or use `searchCallback` prop to get value. You can try create something like autocomplete with help of this event.
|
|
195
|
+
**open-close-group** | { groupId: [String \| Number], isClosed: Boolean } | Returns groupId and closed/open status of this group, action is triggered on open/close group in the list. Add `eventListener` or use `openCloseGroupCallback` prop to get value.
|
|
192
196
|
|
|
193
197
|
---
|
|
194
198
|
|
|
@@ -212,3 +216,8 @@ Name | Params | Description
|
|
|
212
216
|
6) **Value** prop inside the **options** prop should be a **String** or **Number**.
|
|
213
217
|
7) If you use **isSingleSelect** prop, you should pass only a single **value** without an array.
|
|
214
218
|
8) If you use **isSingleSelect** prop, you can set **showTags** to false. It helps to show treeselect as a dropdown. Also you can disable selecting of group's nodes with help of **disabledBranchNode**.
|
|
219
|
+
|
|
220
|
+
### Support
|
|
221
|
+
You can buy me a coffee if you want to support my work. Thank you!
|
|
222
|
+
|
|
223
|
+
<a href="https://www.buymeacoffee.com/dipson88" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>
|
package/dist/treeselectjs.d.ts
CHANGED
|
@@ -49,6 +49,7 @@ declare interface ITreeselect {
|
|
|
49
49
|
closeCallback: ((value: ValueType) => void) | undefined;
|
|
50
50
|
nameChangeCallback: ((name: string) => void) | undefined;
|
|
51
51
|
searchCallback: ((value: string) => void) | undefined;
|
|
52
|
+
openCloseGroupCallback: ((groupId: ValueOptionType, isClosed: boolean) => void) | undefined;
|
|
52
53
|
mount: () => void;
|
|
53
54
|
updateValue: (newValue: ValueInputType) => void;
|
|
54
55
|
destroy: () => void;
|
|
@@ -89,6 +90,7 @@ export declare interface ITreeselectParams {
|
|
|
89
90
|
closeCallback?: (value: ValueType) => void;
|
|
90
91
|
nameChangeCallback?: (name: string) => void;
|
|
91
92
|
searchCallback?: (value: string) => void;
|
|
93
|
+
openCloseGroupCallback?: (groupId: ValueOptionType, isClosed: boolean) => void;
|
|
92
94
|
}
|
|
93
95
|
|
|
94
96
|
export declare type OptionType = {
|
|
@@ -133,13 +135,14 @@ declare class Treeselect implements ITreeselect {
|
|
|
133
135
|
closeCallback: ((value: ValueType) => void) | undefined;
|
|
134
136
|
nameChangeCallback: ((name: string) => void) | undefined;
|
|
135
137
|
searchCallback: ((value: string) => void) | undefined;
|
|
138
|
+
openCloseGroupCallback: ((groupId: ValueOptionType, isClosed: boolean) => void) | undefined;
|
|
136
139
|
ungroupedValue: ValueOptionType[];
|
|
137
140
|
groupedValue: ValueOptionType[];
|
|
138
141
|
allValue: ValueOptionType[];
|
|
139
142
|
isListOpened: boolean;
|
|
140
143
|
selectedName: string;
|
|
141
144
|
srcElement: HTMLElement | null;
|
|
142
|
-
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, iconElements, inputCallback, openCallback, closeCallback, nameChangeCallback, searchCallback }: ITreeselectParams);
|
|
145
|
+
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, iconElements, inputCallback, openCallback, closeCallback, nameChangeCallback, searchCallback, openCloseGroupCallback }: ITreeselectParams);
|
|
143
146
|
mount(): void;
|
|
144
147
|
updateValue(newValue: ValueInputType): void;
|
|
145
148
|
destroy(): void;
|