treeselectjs 0.8.6 → 0.9.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 +8 -4
- package/dist/treeselectjs.d.ts +11 -1
- package/dist/treeselectjs.mjs +448 -419
- package/dist/treeselectjs.umd.js +1 -1
- package/package.json +1 -1
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 50.05 kB │ gzip: 11.33 kB
|
|
13
|
+
- treeselectjs.umd.js 40.62 kB │ gzip: 10.35 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.
|
|
34
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/treeselectjs@0.
|
|
33
|
+
<script src="https://cdn.jsdelivr.net/npm/treeselectjs@0.9.1/dist/treeselectjs.umd.js"></script>
|
|
34
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/treeselectjs@0.9.1/dist/treeselectjs.css" />
|
|
35
35
|
...
|
|
36
36
|
<script>
|
|
37
37
|
...
|
|
@@ -125,6 +125,7 @@ Name | Type (default) | Description
|
|
|
125
125
|
**id** | String ('') | id attribute for the accessibility.
|
|
126
126
|
**isSingleSelect** | Boolean (false) | Converts multi-select to the single value select. Checkboxes will be removed. You should pass only one id instead of array of values. Also you can set **showTags** to false. It helps to show treeselect as a dropdown.
|
|
127
127
|
**isGroupedValue** | Boolean (false) | Return groups if they selected instead of separate ids. Treeselect returns only leaves ids by default.
|
|
128
|
+
**isIndependentNodes** | Boolean (false) | All nodes in treeselect work as an independent entity. Check/uncheck action ignore children/parent updates workflow. Disabled nodes ignore children/parent workflow as well.
|
|
128
129
|
|
|
129
130
|
#### List settings props
|
|
130
131
|
Name | Type (default) | Description
|
|
@@ -150,6 +151,7 @@ Name | Type (default) | Description
|
|
|
150
151
|
**searchable** | Boolean (true) | Search is available.
|
|
151
152
|
**placeholder** | String ('Search...') | Placeholder text.
|
|
152
153
|
**grouped** | Boolean (true) | Show groups in the input and group leafs if all group selected.
|
|
154
|
+
**ariaLabel** | String (**placeholder**) | ariaLabel attribute for the accessibility. Prop uses **placeholder** as a default value.
|
|
153
155
|
|
|
154
156
|
#### Callback props
|
|
155
157
|
Name | Type (default) | Description
|
|
@@ -158,6 +160,7 @@ Name | Type (default) | Description
|
|
|
158
160
|
**openCallback** | (value) => void (undefined) | Callback method for `open` if you don't want to use eventListener.
|
|
159
161
|
**closeCallback** | (value) => void (undefined) | Callback method for `close` if you don't want to use eventListener.
|
|
160
162
|
**nameChangeCallback** | (name) => void (undefined) | Callback method for `name-change` if you don't want to use eventListener.
|
|
163
|
+
**searchCallback** | (value) => void (undefined) | Callback method for `search` if you don't want to use eventListener.
|
|
161
164
|
|
|
162
165
|
#### Additional props
|
|
163
166
|
Name | Type (default) | Description
|
|
@@ -185,6 +188,7 @@ Name | Return Type | Description
|
|
|
185
188
|
**open** | Array[String \| Number] | Returns selected values, action is triggered on opening the list. Add `eventListener` or use `openCallback` prop to get value.
|
|
186
189
|
**close** | Array[String \| Number] | Returns selected values, action is triggered on closing the list. Add `eventListener` or use `closeCallback` prop to get value.
|
|
187
190
|
**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
|
+
**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.
|
|
188
192
|
|
|
189
193
|
---
|
|
190
194
|
|
package/dist/treeselectjs.d.ts
CHANGED
|
@@ -30,12 +30,14 @@ declare interface ITreeselect {
|
|
|
30
30
|
emptyText: string;
|
|
31
31
|
staticList: boolean;
|
|
32
32
|
id: string;
|
|
33
|
+
ariaLabel: string;
|
|
33
34
|
isSingleSelect: boolean;
|
|
34
35
|
showCount: boolean;
|
|
35
36
|
disabledBranchNode: boolean;
|
|
36
37
|
direction: DirectionType;
|
|
37
38
|
expandSelected: boolean;
|
|
38
39
|
saveScrollPosition: boolean;
|
|
40
|
+
isIndependentNodes: boolean;
|
|
39
41
|
iconElements: IconsType;
|
|
40
42
|
ungroupedValue: ValueOptionType[];
|
|
41
43
|
groupedValue: ValueOptionType[];
|
|
@@ -46,6 +48,7 @@ declare interface ITreeselect {
|
|
|
46
48
|
openCallback: ((value: ValueType) => void) | undefined;
|
|
47
49
|
closeCallback: ((value: ValueType) => void) | undefined;
|
|
48
50
|
nameChangeCallback: ((name: string) => void) | undefined;
|
|
51
|
+
searchCallback: ((value: string) => void) | undefined;
|
|
49
52
|
mount: () => void;
|
|
50
53
|
updateValue: (newValue: ValueInputType) => void;
|
|
51
54
|
destroy: () => void;
|
|
@@ -72,17 +75,20 @@ export declare interface ITreeselectParams {
|
|
|
72
75
|
emptyText?: string;
|
|
73
76
|
staticList?: boolean;
|
|
74
77
|
id?: string;
|
|
78
|
+
ariaLabel?: string;
|
|
75
79
|
isSingleSelect?: boolean;
|
|
76
80
|
showCount?: boolean;
|
|
77
81
|
disabledBranchNode?: boolean;
|
|
78
82
|
direction?: DirectionType;
|
|
79
83
|
expandSelected?: boolean;
|
|
80
84
|
saveScrollPosition?: boolean;
|
|
85
|
+
isIndependentNodes?: boolean;
|
|
81
86
|
iconElements?: Partial<IconsType>;
|
|
82
87
|
inputCallback?: (value: ValueType) => void;
|
|
83
88
|
openCallback?: (value: ValueType) => void;
|
|
84
89
|
closeCallback?: (value: ValueType) => void;
|
|
85
90
|
nameChangeCallback?: (name: string) => void;
|
|
91
|
+
searchCallback?: (value: string) => void;
|
|
86
92
|
}
|
|
87
93
|
|
|
88
94
|
export declare type OptionType = {
|
|
@@ -113,23 +119,27 @@ declare class Treeselect implements ITreeselect {
|
|
|
113
119
|
emptyText: string;
|
|
114
120
|
staticList: boolean;
|
|
115
121
|
id: string;
|
|
122
|
+
ariaLabel: string;
|
|
116
123
|
isSingleSelect: boolean;
|
|
117
124
|
showCount: boolean;
|
|
118
125
|
disabledBranchNode: boolean;
|
|
119
126
|
direction: DirectionType;
|
|
120
127
|
expandSelected: boolean;
|
|
121
128
|
saveScrollPosition: boolean;
|
|
129
|
+
isIndependentNodes: boolean;
|
|
122
130
|
iconElements: IconsType;
|
|
123
131
|
inputCallback: ((value: ValueType) => void) | undefined;
|
|
124
132
|
openCallback: ((value: ValueType) => void) | undefined;
|
|
125
133
|
closeCallback: ((value: ValueType) => void) | undefined;
|
|
126
134
|
nameChangeCallback: ((name: string) => void) | undefined;
|
|
135
|
+
searchCallback: ((value: string) => void) | undefined;
|
|
127
136
|
ungroupedValue: ValueOptionType[];
|
|
128
137
|
groupedValue: ValueOptionType[];
|
|
138
|
+
allValue: ValueOptionType[];
|
|
129
139
|
isListOpened: boolean;
|
|
130
140
|
selectedName: string;
|
|
131
141
|
srcElement: HTMLElement | null;
|
|
132
|
-
constructor({ parentHtmlContainer, value, options, openLevel, appendToBody, alwaysOpen, showTags, tagsCountText, clearable, searchable, placeholder, grouped, isGroupedValue, listSlotHtmlComponent, disabled, emptyText, staticList, id, isSingleSelect, showCount, disabledBranchNode, direction, expandSelected, saveScrollPosition, iconElements, inputCallback, openCallback, closeCallback, nameChangeCallback }: ITreeselectParams);
|
|
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);
|
|
133
143
|
mount(): void;
|
|
134
144
|
updateValue(newValue: ValueInputType): void;
|
|
135
145
|
destroy(): void;
|