superdesk-ui-framework 3.0.1-beta.8 → 3.0.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/app/fonts/sd_icons.eot +0 -0
- package/app/fonts/sd_icons.svg +1 -0
- 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 +11 -10
- package/app/styles/_labels.scss +0 -1
- package/app/styles/_master-desk.scss +5 -4
- package/app/styles/_modals.scss +7 -3
- package/app/styles/_normalize.scss +4 -0
- package/app/styles/_sd-tag-input.scss +56 -2
- package/app/styles/_simple-list.scss +0 -2
- package/app/styles/_table-list.scss +116 -12
- package/app/styles/app.scss +3 -0
- package/app/styles/components/_list-item.scss +23 -16
- 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-media-carousel.scss +37 -2
- package/app/styles/components/_sd-pagination.scss +41 -0
- package/app/styles/components/_sd-photo-preview.scss +2 -2
- package/app/styles/components/_subnav.scss +470 -470
- package/app/styles/design-tokens/_new-colors.scss +29 -12
- package/app/styles/dropdowns/_basic-dropdown.scss +6 -0
- package/app/styles/form-elements/_input-wrap.scss +138 -0
- package/app/styles/form-elements/_inputs.scss +230 -61
- package/app/styles/grids/_grid-layout.scss +13 -14
- package/app/styles/interface-elements/_side-panel.scss +1 -1
- package/app/styles/layout/_editor.scss +6 -0
- package/app/styles/menus/_sd-sidebar-menu.scss +1 -1
- package/app/styles/primereact/_pr-datepicker.scss +16 -2
- package/app/styles/primereact/_pr-dialog.scss +9 -0
- package/app/styles/primereact/_pr-menu.scss +6 -5
- package/app/styles/variables/_colors.scss +47 -47
- package/app/template/search-handler.html +2 -2
- package/app-typescript/components/ContentDivider.tsx +3 -0
- package/app-typescript/components/DatePicker.tsx +8 -9
- package/app-typescript/components/Dropdown.tsx +127 -82
- package/app-typescript/components/DurationInput.tsx +39 -14
- package/app-typescript/components/Form/FormLabel.tsx +8 -1
- package/app-typescript/components/Form/InputBase.tsx +12 -2
- package/app-typescript/components/Input.tsx +4 -4
- package/app-typescript/components/Label.tsx +17 -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 +3 -1
- package/app-typescript/components/Layouts/CoreLayoutMain.tsx +10 -1
- package/app-typescript/components/Lists/ContentList.tsx +64 -30
- package/app-typescript/components/Lists/TableList.tsx +255 -53
- package/app-typescript/components/Menu.tsx +2 -2
- package/app-typescript/components/Modal.tsx +6 -2
- package/app-typescript/components/MultiSelect.tsx +1 -1
- package/app-typescript/components/NavButton.tsx +2 -1
- package/app-typescript/components/Navigation/SideBarMenu.tsx +30 -4
- package/app-typescript/components/SearchBar.tsx +11 -3
- package/app-typescript/components/Spacer.tsx +87 -0
- package/app-typescript/components/TimePicker.tsx +2 -13
- package/app-typescript/components/TreeSelect.tsx +286 -180
- package/app-typescript/index.ts +1 -0
- package/dist/examples.bundle.css +110 -71
- package/dist/examples.bundle.js +23848 -21661
- package/dist/playgrounds/react-playgrounds/CoreLayout.tsx +505 -2
- 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 +17 -19
- package/dist/playgrounds/react-playgrounds/Rundowns.tsx +22 -23
- package/dist/playgrounds/react-playgrounds/TestGround.tsx +226 -25
- package/dist/react/ContentDivider.tsx +22 -18
- package/dist/react/ContentList.tsx +188 -12
- package/dist/react/DatePicker.tsx +50 -2
- package/dist/react/Dropdowns.tsx +580 -48
- package/dist/react/DurationInput.tsx +7 -3
- package/dist/react/Inputs.tsx +1 -7
- package/dist/react/Modal.tsx +154 -22
- package/dist/react/MultiSelect.tsx +5 -5
- package/dist/react/NavButtons.tsx +31 -1
- package/dist/react/TableList.tsx +52 -139
- package/dist/react/Togglebox.tsx +1 -1
- package/dist/react/TreeSelect.tsx +167 -176
- package/dist/sd_icons.eot +0 -0
- package/dist/sd_icons.svg +1 -0
- package/dist/sd_icons.ttf +0 -0
- package/dist/sd_icons.woff +0 -0
- package/dist/superdesk-ui.bundle.css +1100 -407
- package/dist/superdesk-ui.bundle.js +6591 -4035
- 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 +505 -2
- 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 +17 -19
- package/examples/pages/playgrounds/react-playgrounds/Rundowns.tsx +22 -23
- package/examples/pages/playgrounds/react-playgrounds/TestGround.tsx +226 -25
- package/examples/pages/react/ContentDivider.tsx +22 -18
- package/examples/pages/react/ContentList.tsx +188 -12
- package/examples/pages/react/DatePicker.tsx +50 -2
- package/examples/pages/react/Dropdowns.tsx +580 -48
- package/examples/pages/react/DurationInput.tsx +7 -3
- package/examples/pages/react/Inputs.tsx +1 -7
- package/examples/pages/react/Modal.tsx +154 -22
- package/examples/pages/react/MultiSelect.tsx +5 -5
- package/examples/pages/react/NavButtons.tsx +31 -1
- package/examples/pages/react/TableList.tsx +52 -139
- package/examples/pages/react/Togglebox.tsx +1 -1
- package/examples/pages/react/TreeSelect.tsx +167 -176
- package/package.json +3 -5
- package/react/components/ContentDivider.d.ts +1 -0
- package/react/components/ContentDivider.js +2 -0
- package/react/components/DatePicker.d.ts +2 -2
- package/react/components/DatePicker.js +3 -3
- package/react/components/Dropdown.d.ts +6 -5
- package/react/components/Dropdown.js +57 -30
- package/react/components/DurationInput.d.ts +1 -1
- package/react/components/DurationInput.js +46 -17
- package/react/components/Form/FormLabel.d.ts +4 -1
- package/react/components/Form/FormLabel.js +9 -3
- package/react/components/Form/InputBase.d.ts +0 -1
- package/react/components/Form/InputBase.js +15 -1
- package/react/components/Input.d.ts +3 -3
- package/react/components/Input.js +2 -1
- package/react/components/Label.d.ts +1 -0
- package/react/components/Label.js +17 -2
- 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 +2 -0
- package/react/components/Layouts/CoreLayout.js +1 -1
- package/react/components/Layouts/CoreLayoutMain.d.ts +2 -0
- package/react/components/Layouts/CoreLayoutMain.js +8 -1
- package/react/components/Lists/ContentList.d.ts +6 -0
- package/react/components/Lists/ContentList.js +42 -16
- package/react/components/Lists/TableList.d.ts +30 -8
- package/react/components/Lists/TableList.js +127 -24
- package/react/components/Menu.js +1 -1
- package/react/components/Modal.d.ts +2 -0
- package/react/components/Modal.js +3 -3
- 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/SideBarMenu.d.ts +6 -0
- package/react/components/Navigation/SideBarMenu.js +19 -2
- package/react/components/SearchBar.d.ts +1 -1
- package/react/components/SearchBar.js +15 -7
- package/react/components/TimePicker.d.ts +1 -5
- package/react/components/TimePicker.js +3 -7
- package/react/components/TreeSelect.d.ts +12 -5
- package/react/components/TreeSelect.js +189 -116
- package/react/index.d.ts +1 -0
- package/react/index.js +3 -0
- package/patches/@superdesk+primereact+5.0.2-4.patch +0 -66
@@ -10,70 +10,127 @@ interface IState {
|
|
10
10
|
options: any;
|
11
11
|
options2: any;
|
12
12
|
inputValue: string;
|
13
|
+
arr: any;
|
13
14
|
}
|
14
15
|
|
15
|
-
let
|
16
|
+
let options = [
|
16
17
|
{
|
17
|
-
value: 'Category1',
|
18
|
+
value: {name: 'Category1'},
|
18
19
|
children: [
|
19
20
|
{
|
20
|
-
value: 'Sub-
|
21
|
+
value: {name: 'Sub-category1'},
|
21
22
|
children: [
|
22
|
-
{value: '
|
23
|
+
{value: {name: 'Item20'}}
|
23
24
|
]
|
24
25
|
},
|
25
26
|
{
|
26
|
-
value: 'Sub-
|
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'},
|
27
49
|
children: [
|
28
|
-
{value: '
|
50
|
+
{value: {name: 'Item24'}}
|
51
|
+
]
|
52
|
+
}
|
53
|
+
,
|
54
|
+
{
|
55
|
+
value: {name: 'Sub-category6'},
|
56
|
+
children: [
|
57
|
+
{value: {name: 'Item25'}}
|
29
58
|
]
|
30
59
|
}
|
31
60
|
]
|
32
61
|
},
|
33
62
|
{
|
34
|
-
value: 'Category2',
|
63
|
+
value: {name: 'Category2'},
|
35
64
|
children: [
|
36
65
|
{
|
37
|
-
value: '
|
66
|
+
value: {name: 'Item8'}
|
38
67
|
},
|
39
68
|
{
|
40
|
-
value: '
|
69
|
+
value: {name: 'Item9'}
|
41
70
|
}
|
42
71
|
]
|
43
72
|
},
|
44
73
|
{
|
45
|
-
value: 'Category3',
|
74
|
+
value: {name: 'Category3', bgColor: 'red'},
|
46
75
|
children: [
|
47
76
|
{
|
48
|
-
value: '
|
77
|
+
value: {name: 'Item10'}
|
49
78
|
},
|
50
79
|
{
|
51
|
-
value: '
|
80
|
+
value: {name: 'Item11'}
|
52
81
|
}
|
53
82
|
]
|
54
83
|
},
|
55
84
|
]
|
56
85
|
|
57
|
-
let
|
86
|
+
let options2 = [
|
58
87
|
{
|
59
|
-
value: {name: 'Category1'},
|
88
|
+
value: {name: 'Category1', border: 'red'},
|
60
89
|
children: [
|
61
90
|
{
|
62
91
|
value: {name: 'Sub-category1'},
|
63
92
|
children: [
|
64
|
-
{value: {name: '
|
93
|
+
{value: {name: 'Item20'}}
|
65
94
|
]
|
66
95
|
},
|
67
96
|
{
|
68
97
|
value: {name: 'Sub-category2'},
|
69
98
|
children: [
|
70
|
-
{value: {name: '
|
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'}}
|
71
128
|
]
|
72
129
|
}
|
73
130
|
]
|
74
131
|
},
|
75
132
|
{
|
76
|
-
value: {name: 'Category2'},
|
133
|
+
value: {name: 'Category2', border: 'green'},
|
77
134
|
children: [
|
78
135
|
{
|
79
136
|
value: {name: 'Item8'}
|
@@ -84,7 +141,7 @@ let itemArr2 = [
|
|
84
141
|
]
|
85
142
|
},
|
86
143
|
{
|
87
|
-
value: {name: 'Category3'},
|
144
|
+
value: {name: 'Category3', border: 'yellow'},
|
88
145
|
children: [
|
89
146
|
{
|
90
147
|
value: {name: 'Item10'}
|
@@ -96,32 +153,28 @@ let itemArr2 = [
|
|
96
153
|
},
|
97
154
|
]
|
98
155
|
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
{
|
105
|
-
'name': 'Sidebar',
|
106
|
-
'qcode': 'Sidebar',
|
107
|
-
},
|
108
|
-
{
|
109
|
-
'name': 'Factbox',
|
110
|
-
'qcode': 'Factbox',
|
111
|
-
},
|
112
|
-
];
|
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;
|
113
161
|
|
114
162
|
function searchOptions(
|
115
163
|
term: string,
|
116
|
-
callback: (res:
|
117
|
-
):
|
118
|
-
setTimeout(() => {
|
164
|
+
callback: (res: any) => void,
|
165
|
+
): ICancelFn {
|
166
|
+
let timeout = setTimeout(() => {
|
167
|
+
|
119
168
|
callback(
|
120
|
-
|
121
|
-
.filter((item) => item.
|
169
|
+
fetchedArr
|
170
|
+
.filter((item: any) => item.display_name.toLocaleLowerCase().includes(term.toLocaleLowerCase()))
|
122
171
|
.map((item) => ({value: item})),
|
123
|
-
);
|
172
|
+
);
|
124
173
|
}, 1000);
|
174
|
+
|
175
|
+
return () => {
|
176
|
+
clearTimeout(timeout);
|
177
|
+
}
|
125
178
|
}
|
126
179
|
|
127
180
|
export class TreeSelectDocs extends React.Component<{}, IState> {
|
@@ -130,10 +183,12 @@ export class TreeSelectDocs extends React.Component<{}, IState> {
|
|
130
183
|
this.state = {
|
131
184
|
value: [],
|
132
185
|
value2: [],
|
133
|
-
options:
|
134
|
-
options2:
|
135
|
-
inputValue: ''
|
186
|
+
options: options,
|
187
|
+
options2: options,
|
188
|
+
inputValue: '',
|
189
|
+
arr: []
|
136
190
|
}
|
191
|
+
|
137
192
|
|
138
193
|
this.handleChange = this.handleChange.bind(this);
|
139
194
|
}
|
@@ -146,13 +201,13 @@ export class TreeSelectDocs extends React.Component<{}, IState> {
|
|
146
201
|
this.setState({
|
147
202
|
options: option.item
|
148
203
|
})
|
149
|
-
}
|
204
|
+
}
|
150
205
|
}
|
151
206
|
|
152
207
|
render() {
|
153
208
|
return (
|
154
209
|
<section className='docs-page__container'>
|
155
|
-
<h2 className='docs-page__h2'>TreeSelect
|
210
|
+
<h2 className='docs-page__h2'>TreeSelect</h2>
|
156
211
|
|
157
212
|
<Markup.ReactMarkupCodePreview>{`
|
158
213
|
<TreeSelect
|
@@ -170,20 +225,29 @@ export class TreeSelectDocs extends React.Component<{}, IState> {
|
|
170
225
|
<div className='docs-page__content-row docs-page__content-row--no-margin'>
|
171
226
|
<div className='form__row'>
|
172
227
|
<TreeSelect
|
228
|
+
value={[{name: 'Item1'}, {name: 'Item2'}]}
|
229
|
+
getOptions={() => options}
|
230
|
+
kind={'synchronous'}
|
173
231
|
getId={(item) => item.name}
|
174
232
|
getLabel={(item) => item.name}
|
175
|
-
|
176
|
-
value={[{name: 'Item1'}, {name: 'Item2'}]}
|
233
|
+
getBackgroundColor={(item: any) => item.bgColor}
|
177
234
|
selectBranchWithChildren={true}
|
178
|
-
onChange={(e) => console.log(e)}
|
179
235
|
allowMultiple
|
180
|
-
kind={'synchronous'}
|
181
236
|
fullWidth
|
237
|
+
singleLevelSearch
|
238
|
+
required
|
182
239
|
info={'Info Message'}
|
183
240
|
error={'Error Message'}
|
184
|
-
required
|
185
241
|
label={'TreeSelect Label'}
|
186
|
-
|
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
|
+
}}
|
187
251
|
/>
|
188
252
|
</div>
|
189
253
|
</div>
|
@@ -191,21 +255,29 @@ export class TreeSelectDocs extends React.Component<{}, IState> {
|
|
191
255
|
|
192
256
|
<Markup.ReactMarkupCode>{`
|
193
257
|
<TreeSelect
|
258
|
+
value={[{name: 'Item1'}, {name: 'Item2'}]}
|
259
|
+
getOptions={() => options}
|
260
|
+
kind={'synchronous'}
|
194
261
|
getId={(item) => item.name}
|
195
262
|
getLabel={(item) => item.name}
|
196
|
-
|
197
|
-
return itemArr2
|
198
|
-
}}
|
199
|
-
value={[{name: 'Item1'}, {name: 'Item2'}]}
|
263
|
+
getBackgroundColor={(item: any) => item.bgColor}
|
200
264
|
selectBranchWithChildren={true}
|
201
|
-
onChange={(e) => console.log(e)}
|
202
265
|
allowMultiple
|
203
|
-
kind={'synchronous'}
|
204
266
|
fullWidth
|
267
|
+
singleLevelSearch
|
268
|
+
required
|
205
269
|
info={'Info Message'}
|
206
270
|
error={'Error Message'}
|
207
|
-
required
|
208
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
|
+
}}
|
209
281
|
/>
|
210
282
|
`}</Markup.ReactMarkupCode>
|
211
283
|
|
@@ -223,10 +295,10 @@ export class TreeSelectDocs extends React.Component<{}, IState> {
|
|
223
295
|
onChange={(val) => {
|
224
296
|
this.setState({value: val});
|
225
297
|
}}
|
226
|
-
getLabel={({
|
227
|
-
|
298
|
+
getLabel={({display_name}) => display_name
|
299
|
+
}
|
300
|
+
getId={({qcode}) => qcode.display_name}
|
228
301
|
selectBranchWithChildren={false}
|
229
|
-
optionTemplate={(item) => <span style={{color: 'blue'}}>{item.name}</span>}
|
230
302
|
allowMultiple={true}
|
231
303
|
/>
|
232
304
|
</div>
|
@@ -257,17 +329,22 @@ export class TreeSelectDocs extends React.Component<{}, IState> {
|
|
257
329
|
<div className='docs-page__content-row docs-page__content-row--no-margin'>
|
258
330
|
<div className='form__row'>
|
259
331
|
<TreeSelect
|
332
|
+
getOptions={() => options2}
|
333
|
+
kind={'synchronous'}
|
260
334
|
getId={(item) => item.name}
|
261
335
|
getLabel={(item) => item.name}
|
336
|
+
getBackgroundColor={(item) => item.bgColor}
|
337
|
+
getBorderColor={(item) => item.border}
|
262
338
|
placeholder='Select one'
|
263
|
-
|
264
|
-
|
265
|
-
onChange={(e) => console.log(e)}
|
339
|
+
selectBranchWithChildren={true}
|
340
|
+
onChange={(e) => false}
|
266
341
|
optionTemplate={(item: any) => {
|
267
342
|
return <div>Label: {item.name}</div>
|
268
343
|
}}
|
269
|
-
valueTemplate={(item: any) => {
|
270
|
-
return <
|
344
|
+
valueTemplate={(item: any, Wrapper) => {
|
345
|
+
return <Wrapper borderColor={item.border}>
|
346
|
+
<span>{item.name}</span>
|
347
|
+
</Wrapper>
|
271
348
|
}}
|
272
349
|
/>
|
273
350
|
</div>
|
@@ -276,17 +353,22 @@ export class TreeSelectDocs extends React.Component<{}, IState> {
|
|
276
353
|
|
277
354
|
<Markup.ReactMarkupCode>{`
|
278
355
|
<TreeSelect
|
356
|
+
getOptions={() => options2}
|
357
|
+
kind={'synchronous'}
|
279
358
|
getId={(item) => item.name}
|
280
359
|
getLabel={(item) => item.name}
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
360
|
+
getBackgroundColor={(item) => item.bgColor}
|
361
|
+
getBorderColor={(item) => item.border}
|
362
|
+
placeholder='Select one'
|
363
|
+
selectBranchWithChildren={true}
|
364
|
+
onChange={(e) => false}
|
285
365
|
optionTemplate={(item: any) => {
|
286
366
|
return <div>Label: {item.name}</div>
|
287
367
|
}}
|
288
|
-
valueTemplate={(item: any) => {
|
289
|
-
return <
|
368
|
+
valueTemplate={(item: any, Wrapper) => {
|
369
|
+
return <Wrapper borderColor={item.border}>
|
370
|
+
<span>{item.name}</span>
|
371
|
+
</Wrapper>
|
290
372
|
}}
|
291
373
|
/>
|
292
374
|
`}</Markup.ReactMarkupCode>
|
@@ -302,12 +384,25 @@ export class TreeSelectDocs extends React.Component<{}, IState> {
|
|
302
384
|
<Prop name='selectBranchWithChildren' isRequired={false} type='boolean' default='false' description='When specified, select branch with children is enabled.'/>
|
303
385
|
<Prop name='readonly' isRequired={false} type='boolean' default='false' description='When specified, component changes are not enabled.'/>
|
304
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.'/>
|
305
391
|
<Prop name='getLabel' isRequired={true} type='Function' default='/' description='Callback to invoke when value changes.'/>
|
306
392
|
<Prop name='getId' isRequired={true} type='Function' default='/' description='Callback to invoke when value changes.'/>
|
307
|
-
<Prop name='
|
308
|
-
<Prop name='
|
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.'/>
|
309
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.'/>
|
310
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'/>
|
311
406
|
</PropsList>
|
312
407
|
|
313
408
|
<p className='docs-page__paragraph'>synchronous:</p>
|
@@ -325,107 +420,3 @@ export class TreeSelectDocs extends React.Component<{}, IState> {
|
|
325
420
|
)
|
326
421
|
}
|
327
422
|
}
|
328
|
-
|
329
|
-
// import React from 'react';
|
330
|
-
// import {ITreeNode, TreeSelect} from './TreeSelect';
|
331
|
-
|
332
|
-
// type IProps = {};
|
333
|
-
|
334
|
-
// interface IVocabularyItem {
|
335
|
-
// qcode: string;
|
336
|
-
// name: string;
|
337
|
-
// }
|
338
|
-
|
339
|
-
// interface IState {
|
340
|
-
// value: Array<IVocabularyItem>;
|
341
|
-
// }
|
342
|
-
|
343
|
-
// const source: Array<ITreeNode<IVocabularyItem>> = [
|
344
|
-
// {
|
345
|
-
// value: {
|
346
|
-
// 'name': 'Article (news)',
|
347
|
-
// 'qcode': 'Article',
|
348
|
-
// },
|
349
|
-
// children: [
|
350
|
-
// {
|
351
|
-
// value: {
|
352
|
-
// 'name': 'Test 1',
|
353
|
-
// 'qcode': 'test-1',
|
354
|
-
// },
|
355
|
-
// }
|
356
|
-
// ],
|
357
|
-
// },
|
358
|
-
// {
|
359
|
-
// value: {
|
360
|
-
// 'name': 'Sidebar',
|
361
|
-
// 'qcode': 'Sidebar',
|
362
|
-
// },
|
363
|
-
// children: [
|
364
|
-
// {
|
365
|
-
// value: {
|
366
|
-
// 'name': 'Test 2',
|
367
|
-
// 'qcode': 'test-2',
|
368
|
-
// },
|
369
|
-
// }
|
370
|
-
// ],
|
371
|
-
// },
|
372
|
-
// {
|
373
|
-
// value: {
|
374
|
-
// 'name': 'Factbox',
|
375
|
-
// 'qcode': 'Factbox',
|
376
|
-
// },
|
377
|
-
// children: [
|
378
|
-
// {
|
379
|
-
// value: {
|
380
|
-
// 'name': 'Test 3',
|
381
|
-
// 'qcode': 'test-3',
|
382
|
-
// },
|
383
|
-
// }
|
384
|
-
// ],
|
385
|
-
// }
|
386
|
-
// ];
|
387
|
-
|
388
|
-
// export class TreeSelectDocs extends React.PureComponent<IProps, IState> {
|
389
|
-
// constructor(props: IProps) {
|
390
|
-
// super(props);
|
391
|
-
// this.state = {
|
392
|
-
// value: [],
|
393
|
-
// };
|
394
|
-
// }
|
395
|
-
// render() {
|
396
|
-
// return (
|
397
|
-
// // <TreeSelect
|
398
|
-
// // kind="synchronous"
|
399
|
-
// // getOptions={() => source}
|
400
|
-
// // value={this.state.value}
|
401
|
-
// // onChange={(val) => {
|
402
|
-
// // this.setState({value: val});
|
403
|
-
// // }}
|
404
|
-
// // getId={(item) => item.name}
|
405
|
-
// // getLabel={(item) => item.name}
|
406
|
-
// // selectBranchWithChildren={false}
|
407
|
-
// // optionTemplate={(item) => <span style={{color: 'blue'}}>{item.name}</span>}
|
408
|
-
// // allowMultiple={true}
|
409
|
-
|
410
|
-
// // />
|
411
|
-
|
412
|
-
// <TreeSelect
|
413
|
-
// getId={(item) => item.name}
|
414
|
-
// getLabel={(item) => item.name}
|
415
|
-
// getOptions={() => {
|
416
|
-
// return source
|
417
|
-
// }}
|
418
|
-
// //value={[{name: 'Item1'}, {name: 'Item2'}]}
|
419
|
-
// //selectBranchWithChildren={true}
|
420
|
-
// onChange={(e) => console.log(e)}
|
421
|
-
// allowMultiple
|
422
|
-
// kind={'synchronous'}
|
423
|
-
// fullWidth
|
424
|
-
// info={'Info Message'}
|
425
|
-
// error={'Error Message'}
|
426
|
-
// required
|
427
|
-
// label={'TreeSelect Label'}
|
428
|
-
// />
|
429
|
-
// );
|
430
|
-
// }
|
431
|
-
// }
|
package/dist/sd_icons.eot
CHANGED
Binary file
|
package/dist/sd_icons.svg
CHANGED
@@ -193,4 +193,5 @@
|
|
193
193
|
<glyph unicode="" glyph-name="audio-cancel" d="M67.882 891.8l195.052-195.052 0.128 0.102 477.43-477.66c0.037 0.039 0.074 0.077 0.111 0.116l75.807-75.805-0.114-0.115 139.712-139.712-67.882-67.882-145.282 145.284c-48.898-33.743-104.339-58.713-164.049-72.639l-2.796-0.643v110.54c31.797 9.462 61.834 23.030 89.496 40.088l-153.496 153.496v-247.918l-320 256h-192v320h183.918l-183.918 183.918zM576 949c215.178-48.832 375.624-240.934 375.624-470.602 0-95.32-27.637-184.169-75.354-258.991l-78.258 78.258c29.502 53.629 46.29 115.232 46.29 180.733 0 168.403-110.971 311.035-263.662 358.648l-4.64 1.414zM576 694.648c79.418-39.708 134.152-121.272 134.152-216.252 0-27.892-4.72-54.628-13.4-79.473l-120.752 120.751zM512 896v-312.326l-173.516 173.514z" />
|
194
194
|
<glyph unicode="" glyph-name="list-alt-cancel" d="M67.882 891.8l60.116-60.116 0.002 0.228 128-128-0.002-0.228 63.684-63.684h0.23l64.088-64.088-0.002-0.228 63.684-63.684h0.23l64-64h-0.23l64-64h0.23l64-64h-0.23l64-64h0.23l192.088-192.088-0.004-0.226 60.012-60.012-67.882-67.882-64.208 64.208h-631.918c-34.353 0-63.413 30.677-63.991 63.019l-0.009 0.981-0.002 631.92-127.998 127.998zM832 896c34.353 0 63.413-28.717 63.991-62.961l0.009-1.039v-632.324l-184.324 184.324h56.324v64h-120.324l-63.998 64h184.322v64h-248.322l-64 64h312.322v64h-376.322l-192 192zM567.918 256l-64 64h-119.918v-64zM320 320h-64v-64h64zM439.918 384l-55.92 55.92 0.002-55.92zM320 448h-64v-64h64zM255.998 567.92l0.002-55.92h55.918z" />
|
195
195
|
<glyph unicode="" glyph-name="post-cancel" d="M67.882 891.8l59.8-59.8 0.228 0.002 128.090-128.092v-0.228l63.68-63.68h0.228l64-64h-0.228l64-64h0.228l64-64h-0.228l64-64h0.23l128-128h-0.23l252.328-252.328-67.882-67.882-320.21 320.21-311.916-0.002-192-192v695.918l-64 64zM896 832c34.353 0 63.413-28.717 63.991-62.961l0.009-1.039v-448c0-34.353-28.717-63.413-62.961-63.991l-1.039-0.009-56.326 0.002-256.002 256 184.328-0.002v64l-248.328 0.002-64 64 312.328-0.002v64l-376.328 0.002-128 128zM439.916 384.002l-64 64-119.916-0.002v-64zM311.916 512.002l-55.916 55.916v-55.918z" />
|
196
|
+
<glyph unicode="" glyph-name="text-block" d="M896 543.95v-191.9c0-53.012-43.038-96.050-96.050-96.050h-575.9c-53.012 0-96.050 43.038-96.050 96.050v191.9c0 53.012 43.039 96.050 96.050 96.050h575.9c53.012 0 96.050-43.038 96.050-96.050zM256 384h512v128h-512zM128 768h768v128h-768zM128 0h768v128h-768z" />
|
196
197
|
</font></defs></svg>
|
package/dist/sd_icons.ttf
CHANGED
Binary file
|
package/dist/sd_icons.woff
CHANGED
Binary file
|