superdesk-ui-framework 3.0.14 → 3.0.15
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/.mocharc.json +5 -0
- package/app-typescript/components/ResizablePanels.tsx +98 -0
- package/app-typescript/components/WithPagination.tsx +231 -0
- package/app-typescript/components/with-pagination.spec.tsx +146 -0
- package/app-typescript/index.ts +2 -0
- package/dist/examples.bundle.js +2900 -1032
- package/dist/react/Index.tsx +11 -0
- package/dist/react/ResizablePanels.tsx +49 -0
- package/dist/react/WithPaginationDocs.tsx +57 -0
- package/dist/superdesk-ui.bundle.js +2498 -795
- package/dist/vendor.bundle.js +20 -20
- package/examples/pages/react/Index.tsx +11 -0
- package/examples/pages/react/ResizablePanels.tsx +49 -0
- package/examples/pages/react/WithPaginationDocs.tsx +57 -0
- package/mocha-setup.ts +5 -0
- package/package.json +15 -2
- package/react/components/ResizablePanels.d.ts +34 -0
- package/react/components/ResizablePanels.js +101 -0
- package/react/components/WithPagination.d.ts +26 -0
- package/react/components/WithPagination.js +191 -0
- package/react/index.d.ts +2 -0
- package/react/index.js +7 -2
- package/tsconfig.json +1 -1
- package/spec/scenarios.js +0 -13
package/dist/react/Index.tsx
CHANGED
@@ -62,9 +62,11 @@ import { SelectWithTemplateDocs } from './SelectWithTemplate';
|
|
62
62
|
import { MultiselectDocs } from './MultiSelect';
|
63
63
|
import { TreeSelectDocs } from './TreeSelect';
|
64
64
|
import DurationInputDoc from './DurationInput';
|
65
|
+
import {WithPaginationDocs} from './WithPaginationDocs';
|
65
66
|
import { PopoverDoc } from './Popover';
|
66
67
|
import { MenuDocs } from './Menu';
|
67
68
|
import {WithSizeObserverDocs} from './WithSizeObserver';
|
69
|
+
import {ResizablePanelsDoc} from './ResizablePanels';
|
68
70
|
|
69
71
|
const pages = {
|
70
72
|
basicComponents: {
|
@@ -166,6 +168,9 @@ const pages = {
|
|
166
168
|
"togglebox": {
|
167
169
|
name: "Togglebox"
|
168
170
|
},
|
171
|
+
"resizable-panels": {
|
172
|
+
name: "Resizable panels"
|
173
|
+
},
|
169
174
|
}
|
170
175
|
},
|
171
176
|
textComponents: {
|
@@ -200,6 +205,9 @@ const pages = {
|
|
200
205
|
'content-list': {
|
201
206
|
name: 'Content list'
|
202
207
|
},
|
208
|
+
'with-pagination': {
|
209
|
+
name: 'With pagination'
|
210
|
+
},
|
203
211
|
}
|
204
212
|
},
|
205
213
|
formComponents: {
|
@@ -342,6 +350,7 @@ class ReactDoc extends React.Component<IProps, IState> {
|
|
342
350
|
<Route path="/react/multiselect" component={MultiselectDocs} />
|
343
351
|
<Route path="/react/treeselect" component={TreeSelectDocs} />
|
344
352
|
<Route path="/react/duration-input" component={DurationInputDoc} />
|
353
|
+
<Route path="/react/with-pagination" component={WithPaginationDocs} />
|
345
354
|
<Route path="/react/popover" component={PopoverDoc} />
|
346
355
|
<Route path="/react/date-picker" component={DatePickerDoc} />
|
347
356
|
<Route path="/react/time-picker" component={TimePickerDoc} />
|
@@ -379,6 +388,7 @@ class ReactDoc extends React.Component<IProps, IState> {
|
|
379
388
|
<Route path="/react/container" component={ContainerDoc} />
|
380
389
|
<Route path="/react/dropzone" component={DropZoneDoc} />
|
381
390
|
<Route path="/react/create-button" component={CreateButtonDoc} />
|
391
|
+
<Route path="/react/resizable-panels" component={ResizablePanelsDoc} />
|
382
392
|
<Route path="/" component={ReactDefault} />
|
383
393
|
</Switch>
|
384
394
|
</main>
|
@@ -409,3 +419,4 @@ const parsePlayground = ({ match }, playgrounds) => {
|
|
409
419
|
};
|
410
420
|
|
411
421
|
export { ReactDoc, ReactPlayground };
|
422
|
+
|
@@ -0,0 +1,49 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
|
3
|
+
import * as Markup from '../../js/react';
|
4
|
+
|
5
|
+
import {ResizablePanels} from '../../../app-typescript';
|
6
|
+
import {repeat} from 'lodash';
|
7
|
+
|
8
|
+
export class ResizablePanelsDoc extends React.Component {
|
9
|
+
render() {
|
10
|
+
return (
|
11
|
+
<section className='docs-page__container'>
|
12
|
+
|
13
|
+
<h2 className='docs-page__h2'>Resizable panels</h2>
|
14
|
+
|
15
|
+
<p className='docs-page__paragraph'></p>
|
16
|
+
<Markup.ReactMarkup>
|
17
|
+
<Markup.ReactMarkupPreview>
|
18
|
+
<div className='docs-page__content-row docs-page__content-row--no-margin'>
|
19
|
+
<div className='form__row'>
|
20
|
+
<ResizablePanels direction="horizontal" secondarySize={{default: 20}}>
|
21
|
+
<div>
|
22
|
+
{repeat('Lorem ipsum dolor sit amet ', 50)}
|
23
|
+
</div>
|
24
|
+
|
25
|
+
<div>
|
26
|
+
{repeat('Lorem ipsum dolor sit amet ', 50)}
|
27
|
+
</div>
|
28
|
+
</ResizablePanels>
|
29
|
+
</div>
|
30
|
+
</div>
|
31
|
+
|
32
|
+
</Markup.ReactMarkupPreview>
|
33
|
+
|
34
|
+
<Markup.ReactMarkupCode>{`
|
35
|
+
<ResizablePanels direction="horizontal" secondarySize={{default: 20}}>
|
36
|
+
<div>
|
37
|
+
{repeat('Lorem ipsum dolor sit amet', 50)}
|
38
|
+
</div>
|
39
|
+
|
40
|
+
<div>
|
41
|
+
{repeat('Lorem ipsum dolor sit amet', 50)}
|
42
|
+
</div>
|
43
|
+
</ResizablePanels>
|
44
|
+
`}</Markup.ReactMarkupCode>
|
45
|
+
</Markup.ReactMarkup>
|
46
|
+
</section>
|
47
|
+
)
|
48
|
+
}
|
49
|
+
}
|
@@ -0,0 +1,57 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
|
3
|
+
import * as Markup from '../../js/react';
|
4
|
+
|
5
|
+
import {WithPagination} from '../../../app-typescript';
|
6
|
+
import {range} from 'lodash';
|
7
|
+
|
8
|
+
function getItems(pageNo: number): Promise<{items: Array<number>, itemCount: number}> {
|
9
|
+
return new Promise((resolve) => {
|
10
|
+
setTimeout(() => {
|
11
|
+
return resolve({items: range(1, 500).slice((pageNo - 1) * 20, (pageNo - 1) * 20 + 20), itemCount: 500});
|
12
|
+
}, 1000);
|
13
|
+
});
|
14
|
+
};
|
15
|
+
|
16
|
+
export class WithPaginationDocs extends React.Component {
|
17
|
+
render() {
|
18
|
+
const wrapperStyle: React.CSSProperties = {
|
19
|
+
display: 'flex',
|
20
|
+
flexDirection: 'column',
|
21
|
+
alignItems: 'center'
|
22
|
+
};
|
23
|
+
|
24
|
+
return (
|
25
|
+
<section className='docs-page__container'>
|
26
|
+
<h2 className='docs-page__h2'>With pagination</h2>
|
27
|
+
<p className='docs-page__paragraph'></p>
|
28
|
+
<Markup.ReactMarkup>
|
29
|
+
<Markup.ReactMarkupPreview>
|
30
|
+
<WithPagination
|
31
|
+
getItems={(pageNo) => getItems(pageNo)}
|
32
|
+
>
|
33
|
+
{
|
34
|
+
(items) =>
|
35
|
+
<div style={wrapperStyle}>
|
36
|
+
{items.map((x, i) => <div key={i}>{x}</div>)}
|
37
|
+
</div>
|
38
|
+
}
|
39
|
+
</WithPagination>
|
40
|
+
</Markup.ReactMarkupPreview>
|
41
|
+
<Markup.ReactMarkupCode>{`
|
42
|
+
<WithPagination
|
43
|
+
getItems={(pageNo) => getItems(pageNo)}
|
44
|
+
>
|
45
|
+
{
|
46
|
+
(items) =>
|
47
|
+
<div style={wrapperStyle}>
|
48
|
+
{items.map((x, i) => <div key={i}>{x}</div>)}
|
49
|
+
</div>
|
50
|
+
}
|
51
|
+
</WithPagination>
|
52
|
+
`}</Markup.ReactMarkupCode>
|
53
|
+
</Markup.ReactMarkup>
|
54
|
+
</section>
|
55
|
+
)
|
56
|
+
}
|
57
|
+
}
|