superdesk-ui-framework 3.0.1-beta.3 → 3.0.1-beta.30
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/app/fonts/sd_icons.eot +0 -0
- package/app/fonts/sd_icons.svg +14 -7
- package/app/fonts/sd_icons.ttf +0 -0
- package/app/fonts/sd_icons.woff +0 -0
- package/app/scripts/toggleBoxNext.js +1 -1
- package/app/styles/_big-icon-font.scss +1 -1
- package/app/styles/_buttons.scss +11 -6
- package/app/styles/_content-divider.scss +63 -8
- package/app/styles/_helpers.scss +24 -1
- package/app/styles/_icon-font.scss +17 -10
- package/app/styles/_labels.scss +0 -1
- package/app/styles/_master-desk.scss +3 -2
- package/app/styles/_modals.scss +6 -3
- package/app/styles/_normalize.scss +4 -0
- package/app/styles/_sd-tag-input.scss +256 -296
- package/app/styles/_simple-list.scss +0 -2
- package/app/styles/_table-list.scss +116 -12
- package/app/styles/app.scss +1 -0
- package/app/styles/components/_list-item.scss +36 -17
- package/app/styles/components/_sd-collapse-box.scss +6 -6
- package/app/styles/components/_sd-comment-box.scss +8 -4
- package/app/styles/components/_sd-editor-popup.scss +4 -4
- package/app/styles/components/_sd-grid-item.scss +30 -16
- package/app/styles/components/_sd-media-carousel.scss +37 -2
- package/app/styles/components/_sd-photo-preview.scss +3 -3
- package/app/styles/components/_sd-searchbar.scss +7 -0
- package/app/styles/components/_subnav.scss +470 -470
- package/app/styles/design-tokens/_design-tokens-general.scss +1 -1
- package/app/styles/design-tokens/_new-colors.scss +30 -13
- package/app/styles/dropdowns/_basic-dropdown.scss +6 -0
- package/app/styles/form-elements/_forms-general.scss +81 -7
- package/app/styles/form-elements/_input-wrap.scss +138 -0
- package/app/styles/form-elements/_inputs.scss +368 -110
- package/app/styles/grids/_grid-layout.scss +34 -1
- package/app/styles/interface-elements/_side-panel.scss +1 -1
- package/app/styles/layout/_basic-layout.scss +2 -2
- package/app/styles/layout/_editor.scss +10 -4
- package/app/styles/primereact/_pr-datepicker.scss +4 -2
- package/app/styles/primereact/_pr-dialog.scss +5 -0
- package/app/styles/primereact/_pr-dropdown.scss +17 -1
- package/app/styles/primereact/_pr-menu.scss +6 -5
- package/app/styles/variables/_colors.scss +21 -21
- package/app-typescript/components/Badge.tsx +3 -2
- package/app-typescript/components/ContentDivider.tsx +3 -0
- package/app-typescript/components/DatePicker.tsx +40 -52
- package/app-typescript/components/Dropdown.tsx +127 -82
- package/app-typescript/components/DurationInput.tsx +400 -0
- package/app-typescript/components/EmptyState.tsx +2 -1
- package/app-typescript/components/Form/FormLabel.tsx +8 -1
- package/app-typescript/components/Form/FormRowNew.tsx +41 -0
- package/app-typescript/components/Form/InputBase.tsx +95 -0
- package/app-typescript/components/Form/InputNew.tsx +107 -0
- package/app-typescript/components/Form/InputWrapper.tsx +79 -0
- package/app-typescript/components/Form/index.tsx +4 -0
- package/app-typescript/components/Input.tsx +28 -45
- package/app-typescript/components/Label.tsx +65 -10
- package/app-typescript/components/Layouts/AuthoringContainer.tsx +2 -1
- package/app-typescript/components/Layouts/AuthoringFrame.tsx +2 -1
- package/app-typescript/components/Layouts/AuthoringFrameRightBar.tsx +21 -2
- package/app-typescript/components/Layouts/AuthoringInnerHeader.tsx +1 -1
- package/app-typescript/components/Layouts/AuthoringMain.tsx +4 -2
- package/app-typescript/components/Layouts/CoreLayout.tsx +2 -1
- package/app-typescript/components/Layouts/CoreLayoutMain.tsx +7 -1
- package/app-typescript/components/Layouts/Layout.tsx +1 -1
- package/app-typescript/components/LeftMenu.tsx +127 -122
- package/app-typescript/components/Lists/ContentList.tsx +66 -33
- package/app-typescript/components/Lists/TableList.tsx +348 -151
- package/app-typescript/components/Menu.tsx +2 -2
- package/app-typescript/components/MultiSelect.tsx +37 -50
- package/app-typescript/components/NavButton.tsx +2 -1
- package/app-typescript/components/Navigation/BottomNav.tsx +3 -2
- package/app-typescript/components/SearchBar.tsx +39 -12
- package/app-typescript/components/Select.tsx +23 -41
- package/app-typescript/components/SelectWithTemplate.tsx +32 -7
- package/app-typescript/components/Spacer.tsx +87 -0
- package/app-typescript/components/TimePicker.tsx +38 -15
- package/app-typescript/components/TreeSelect.tsx +546 -212
- package/app-typescript/index.ts +6 -1
- package/dist/examples.bundle.css +344 -71
- package/dist/examples.bundle.js +48203 -45174
- package/dist/playgrounds/react-playgrounds/CoreLayout.tsx +65 -54
- package/dist/playgrounds/react-playgrounds/Index.tsx +1 -0
- package/dist/playgrounds/react-playgrounds/Multiedit.tsx +321 -0
- package/dist/playgrounds/react-playgrounds/RundownEditor.tsx +26 -23
- package/dist/playgrounds/react-playgrounds/Rundowns.tsx +20 -21
- package/dist/playgrounds/react-playgrounds/SamsPlayground.tsx +12 -3
- package/dist/playgrounds/react-playgrounds/TestGround.tsx +379 -25
- package/dist/playgrounds/react-playgrounds/components/Layout.tsx +1 -1
- package/dist/react/Badges.tsx +18 -0
- package/dist/react/ContentDivider.tsx +22 -18
- package/dist/react/ContentList.tsx +200 -18
- package/dist/react/DatePicker.tsx +21 -1
- package/dist/react/Dropdowns.tsx +580 -48
- package/dist/react/DurationInput.tsx +108 -0
- package/dist/react/Index.tsx +5 -0
- package/dist/react/Inputs.tsx +147 -2
- package/dist/react/Labels.tsx +51 -1
- package/dist/react/LeftNavigations.tsx +71 -44
- package/dist/react/MultiSelect.tsx +10 -7
- package/dist/react/NavButtons.tsx +31 -1
- package/dist/react/SelectWithTemplate.tsx +6 -1
- package/dist/react/TableList.tsx +79 -186
- package/dist/react/TimePicker.tsx +22 -12
- package/dist/react/Togglebox.tsx +1 -1
- package/dist/react/TreeSelect.tsx +295 -51
- package/dist/react/tree-select/TreeSelect.tsx +273 -0
- package/dist/react/tree-select/example-1.tsx +71 -0
- package/dist/react/tree-select/example-2.tsx +59 -0
- package/dist/sd_icons.eot +0 -0
- package/dist/sd_icons.svg +14 -7
- package/dist/sd_icons.ttf +0 -0
- package/dist/sd_icons.woff +0 -0
- package/dist/superdesk-ui.bundle.css +2282 -782
- package/dist/superdesk-ui.bundle.js +37312 -21800
- package/dist/vendor.bundle.js +27 -27
- package/examples/css/docs-page.css +4 -4
- package/examples/index.js +4 -0
- package/examples/pages/playgrounds/react-playgrounds/CoreLayout.tsx +65 -54
- package/examples/pages/playgrounds/react-playgrounds/Index.tsx +1 -0
- package/examples/pages/playgrounds/react-playgrounds/Multiedit.tsx +321 -0
- package/examples/pages/playgrounds/react-playgrounds/RundownEditor.tsx +26 -23
- package/examples/pages/playgrounds/react-playgrounds/Rundowns.tsx +20 -21
- package/examples/pages/playgrounds/react-playgrounds/SamsPlayground.tsx +12 -3
- package/examples/pages/playgrounds/react-playgrounds/TestGround.tsx +379 -25
- package/examples/pages/playgrounds/react-playgrounds/components/Layout.tsx +1 -1
- package/examples/pages/react/Badges.tsx +18 -0
- package/examples/pages/react/ContentDivider.tsx +22 -18
- package/examples/pages/react/ContentList.tsx +200 -18
- package/examples/pages/react/DatePicker.tsx +21 -1
- package/examples/pages/react/Dropdowns.tsx +580 -48
- package/examples/pages/react/DurationInput.tsx +108 -0
- package/examples/pages/react/Index.tsx +5 -0
- package/examples/pages/react/Inputs.tsx +147 -2
- package/examples/pages/react/Labels.tsx +51 -1
- package/examples/pages/react/LeftNavigations.tsx +71 -44
- package/examples/pages/react/MultiSelect.tsx +10 -7
- package/examples/pages/react/NavButtons.tsx +31 -1
- package/examples/pages/react/SelectWithTemplate.tsx +6 -1
- package/examples/pages/react/TableList.tsx +79 -186
- package/examples/pages/react/TimePicker.tsx +22 -12
- package/examples/pages/react/Togglebox.tsx +1 -1
- package/examples/pages/react/TreeSelect.tsx +295 -51
- package/examples/pages/react/tree-select/TreeSelect.tsx +273 -0
- package/examples/pages/react/tree-select/example-1.tsx +71 -0
- package/examples/pages/react/tree-select/example-2.tsx +59 -0
- package/package.json +5 -5
- package/react/components/Badge.d.ts +1 -0
- package/react/components/Badge.js +2 -2
- package/react/components/ContentDivider.d.ts +1 -0
- package/react/components/ContentDivider.js +2 -0
- package/react/components/DatePicker.d.ts +1 -0
- package/react/components/DatePicker.js +6 -22
- package/react/components/Dropdown.d.ts +6 -5
- package/react/components/Dropdown.js +57 -30
- package/react/components/DurationInput.d.ts +42 -0
- package/react/components/DurationInput.js +364 -0
- package/react/components/EmptyState.d.ts +1 -0
- package/react/components/EmptyState.js +1 -1
- package/react/components/Form/FormLabel.d.ts +4 -1
- package/react/components/Form/FormLabel.js +9 -3
- package/react/components/Form/FormRowNew.d.ts +12 -0
- package/react/components/Form/FormRowNew.js +67 -0
- package/react/components/Form/InputBase.d.ts +41 -0
- package/react/components/Form/InputBase.js +86 -0
- package/react/components/Form/InputNew.d.ts +45 -0
- package/react/components/Form/InputNew.js +75 -0
- package/react/components/Form/InputWrapper.d.ts +28 -0
- package/react/components/Form/InputWrapper.js +91 -0
- package/react/components/Form/index.d.ts +4 -0
- package/react/components/Form/index.js +9 -1
- package/react/components/Input.js +5 -34
- package/react/components/Label.d.ts +2 -0
- package/react/components/Label.js +34 -3
- package/react/components/Layouts/AuthoringContainer.d.ts +1 -0
- package/react/components/Layouts/AuthoringContainer.js +1 -1
- package/react/components/Layouts/AuthoringFrame.d.ts +1 -0
- package/react/components/Layouts/AuthoringFrame.js +1 -1
- package/react/components/Layouts/AuthoringFrameRightBar.d.ts +9 -2
- package/react/components/Layouts/AuthoringFrameRightBar.js +14 -3
- package/react/components/Layouts/AuthoringInnerHeader.js +1 -1
- package/react/components/Layouts/AuthoringMain.js +1 -1
- package/react/components/Layouts/CoreLayout.d.ts +1 -0
- package/react/components/Layouts/CoreLayout.js +1 -1
- package/react/components/Layouts/CoreLayoutMain.d.ts +1 -0
- package/react/components/Layouts/CoreLayoutMain.js +8 -1
- package/react/components/Layouts/Layout.js +1 -1
- package/react/components/LeftMenu.d.ts +3 -1
- package/react/components/LeftMenu.js +8 -1
- package/react/components/Lists/ContentList.d.ts +51 -0
- package/react/components/Lists/ContentList.js +110 -0
- package/react/components/Lists/TableList.d.ts +64 -0
- package/react/components/Lists/TableList.js +240 -0
- package/react/components/Menu.js +1 -1
- package/react/components/MultiSelect.d.ts +40 -0
- package/react/components/MultiSelect.js +70 -0
- package/react/components/NavButton.d.ts +1 -1
- package/react/components/Navigation/BottomNav.d.ts +1 -0
- package/react/components/Navigation/BottomNav.js +2 -2
- package/react/components/SearchBar.d.ts +3 -2
- package/react/components/SearchBar.js +28 -4
- package/react/components/Select.d.ts +1 -1
- package/react/components/Select.js +4 -26
- package/react/components/SelectWithTemplate.d.ts +11 -1
- package/react/components/SelectWithTemplate.js +19 -10
- package/react/components/TimePicker.d.ts +11 -1
- package/react/components/TimePicker.js +10 -3
- package/react/components/TreeSelect.d.ts +82 -0
- package/react/components/TreeSelect.js +521 -0
- package/react/index.d.ts +6 -0
- package/react/index.js +16 -3
- package/.vscode/settings.json +0 -5
- package/app-typescript/dist/components/Alert.d.ts +0 -16
- package/app-typescript/dist/components/Autocomplete.d.ts +0 -48
- package/app-typescript/dist/components/Avatar.d.ts +0 -33
- package/app-typescript/dist/components/Badge.d.ts +0 -13
- package/app-typescript/dist/components/Button.d.ts +0 -23
- package/app-typescript/dist/components/ButtonGroup.d.ts +0 -12
- package/app-typescript/dist/components/CheckButtonGroup.d.ts +0 -11
- package/app-typescript/dist/components/CheckGroup.d.ts +0 -9
- package/app-typescript/dist/components/Checkbox.d.ts +0 -19
- package/app-typescript/dist/components/CheckboxButton.d.ts +0 -19
- package/app-typescript/dist/components/DatePicker.d.ts +0 -37
- package/app-typescript/dist/components/Divider.d.ts +0 -9
- package/app-typescript/dist/components/DonutChart.d.ts +0 -12
- package/app-typescript/dist/components/Dropdown.d.ts +0 -28
- package/app-typescript/dist/components/DropdownFirst.d.ts +0 -42
- package/app-typescript/dist/components/EmptyState.d.ts +0 -11
- package/app-typescript/dist/components/FormLabel.d.ts +0 -9
- package/app-typescript/dist/components/Genie.d.ts +0 -13
- package/app-typescript/dist/components/GridItem.d.ts +0 -69
- package/app-typescript/dist/components/GridList.d.ts +0 -14
- package/app-typescript/dist/components/HeadingText.d.ts +0 -10
- package/app-typescript/dist/components/HelloWorld.d.ts +0 -8
- package/app-typescript/dist/components/Icon.d.ts +0 -12
- package/app-typescript/dist/components/IconButton.d.ts +0 -12
- package/app-typescript/dist/components/IconLabel.d.ts +0 -11
- package/app-typescript/dist/components/Input.d.ts +0 -24
- package/app-typescript/dist/components/Label.d.ts +0 -15
- package/app-typescript/dist/components/LeftMenu.d.ts +0 -26
- package/app-typescript/dist/components/Loader.d.ts +0 -8
- package/app-typescript/dist/components/NavButton.d.ts +0 -15
- package/app-typescript/dist/components/Popover.d.ts +0 -13
- package/app-typescript/dist/components/PropsList.d.ts +0 -15
- package/app-typescript/dist/components/Radio.d.ts +0 -19
- package/app-typescript/dist/components/RadioButton.d.ts +0 -20
- package/app-typescript/dist/components/Select.d.ts +0 -29
- package/app-typescript/dist/components/SelectWithTemplate.d.ts +0 -32
- package/app-typescript/dist/components/SlidingToolbar.d.ts +0 -8
- package/app-typescript/dist/components/StrechBar.d.ts +0 -4
- package/app-typescript/dist/components/SubNav.d.ts +0 -10
- package/app-typescript/dist/components/Switch.d.ts +0 -12
- package/app-typescript/dist/components/TabCustom.d.ts +0 -25
- package/app-typescript/dist/components/TabList.d.ts +0 -22
- package/app-typescript/dist/components/Tag.d.ts +0 -9
- package/app-typescript/dist/components/TagInput.d.ts +0 -7
- package/app-typescript/dist/components/TagInputTest.d.ts +0 -18
- package/app-typescript/dist/components/TimePicker.d.ts +0 -11
- package/app-typescript/dist/components/Tooltip.d.ts +0 -11
- package/app-typescript/dist/components/_Positioner.d.ts +0 -27
- package/app-typescript/dist/index.d.ts +0 -56
- package/patches/@superdesk+primereact+5.0.2-4.patch +0 -57
- package/yarn-error.log +0 -111
@@ -2,72 +2,198 @@ import * as React from 'react';
|
|
2
2
|
import * as Markup from '../../js/react';
|
3
3
|
import { PropsList, Prop } from '../../../app-typescript';
|
4
4
|
import { MultiSelect } from '../../../app-typescript/components/MultiSelect';
|
5
|
-
import { TreeSelect } from '../../../app-typescript/components/TreeSelect';
|
5
|
+
import { ITreeNode, TreeSelect } from '../../../app-typescript/components/TreeSelect';
|
6
6
|
|
7
7
|
interface IState {
|
8
8
|
value: any;
|
9
9
|
value2: any;
|
10
10
|
options: any;
|
11
11
|
options2: any;
|
12
|
+
inputValue: string;
|
13
|
+
arr: any;
|
12
14
|
}
|
13
15
|
|
14
|
-
let
|
16
|
+
let options = [
|
15
17
|
{
|
16
|
-
|
17
|
-
|
18
|
+
value: {name: 'Category1'},
|
19
|
+
children: [
|
18
20
|
{
|
19
|
-
|
20
|
-
|
21
|
-
{
|
21
|
+
value: {name: 'Sub-category1'},
|
22
|
+
children: [
|
23
|
+
{value: {name: 'Item20'}}
|
22
24
|
]
|
23
25
|
},
|
24
26
|
{
|
25
|
-
|
26
|
-
|
27
|
-
{
|
27
|
+
value: {name: 'Sub-category2'},
|
28
|
+
children: [
|
29
|
+
{value: {name: 'Item21'}}
|
30
|
+
]
|
31
|
+
}
|
32
|
+
,
|
33
|
+
{
|
34
|
+
value: {name: 'Sub-category3'},
|
35
|
+
children: [
|
36
|
+
{value: {name: 'Item22'}}
|
37
|
+
]
|
38
|
+
}
|
39
|
+
,
|
40
|
+
{
|
41
|
+
value: {name: 'Sub-category4'},
|
42
|
+
children: [
|
43
|
+
{value: {name: 'Item23'}}
|
44
|
+
]
|
45
|
+
}
|
46
|
+
,
|
47
|
+
{
|
48
|
+
value: {name: 'Sub-category5'},
|
49
|
+
children: [
|
50
|
+
{value: {name: 'Item24'}}
|
51
|
+
]
|
52
|
+
}
|
53
|
+
,
|
54
|
+
{
|
55
|
+
value: {name: 'Sub-category6'},
|
56
|
+
children: [
|
57
|
+
{value: {name: 'Item25'}}
|
28
58
|
]
|
29
59
|
}
|
30
60
|
]
|
31
61
|
},
|
32
62
|
{
|
33
|
-
|
34
|
-
|
63
|
+
value: {name: 'Category2'},
|
64
|
+
children: [
|
35
65
|
{
|
36
|
-
|
66
|
+
value: {name: 'Item8'}
|
37
67
|
},
|
38
68
|
{
|
39
|
-
|
69
|
+
value: {name: 'Item9'}
|
40
70
|
}
|
41
71
|
]
|
42
72
|
},
|
43
73
|
{
|
44
|
-
|
45
|
-
|
74
|
+
value: {name: 'Category3', bgColor: 'red'},
|
75
|
+
children: [
|
46
76
|
{
|
47
|
-
|
77
|
+
value: {name: 'Item10'}
|
48
78
|
},
|
49
79
|
{
|
50
|
-
|
80
|
+
value: {name: 'Item11'}
|
51
81
|
}
|
52
82
|
]
|
53
83
|
},
|
54
84
|
]
|
55
85
|
|
86
|
+
let options2 = [
|
87
|
+
{
|
88
|
+
value: {name: 'Category1', border: 'red'},
|
89
|
+
children: [
|
90
|
+
{
|
91
|
+
value: {name: 'Sub-category1'},
|
92
|
+
children: [
|
93
|
+
{value: {name: 'Item20'}}
|
94
|
+
]
|
95
|
+
},
|
96
|
+
{
|
97
|
+
value: {name: 'Sub-category2'},
|
98
|
+
children: [
|
99
|
+
{value: {name: 'Item21'}}
|
100
|
+
]
|
101
|
+
}
|
102
|
+
,
|
103
|
+
{
|
104
|
+
value: {name: 'Sub-category3'},
|
105
|
+
children: [
|
106
|
+
{value: {name: 'Item22'}}
|
107
|
+
]
|
108
|
+
}
|
109
|
+
,
|
110
|
+
{
|
111
|
+
value: {name: 'Sub-category4'},
|
112
|
+
children: [
|
113
|
+
{value: {name: 'Item23'}}
|
114
|
+
]
|
115
|
+
}
|
116
|
+
,
|
117
|
+
{
|
118
|
+
value: {name: 'Sub-category5'},
|
119
|
+
children: [
|
120
|
+
{value: {name: 'Item24'}}
|
121
|
+
]
|
122
|
+
}
|
123
|
+
,
|
124
|
+
{
|
125
|
+
value: {name: 'Sub-category6'},
|
126
|
+
children: [
|
127
|
+
{value: {name: 'Item25'}}
|
128
|
+
]
|
129
|
+
}
|
130
|
+
]
|
131
|
+
},
|
132
|
+
{
|
133
|
+
value: {name: 'Category2', border: 'green'},
|
134
|
+
children: [
|
135
|
+
{
|
136
|
+
value: {name: 'Item8'}
|
137
|
+
},
|
138
|
+
{
|
139
|
+
value: {name: 'Item9'}
|
140
|
+
}
|
141
|
+
]
|
142
|
+
},
|
143
|
+
{
|
144
|
+
value: {name: 'Category3', border: 'yellow'},
|
145
|
+
children: [
|
146
|
+
{
|
147
|
+
value: {name: 'Item10'}
|
148
|
+
},
|
149
|
+
{
|
150
|
+
value: {name: 'Item11'}
|
151
|
+
}
|
152
|
+
]
|
153
|
+
},
|
154
|
+
]
|
155
|
+
|
156
|
+
let fetchedArr = [];
|
157
|
+
fetch('https://nominatim.openstreetmap.org/search/berlin?format=json&addressdetails=1&limit=20').then(response => response.json()).then(data => fetchedArr = data
|
158
|
+
);
|
159
|
+
|
160
|
+
type ICancelFn = () => void;
|
161
|
+
|
162
|
+
function searchOptions(
|
163
|
+
term: string,
|
164
|
+
callback: (res: any) => void,
|
165
|
+
): ICancelFn {
|
166
|
+
let timeout = setTimeout(() => {
|
167
|
+
|
168
|
+
callback(
|
169
|
+
fetchedArr
|
170
|
+
.filter((item: any) => item.display_name.toLocaleLowerCase().includes(term.toLocaleLowerCase()))
|
171
|
+
.map((item) => ({value: item})),
|
172
|
+
);
|
173
|
+
}, 1000);
|
174
|
+
|
175
|
+
return () => {
|
176
|
+
clearTimeout(timeout);
|
177
|
+
}
|
178
|
+
}
|
179
|
+
|
56
180
|
export class TreeSelectDocs extends React.Component<{}, IState> {
|
57
181
|
constructor(props) {
|
58
182
|
super(props);
|
59
183
|
this.state = {
|
60
184
|
value: [],
|
61
185
|
value2: [],
|
62
|
-
options:
|
63
|
-
options2:
|
186
|
+
options: options,
|
187
|
+
options2: options,
|
188
|
+
inputValue: '',
|
189
|
+
arr: []
|
64
190
|
}
|
191
|
+
|
65
192
|
|
66
193
|
this.handleChange = this.handleChange.bind(this);
|
67
194
|
}
|
68
195
|
|
69
196
|
handleChange(e, option) {
|
70
|
-
|
71
197
|
if(option.item) {
|
72
198
|
e.stopPropagation();
|
73
199
|
e.preventDefault();
|
@@ -75,7 +201,7 @@ export class TreeSelectDocs extends React.Component<{}, IState> {
|
|
75
201
|
this.setState({
|
76
202
|
options: option.item
|
77
203
|
})
|
78
|
-
}
|
204
|
+
}
|
79
205
|
}
|
80
206
|
|
81
207
|
render() {
|
@@ -99,11 +225,29 @@ export class TreeSelectDocs extends React.Component<{}, IState> {
|
|
99
225
|
<div className='docs-page__content-row docs-page__content-row--no-margin'>
|
100
226
|
<div className='form__row'>
|
101
227
|
<TreeSelect
|
102
|
-
|
103
|
-
|
104
|
-
|
228
|
+
value={[{name: 'Item1'}, {name: 'Item2'}]}
|
229
|
+
getOptions={() => options}
|
230
|
+
kind={'synchronous'}
|
231
|
+
getId={(item) => item.name}
|
232
|
+
getLabel={(item) => item.name}
|
233
|
+
getBackgroundColor={(item: any) => item.bgColor}
|
105
234
|
selectBranchWithChildren={true}
|
106
|
-
|
235
|
+
allowMultiple
|
236
|
+
fullWidth
|
237
|
+
singleLevelSearch
|
238
|
+
required
|
239
|
+
info={'Info Message'}
|
240
|
+
error={'Error Message'}
|
241
|
+
label={'TreeSelect Label'}
|
242
|
+
searchPlaceholder='Search...'
|
243
|
+
onChange={(e) => false}
|
244
|
+
valueTemplate={(item, Wrapper) => {
|
245
|
+
return (
|
246
|
+
<Wrapper backgroundColor={item.bgColor}>
|
247
|
+
<span>{item.name}</span>
|
248
|
+
</Wrapper>
|
249
|
+
);
|
250
|
+
}}
|
107
251
|
/>
|
108
252
|
</div>
|
109
253
|
</div>
|
@@ -111,30 +255,96 @@ export class TreeSelectDocs extends React.Component<{}, IState> {
|
|
111
255
|
|
112
256
|
<Markup.ReactMarkupCode>{`
|
113
257
|
<TreeSelect
|
114
|
-
|
115
|
-
|
116
|
-
|
258
|
+
value={[{name: 'Item1'}, {name: 'Item2'}]}
|
259
|
+
getOptions={() => options}
|
260
|
+
kind={'synchronous'}
|
261
|
+
getId={(item) => item.name}
|
262
|
+
getLabel={(item) => item.name}
|
263
|
+
getBackgroundColor={(item: any) => item.bgColor}
|
117
264
|
selectBranchWithChildren={true}
|
118
|
-
|
265
|
+
allowMultiple
|
266
|
+
fullWidth
|
267
|
+
singleLevelSearch
|
268
|
+
required
|
269
|
+
info={'Info Message'}
|
270
|
+
error={'Error Message'}
|
271
|
+
label={'TreeSelect Label'}
|
272
|
+
searchPlaceholder='Search...'
|
273
|
+
onChange={(e) => false}
|
274
|
+
valueTemplate={(item, Wrapper) => {
|
275
|
+
return (
|
276
|
+
<Wrapper backgroundColor={item.bgColor}>
|
277
|
+
<span>{item.name}</span>
|
278
|
+
</Wrapper>
|
279
|
+
);
|
280
|
+
}}
|
119
281
|
/>
|
120
282
|
`}</Markup.ReactMarkupCode>
|
121
283
|
|
122
284
|
</Markup.ReactMarkup>
|
285
|
+
|
286
|
+
<p className='docs-page__paragraph'>Asynchronous mode in TreeSelect component.</p>
|
287
|
+
<Markup.ReactMarkup>
|
288
|
+
<Markup.ReactMarkupPreview>
|
289
|
+
<div className='docs-page__content-row docs-page__content-row--no-margin'>
|
290
|
+
<div className='form__row'>
|
291
|
+
<TreeSelect
|
292
|
+
kind="asynchronous"
|
293
|
+
searchOptions={searchOptions}
|
294
|
+
value={this.state.value}
|
295
|
+
onChange={(val) => {
|
296
|
+
this.setState({value: val});
|
297
|
+
}}
|
298
|
+
getLabel={({display_name}) => display_name
|
299
|
+
}
|
300
|
+
getId={({qcode}) => qcode.display_name}
|
301
|
+
selectBranchWithChildren={false}
|
302
|
+
allowMultiple={true}
|
303
|
+
/>
|
304
|
+
</div>
|
305
|
+
</div>
|
306
|
+
</Markup.ReactMarkupPreview>
|
307
|
+
|
308
|
+
<Markup.ReactMarkupCode>{`
|
309
|
+
<TreeSelect
|
310
|
+
kind="asynchronous"
|
311
|
+
searchOptions={searchOptions}
|
312
|
+
value={this.state.value}
|
313
|
+
onChange={(val) => {
|
314
|
+
this.setState({value: val});
|
315
|
+
}}
|
316
|
+
getLabel={({name}) => name}
|
317
|
+
getId={({qcode}) => qcode}
|
318
|
+
selectBranchWithChildren={false}
|
319
|
+
optionTemplate={(item) => <span style={{color: 'blue'}}>{item.name}</span>}
|
320
|
+
allowMultiple={true}
|
321
|
+
/>
|
322
|
+
`}</Markup.ReactMarkupCode>
|
323
|
+
|
324
|
+
</Markup.ReactMarkup>
|
325
|
+
|
123
326
|
<p className='docs-page__paragraph'>TreeSelect with custom template.</p>
|
124
327
|
<Markup.ReactMarkup>
|
125
328
|
<Markup.ReactMarkupPreview>
|
126
329
|
<div className='docs-page__content-row docs-page__content-row--no-margin'>
|
127
330
|
<div className='form__row'>
|
128
331
|
<TreeSelect
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
332
|
+
getOptions={() => options2}
|
333
|
+
kind={'synchronous'}
|
334
|
+
getId={(item) => item.name}
|
335
|
+
getLabel={(item) => item.name}
|
336
|
+
getBackgroundColor={(item) => item.bgColor}
|
337
|
+
getBorderColor={(item) => item.border}
|
338
|
+
placeholder='Select one'
|
339
|
+
selectBranchWithChildren={true}
|
340
|
+
onChange={(e) => false}
|
133
341
|
optionTemplate={(item: any) => {
|
134
|
-
return <div>Label: {item.
|
342
|
+
return <div>Label: {item.name}</div>
|
135
343
|
}}
|
136
|
-
valueTemplate={(item: any) => {
|
137
|
-
return <
|
344
|
+
valueTemplate={(item: any, Wrapper) => {
|
345
|
+
return <Wrapper borderColor={item.border}>
|
346
|
+
<span>{item.name}</span>
|
347
|
+
</Wrapper>
|
138
348
|
}}
|
139
349
|
/>
|
140
350
|
</div>
|
@@ -143,16 +353,23 @@ export class TreeSelectDocs extends React.Component<{}, IState> {
|
|
143
353
|
|
144
354
|
<Markup.ReactMarkupCode>{`
|
145
355
|
<TreeSelect
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
356
|
+
getOptions={() => options2}
|
357
|
+
kind={'synchronous'}
|
358
|
+
getId={(item) => item.name}
|
359
|
+
getLabel={(item) => item.name}
|
360
|
+
getBackgroundColor={(item) => item.bgColor}
|
361
|
+
getBorderColor={(item) => item.border}
|
362
|
+
placeholder='Select one'
|
363
|
+
selectBranchWithChildren={true}
|
364
|
+
onChange={(e) => false}
|
150
365
|
optionTemplate={(item: any) => {
|
151
|
-
return <div>Label: {item.
|
366
|
+
return <div>Label: {item.name}</div>
|
367
|
+
}}
|
368
|
+
valueTemplate={(item: any, Wrapper) => {
|
369
|
+
return <Wrapper borderColor={item.border}>
|
370
|
+
<span>{item.name}</span>
|
371
|
+
</Wrapper>
|
152
372
|
}}
|
153
|
-
valueTemplate={(item: any) => {
|
154
|
-
return <span>Label: {item.label}</span>
|
155
|
-
}}
|
156
373
|
/>
|
157
374
|
`}</Markup.ReactMarkupCode>
|
158
375
|
|
@@ -161,15 +378,42 @@ export class TreeSelectDocs extends React.Component<{}, IState> {
|
|
161
378
|
<h3 className="docs-page__h3">Props</h3>
|
162
379
|
<PropsList>
|
163
380
|
<Prop name='value' isRequired={false} type='Array<T>' default='/' description='Value of the component.'/>
|
164
|
-
<Prop name='
|
165
|
-
<Prop name='
|
166
|
-
<Prop name='getMultilevelArray' isRequired={true} type='string' default='/' description='Name of the children array of an option.'/>
|
381
|
+
<Prop name='getOptions' isRequired={true} type='Function' default='/' description='An array of selectitems to display as the available options.'/>
|
382
|
+
<Prop name='kind' isRequired={true} type='synchronous | asynchronous' default='/' description='Type of TreeSelect component.'/>
|
167
383
|
<Prop name='width' isRequired={false} type='medium | full-width (100%)' default='100%' description='Dropdown width.'/>
|
168
384
|
<Prop name='selectBranchWithChildren' isRequired={false} type='boolean' default='false' description='When specified, select branch with children is enabled.'/>
|
169
385
|
<Prop name='readonly' isRequired={false} type='boolean' default='false' description='When specified, component changes are not enabled.'/>
|
170
|
-
<Prop name='
|
171
|
-
<Prop name='
|
172
|
-
<Prop name='
|
386
|
+
<Prop name='loading' isRequired={false} type='boolean' default='false' description='Adds a loading indicator in dropdown.'/>
|
387
|
+
<Prop name='allowMultiple' isRequired={false} type='boolean' default='/' description='Enable multi-select mode.'/>
|
388
|
+
<Prop name='singleLevelSearch' isRequired={false} type='boolean' default='/' description='Limit search to only the level that is displayed.'/>
|
389
|
+
<Prop name='placeholder' isRequired={false} type='string' default='/' description='Placeholder of component in single select mode.'/>
|
390
|
+
<Prop name='searchPlaceholder' isRequired={false} type='string' default='/' description='Filter input placeholder.'/>
|
391
|
+
<Prop name='getLabel' isRequired={true} type='Function' default='/' description='Callback to invoke when value changes.'/>
|
392
|
+
<Prop name='getId' isRequired={true} type='Function' default='/' description='Callback to invoke when value changes.'/>
|
393
|
+
<Prop name='getBackgroundColor' isRequired={true} type='Function' default='/' description='Function to return background color of individual item in options.'/>
|
394
|
+
<Prop name='getBorderColor' isRequired={true} type='Function' default='/' description='Function to return border color of individual item in options in single-select mode.'/>
|
395
|
+
<Prop name='valueTemplate' isRequired={false} type='Function(item, Wrapper)' default='/' description='Function that gets an item in the value and returns the content for it.'/>
|
396
|
+
<Prop name='optionTemplate' isRequired={false} type='Function(item)' default='/' description='Function that gets the option and returns the content for it.'/>
|
397
|
+
<Prop name='searchOptions' isRequired={false} type='Function' default='/' description='The function will be called when a search is initiated from UI in asynchronous mode.'/>
|
398
|
+
<Prop name='onChange' isRequired={true} type='Function' default='/' description='Callback to invoke when value changes.'/>
|
399
|
+
<Prop name='label' isRequired={false} type='string' default='/' description='Input label'/>
|
400
|
+
<Prop name='info' isRequired={false} type='string' default='/' description='Hint text'/>
|
401
|
+
<Prop name='error' isRequired={false} type='string' default='/' description='Error text'/>
|
402
|
+
<Prop name='inlineLabel' isRequired={false} type='boolean' default='false' description='Position labels as inline'/>
|
403
|
+
<Prop name='required' isRequired={false} type='boolean' default='false' description='Mark field as required'/>
|
404
|
+
<Prop name='disabled' isRequired={false} type='boolean' default='false' description='Mark field as disabled'/>
|
405
|
+
<Prop name='invalid' isRequired={false} type='boolean' default='false' description='Mark field as invalid'/>
|
406
|
+
</PropsList>
|
407
|
+
|
408
|
+
<p className='docs-page__paragraph'>synchronous:</p>
|
409
|
+
<PropsList>
|
410
|
+
<Prop name='getOptions' isRequired={false} type='Function' default='/' description='An array of selectitems to display as the available options.'/>
|
411
|
+
</PropsList>
|
412
|
+
|
413
|
+
<p className='docs-page__paragraph'>asynchronous:</p>
|
414
|
+
<PropsList>
|
415
|
+
<Prop name='getOptions' isRequired={false} type='Function' default='/' description='An array of selectitems to display as the available options.'/>
|
416
|
+
<Prop name='searchOptions' isRequired={false} type='Function' default='/' description='function will be called when a search is initiated from UI.'/>
|
173
417
|
</PropsList>
|
174
418
|
|
175
419
|
</section>
|