superdesk-ui-framework 3.0.1-beta.26 → 3.0.1-beta.27
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/.vscode/settings.json +5 -0
- package/app/styles/_sd-tag-input.scss +1 -36
- package/app/styles/_table-list.scss +0 -1
- package/app/styles/primereact/_pr-dialog.scss +0 -4
- package/app-typescript/components/Label.tsx +6 -10
- package/app-typescript/components/Layouts/AuthoringFrame.tsx +1 -2
- package/app-typescript/components/Layouts/AuthoringFrameRightBar.tsx +2 -21
- package/app-typescript/components/Lists/TableList.tsx +2 -62
- package/app-typescript/components/Spacer.tsx +1 -1
- package/app-typescript/components/TreeSelect.tsx +33 -85
- package/app-typescript/dist/components/Alert.d.ts +16 -0
- package/app-typescript/dist/components/Autocomplete.d.ts +48 -0
- package/app-typescript/dist/components/Avatar.d.ts +33 -0
- package/app-typescript/dist/components/Badge.d.ts +13 -0
- package/app-typescript/dist/components/Button.d.ts +23 -0
- package/app-typescript/dist/components/ButtonGroup.d.ts +12 -0
- package/app-typescript/dist/components/CheckButtonGroup.d.ts +11 -0
- package/app-typescript/dist/components/CheckGroup.d.ts +9 -0
- package/app-typescript/dist/components/Checkbox.d.ts +19 -0
- package/app-typescript/dist/components/CheckboxButton.d.ts +19 -0
- package/app-typescript/dist/components/DatePicker.d.ts +37 -0
- package/app-typescript/dist/components/Divider.d.ts +9 -0
- package/app-typescript/dist/components/DonutChart.d.ts +12 -0
- package/app-typescript/dist/components/Dropdown.d.ts +28 -0
- package/app-typescript/dist/components/DropdownFirst.d.ts +42 -0
- package/app-typescript/dist/components/EmptyState.d.ts +11 -0
- package/app-typescript/dist/components/FormLabel.d.ts +9 -0
- package/app-typescript/dist/components/Genie.d.ts +13 -0
- package/app-typescript/dist/components/GridItem.d.ts +69 -0
- package/app-typescript/dist/components/GridList.d.ts +14 -0
- package/app-typescript/dist/components/HeadingText.d.ts +10 -0
- package/app-typescript/dist/components/HelloWorld.d.ts +8 -0
- package/app-typescript/dist/components/Icon.d.ts +12 -0
- package/app-typescript/dist/components/IconButton.d.ts +12 -0
- package/app-typescript/dist/components/IconLabel.d.ts +11 -0
- package/app-typescript/dist/components/Input.d.ts +24 -0
- package/app-typescript/dist/components/Label.d.ts +15 -0
- package/app-typescript/dist/components/LeftMenu.d.ts +26 -0
- package/app-typescript/dist/components/Loader.d.ts +8 -0
- package/app-typescript/dist/components/NavButton.d.ts +15 -0
- package/app-typescript/dist/components/Popover.d.ts +13 -0
- package/app-typescript/dist/components/PropsList.d.ts +15 -0
- package/app-typescript/dist/components/Radio.d.ts +19 -0
- package/app-typescript/dist/components/RadioButton.d.ts +20 -0
- package/app-typescript/dist/components/Select.d.ts +29 -0
- package/app-typescript/dist/components/SelectWithTemplate.d.ts +32 -0
- package/app-typescript/dist/components/SlidingToolbar.d.ts +8 -0
- package/app-typescript/dist/components/StrechBar.d.ts +4 -0
- package/app-typescript/dist/components/SubNav.d.ts +10 -0
- package/app-typescript/dist/components/Switch.d.ts +12 -0
- package/app-typescript/dist/components/TabCustom.d.ts +25 -0
- package/app-typescript/dist/components/TabList.d.ts +22 -0
- package/app-typescript/dist/components/Tag.d.ts +9 -0
- package/app-typescript/dist/components/TagInput.d.ts +7 -0
- package/app-typescript/dist/components/TagInputTest.d.ts +18 -0
- package/app-typescript/dist/components/TimePicker.d.ts +11 -0
- package/app-typescript/dist/components/Tooltip.d.ts +11 -0
- package/app-typescript/dist/components/_Positioner.d.ts +27 -0
- package/app-typescript/dist/index.d.ts +56 -0
- package/dist/examples.bundle.js +1183 -1548
- package/dist/playgrounds/react-playgrounds/Index.tsx +0 -1
- package/dist/react/TableList.tsx +0 -2
- package/dist/react/TreeSelect.tsx +78 -100
- package/dist/superdesk-ui.bundle.css +2 -34
- package/dist/superdesk-ui.bundle.js +1058 -1131
- package/dist/vendor.bundle.js +4 -4
- package/examples/index.js +0 -4
- package/examples/pages/playgrounds/react-playgrounds/Index.tsx +0 -1
- package/examples/pages/react/TableList.tsx +0 -2
- package/examples/pages/react/TreeSelect.tsx +78 -100
- package/package.json +1 -1
- package/react/components/Label.d.ts +1 -1
- package/react/components/Label.js +5 -10
- package/react/components/Layouts/AuthoringFrame.d.ts +0 -1
- package/react/components/Layouts/AuthoringFrame.js +1 -1
- package/react/components/Layouts/AuthoringFrameRightBar.d.ts +2 -9
- package/react/components/Layouts/AuthoringFrameRightBar.js +3 -14
- package/react/components/Lists/TableList.d.ts +0 -1
- package/react/components/Lists/TableList.js +6 -34
- package/react/components/TreeSelect.d.ts +1 -3
- package/react/components/TreeSelect.js +23 -50
- package/yarn-error.log +111 -0
- package/dist/playgrounds/react-playgrounds/Multiedit.tsx +0 -321
- package/examples/pages/playgrounds/react-playgrounds/Multiedit.tsx +0 -321
package/dist/vendor.bundle.js
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
var a = typeof exports === 'object' ? factory(require("react"), require("react-dom")) : factory(root["react"], root["react-dom"]);
|
8
8
|
for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
|
9
9
|
}
|
10
|
-
})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_0__,
|
10
|
+
})(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_0__, __WEBPACK_EXTERNAL_MODULE_9__) {
|
11
11
|
return /******/ (function(modules) { // webpackBootstrap
|
12
12
|
/******/ // The module cache
|
13
13
|
/******/ var installedModules = {};
|
@@ -28264,7 +28264,7 @@ __webpack_require__(541);
|
|
28264
28264
|
|
28265
28265
|
__webpack_require__(0);
|
28266
28266
|
|
28267
|
-
__webpack_require__(
|
28267
|
+
__webpack_require__(9);
|
28268
28268
|
|
28269
28269
|
/***/ }),
|
28270
28270
|
|
@@ -69964,10 +69964,10 @@ angular.module('ngAnimate', [], function initAngularHelpers() {
|
|
69964
69964
|
|
69965
69965
|
/***/ }),
|
69966
69966
|
|
69967
|
-
/***/
|
69967
|
+
/***/ 9:
|
69968
69968
|
/***/ (function(module, exports) {
|
69969
69969
|
|
69970
|
-
module.exports =
|
69970
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_9__;
|
69971
69971
|
|
69972
69972
|
/***/ })
|
69973
69973
|
|
package/examples/index.js
CHANGED
@@ -4,7 +4,6 @@ export { TestGround } from './TestGround';
|
|
4
4
|
export { UiPlayground } from './UiPlayground';
|
5
5
|
export { PageLayoutTest } from './PageLayoutTest';
|
6
6
|
export { EditorTest } from './EditorTest';
|
7
|
-
export { Multiedit } from './Multiedit';
|
8
7
|
export { RundownEditor } from './RundownEditor';
|
9
8
|
export { PersonalProfile } from './PersonalProfile';
|
10
9
|
export { Rundowns } from './Rundowns';
|
@@ -98,7 +98,6 @@ export default class TableListDoc extends React.Component<IProps, IState> {
|
|
98
98
|
<Markup.ReactMarkupPreview>
|
99
99
|
<TableList
|
100
100
|
dragAndDrop
|
101
|
-
append
|
102
101
|
addItem
|
103
102
|
array={this.state.array}
|
104
103
|
itemsDropdown={(index) => [
|
@@ -136,7 +135,6 @@ export default class TableListDoc extends React.Component<IProps, IState> {
|
|
136
135
|
<Prop name='className' isRequired={false} type='string' default='false' description='Add class on TableList container.' />
|
137
136
|
<Prop name='showDragHandle' isRequired={false} type='string' default='always' description='"always" | "onHover" | "none".' />
|
138
137
|
<Prop name='readOnly' isRequired={false} type='boolean' default='false' description='When specified, component changes are not enabled.' />
|
139
|
-
<Prop name='append' isRequired={false} type='boolean' default='false' description='Set append to body on individual item while draging.' />
|
140
138
|
<Prop name='onDrag' isRequired={false} type='function' default='false' description='Returns start and end position of draggable item' />
|
141
139
|
<Prop name='onAddItem' isRequired={false} type='function' default='false' description='Returns index of draggable item.' />
|
142
140
|
<Prop name='itemsDropdown' isRequired={false} type='function' default='false' description='Dropdown for adding items in the list. Returns index of draggable item.' />
|
@@ -13,79 +13,51 @@ interface IState {
|
|
13
13
|
arr: any;
|
14
14
|
}
|
15
15
|
|
16
|
-
let
|
16
|
+
let itemArr = [
|
17
17
|
{
|
18
|
-
value:
|
18
|
+
value: 'Category1',
|
19
19
|
children: [
|
20
20
|
{
|
21
|
-
value:
|
21
|
+
value: 'Sub-Category1',
|
22
22
|
children: [
|
23
|
-
{value:
|
23
|
+
{value: 'Item10'}
|
24
24
|
]
|
25
25
|
},
|
26
26
|
{
|
27
|
-
value:
|
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
|
+
value: 'Sub-Category2',
|
49
28
|
children: [
|
50
|
-
{value:
|
51
|
-
]
|
52
|
-
}
|
53
|
-
,
|
54
|
-
{
|
55
|
-
value: {name: 'Sub-category6'},
|
56
|
-
children: [
|
57
|
-
{value: {name: 'Item25'}}
|
29
|
+
{value: 'Item11'}
|
58
30
|
]
|
59
31
|
}
|
60
32
|
]
|
61
33
|
},
|
62
34
|
{
|
63
|
-
value:
|
35
|
+
value: 'Category2',
|
64
36
|
children: [
|
65
37
|
{
|
66
|
-
value:
|
38
|
+
value: 'Sub-Category3'
|
67
39
|
},
|
68
40
|
{
|
69
|
-
value:
|
41
|
+
value: 'Sub-Category4'
|
70
42
|
}
|
71
43
|
]
|
72
44
|
},
|
73
45
|
{
|
74
|
-
value:
|
46
|
+
value: 'Category3',
|
75
47
|
children: [
|
76
48
|
{
|
77
|
-
value:
|
49
|
+
value: 'Sub-Category5'
|
78
50
|
},
|
79
51
|
{
|
80
|
-
value:
|
52
|
+
value: 'Sub-Category6'
|
81
53
|
}
|
82
54
|
]
|
83
55
|
},
|
84
56
|
]
|
85
57
|
|
86
|
-
let
|
58
|
+
let itemArr2 = [
|
87
59
|
{
|
88
|
-
value: {name: 'Category1'
|
60
|
+
value: {name: 'Category1'},
|
89
61
|
children: [
|
90
62
|
{
|
91
63
|
value: {name: 'Sub-category1'},
|
@@ -130,7 +102,7 @@ let options2 = [
|
|
130
102
|
]
|
131
103
|
},
|
132
104
|
{
|
133
|
-
value: {name: 'Category2'
|
105
|
+
value: {name: 'Category2'},
|
134
106
|
children: [
|
135
107
|
{
|
136
108
|
value: {name: 'Item8'}
|
@@ -141,7 +113,7 @@ let options2 = [
|
|
141
113
|
]
|
142
114
|
},
|
143
115
|
{
|
144
|
-
value: {name: 'Category3'
|
116
|
+
value: {name: 'Category3'},
|
145
117
|
children: [
|
146
118
|
{
|
147
119
|
value: {name: 'Item10'}
|
@@ -153,6 +125,37 @@ let options2 = [
|
|
153
125
|
},
|
154
126
|
]
|
155
127
|
|
128
|
+
const source = [
|
129
|
+
{
|
130
|
+
'name': 'Article (news)',
|
131
|
+
'qcode': 'Article (news)',
|
132
|
+
},
|
133
|
+
{
|
134
|
+
'name': 'Article',
|
135
|
+
'qcode': 'Article',
|
136
|
+
},
|
137
|
+
{
|
138
|
+
'name': 'Sidebar',
|
139
|
+
'qcode': 'Sidebar',
|
140
|
+
},
|
141
|
+
{
|
142
|
+
'name': 'Factbox',
|
143
|
+
'qcode': 'Factbox',
|
144
|
+
},
|
145
|
+
{
|
146
|
+
'name': 'Item',
|
147
|
+
'qcode': 'Item',
|
148
|
+
},
|
149
|
+
{
|
150
|
+
'name': 'Array',
|
151
|
+
'qcode': 'Array',
|
152
|
+
},
|
153
|
+
{
|
154
|
+
'name': 'Object',
|
155
|
+
'qcode': 'Object',
|
156
|
+
},
|
157
|
+
];
|
158
|
+
|
156
159
|
let fetchedArr = [];
|
157
160
|
fetch('https://nominatim.openstreetmap.org/search/berlin?format=json&addressdetails=1&limit=20').then(response => response.json()).then(data => fetchedArr = data
|
158
161
|
);
|
@@ -183,8 +186,8 @@ export class TreeSelectDocs extends React.Component<{}, IState> {
|
|
183
186
|
this.state = {
|
184
187
|
value: [],
|
185
188
|
value2: [],
|
186
|
-
options:
|
187
|
-
options2:
|
189
|
+
options: itemArr2,
|
190
|
+
options2: itemArr2,
|
188
191
|
inputValue: '',
|
189
192
|
arr: []
|
190
193
|
}
|
@@ -225,29 +228,21 @@ export class TreeSelectDocs extends React.Component<{}, IState> {
|
|
225
228
|
<div className='docs-page__content-row docs-page__content-row--no-margin'>
|
226
229
|
<div className='form__row'>
|
227
230
|
<TreeSelect
|
228
|
-
value={[{name: 'Item1'}, {name: 'Item2'}]}
|
229
|
-
getOptions={() => options}
|
230
|
-
kind={'synchronous'}
|
231
231
|
getId={(item) => item.name}
|
232
232
|
getLabel={(item) => item.name}
|
233
|
-
|
233
|
+
getOptions={() => itemArr2}
|
234
|
+
value={[{name: 'Item1'}, {name: 'Item2'}]}
|
234
235
|
selectBranchWithChildren={true}
|
236
|
+
onChange={(e) => console.log(e)}
|
235
237
|
allowMultiple
|
238
|
+
kind={'synchronous'}
|
236
239
|
fullWidth
|
237
|
-
singleLevelSearch
|
238
|
-
required
|
239
240
|
info={'Info Message'}
|
240
241
|
error={'Error Message'}
|
242
|
+
required
|
241
243
|
label={'TreeSelect Label'}
|
244
|
+
singleLevelSearch
|
242
245
|
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
|
-
}}
|
251
246
|
/>
|
252
247
|
</div>
|
253
248
|
</div>
|
@@ -255,29 +250,21 @@ export class TreeSelectDocs extends React.Component<{}, IState> {
|
|
255
250
|
|
256
251
|
<Markup.ReactMarkupCode>{`
|
257
252
|
<TreeSelect
|
258
|
-
value={[{name: 'Item1'}, {name: 'Item2'}]}
|
259
|
-
getOptions={() => options}
|
260
|
-
kind={'synchronous'}
|
261
253
|
getId={(item) => item.name}
|
262
254
|
getLabel={(item) => item.name}
|
263
|
-
|
255
|
+
getOptions={() => {
|
256
|
+
return itemArr2
|
257
|
+
}}
|
258
|
+
value={[{name: 'Item1'}, {name: 'Item2'}]}
|
264
259
|
selectBranchWithChildren={true}
|
260
|
+
onChange={(e) => console.log(e)}
|
265
261
|
allowMultiple
|
262
|
+
kind={'synchronous'}
|
266
263
|
fullWidth
|
267
|
-
singleLevelSearch
|
268
|
-
required
|
269
264
|
info={'Info Message'}
|
270
265
|
error={'Error Message'}
|
266
|
+
required
|
271
267
|
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
|
-
}}
|
281
268
|
/>
|
282
269
|
`}</Markup.ReactMarkupCode>
|
283
270
|
|
@@ -299,6 +286,7 @@ export class TreeSelectDocs extends React.Component<{}, IState> {
|
|
299
286
|
}
|
300
287
|
getId={({qcode}) => qcode.display_name}
|
301
288
|
selectBranchWithChildren={false}
|
289
|
+
//optionTemplate={(item) => <span style={{color: 'blue'}}>{item.display_name}</span>}
|
302
290
|
allowMultiple={true}
|
303
291
|
/>
|
304
292
|
</div>
|
@@ -329,23 +317,20 @@ export class TreeSelectDocs extends React.Component<{}, IState> {
|
|
329
317
|
<div className='docs-page__content-row docs-page__content-row--no-margin'>
|
330
318
|
<div className='form__row'>
|
331
319
|
<TreeSelect
|
332
|
-
getOptions={() => options2}
|
333
|
-
kind={'synchronous'}
|
334
320
|
getId={(item) => item.name}
|
335
321
|
getLabel={(item) => item.name}
|
336
|
-
getBackgroundColor={(item) => item.bgColor}
|
337
|
-
getBorderColor={(item) => item.border}
|
338
322
|
placeholder='Select one'
|
339
|
-
|
340
|
-
|
323
|
+
getOptions={() => this.state.options}
|
324
|
+
kind={'synchronous'}
|
325
|
+
onChange={(e) => console.log(e)}
|
341
326
|
optionTemplate={(item: any) => {
|
342
327
|
return <div>Label: {item.name}</div>
|
343
328
|
}}
|
344
|
-
valueTemplate={(item: any
|
345
|
-
return <
|
346
|
-
<span>{item.name}</span>
|
347
|
-
</Wrapper>
|
329
|
+
valueTemplate={(item: any) => {
|
330
|
+
return <span>Label: {item.name}</span>
|
348
331
|
}}
|
332
|
+
//allowMultiple
|
333
|
+
//readOnly
|
349
334
|
/>
|
350
335
|
</div>
|
351
336
|
</div>
|
@@ -353,22 +338,17 @@ export class TreeSelectDocs extends React.Component<{}, IState> {
|
|
353
338
|
|
354
339
|
<Markup.ReactMarkupCode>{`
|
355
340
|
<TreeSelect
|
356
|
-
getOptions={() => options2}
|
357
|
-
kind={'synchronous'}
|
358
341
|
getId={(item) => item.name}
|
359
342
|
getLabel={(item) => item.name}
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
onChange={(e) => false}
|
343
|
+
value={[{name: 'Item4'}, {name: 'Item10'}]}
|
344
|
+
getOptions={() => this.state.options}
|
345
|
+
kind={'synchronous'}
|
346
|
+
onChange={(e) => console.log(e)}
|
365
347
|
optionTemplate={(item: any) => {
|
366
348
|
return <div>Label: {item.name}</div>
|
367
349
|
}}
|
368
|
-
valueTemplate={(item: any
|
369
|
-
return <
|
370
|
-
<span>{item.name}</span>
|
371
|
-
</Wrapper>
|
350
|
+
valueTemplate={(item: any) => {
|
351
|
+
return <span>Label: {item.name}</span>
|
372
352
|
}}
|
373
353
|
/>
|
374
354
|
`}</Markup.ReactMarkupCode>
|
@@ -390,10 +370,8 @@ export class TreeSelectDocs extends React.Component<{}, IState> {
|
|
390
370
|
<Prop name='searchPlaceholder' isRequired={false} type='string' default='/' description='Filter input placeholder.'/>
|
391
371
|
<Prop name='getLabel' isRequired={true} type='Function' default='/' description='Callback to invoke when value changes.'/>
|
392
372
|
<Prop name='getId' isRequired={true} type='Function' default='/' description='Callback to invoke when value changes.'/>
|
393
|
-
<Prop name='
|
394
|
-
<Prop name='
|
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.'/>
|
373
|
+
<Prop name='valueTemplate' isRequired={false} type='Function' default='/' description='Function that gets an item in the value and returns the content for it.'/>
|
374
|
+
<Prop name='optionTemplate' isRequired={false} type='Function' default='/' description='Function that gets the option and returns the content for it.'/>
|
397
375
|
<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
376
|
<Prop name='onChange' isRequired={true} type='Function' default='/' description='Callback to invoke when value changes.'/>
|
399
377
|
<Prop name='label' isRequired={false} type='string' default='/' description='Input label'/>
|
package/package.json
CHANGED
@@ -13,5 +13,5 @@ interface IProps {
|
|
13
13
|
export declare class Label extends React.PureComponent<IProps> {
|
14
14
|
render(): JSX.Element;
|
15
15
|
}
|
16
|
-
export declare function getTextColor(backgroundColor: string): 'black' | 'white'
|
16
|
+
export declare function getTextColor(backgroundColor: string): 'black' | 'white';
|
17
17
|
export {};
|
@@ -84,15 +84,10 @@ var Label = /** @class */ (function (_super) {
|
|
84
84
|
}(React.PureComponent));
|
85
85
|
exports.Label = Label;
|
86
86
|
function getTextColor(backgroundColor) {
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
return (yiq >= 128) ? 'black' : 'white';
|
93
|
-
}
|
94
|
-
else {
|
95
|
-
return;
|
96
|
-
}
|
87
|
+
var r = parseInt(backgroundColor.substr(1, 2), 16);
|
88
|
+
var g = parseInt(backgroundColor.substr(3, 2), 16);
|
89
|
+
var b = parseInt(backgroundColor.substr(5, 2), 16);
|
90
|
+
var yiq = ((r * 299) + (g * 587) + (b * 114)) / 1000;
|
91
|
+
return (yiq >= 128) ? 'black' : 'white';
|
97
92
|
}
|
98
93
|
exports.getTextColor = getTextColor;
|
@@ -50,7 +50,7 @@ var AuthoringFrame = /** @class */ (function (_super) {
|
|
50
50
|
this.props.main && (React.createElement(_1.AuthoringFrameMain, null, this.props.main)),
|
51
51
|
this.props.sidePanel && (React.createElement(_1.AuthoringFrameSidePanel, { opened: this.props.sidePanelOpen, pinned: this.props.sidePanelPinned }, this.props.sidePanel)),
|
52
52
|
this.props.sideOverlay && (React.createElement(_1.AuthoringFrameSidePanelOverlay, { opened: this.props.sideOverlayOpen }, this.props.sideOverlay)),
|
53
|
-
this.props.sideBar && (React.createElement(_1.AuthoringFrameRightBar,
|
53
|
+
this.props.sideBar && (React.createElement(_1.AuthoringFrameRightBar, null, this.props.sideBar)),
|
54
54
|
this.props.overlayPanel && (React.createElement(_1.AuthoringFrameOverlay, null, this.props.overlayPanel))));
|
55
55
|
};
|
56
56
|
return AuthoringFrame;
|
@@ -1,15 +1,8 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
interface IProps {
|
3
3
|
children?: React.ReactNode;
|
4
|
-
closed?: boolean;
|
5
4
|
}
|
6
|
-
|
7
|
-
|
8
|
-
closed?: boolean;
|
9
|
-
}
|
10
|
-
export declare class AuthoringFrameRightBar extends React.PureComponent<IProps, IState> {
|
11
|
-
constructor(props: IProps);
|
12
|
-
componentDidUpdate(prevProps: Readonly<IProps>): void;
|
13
|
-
render(): false | JSX.Element;
|
5
|
+
export declare class AuthoringFrameRightBar extends React.PureComponent<IProps> {
|
6
|
+
render(): JSX.Element;
|
14
7
|
}
|
15
8
|
export {};
|
@@ -38,22 +38,11 @@ exports.AuthoringFrameRightBar = void 0;
|
|
38
38
|
var React = __importStar(require("react"));
|
39
39
|
var AuthoringFrameRightBar = /** @class */ (function (_super) {
|
40
40
|
__extends(AuthoringFrameRightBar, _super);
|
41
|
-
function AuthoringFrameRightBar(
|
42
|
-
|
43
|
-
_this.state = {
|
44
|
-
closed: _this.props.closed ? _this.props.closed : false,
|
45
|
-
};
|
46
|
-
return _this;
|
41
|
+
function AuthoringFrameRightBar() {
|
42
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
47
43
|
}
|
48
|
-
AuthoringFrameRightBar.prototype.componentDidUpdate = function (prevProps) {
|
49
|
-
if (prevProps.closed !== this.props.closed) {
|
50
|
-
this.setState({
|
51
|
-
closed: this.props.closed,
|
52
|
-
});
|
53
|
-
}
|
54
|
-
};
|
55
44
|
AuthoringFrameRightBar.prototype.render = function () {
|
56
|
-
return (
|
45
|
+
return (React.createElement("div", { className: "sd-editor-grid__sidetabs-bar" }, this.props.children));
|
57
46
|
};
|
58
47
|
return AuthoringFrameRightBar;
|
59
48
|
}(React.PureComponent));
|
@@ -8,7 +8,6 @@ export interface IProps {
|
|
8
8
|
className?: string;
|
9
9
|
readOnly?: boolean;
|
10
10
|
showDragHandle?: 'always' | 'onHover' | 'none';
|
11
|
-
append?: boolean;
|
12
11
|
onDrag?(start: number, end: number): void;
|
13
12
|
onAddItem?(index: number, item?: IPropsArrayItem): void;
|
14
13
|
itemsDropdown?(index?: number): Array<IMenuItem | ISubmenu | IMenuGroup | 'divider'>;
|
@@ -55,7 +55,6 @@ var react_beautiful_dnd_1 = require("react-beautiful-dnd");
|
|
55
55
|
var Tooltip_1 = require("../Tooltip");
|
56
56
|
var Button_1 = require("../Button");
|
57
57
|
var Dropdown_1 = require("../Dropdown");
|
58
|
-
var react_dom_1 = __importDefault(require("react-dom"));
|
59
58
|
var reorder = function (list, startIndex, endIndex) {
|
60
59
|
var result = Array.from(list);
|
61
60
|
var removed = result.splice(startIndex, 1)[0];
|
@@ -115,18 +114,13 @@ var TableList = /** @class */ (function (_super) {
|
|
115
114
|
? this.props.dragAndDrop
|
116
115
|
? React.createElement(react_beautiful_dnd_1.DragDropContext, { onDragEnd: this.onDragEnd },
|
117
116
|
React.createElement(react_beautiful_dnd_1.Droppable, { droppableId: "droppable" }, function (provided, _snapshot) { return (React.createElement("div", __assign({ role: 'list', className: classes, ref: provided.innerRef }, provided.droppableProps),
|
118
|
-
_this.state.items.map(function (item, index) { return (React.createElement(react_beautiful_dnd_1.Draggable, { key: index, draggableId: "".concat(index), index: index }, function (provided2,
|
119
|
-
|
120
|
-
|
117
|
+
_this.state.items.map(function (item, index) { return (React.createElement(react_beautiful_dnd_1.Draggable, { key: index, draggableId: "".concat(index), index: index }, function (provided2, _snapshot2) { return (React.createElement("div", __assign({ ref: provided2.innerRef }, provided2.draggableProps, provided2.dragHandleProps),
|
118
|
+
React.createElement(TableListItem, { dragAndDrop: _this.props.dragAndDrop, start: item.start, center: item.center, end: item.end, action: item.action, onClick: item.onClick ? item.onClick : undefined, onDoubleClick: item.onDoubleClick
|
119
|
+
? item.onDoubleClick
|
120
|
+
: undefined, addItem: _this.props.addItem, itemsDropdown: function () { return _this.props.itemsDropdown
|
121
121
|
? _this.props.itemsDropdown(index)
|
122
|
-
: []; }
|
123
|
-
|
124
|
-
React.createElement(TableListItem, { dragAndDrop: _this.props.dragAndDrop, start: item.start, center: item.center, end: item.end, action: item.action, onClick: item.onClick ? item.onClick : undefined, onDoubleClick: item.onDoubleClick
|
125
|
-
? item.onDoubleClick
|
126
|
-
: undefined, addItem: _this.props.addItem, itemsDropdown: function () { return _this.props.itemsDropdown
|
127
|
-
? _this.props.itemsDropdown(index)
|
128
|
-
: []; }, hexColor: item.hexColor, locked: item.locked, positionLocked: item.positionLocked, onAddItem: function () { return _this.props.onAddItem
|
129
|
-
&& _this.props.onAddItem(index, item); }, showDragHandle: _this.props.showDragHandle }))); })); }),
|
122
|
+
: []; }, hexColor: item.hexColor, locked: item.locked, positionLocked: item.positionLocked, onAddItem: function () { return _this.props.onAddItem
|
123
|
+
&& _this.props.onAddItem(index, item); }, showDragHandle: _this.props.showDragHandle }))); })); }),
|
130
124
|
provided.placeholder,
|
131
125
|
(_this.props.addItem && !_this.props.readOnly) &&
|
132
126
|
React.createElement("div", { className: "table-list__add-item table-list__item--margin" },
|
@@ -212,25 +206,3 @@ var TableListItem = /** @class */ (function (_super) {
|
|
212
206
|
return TableListItem;
|
213
207
|
}(React.PureComponent));
|
214
208
|
exports.TableListItem = TableListItem;
|
215
|
-
var PortalItem = /** @class */ (function (_super) {
|
216
|
-
__extends(PortalItem, _super);
|
217
|
-
function PortalItem() {
|
218
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
219
|
-
}
|
220
|
-
PortalItem.prototype.render = function () {
|
221
|
-
var _this = this;
|
222
|
-
var provided = this.props.provided;
|
223
|
-
var snapshot = this.props.snapshot;
|
224
|
-
var usePortal = snapshot.isDragging;
|
225
|
-
var child = (React.createElement("div", __assign({ ref: provided.innerRef }, provided.draggableProps, provided.dragHandleProps),
|
226
|
-
React.createElement(TableListItem, { dragAndDrop: this.props.dragAndDrop, start: this.props.item.start, center: this.props.item.center, end: this.props.item.end, action: this.props.item.action, onClick: this.props.item.onClick ? this.props.item.onClick : undefined, onDoubleClick: this.props.item.onDoubleClick
|
227
|
-
? this.props.item.onDoubleClick
|
228
|
-
: undefined, addItem: this.props.addItem, itemsDropdown: this.props.itemsDropdown, hexColor: this.props.item.hexColor, locked: this.props.item.locked, positionLocked: this.props.item.positionLocked, onAddItem: function () { return _this.props.onAddItem; }, showDragHandle: this.props.showDragHandle })));
|
229
|
-
if (!usePortal) {
|
230
|
-
return child;
|
231
|
-
}
|
232
|
-
// if dragging - put the item in a portal
|
233
|
-
return react_dom_1.default.createPortal(child, document.body);
|
234
|
-
};
|
235
|
-
return PortalItem;
|
236
|
-
}(React.PureComponent));
|
@@ -34,10 +34,8 @@ interface IPropsBase<T> {
|
|
34
34
|
disabled?: boolean;
|
35
35
|
getLabel(item: T): string;
|
36
36
|
getId(item: T): string;
|
37
|
-
getBackgroundColor?(item: T): string;
|
38
|
-
getBorderColor?(item: T): string;
|
39
37
|
optionTemplate?(item: T): React.ComponentType<T> | JSX.Element;
|
40
|
-
valueTemplate?(item: T
|
38
|
+
valueTemplate?(item: T): React.ComponentType<T> | JSX.Element;
|
41
39
|
onChange(e: Array<T>): void;
|
42
40
|
}
|
43
41
|
interface IPropsSync<T> extends IPropsBase<T> {
|