superdesk-ui-framework 2.4.18 → 2.4.21
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/scripts/check.js +1 -1
- package/app/styles/_accessibility.scss +7 -3
- package/app/styles/_buttons.scss +52 -1
- package/app/styles/_spinner.scss +46 -0
- package/app-typescript/components/Button.tsx +7 -1
- package/app-typescript/components/Input.tsx +16 -5
- package/app-typescript/components/Select.tsx +7 -0
- package/app-typescript/components/Spinner.tsx +33 -0
- package/app-typescript/components/TabCustom.tsx +89 -40
- package/app-typescript/components/TabList.tsx +43 -18
- package/app-typescript/components/Tag.tsx +3 -3
- package/app-typescript/index.ts +1 -1
- package/dist/components/checkbox.html +1 -1
- package/dist/examples.bundle.css +36 -1
- package/dist/examples.bundle.js +1638 -1201
- package/dist/react/Buttons.tsx +25 -0
- package/dist/react/Inputs.tsx +7 -3
- package/dist/react/Tabs.tsx +225 -72
- package/dist/react/Tags.tsx +9 -7
- package/dist/superdesk-ui.bundle.css +74 -13
- package/dist/superdesk-ui.bundle.js +1269 -957
- package/dist/vendor.bundle.js +23 -23
- package/examples/pages/components/checkbox.html +1 -1
- package/examples/pages/react/Buttons.tsx +25 -0
- package/examples/pages/react/Inputs.tsx +7 -3
- package/examples/pages/react/Tabs.tsx +225 -72
- package/examples/pages/react/Tags.tsx +9 -7
- package/package.json +2 -2
- package/react/components/Button.d.ts +2 -0
- package/react/components/Button.js +4 -2
- package/react/components/Input.d.ts +3 -0
- package/react/components/Input.js +15 -5
- package/react/components/Select.d.ts +1 -0
- package/react/components/Select.js +7 -0
- package/react/components/Spinner.d.ts +12 -0
- package/react/components/Spinner.js +70 -0
- package/react/components/TabCustom.d.ts +22 -12
- package/react/components/TabCustom.js +52 -23
- package/react/components/TabList.d.ts +11 -2
- package/react/components/TabList.js +32 -11
- package/react/components/Tag.d.ts +2 -2
- package/react/components/Tag.js +2 -2
- package/react/index.d.ts +1 -1
- package/react/index.js +2 -2
package/dist/vendor.bundle.js
CHANGED
@@ -70,7 +70,7 @@ return /******/ (function(modules) { // webpackBootstrap
|
|
70
70
|
/******/ __webpack_require__.p = "";
|
71
71
|
/******/
|
72
72
|
/******/ // Load entry module and return exports
|
73
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
73
|
+
/******/ return __webpack_require__(__webpack_require__.s = 385);
|
74
74
|
/******/ })
|
75
75
|
/************************************************************************/
|
76
76
|
/******/ ({
|
@@ -28217,7 +28217,7 @@ return jQuery;
|
|
28217
28217
|
|
28218
28218
|
/***/ }),
|
28219
28219
|
|
28220
|
-
/***/
|
28220
|
+
/***/ 385:
|
28221
28221
|
/***/ (function(module, exports, __webpack_require__) {
|
28222
28222
|
|
28223
28223
|
"use strict";
|
@@ -28227,19 +28227,19 @@ __webpack_require__(38);
|
|
28227
28227
|
|
28228
28228
|
__webpack_require__(35);
|
28229
28229
|
|
28230
|
-
__webpack_require__(384);
|
28231
|
-
|
28232
28230
|
__webpack_require__(386);
|
28233
28231
|
|
28234
28232
|
__webpack_require__(388);
|
28235
28233
|
|
28234
|
+
__webpack_require__(390);
|
28235
|
+
|
28236
28236
|
__webpack_require__(1);
|
28237
28237
|
|
28238
28238
|
__webpack_require__(7);
|
28239
28239
|
|
28240
28240
|
/***/ }),
|
28241
28241
|
|
28242
|
-
/***/
|
28242
|
+
/***/ 386:
|
28243
28243
|
/***/ (function(module, exports, __webpack_require__) {
|
28244
28244
|
|
28245
28245
|
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*!
|
@@ -28263,7 +28263,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
|
|
28263
28263
|
if ( true ) {
|
28264
28264
|
|
28265
28265
|
// AMD. Register as an anonymous module.
|
28266
|
-
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(35), __webpack_require__(
|
28266
|
+
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [ __webpack_require__(35), __webpack_require__(387) ], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),
|
28267
28267
|
__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
|
28268
28268
|
(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
|
28269
28269
|
__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
|
@@ -29005,7 +29005,7 @@ return $.widget;
|
|
29005
29005
|
|
29006
29006
|
/***/ }),
|
29007
29007
|
|
29008
|
-
/***/
|
29008
|
+
/***/ 387:
|
29009
29009
|
/***/ (function(module, exports, __webpack_require__) {
|
29010
29010
|
|
29011
29011
|
var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;( function( factory ) {
|
@@ -29035,20 +29035,20 @@ return $.ui.version = "1.13.1";
|
|
29035
29035
|
|
29036
29036
|
/***/ }),
|
29037
29037
|
|
29038
|
-
/***/
|
29038
|
+
/***/ 388:
|
29039
29039
|
/***/ (function(module, exports, __webpack_require__) {
|
29040
29040
|
|
29041
|
-
__webpack_require__(
|
29041
|
+
__webpack_require__(389);
|
29042
29042
|
module.exports = angular;
|
29043
29043
|
|
29044
29044
|
|
29045
29045
|
/***/ }),
|
29046
29046
|
|
29047
|
-
/***/
|
29047
|
+
/***/ 389:
|
29048
29048
|
/***/ (function(module, exports, __webpack_require__) {
|
29049
29049
|
|
29050
29050
|
/* WEBPACK VAR INJECTION */(function(__webpack_provided_window_dot_jQuery) {/**
|
29051
|
-
* @license AngularJS v1.8.
|
29051
|
+
* @license AngularJS v1.8.3
|
29052
29052
|
* (c) 2010-2020 Google LLC. http://angularjs.org
|
29053
29053
|
* License: MIT
|
29054
29054
|
*/
|
@@ -29148,7 +29148,7 @@ function isValidObjectMaxDepth(maxDepth) {
|
|
29148
29148
|
function minErr(module, ErrorConstructor) {
|
29149
29149
|
ErrorConstructor = ErrorConstructor || Error;
|
29150
29150
|
|
29151
|
-
var url = 'https://errors.angularjs.org/1.8.
|
29151
|
+
var url = 'https://errors.angularjs.org/1.8.3/';
|
29152
29152
|
var regex = url.replace('.', '\\.') + '[\\s\\S]*';
|
29153
29153
|
var errRegExp = new RegExp(regex, 'g');
|
29154
29154
|
|
@@ -31877,11 +31877,11 @@ function toDebugString(obj, maxDepth) {
|
|
31877
31877
|
var version = {
|
31878
31878
|
// These placeholder strings will be replaced by grunt's `build` task.
|
31879
31879
|
// They need to be double- or single-quoted.
|
31880
|
-
full: '1.8.
|
31880
|
+
full: '1.8.3',
|
31881
31881
|
major: 1,
|
31882
31882
|
minor: 8,
|
31883
|
-
dot:
|
31884
|
-
codeName: '
|
31883
|
+
dot: 3,
|
31884
|
+
codeName: 'ultimate-farewell'
|
31885
31885
|
};
|
31886
31886
|
|
31887
31887
|
|
@@ -32032,7 +32032,7 @@ function publishExternalAPI(angular) {
|
|
32032
32032
|
});
|
32033
32033
|
}
|
32034
32034
|
])
|
32035
|
-
.info({ angularVersion: '1.8.
|
32035
|
+
.info({ angularVersion: '1.8.3' });
|
32036
32036
|
}
|
32037
32037
|
|
32038
32038
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
@@ -46649,7 +46649,7 @@ function $ParseProvider() {
|
|
46649
46649
|
|
46650
46650
|
var useInputs = parsedExpression.inputs && !exp.inputs;
|
46651
46651
|
|
46652
|
-
//
|
46652
|
+
// Propagate the literal/inputs/constant attributes
|
46653
46653
|
// ... but not oneTime since we are handling it
|
46654
46654
|
oneTimeWatch.literal = parsedExpression.literal;
|
46655
46655
|
oneTimeWatch.constant = parsedExpression.constant;
|
@@ -46736,7 +46736,7 @@ function $ParseProvider() {
|
|
46736
46736
|
fn.$$intercepted = parsedExpression;
|
46737
46737
|
fn.$$interceptor = interceptorFn;
|
46738
46738
|
|
46739
|
-
//
|
46739
|
+
// Propagate the literal/oneTime/constant attributes
|
46740
46740
|
fn.literal = parsedExpression.literal;
|
46741
46741
|
fn.oneTime = parsedExpression.oneTime;
|
46742
46742
|
fn.constant = parsedExpression.constant;
|
@@ -65651,20 +65651,20 @@ $provide.value("$locale", {
|
|
65651
65651
|
|
65652
65652
|
/***/ }),
|
65653
65653
|
|
65654
|
-
/***/
|
65654
|
+
/***/ 390:
|
65655
65655
|
/***/ (function(module, exports, __webpack_require__) {
|
65656
65656
|
|
65657
|
-
__webpack_require__(
|
65657
|
+
__webpack_require__(391);
|
65658
65658
|
module.exports = 'ngAnimate';
|
65659
65659
|
|
65660
65660
|
|
65661
65661
|
/***/ }),
|
65662
65662
|
|
65663
|
-
/***/
|
65663
|
+
/***/ 391:
|
65664
65664
|
/***/ (function(module, exports) {
|
65665
65665
|
|
65666
65666
|
/**
|
65667
|
-
* @license AngularJS v1.8.
|
65667
|
+
* @license AngularJS v1.8.3
|
65668
65668
|
* (c) 2010-2020 Google LLC. http://angularjs.org
|
65669
65669
|
* License: MIT
|
65670
65670
|
*/
|
@@ -69917,7 +69917,7 @@ angular.module('ngAnimate', [], function initAngularHelpers() {
|
|
69917
69917
|
isFunction = angular.isFunction;
|
69918
69918
|
isElement = angular.isElement;
|
69919
69919
|
})
|
69920
|
-
.info({ angularVersion: '1.8.
|
69920
|
+
.info({ angularVersion: '1.8.3' })
|
69921
69921
|
.directive('ngAnimateSwap', ngAnimateSwapDirective)
|
69922
69922
|
|
69923
69923
|
.directive('ngAnimateChildren', $$AnimateChildrenDirective)
|
@@ -45,7 +45,7 @@
|
|
45
45
|
<sd-check ng-model="def6" label-position="inside" data-icon="th-list">Button style with icon</sd-check>
|
46
46
|
<sd-check ng-model="def7" label-position="inside" data-icon="th" ng-checked="true">I have an icon!</sd-check>
|
47
47
|
<sd-check ng-model="def8" label-position="inside" data-icon="th-large">Yeah, me too!</sd-check>
|
48
|
-
<sd-check ng-model="def9" data-icon="star">I have an icon :) </sd-check>
|
48
|
+
<sd-check ng-model="def9" data-icon="star" disabled>I have an icon :) </sd-check>
|
49
49
|
</div>
|
50
50
|
</div>
|
51
51
|
|
@@ -187,6 +187,30 @@ export default class ButtonsDoc extends React.Component {
|
|
187
187
|
`}</Markup.ReactMarkupCode>
|
188
188
|
</Markup.ReactMarkup>
|
189
189
|
|
190
|
+
|
191
|
+
<h3 className="docs-page__h3">Loading</h3>
|
192
|
+
<p className="docs-page__paragraph"><code>isLoading={'{true}'}</code></p>
|
193
|
+
<Markup.ReactMarkup>
|
194
|
+
<Markup.ReactMarkupPreview>
|
195
|
+
<div className="docs-page__content-row">
|
196
|
+
<Button text="default" isLoading={true} onClick={()=> false} />
|
197
|
+
<Button text="primary" type="primary" isLoading={true} onClick={()=> false} />
|
198
|
+
<Button text="success" type="success" isLoading={true} onClick={()=> false} />
|
199
|
+
<Button text="warning" type="warning" isLoading={true} onClick={()=> false} />
|
200
|
+
<Button text="alert" type="alert" isLoading={true} onClick={()=> false} />
|
201
|
+
<Button text="highlight" type="highlight" isLoading={true} onClick={()=> false} />
|
202
|
+
</div>
|
203
|
+
</Markup.ReactMarkupPreview>
|
204
|
+
<Markup.ReactMarkupCode>{`
|
205
|
+
<Button text="default" isLoading={true} onClick={()=> false} />
|
206
|
+
<Button text="primary" type="primary" isLoading={true} onClick={()=> false} />
|
207
|
+
<Button text="success" type="success" isLoading={true} onClick={()=> false} />
|
208
|
+
<Button text="warning" type="warning" isLoading={true} onClick={()=> false} />
|
209
|
+
<Button text="alert" type="alert" isLoading={true} onClick={()=> false} />
|
210
|
+
<Button text="highlight" type="highlight" isLoading={true} onClick={()=> false} />
|
211
|
+
`}</Markup.ReactMarkupCode>
|
212
|
+
</Markup.ReactMarkup>
|
213
|
+
|
190
214
|
<h3 className="docs-page__h3">Buttons with icon and text</h3>
|
191
215
|
<p className="docs-page__paragraph">Buttons can be combined with icons from the icon font. Just add any of the available classes from the Icon font as a value of the <code>icon</code> prop.</p>
|
192
216
|
<Markup.ReactMarkup>
|
@@ -443,6 +467,7 @@ export default class ButtonsDoc extends React.Component {
|
|
443
467
|
<Prop name='size' isRequired={false} type='small | normal | large' default='normal' description='Specifies a small, normal or large button.'/>
|
444
468
|
<Prop name='icon' isRequired={false} type='string' default='/' description='Icon class name without the icon- part.'/>
|
445
469
|
<Prop name='disabled' isRequired={false} type='boolean' default='false' description='Disables the Button, preventing mouse events.'/>
|
470
|
+
<Prop name='isLoading' isRequired={false} type='boolean' default='false' description='Adds a loading indicator and disables the button if set to true.'/>
|
446
471
|
<Prop name='onClick' isRequired={true} type='function' default='false' description='Callback fired when a button is pressed.'/>
|
447
472
|
</PropsList>
|
448
473
|
</section>
|
@@ -9,6 +9,7 @@ interface IState {
|
|
9
9
|
required: boolean;
|
10
10
|
disabled: boolean;
|
11
11
|
invalid: boolean;
|
12
|
+
val: string
|
12
13
|
}
|
13
14
|
|
14
15
|
export default class InputsDoc extends React.Component<{}, IState> {
|
@@ -18,7 +19,8 @@ export default class InputsDoc extends React.Component<{}, IState> {
|
|
18
19
|
inlineLabel: false,
|
19
20
|
required: true,
|
20
21
|
disabled: false,
|
21
|
-
invalid: false
|
22
|
+
invalid: false,
|
23
|
+
val: 'This is some text'
|
22
24
|
}
|
23
25
|
}
|
24
26
|
|
@@ -45,7 +47,7 @@ export default class InputsDoc extends React.Component<{}, IState> {
|
|
45
47
|
|
46
48
|
<div className='form__row'>
|
47
49
|
<Input label='Input label'
|
48
|
-
value=
|
50
|
+
value={this.state.val}
|
49
51
|
maxLength={30}
|
50
52
|
error='This is error message'
|
51
53
|
info='This is some hint message'
|
@@ -53,14 +55,16 @@ export default class InputsDoc extends React.Component<{}, IState> {
|
|
53
55
|
required={this.state.required}
|
54
56
|
disabled={this.state.disabled}
|
55
57
|
invalid={this.state.invalid}
|
56
|
-
onChange={(value) => {}} />
|
58
|
+
onChange={(value) => {this.setState({val: value})}} />
|
57
59
|
</div>
|
60
|
+
|
58
61
|
</div>
|
59
62
|
|
60
63
|
<div className='docs-page__content-row docs-page__content-row--no-margin'>
|
61
64
|
<p className="docs-page__paragraph">// Hidden label</p>
|
62
65
|
<div className='form__row'>
|
63
66
|
<Input label='Hidden input label'
|
67
|
+
type='number'
|
64
68
|
value='Lorem ipsum input'
|
65
69
|
maxLength={30}
|
66
70
|
error='This is an error message'
|
@@ -2,30 +2,45 @@ import * as React from 'react';
|
|
2
2
|
|
3
3
|
import * as Markup from '../../js/react';
|
4
4
|
|
5
|
-
import { Tab, TabList, Prop, PropsList } from '../../../app-typescript';
|
6
|
-
import {
|
5
|
+
import { Tab, TabList, Prop, PropsList, TabNav, TabItem } from '../../../app-typescript';
|
6
|
+
import {TabPanel, TabContent} from '../../../app-typescript';
|
7
|
+
import { stringify } from 'querystring';
|
7
8
|
|
8
9
|
interface IState {
|
9
|
-
|
10
|
+
selected: string;
|
11
|
+
customSelected: string;
|
12
|
+
alternativeWaySelected: string;
|
10
13
|
}
|
11
14
|
|
12
15
|
export default class TabsDoc extends React.Component<{}, IState> {
|
13
16
|
constructor(props){
|
14
17
|
super(props);
|
15
18
|
this.state = {
|
16
|
-
|
19
|
+
selected: null,
|
20
|
+
customSelected: 'metadata',
|
21
|
+
alternativeWaySelected: null,
|
17
22
|
}
|
18
23
|
this.handleClick=this.handleClick.bind(this);
|
24
|
+
this.handleClick_customTab=this.handleClick_customTab.bind(this);
|
25
|
+
this.handleClick_alternativeWay=this.handleClick_alternativeWay.bind(this);
|
19
26
|
}
|
20
27
|
tabs: TabList;
|
21
28
|
|
22
|
-
|
23
|
-
this.
|
29
|
+
handleClick = (id: string) => {
|
30
|
+
this.setState({
|
31
|
+
selected: id,
|
32
|
+
})
|
33
|
+
}
|
34
|
+
|
35
|
+
handleClick_customTab = (id: string) => {
|
36
|
+
this.setState({
|
37
|
+
customSelected: id,
|
38
|
+
})
|
24
39
|
}
|
25
40
|
|
26
|
-
|
41
|
+
handleClick_alternativeWay = (id: string) => {
|
27
42
|
this.setState({
|
28
|
-
|
43
|
+
alternativeWaySelected: id,
|
29
44
|
})
|
30
45
|
}
|
31
46
|
|
@@ -34,32 +49,78 @@ export default class TabsDoc extends React.Component<{}, IState> {
|
|
34
49
|
<section className="docs-page__container">
|
35
50
|
<h2 className="docs-page__h2">Tabs</h2>
|
36
51
|
<Markup.ReactMarkupCodePreview>{`
|
37
|
-
<TabList
|
38
|
-
|
39
|
-
|
40
|
-
|
52
|
+
<TabList ref={(tabs) => {
|
53
|
+
this.tabs = tabs;
|
54
|
+
}}
|
55
|
+
tabs={[
|
56
|
+
{label: 'Content', content: 'Content here.', id: 'content'},
|
57
|
+
{label: 'Metadata', content: 'Metadata here', id: 'metadata'},
|
58
|
+
{label: 'Duplicate', content: 'Duplicate here.', id: 'duplicate'}
|
59
|
+
]}
|
60
|
+
>
|
41
61
|
</TabList>
|
42
62
|
`}
|
43
63
|
</Markup.ReactMarkupCodePreview>
|
44
64
|
<h3 className="docs-page__h3">Default tabs</h3>
|
45
|
-
<p className="docs-page__paragraph">To have a tab-like navigation add the <code>TabList</code> component and multiple <code>Tab</code> components inside of it.</p>
|
65
|
+
<p className="docs-page__paragraph">To have a tab-like navigation add the <code>TabList</code> component and multiple <code>Tab</code> components inside of it, or add the appropriate attributes on <code>TabList.</code></p>
|
46
66
|
<Markup.ReactMarkup>
|
47
67
|
<Markup.ReactMarkupPreview>
|
48
68
|
<div className='docs-page__content-row'>
|
49
|
-
<TabList
|
69
|
+
<TabList ref={(tabs) => {
|
50
70
|
this.tabs = tabs;
|
51
|
-
}}
|
52
|
-
|
53
|
-
|
54
|
-
|
71
|
+
}}
|
72
|
+
tabs={[
|
73
|
+
{label: 'Content', content: 'Content here.', id: 'content'},
|
74
|
+
{label: 'Metadata', content: 'Metadata here', id: 'metadata'},
|
75
|
+
{label: 'Duplicate', content: 'Duplicate here.', id: 'duplicate'}
|
76
|
+
]}
|
77
|
+
>
|
78
|
+
{/* <Tab label='Content' id='content' >Content here.</Tab>
|
79
|
+
<Tab label='Metadata' id='metadata' >Metadata here.</Tab>
|
80
|
+
<Tab label='Duplicates' id='duplicate' >Duplicates here.</Tab> */}
|
81
|
+
</TabList>
|
82
|
+
</div>
|
83
|
+
<p className="docs-page__paragraph">// Start width custom tab.</p>
|
84
|
+
<div className='docs-page__content-row'>
|
85
|
+
<TabList ref={(tabs) => {
|
86
|
+
this.tabs = tabs;
|
87
|
+
}}
|
88
|
+
selected='metadata'
|
89
|
+
tabs={[
|
90
|
+
{label: 'Content', content: 'Content here.', id: 'content'},
|
91
|
+
{label: 'Metadata', content: 'Metadata here', id: 'metadata'},
|
92
|
+
{label: 'Duplicate', content: 'Duplicate here.', id: 'duplicate'}
|
93
|
+
]}
|
94
|
+
>
|
95
|
+
{/* <Tab label='Content' id='content' >Content here.</Tab>
|
96
|
+
<Tab label='Metadata' id='metadata' >Metadata here.</Tab>
|
97
|
+
<Tab label='Duplicates' id='duplicate' >Duplicates here.</Tab> */}
|
55
98
|
</TabList>
|
56
99
|
</div>
|
57
100
|
</Markup.ReactMarkupPreview>
|
58
101
|
<Markup.ReactMarkupCode>{`
|
59
|
-
<TabList
|
60
|
-
|
61
|
-
|
62
|
-
|
102
|
+
<TabList ref={(tabs) => {
|
103
|
+
this.tabs = tabs;
|
104
|
+
}}
|
105
|
+
tabs={[
|
106
|
+
{label: 'Content', content: 'Content here.', id: 'content'},
|
107
|
+
{label: 'Metadata', content: 'Metadata here', id: 'metadata'},
|
108
|
+
{label: 'Duplicate', content: 'Duplicate here.', id: 'duplicate'}
|
109
|
+
]}
|
110
|
+
>
|
111
|
+
</TabList>
|
112
|
+
|
113
|
+
// start with custom tab (add atributte selected)
|
114
|
+
<TabList ref={(tabs) => {
|
115
|
+
this.tabs = tabs;
|
116
|
+
}}
|
117
|
+
selected='metadata' //tabs.id
|
118
|
+
tabs={[
|
119
|
+
{label: 'Content', content: 'Content here.', id: 'content'},
|
120
|
+
{label: 'Metadata', content: 'Metadata here', id: 'metadata'},
|
121
|
+
{label: 'Duplicate', content: 'Duplicate here.', id: 'duplicate'}
|
122
|
+
]}
|
123
|
+
>
|
63
124
|
</TabList>
|
64
125
|
`}
|
65
126
|
</Markup.ReactMarkupCode>
|
@@ -139,74 +200,166 @@ export default class TabsDoc extends React.Component<{}, IState> {
|
|
139
200
|
</Markup.ReactMarkupCode>
|
140
201
|
</Markup.ReactMarkup>
|
141
202
|
|
142
|
-
<h3 className="docs-page__h3">Tabs with two components ( <code>
|
143
|
-
<p className="docs-page__paragraph">If you want to use on one place list of tabs and on another place content of tabs, wrap all <code>
|
203
|
+
<h3 className="docs-page__h3">Tabs with two components ( <code>TabNav</code> and <code> TabContent</code> ) </h3>
|
204
|
+
<p className="docs-page__paragraph">If you want to use on one place list of tabs and on another place content of tabs, wrap all <code>TabItem</code> with <code>TabNav</code> component and all <code>TabPanel</code> components with <code>TabContent</code>, or add the appropriate attributes on <code>TabNav</code> and <code>TabContent</code></p>
|
205
|
+
<Markup.ReactMarkup>
|
206
|
+
<Markup.ReactMarkupPreview>
|
207
|
+
<div className='docs-page__content-row'>
|
208
|
+
<TabNav onClick={this.handleClick} activePanel={this.state.selected}
|
209
|
+
tabs={[
|
210
|
+
{label: 'Content', id: 'content'},
|
211
|
+
{label: 'Metadata', id: 'metadata'},
|
212
|
+
{label: 'Duplicate', id: 'duplicate'}
|
213
|
+
]}
|
214
|
+
>
|
215
|
+
</TabNav>
|
216
|
+
<TabContent activePanel={this.state.selected}
|
217
|
+
tabs={[
|
218
|
+
{content: 'Content here.', id: 'content'},
|
219
|
+
{content: 'Metadata here.', id: 'metadata'},
|
220
|
+
{content: 'Duplicates here.', id: 'duplicate'}
|
221
|
+
]}
|
222
|
+
>
|
223
|
+
</TabContent>
|
224
|
+
</div>
|
225
|
+
<p className="docs-page__paragraph">// Start width custom tab.</p>
|
226
|
+
<div className='docs-page__content-row'>
|
227
|
+
<TabNav onClick={this.handleClick_customTab} activePanel={this.state.customSelected}
|
228
|
+
tabs={[
|
229
|
+
{label: 'Content', id: 'content'},
|
230
|
+
{label: 'Metadata', id: 'metadata'},
|
231
|
+
{label: 'Duplicate', id: 'duplicate'}
|
232
|
+
]}
|
233
|
+
>
|
234
|
+
</TabNav>
|
235
|
+
<TabContent activePanel={this.state.customSelected}
|
236
|
+
tabs={[
|
237
|
+
{content: 'Content here.', id: 'content'},
|
238
|
+
{content: 'Metadata here.', id: 'metadata'},
|
239
|
+
{content: 'Duplicates here.', id: 'duplicate'}
|
240
|
+
]}
|
241
|
+
>
|
242
|
+
</TabContent>
|
243
|
+
</div>
|
244
|
+
</Markup.ReactMarkupPreview>
|
245
|
+
<Markup.ReactMarkupCode>{`
|
246
|
+
this.state = {
|
247
|
+
selected: null,
|
248
|
+
}
|
249
|
+
handleClick = (id: string) => {
|
250
|
+
this.setState({
|
251
|
+
selected: id,
|
252
|
+
})
|
253
|
+
}
|
254
|
+
|
255
|
+
<TabNav onClick={this.handleClick} activePanel={this.state.selected}
|
256
|
+
tabs={[
|
257
|
+
{label: 'Content', id: 'content'},
|
258
|
+
{label: 'Metadata', id: 'metadata'},
|
259
|
+
{label: 'Duplicate', id: 'duplicate'}
|
260
|
+
]}
|
261
|
+
>
|
262
|
+
</TabNav>
|
263
|
+
<TabContent activePanel={this.state.selected}
|
264
|
+
tabs={[
|
265
|
+
{content: 'Content here.', id: 'content'},
|
266
|
+
{content: 'Metadata here.', id: 'metadata'},
|
267
|
+
{content: 'Duplicates here.', id: 'duplicate'}
|
268
|
+
]}
|
269
|
+
>
|
270
|
+
</TabContent>
|
271
|
+
|
272
|
+
// start with custom tab
|
273
|
+
this.state = {
|
274
|
+
selected: 'metadata' //tabs.id,
|
275
|
+
}
|
276
|
+
`}
|
277
|
+
</Markup.ReactMarkupCode>
|
278
|
+
</Markup.ReactMarkup>
|
279
|
+
|
280
|
+
<p className="docs-page__paragraph">Alternative way with children:</p>
|
144
281
|
<Markup.ReactMarkup>
|
145
282
|
<Markup.ReactMarkupPreview>
|
146
283
|
<div className='docs-page__content-row'>
|
147
|
-
<
|
148
|
-
<
|
149
|
-
<
|
150
|
-
<
|
151
|
-
</
|
152
|
-
<TabContent activePanel={this.state.
|
153
|
-
<TabPanel
|
154
|
-
|
155
|
-
|
156
|
-
<TabPanel indexValue={1}>
|
157
|
-
Metadata here.
|
158
|
-
</TabPanel>
|
159
|
-
<TabPanel indexValue={2}>
|
160
|
-
Duplicates here.
|
161
|
-
</TabPanel>
|
284
|
+
<TabNav onClick={this.handleClick_alternativeWay} activePanel={this.state.alternativeWaySelected}>
|
285
|
+
<TabItem id='content'>Content</TabItem>
|
286
|
+
<TabItem id='metadata'>Metadata</TabItem>
|
287
|
+
<TabItem id='duplicate'>Duplicate</TabItem>
|
288
|
+
</TabNav>
|
289
|
+
<TabContent activePanel={this.state.alternativeWaySelected}>
|
290
|
+
<TabPanel id='content'>Content here.</TabPanel>
|
291
|
+
<TabPanel id='metadata'>Metadata here.</TabPanel>
|
292
|
+
<TabPanel id='duplicate'>Duplicates here.</TabPanel>
|
162
293
|
</TabContent>
|
163
294
|
</div>
|
164
295
|
</Markup.ReactMarkupPreview>
|
165
296
|
<Markup.ReactMarkupCode>{`
|
166
|
-
|
167
|
-
|
168
|
-
|
297
|
+
this.state = {
|
298
|
+
selected: null,
|
299
|
+
}
|
300
|
+
handleClick = (id: string) => {
|
301
|
+
this.setState({
|
302
|
+
selected: id,
|
303
|
+
})
|
169
304
|
}
|
170
305
|
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
Metadata here.
|
182
|
-
</TabPanel>
|
183
|
-
<TabPanel indexValue={2}>
|
184
|
-
Duplicates here.
|
185
|
-
</TabPanel>
|
186
|
-
</TabContent>
|
306
|
+
<TabNav onClick={this.handleClick} activePanel={this.state.selected}>
|
307
|
+
<TabItem id='content'>Content</TabItem>
|
308
|
+
<TabItem id='metadata'>Metadata</TabItem>
|
309
|
+
<TabItem id='duplicate'>Duplicate</TabItem>
|
310
|
+
</TabNav>
|
311
|
+
<TabContent activePanel={this.state.selected}>
|
312
|
+
<TabPanel id='content'>Content here.</TabPanel>
|
313
|
+
<TabPanel id='metadata'>Metadata here.</TabPanel>
|
314
|
+
<TabPanel id='duplicate'>Duplicates here.</TabPanel>
|
315
|
+
</TabContent>
|
187
316
|
`}
|
188
317
|
</Markup.ReactMarkupCode>
|
189
318
|
</Markup.ReactMarkup>
|
190
319
|
|
191
320
|
<h3 className="docs-page__h3">Props</h3>
|
321
|
+
<br/>
|
322
|
+
<h4 className="docs-page__h4">TabList</h4>
|
192
323
|
<PropsList>
|
193
|
-
<Prop name='
|
194
|
-
<Prop name='
|
195
|
-
<Prop name='
|
324
|
+
<Prop name='TabList size' isRequired={false} type='small | normal | large' default='normal' description='Specifies a small, normal or large button.'/>
|
325
|
+
<Prop name='TabList theme' isRequired={false} type='light | dark' default='light' description='Styles tablist for diffrent background'/>
|
326
|
+
<Prop name='TabList selected' isRequired={false} type='string' default='/' description='Specify which tab should be pre-selected'/>
|
327
|
+
<Prop name='TabList tabs' isRequired={false} type='Array<label: string, content: React.ReactNode, id: string>' default='/' description='Array of objects'/>
|
328
|
+
<Prop name='Tab label' isRequired={false} type='string' default='/' description='Text value of label'/>
|
329
|
+
<Prop name='Tab id' isRequired={false} type='string' default='/' description='Id value of Tab component'/>
|
330
|
+
<Prop name='Tab children' isRequired={false} type='React.ReactNode' default='/' description='Children of component'/>
|
331
|
+
</PropsList>
|
332
|
+
<p className='docs-page__paragraph'>tabs: TabList</p>
|
333
|
+
<PropsList>
|
334
|
+
<Prop name='label' isRequired={true} type='string' default='/' description='Text value of label'/>
|
335
|
+
<Prop name='content' isRequired={true} type='React.ReactNode' default='/' description='React.ReactNode'/>
|
336
|
+
<Prop name='id' isRequired={true} type='string' default='/' description='Id value'/>
|
196
337
|
</PropsList>
|
197
338
|
<br/>
|
198
|
-
<h4 className="docs-page__h4">
|
339
|
+
<h4 className="docs-page__h4">TabNav and TabContent</h4>
|
340
|
+
<PropsList>
|
341
|
+
<Prop name='TabNav size' isRequired={false} type='small | normal | large' default='normal' description='Specifies a small, normal or large button'/>
|
342
|
+
<Prop name='TabNav theme' isRequired={false} type='light | dark' default='light' description='Styles tablist for diffrent background'/>
|
343
|
+
<Prop name='TabNav ariaLabel' isRequired={false} type='string' default='/' description='Text value of aria-label'/>
|
344
|
+
<Prop name='TabNav onClick' isRequired={true} type='function' default='/' description='Use to return value of clicked label'/>
|
345
|
+
<Prop name='TabNav activePanel' isRequired={true} type='string' default='/' description='Specify which tab should be pre-selected'/>
|
346
|
+
<Prop name='TabNav tabs' isRequired={false} type='Array<label: string, id: string>' default='/' description='Array of objects'/>
|
347
|
+
<Prop name='TabItem id' isRequired={true} type='string' default='/' description='Id value of Tab Item'/>
|
348
|
+
<Prop name='TabItem label' isRequired={true} type='string' default='/' description='Text value of Tab label'/>
|
349
|
+
<Prop name='TabContent theme' isRequired={false} type='light | dark' default='light' description='Styles tablist for diffrent background'/>
|
350
|
+
<Prop name='TabContent activePanel' isRequired={true} type='string' default='/' description='Specify which tab should be pre-selected'/>
|
351
|
+
<Prop name='TabContent tabs' isRequired={false} type='Array<content: React.ReactNode, id: string>' default='/' description='Array of objects'/>
|
352
|
+
<Prop name='TabPanel id' isRequired={true} type='string' default='/' description='Id value of Tab Panel'/>
|
353
|
+
</PropsList>
|
354
|
+
<p className='docs-page__paragraph'>tabs: TabNav</p>
|
355
|
+
<PropsList>
|
356
|
+
<Prop name='label' isRequired={true} type='string' default='/' description='Text value of label'/>
|
357
|
+
<Prop name='id' isRequired={true} type='string' default='/' description='Unique identifier to connect tab nav and tab content'/>
|
358
|
+
</PropsList>
|
359
|
+
<p className='docs-page__paragraph'>tabs: TabContent</p>
|
199
360
|
<PropsList>
|
200
|
-
<Prop name='
|
201
|
-
<Prop name='
|
202
|
-
<Prop name='tabs ariaLabel' isRequired={false} type='string' default='/' description='Text value of aria-label'/>
|
203
|
-
<Prop name='tabs onClick' isRequired={true} type='function' default='/' description='Use to return value of clicked label'/>
|
204
|
-
<Prop name='tablabel indexValue' isRequired={true} type='number' default='/' description='Index value of label'/>
|
205
|
-
<Prop name='tablabel label' isRequired={true} type='string' default='/' description='Text value of Tab label'/>
|
206
|
-
|
207
|
-
<Prop name='tabcontent theme' isRequired={false} type='light | dark' default='light' description='Styles tablist for diffrent background.'/>
|
208
|
-
<Prop name='tabcontent activePanel' isRequired={true} type='number' default='/' description='Index value of active Tab'/>
|
209
|
-
<Prop name='tabpanel indexValue' isRequired={true} type='number' default='/' description='Index value of Tab Panel'/>
|
361
|
+
<Prop name='content' isRequired={true} type='React.ReactNode' default='/' description='React.ReactNode'/>
|
362
|
+
<Prop name='id' isRequired={true} type='string' default='/' description='Unique identifier to connect tab nav and tab content'/>
|
210
363
|
</PropsList>
|
211
364
|
</section>
|
212
365
|
)
|