superdesk-ui-framework 3.1.8 → 3.1.12
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/styles/_helpers.scss +913 -780
- package/app/styles/_master-desk.scss +2 -2
- package/app/styles/components/_sd-collapse-box.scss +113 -0
- package/app/styles/components/_subnav.scss +0 -1
- package/app/styles/design-tokens/_design-tokens-general.scss +19 -5
- package/app/styles/design-tokens/_new-colors.scss +11 -1
- package/app/styles/grids/_grid-layout.scss +0 -1
- package/app/styles/layout/_editor.scss +5 -5
- package/app-typescript/components/ToggleBox/CustomHeaderToggleBox.tsx +56 -0
- package/app-typescript/components/{Togglebox.tsx → ToggleBox/SimpleToggleBox.tsx} +3 -14
- package/app-typescript/components/ToggleBox/index.tsx +41 -0
- package/app-typescript/components/TreeMenu.tsx +4 -2
- package/app-typescript/index.ts +1 -1
- package/dist/components/Alerts.tsx +1 -1
- package/dist/components/ContentDivider.tsx +1 -1
- package/dist/components/DragHandleDocs.tsx +2 -2
- package/dist/components/Index.tsx +105 -50
- package/dist/components/Panel.tsx +13 -13
- package/dist/components/Tags.tsx +2 -2
- package/dist/components/Togglebox.tsx +154 -15
- package/dist/components/utilities/BorderRadiusUtilities.tsx +56 -0
- package/dist/components/utilities/BorderUtilities.tsx +170 -0
- package/dist/components/utilities/DisplayUtilities.tsx +116 -0
- package/dist/components/utilities/FlexAndGridUtilities.tsx +551 -0
- package/dist/components/utilities/ObjectFitUtilities.tsx +53 -0
- package/dist/components/utilities/ObjectPositionUtilities.tsx +68 -0
- package/dist/components/utilities/OpacityUtilities.tsx +64 -0
- package/dist/components/utilities/OverflowUtilities.tsx +93 -0
- package/dist/components/utilities/PositionUtilities.tsx +52 -0
- package/dist/components/utilities/ShadowUtilities.tsx +123 -0
- package/dist/components/utilities/SpacingUtilities.tsx +2 -2
- package/dist/components/utilities/TextUtilities.tsx +44 -4
- package/dist/components.html +2 -4
- package/dist/components_deprecated/modals.html +2 -2
- package/dist/components_deprecated.html +1 -0
- package/dist/design-patterns/Index.tsx +1 -42
- package/dist/design-patterns.html +2 -4
- package/dist/design.html +1 -0
- package/dist/examples.bundle.css +15 -7
- package/dist/examples.bundle.js +3104 -1270
- package/dist/main.html +1 -0
- package/dist/playgrounds/react-playgrounds/Rundowns.tsx +1 -1
- package/dist/playgrounds/react-playgrounds/TestGround.tsx +214 -2
- package/dist/playgrounds.html +1 -0
- package/dist/superdesk-ui.bundle.css +1331 -1006
- package/dist/superdesk-ui.bundle.js +1094 -919
- package/dist/vendor.bundle.js +13 -13
- package/examples/css/docs-page.css +15 -7
- package/examples/js/doc.js +13 -1
- package/examples/pages/components/Alerts.tsx +1 -1
- package/examples/pages/components/ContentDivider.tsx +1 -1
- package/examples/pages/components/DragHandleDocs.tsx +2 -2
- package/examples/pages/components/Index.tsx +105 -50
- package/examples/pages/components/Panel.tsx +13 -13
- package/examples/pages/components/Tags.tsx +2 -2
- package/examples/pages/components/Togglebox.tsx +154 -15
- package/examples/pages/components/utilities/BorderRadiusUtilities.tsx +56 -0
- package/examples/pages/components/utilities/BorderUtilities.tsx +170 -0
- package/examples/pages/components/utilities/DisplayUtilities.tsx +116 -0
- package/examples/pages/components/utilities/FlexAndGridUtilities.tsx +551 -0
- package/examples/pages/components/utilities/ObjectFitUtilities.tsx +53 -0
- package/examples/pages/components/utilities/ObjectPositionUtilities.tsx +68 -0
- package/examples/pages/components/utilities/OpacityUtilities.tsx +64 -0
- package/examples/pages/components/utilities/OverflowUtilities.tsx +93 -0
- package/examples/pages/components/utilities/PositionUtilities.tsx +52 -0
- package/examples/pages/components/utilities/ShadowUtilities.tsx +123 -0
- package/examples/pages/components/utilities/SpacingUtilities.tsx +2 -2
- package/examples/pages/components/utilities/TextUtilities.tsx +44 -4
- package/examples/pages/components.html +2 -4
- package/examples/pages/components_deprecated/modals.html +2 -2
- package/examples/pages/components_deprecated.html +1 -0
- package/examples/pages/design-patterns/Index.tsx +1 -42
- package/examples/pages/design-patterns.html +2 -4
- package/examples/pages/design.html +1 -0
- package/examples/pages/main.html +1 -0
- package/examples/pages/playgrounds/react-playgrounds/Rundowns.tsx +1 -1
- package/examples/pages/playgrounds/react-playgrounds/TestGround.tsx +214 -2
- package/examples/pages/playgrounds.html +1 -0
- package/package.json +1 -1
- package/react/components/ToggleBox/CustomHeaderToggleBox.d.ts +11 -0
- package/react/components/ToggleBox/CustomHeaderToggleBox.js +78 -0
- package/react/components/ToggleBox/SimpleToggleBox.d.ts +18 -0
- package/react/components/{Togglebox.js → ToggleBox/SimpleToggleBox.js} +7 -7
- package/react/components/ToggleBox/index.d.ts +26 -0
- package/react/components/ToggleBox/index.js +71 -0
- package/react/components/TreeMenu.js +4 -2
- package/react/index.d.ts +1 -1
- package/react/index.js +2 -2
- package/react/components/Togglebox.d.ts +0 -28
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as React from 'react';
|
2
2
|
import * as Components from './components/Index';
|
3
|
-
import { Checkbox, RadioGroup, CheckboxButton, RadioButtonGroup, Button, Dropdown, Input, Label, Icon, IconButton, Badge, ThemeSelector, Container, IconLabel, Tooltip, Spinner, Divider, InputWrapper, InputNew, InputBase, Text, FormRowNew, ButtonGroup, Heading, SearchBar, Modal, BoxedList, BoxedListItem, TimePicker, TreeSelect, DatePicker, ContentDivider, Select, Option, AvatarGroup, SvgIconIllustration, IllustrationButton, SubNav, NavButton } from '../../../../app-typescript/index';
|
3
|
+
import { Checkbox, RadioGroup, CheckboxButton, RadioButtonGroup, Button, Dropdown, Input, Label, Icon, IconButton, Badge, ThemeSelector, Container, IconLabel, Tooltip, Spinner, Divider, InputWrapper, InputNew, InputBase, Text, FormRowNew, ButtonGroup, Heading, SearchBar, Modal, BoxedList, BoxedListItem, TimePicker, TreeSelect, DatePicker, ContentDivider, Select, Option, AvatarGroup, Avatar, SvgIconIllustration, IllustrationButton, SubNav, NavButton } from '../../../../app-typescript/index';
|
4
4
|
import { IAvatarInGroup } from '../../../../app-typescript/components/avatar/avatar-group';
|
5
5
|
import { FormLabel } from '../../../../app-typescript/components/Form/FormLabel';
|
6
6
|
|
@@ -33,6 +33,9 @@ interface IState {
|
|
33
33
|
valueS2: any;
|
34
34
|
thisTheme: string;
|
35
35
|
isExpanded: boolean;
|
36
|
+
openCollapsibleOne: boolean;
|
37
|
+
openCollapsibleTwo: boolean;
|
38
|
+
openCollapsibleThree: boolean;
|
36
39
|
}
|
37
40
|
|
38
41
|
let options2 = [
|
@@ -75,6 +78,9 @@ export class TestGround extends React.Component<IProps, IState> {
|
|
75
78
|
valueS2: undefined,
|
76
79
|
thisTheme: 'light-ui',
|
77
80
|
isExpanded: false,
|
81
|
+
openCollapsibleOne: false,
|
82
|
+
openCollapsibleTwo: false,
|
83
|
+
openCollapsibleThree: false,
|
78
84
|
}
|
79
85
|
}
|
80
86
|
|
@@ -153,6 +159,212 @@ export class TestGround extends React.Component<IProps, IState> {
|
|
153
159
|
|
154
160
|
<hr />
|
155
161
|
|
162
|
+
<div style={{maxWidth: '600px'}} className={`sd-shadow--z1 new-collapse-box ${this.state.openCollapsibleOne ? 'new-collapse-box--open' : ''}`}>
|
163
|
+
{/* Header */}
|
164
|
+
<div className='new-collapse-box__header'>
|
165
|
+
<div className='new-collapse-box__header-inner'>
|
166
|
+
<div role="listitem" className="sd-list-item sd-list-item--no-hover">
|
167
|
+
<div className="sd-list-item__border sd-list-item__border--locked"></div>
|
168
|
+
<div className="sd-list-item__column sd-list-item__column--no-border pe-0-5">
|
169
|
+
<Icon type='primary' name='calendar' scale='1.5x' ariaHidden={true} />
|
170
|
+
</div>
|
171
|
+
<div className="sd-list-item__column sd-list-item__column--grow sd-list-item__column--no-border">
|
172
|
+
<div className="sd-list-item__row">
|
173
|
+
<span className="sd-list-item__slugline">Planning Slug</span>
|
174
|
+
<span className="sd-overflow-ellipsis sd-list-item--element-grow">
|
175
|
+
<span className="sd-list-item__text-strong">Cras justo odio, dapibus ac facilisis in.</span>
|
176
|
+
</span>
|
177
|
+
</div>
|
178
|
+
<div className="sd-list-item__row sd-list-item__row--overflow-visible me-1 mb-1-5">
|
179
|
+
<Label text='draft' style='translucent'/>
|
180
|
+
<span className="sd-margin-s--auto">
|
181
|
+
<AvatarGroup
|
182
|
+
size="x-small"
|
183
|
+
items={avatars}
|
184
|
+
/>
|
185
|
+
</span>
|
186
|
+
</div>
|
187
|
+
</div>
|
188
|
+
</div>
|
189
|
+
</div>
|
190
|
+
<button className='new-collapse-box__divider' onClick={() => this.setState(prevState => ({openCollapsibleOne: !prevState.openCollapsibleOne}))}>
|
191
|
+
<span className='label label--translucent new-collapse-box__divider-label'>
|
192
|
+
{this.state.openCollapsibleOne ? 'Show less' : 'Show more'}
|
193
|
+
</span>
|
194
|
+
</button>
|
195
|
+
</div>
|
196
|
+
|
197
|
+
{/* Content */}
|
198
|
+
<div className='new-collapse-box__content'>
|
199
|
+
<div className='new-collapse-box__content-inner p-2 pt-0-5'>
|
200
|
+
<div>
|
201
|
+
<FormLabel text='Name'/>
|
202
|
+
<Text size='small' weight='medium'>Australian Open 2024</Text>
|
203
|
+
</div>
|
204
|
+
<ContentDivider type="dashed" margin='x-small' />
|
205
|
+
<div>
|
206
|
+
<FormLabel text='Current Date'/>
|
207
|
+
<Text size='small' weight='medium'>05.02.2024 @ 10:00</Text>
|
208
|
+
</div>
|
209
|
+
<ContentDivider type="dashed" margin='x-small' />
|
210
|
+
<div>
|
211
|
+
<FormLabel text='Current Repeat Summary'/>
|
212
|
+
<Text size='small' weight='medium'>Every 1 day(s) until CET 28 Feb 2024</Text>
|
213
|
+
</div>
|
214
|
+
<ContentDivider type="dashed" margin='x-small' />
|
215
|
+
<div>
|
216
|
+
<FormLabel text='No. of events'/>
|
217
|
+
<Text size='small' weight='medium'>1</Text>
|
218
|
+
</div>
|
219
|
+
<ContentDivider type="dashed" margin='x-small' />
|
220
|
+
|
221
|
+
{/* NESTED BOX */}
|
222
|
+
<div className={`sd-shadow--z1 new-collapse-box ${this.state.openCollapsibleTwo ? 'new-collapse-box--open' : ''}`}>
|
223
|
+
{/* Header */}
|
224
|
+
<div className='new-collapse-box__header'>
|
225
|
+
<div className='new-collapse-box__header-inner'>
|
226
|
+
<div role="listitem" className="sd-list-item sd-list-item--no-hover">
|
227
|
+
<div className="sd-list-item__column sd-list-item__column--no-border pe-1">
|
228
|
+
<Avatar
|
229
|
+
displayName="Jeffrey Lebowski"
|
230
|
+
imageUrl={null}
|
231
|
+
initials='JL'
|
232
|
+
size="medium"
|
233
|
+
icon={{name: 'photo', color: 'var(--sd-colour-highlight)'}}
|
234
|
+
/>
|
235
|
+
|
236
|
+
</div>
|
237
|
+
<div className="sd-list-item__column sd-list-item__column--grow sd-list-item__column--no-border">
|
238
|
+
<div className="sd-list-item__row">
|
239
|
+
<span className="sd-overflow-ellipsis sd-list-item--element-grow">
|
240
|
+
<span className="sd-list-item__compound-text">
|
241
|
+
<span className="sd-list-item__text-strong">Photo</span>
|
242
|
+
<span className="sd-list-item__text-light">//</span>
|
243
|
+
<span className="sd-list-item__text">Archive</span>
|
244
|
+
</span>
|
245
|
+
|
246
|
+
</span>
|
247
|
+
<time className="sd-margin-s--auto" title="June 01, 2022 11:08 AM">11:08, 01.06.2022</time>
|
248
|
+
</div>
|
249
|
+
<div className="sd-list-item__row sd-list-item__row--overflow-visible mb-1-5">
|
250
|
+
<span className="sd-list-item__compound-text">
|
251
|
+
<span className="sd-list-item__text-label">Desk:</span>
|
252
|
+
<span>Sports</span>
|
253
|
+
</span>
|
254
|
+
<span className="sd-list-item__compound-text">
|
255
|
+
<span className="sd-list-item__text-label">Assignee:</span>
|
256
|
+
<span>Jeffrey Lebowski</span>
|
257
|
+
</span>
|
258
|
+
<span className='sd-margin-s--auto'>
|
259
|
+
<Label text='in progress' style='translucent' type='success'/>
|
260
|
+
</span>
|
261
|
+
</div>
|
262
|
+
</div>
|
263
|
+
</div>
|
264
|
+
</div>
|
265
|
+
<button className='new-collapse-box__divider' onClick={() => this.setState(prevState => ({openCollapsibleTwo: !prevState.openCollapsibleTwo}))}>
|
266
|
+
<span className='label label--translucent new-collapse-box__divider-label'>
|
267
|
+
{this.state.openCollapsibleTwo ? 'Show less' : 'Show more'}
|
268
|
+
</span>
|
269
|
+
</button>
|
270
|
+
</div>
|
271
|
+
|
272
|
+
{/* Content */}
|
273
|
+
<div className='new-collapse-box__content'>
|
274
|
+
<div className='new-collapse-box__content-inner p-2 pt-0-5'>
|
275
|
+
<div>
|
276
|
+
<FormLabel text='Name'/>
|
277
|
+
<Text size='small' weight='medium'>Australian Open 2024</Text>
|
278
|
+
</div>
|
279
|
+
<ContentDivider type="dashed" margin='x-small' />
|
280
|
+
<div>
|
281
|
+
<FormLabel text='Current Date'/>
|
282
|
+
<Text size='small' weight='medium'>05.02.2024 @ 10:00</Text>
|
283
|
+
</div>
|
284
|
+
<ContentDivider type="dashed" margin='x-small' />
|
285
|
+
<div>
|
286
|
+
<FormLabel text='Current Repeat Summary'/>
|
287
|
+
<Text size='small' weight='medium'>Every 1 day(s) until CET 28 Feb 2024</Text>
|
288
|
+
</div>
|
289
|
+
<ContentDivider type="dashed" margin='x-small' />
|
290
|
+
<div>
|
291
|
+
<FormLabel text='No. of events'/>
|
292
|
+
<Text size='small' weight='medium'>1</Text>
|
293
|
+
</div>
|
294
|
+
{/* <ContentDivider type="dashed" margin='x-small' /> */}
|
295
|
+
</div>
|
296
|
+
</div>
|
297
|
+
</div>
|
298
|
+
</div>
|
299
|
+
</div>
|
300
|
+
</div>
|
301
|
+
|
302
|
+
{/* Second Collapsible */}
|
303
|
+
|
304
|
+
<div style={{maxWidth: '600px'}} className={`mt-2 sd-shadow--z1 new-collapse-box ${this.state.openCollapsibleThree ? 'new-collapse-box--open' : ''}`}>
|
305
|
+
{/* Header */}
|
306
|
+
<div className='new-collapse-box__header'>
|
307
|
+
<div className='new-collapse-box__header-inner'>
|
308
|
+
<div role="listitem" className="sd-list-item sd-list-item--no-hover">
|
309
|
+
<div className="sd-list-item__border sd-list-item__border--active"></div>
|
310
|
+
<div className="sd-list-item__column sd-list-item__column--no-border pe-0-5">
|
311
|
+
<Icon type='primary' name='calendar' scale='1.5x' ariaHidden={true} />
|
312
|
+
</div>
|
313
|
+
<div className="sd-list-item__column sd-list-item__column--grow sd-list-item__column--no-border">
|
314
|
+
<div className="sd-list-item__row">
|
315
|
+
<span className="sd-list-item__slugline">Planning Item Slug</span>
|
316
|
+
<span className="sd-overflow-ellipsis sd-list-item--element-grow">
|
317
|
+
<span className="sd-list-item__text-strong">Aenean eu leo quam. Pellentesque ornare sem lacinia quam</span>
|
318
|
+
</span>
|
319
|
+
</div>
|
320
|
+
<div className="sd-list-item__row sd-list-item__row--overflow-visible me-1 mb-1-5">
|
321
|
+
<Label text='in progress' type='success' style='translucent'/>
|
322
|
+
<span className="sd-margin-s--auto">
|
323
|
+
<AvatarGroup
|
324
|
+
size="x-small"
|
325
|
+
items={avatars}
|
326
|
+
/>
|
327
|
+
</span>
|
328
|
+
</div>
|
329
|
+
</div>
|
330
|
+
</div>
|
331
|
+
</div>
|
332
|
+
<button className='new-collapse-box__divider' onClick={() => this.setState(prevState => ({openCollapsibleThree: !prevState.openCollapsibleThree}))}>
|
333
|
+
<span className='label label--translucent new-collapse-box__divider-label'>
|
334
|
+
{this.state.openCollapsibleThree ? 'Show less' : 'Show more'}
|
335
|
+
</span>
|
336
|
+
</button>
|
337
|
+
</div>
|
338
|
+
|
339
|
+
{/* Content */}
|
340
|
+
<div className='new-collapse-box__content'>
|
341
|
+
<div className='new-collapse-box__content-inner p-2 pt-0-5'>
|
342
|
+
<div>
|
343
|
+
<FormLabel text='Name'/>
|
344
|
+
<Text size='small' weight='medium'>Australian Open 2024</Text>
|
345
|
+
</div>
|
346
|
+
<ContentDivider type="dashed" margin='x-small' />
|
347
|
+
<div>
|
348
|
+
<FormLabel text='Current Date'/>
|
349
|
+
<Text size='small' weight='medium'>05.02.2024 @ 10:00</Text>
|
350
|
+
</div>
|
351
|
+
<ContentDivider type="dashed" margin='x-small' />
|
352
|
+
<div>
|
353
|
+
<FormLabel text='Current Repeat Summary'/>
|
354
|
+
<Text size='small' weight='medium'>Every 1 day(s) until CET 28 Feb 2024</Text>
|
355
|
+
</div>
|
356
|
+
<ContentDivider type="dashed" margin='x-small' />
|
357
|
+
<div>
|
358
|
+
<FormLabel text='No. of events'/>
|
359
|
+
<Text size='small' weight='medium'>1</Text>
|
360
|
+
</div>
|
361
|
+
<ContentDivider type="dashed" margin='x-small' />
|
362
|
+
</div>
|
363
|
+
</div>
|
364
|
+
</div>
|
365
|
+
|
366
|
+
<hr />
|
367
|
+
|
156
368
|
<SubNav color='darker'>
|
157
369
|
<Tooltip text={this.state.isExpanded ? "Revert Authoring" : "Expand Authoring"} flow='right' appendToBody={true}>
|
158
370
|
<button
|
@@ -162,7 +374,7 @@ export class TestGround extends React.Component<IProps, IState> {
|
|
162
374
|
<Icon name='chevron-left-thin' />
|
163
375
|
</button>
|
164
376
|
</Tooltip>
|
165
|
-
<div className='text-2xs text-uppercase
|
377
|
+
<div className='text-2xs text-uppercase d-flex ms-2 gap-0-5'>
|
166
378
|
<span className='font-medium'>News desk</span>
|
167
379
|
<span className='font-light text-color-subdued'>/</span>
|
168
380
|
<span className='text-color-muted'>Working stage</span>
|
@@ -8,6 +8,7 @@
|
|
8
8
|
<li class="docs-page__header-nav-item"><a class="docs-page__header-nav-link" href="#/design">Design guidelines</a></li>
|
9
9
|
<li class="docs-page__header-nav-item docs-page__header-nav-item--active"><a class="docs-page__header-nav-link" href="#/playgrounds">Playground</a></li>
|
10
10
|
</ul>
|
11
|
+
<doc-theme-picker></doc-theme-picker>
|
11
12
|
</header>
|
12
13
|
<main class="docs-page__content">
|
13
14
|
<div class="docs-page__hero sd-margin-b--0">
|
package/package.json
CHANGED
@@ -0,0 +1,11 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import { IPropsCustomHeader } from "../ToggleBox/index";
|
3
|
+
interface IState {
|
4
|
+
isOpen: boolean;
|
5
|
+
}
|
6
|
+
export declare class CustomHeaderToggleBox extends React.PureComponent<IPropsCustomHeader, IState> {
|
7
|
+
constructor(props: IPropsCustomHeader);
|
8
|
+
toggle: () => void;
|
9
|
+
render(): JSX.Element;
|
10
|
+
}
|
11
|
+
export {};
|
@@ -0,0 +1,78 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
3
|
+
var extendStatics = function (d, b) {
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
7
|
+
return extendStatics(d, b);
|
8
|
+
};
|
9
|
+
return function (d, b) {
|
10
|
+
if (typeof b !== "function" && b !== null)
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
12
|
+
extendStatics(d, b);
|
13
|
+
function __() { this.constructor = d; }
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
15
|
+
};
|
16
|
+
})();
|
17
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
18
|
+
if (k2 === undefined) k2 = k;
|
19
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
20
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
21
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
22
|
+
}
|
23
|
+
Object.defineProperty(o, k2, desc);
|
24
|
+
}) : (function(o, m, k, k2) {
|
25
|
+
if (k2 === undefined) k2 = k;
|
26
|
+
o[k2] = m[k];
|
27
|
+
}));
|
28
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
29
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
30
|
+
}) : function(o, v) {
|
31
|
+
o["default"] = v;
|
32
|
+
});
|
33
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
34
|
+
if (mod && mod.__esModule) return mod;
|
35
|
+
var result = {};
|
36
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
37
|
+
__setModuleDefault(result, mod);
|
38
|
+
return result;
|
39
|
+
};
|
40
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
41
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
42
|
+
};
|
43
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
44
|
+
exports.CustomHeaderToggleBox = void 0;
|
45
|
+
var React = __importStar(require("react"));
|
46
|
+
var classnames_1 = __importDefault(require("classnames"));
|
47
|
+
var CustomHeaderToggleBox = /** @class */ (function (_super) {
|
48
|
+
__extends(CustomHeaderToggleBox, _super);
|
49
|
+
function CustomHeaderToggleBox(props) {
|
50
|
+
var _this = this;
|
51
|
+
var _a;
|
52
|
+
_this = _super.call(this, props) || this;
|
53
|
+
_this.toggle = function () {
|
54
|
+
_this.setState({ isOpen: !_this.state.isOpen }, function () {
|
55
|
+
var _a, _b;
|
56
|
+
(_b = (_a = _this.props).onToggle) === null || _b === void 0 ? void 0 : _b.call(_a, _this.state.isOpen);
|
57
|
+
});
|
58
|
+
};
|
59
|
+
_this.state = {
|
60
|
+
isOpen: (_a = _this.props.initiallyOpen) !== null && _a !== void 0 ? _a : false,
|
61
|
+
};
|
62
|
+
return _this;
|
63
|
+
}
|
64
|
+
CustomHeaderToggleBox.prototype.render = function () {
|
65
|
+
var classes = (0, classnames_1.default)('sd-shadow--z1 new-collapse-box', {
|
66
|
+
'new-collapse-box--open': this.state.isOpen,
|
67
|
+
});
|
68
|
+
return (React.createElement("div", { className: classes, "data-test-id": 'toggle-box' },
|
69
|
+
React.createElement("div", { className: 'new-collapse-box__header' },
|
70
|
+
React.createElement("div", { className: 'new-collapse-box__header-inner' }, this.props.header),
|
71
|
+
React.createElement("button", { className: 'new-collapse-box__divider', onClick: this.toggle },
|
72
|
+
React.createElement("span", { className: 'label label--translucent new-collapse-box__divider-label' }, this.props.toggleButtonLabel))),
|
73
|
+
React.createElement("div", { className: 'new-collapse-box__content' },
|
74
|
+
React.createElement("div", { className: 'new-collapse-box__content-inner p-2 pt-0-5' }, this.props.children))));
|
75
|
+
};
|
76
|
+
return CustomHeaderToggleBox;
|
77
|
+
}(React.PureComponent));
|
78
|
+
exports.CustomHeaderToggleBox = CustomHeaderToggleBox;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import { IPropsSimple } from "../ToggleBox/index";
|
3
|
+
interface IState {
|
4
|
+
isOpen: boolean;
|
5
|
+
}
|
6
|
+
/**
|
7
|
+
* @ngdoc react
|
8
|
+
* @name ToggleBox
|
9
|
+
* @description ToggleBox used to open/close a set of details
|
10
|
+
*/
|
11
|
+
export declare class SimpleToggleBox extends React.PureComponent<IPropsSimple, IState> {
|
12
|
+
htmlId: string;
|
13
|
+
constructor(props: IPropsSimple);
|
14
|
+
handleKeyDown: (event: React.KeyboardEvent<HTMLAnchorElement>) => void;
|
15
|
+
toggle: () => void;
|
16
|
+
render(): JSX.Element;
|
17
|
+
}
|
18
|
+
export {};
|
@@ -41,7 +41,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
41
41
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
42
42
|
};
|
43
43
|
Object.defineProperty(exports, "__esModule", { value: true });
|
44
|
-
exports.
|
44
|
+
exports.SimpleToggleBox = void 0;
|
45
45
|
var React = __importStar(require("react"));
|
46
46
|
var classnames_1 = __importDefault(require("classnames"));
|
47
47
|
var react_id_generator_1 = __importDefault(require("react-id-generator"));
|
@@ -50,9 +50,9 @@ var react_id_generator_1 = __importDefault(require("react-id-generator"));
|
|
50
50
|
* @name ToggleBox
|
51
51
|
* @description ToggleBox used to open/close a set of details
|
52
52
|
*/
|
53
|
-
var
|
54
|
-
__extends(
|
55
|
-
function
|
53
|
+
var SimpleToggleBox = /** @class */ (function (_super) {
|
54
|
+
__extends(SimpleToggleBox, _super);
|
55
|
+
function SimpleToggleBox(props) {
|
56
56
|
var _this = this;
|
57
57
|
var _a;
|
58
58
|
_this = _super.call(this, props) || this;
|
@@ -83,7 +83,7 @@ var ToggleBox = /** @class */ (function (_super) {
|
|
83
83
|
};
|
84
84
|
return _this;
|
85
85
|
}
|
86
|
-
|
86
|
+
SimpleToggleBox.prototype.render = function () {
|
87
87
|
var _a;
|
88
88
|
var classes = (0, classnames_1.default)('toggle-box', (_a = {
|
89
89
|
'toggle-box--margin-normal': this.props.margin === undefined
|
@@ -104,6 +104,6 @@ var ToggleBox = /** @class */ (function (_super) {
|
|
104
104
|
isOpen && !hideUsingCSS && (React.createElement("div", { className: "toggle-box__content", "aria-describedby": "togglebox-".concat(this.htmlId) }, children)),
|
105
105
|
hideUsingCSS && (React.createElement("div", { className: (0, classnames_1.default)('toggle-box__content', { 'toggle-box__content--hidden': !isOpen }), "aria-describedby": "togglebox-".concat(this.htmlId) }, children)))));
|
106
106
|
};
|
107
|
-
return
|
107
|
+
return SimpleToggleBox;
|
108
108
|
}(React.PureComponent));
|
109
|
-
exports.
|
109
|
+
exports.SimpleToggleBox = SimpleToggleBox;
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
export interface IPropsSimple {
|
3
|
+
variant: 'simple';
|
4
|
+
title: string;
|
5
|
+
badge?: JSX.Element;
|
6
|
+
children: React.ReactNode;
|
7
|
+
hideUsingCSS?: boolean;
|
8
|
+
initiallyOpen?: boolean;
|
9
|
+
className?: string;
|
10
|
+
margin?: 'none' | 'small' | 'normal' | 'large';
|
11
|
+
onOpen?(): void;
|
12
|
+
onClose?(): void;
|
13
|
+
}
|
14
|
+
export interface IPropsCustomHeader {
|
15
|
+
variant: 'custom-header';
|
16
|
+
header: React.ReactNode;
|
17
|
+
children: React.ReactNode;
|
18
|
+
toggleButtonLabel: string;
|
19
|
+
initiallyOpen?: boolean;
|
20
|
+
onToggle?(isOpen: boolean): void;
|
21
|
+
}
|
22
|
+
type IProps = IPropsSimple | IPropsCustomHeader;
|
23
|
+
export declare class ToggleBox extends React.PureComponent<IProps> {
|
24
|
+
render(): JSX.Element;
|
25
|
+
}
|
26
|
+
export {};
|
@@ -0,0 +1,71 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
3
|
+
var extendStatics = function (d, b) {
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
7
|
+
return extendStatics(d, b);
|
8
|
+
};
|
9
|
+
return function (d, b) {
|
10
|
+
if (typeof b !== "function" && b !== null)
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
12
|
+
extendStatics(d, b);
|
13
|
+
function __() { this.constructor = d; }
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
15
|
+
};
|
16
|
+
})();
|
17
|
+
var __assign = (this && this.__assign) || function () {
|
18
|
+
__assign = Object.assign || function(t) {
|
19
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
20
|
+
s = arguments[i];
|
21
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
22
|
+
t[p] = s[p];
|
23
|
+
}
|
24
|
+
return t;
|
25
|
+
};
|
26
|
+
return __assign.apply(this, arguments);
|
27
|
+
};
|
28
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
29
|
+
if (k2 === undefined) k2 = k;
|
30
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
31
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
32
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
33
|
+
}
|
34
|
+
Object.defineProperty(o, k2, desc);
|
35
|
+
}) : (function(o, m, k, k2) {
|
36
|
+
if (k2 === undefined) k2 = k;
|
37
|
+
o[k2] = m[k];
|
38
|
+
}));
|
39
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
40
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
41
|
+
}) : function(o, v) {
|
42
|
+
o["default"] = v;
|
43
|
+
});
|
44
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
45
|
+
if (mod && mod.__esModule) return mod;
|
46
|
+
var result = {};
|
47
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
48
|
+
__setModuleDefault(result, mod);
|
49
|
+
return result;
|
50
|
+
};
|
51
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
52
|
+
exports.ToggleBox = void 0;
|
53
|
+
var React = __importStar(require("react"));
|
54
|
+
var SimpleToggleBox_1 = require("./SimpleToggleBox");
|
55
|
+
var CustomHeaderToggleBox_1 = require("./CustomHeaderToggleBox");
|
56
|
+
var ToggleBox = /** @class */ (function (_super) {
|
57
|
+
__extends(ToggleBox, _super);
|
58
|
+
function ToggleBox() {
|
59
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
60
|
+
}
|
61
|
+
ToggleBox.prototype.render = function () {
|
62
|
+
if (this.props.variant === "simple") {
|
63
|
+
return (React.createElement(SimpleToggleBox_1.SimpleToggleBox, __assign({}, this.props)));
|
64
|
+
}
|
65
|
+
else {
|
66
|
+
return (React.createElement(CustomHeaderToggleBox_1.CustomHeaderToggleBox, __assign({}, this.props)));
|
67
|
+
}
|
68
|
+
};
|
69
|
+
return ToggleBox;
|
70
|
+
}(React.PureComponent));
|
71
|
+
exports.ToggleBox = ToggleBox;
|
@@ -63,7 +63,7 @@ function nodeCanBeSelected(item) {
|
|
63
63
|
}
|
64
64
|
function onSelect(item) {
|
65
65
|
if (nodeCanBeSelected(item)) {
|
66
|
-
return item.onSelect;
|
66
|
+
return item.onSelect();
|
67
67
|
}
|
68
68
|
return undefined;
|
69
69
|
}
|
@@ -325,7 +325,9 @@ var TreeMenu = /** @class */ (function (_super) {
|
|
325
325
|
: this.props.getLabel(this.state.buttonValue.value)))),
|
326
326
|
this.state.searchFieldValue === '' ?
|
327
327
|
this.props.getOptions ?
|
328
|
-
React.createElement("ul", { ref: this.ref, className: "suggestion-list suggestion-list--multi-select" }, this.state.options.map(function (option, i) { return (React.createElement(TreeSelectItem_1.TreeSelectItem, { key: i, option: option, handleTree: _this.handleTree, onClick:
|
328
|
+
React.createElement("ul", { ref: this.ref, className: "suggestion-list suggestion-list--multi-select" }, this.state.options.map(function (option, i) { return (React.createElement(TreeSelectItem_1.TreeSelectItem, { key: i, option: option, handleTree: _this.handleTree, onClick: function () {
|
329
|
+
onSelect(option);
|
330
|
+
}, disabledItem: disabledItem(option), getBorderColor: _this.props.getBorderColor, getBackgroundColor: _this.props.getBackgroundColor, getId: _this.props.getId, optionTemplate: _this.props.optionTemplate, getLabel: _this.props.getLabel, onKeyDown: function () { return _this.setState({
|
329
331
|
buttonTarget: __spreadArray(__spreadArray([], _this.state.buttonTarget, true), [
|
330
332
|
_this.props.getId(option.value),
|
331
333
|
], false),
|
package/react/index.d.ts
CHANGED
@@ -63,7 +63,7 @@ export { GridList } from './components/GridList';
|
|
63
63
|
export { GridItem, GridItemContent, GridItemMedia, GridItemFooter, GridItemContentBlock, GridItemTime, GridItemTitle, GridItemText, GridItemSlug, GridItemFooterBlock, GridItemFooterActions, GridItemTopActions, GridItemCheckWrapper } from './components/GridItem';
|
64
64
|
export { toasted } from './components/Toast';
|
65
65
|
export { Menu } from './components/Menu';
|
66
|
-
export { ToggleBox } from './components/
|
66
|
+
export { ToggleBox } from './components/ToggleBox/index';
|
67
67
|
export { SelectGrid } from './components/SelectGrid';
|
68
68
|
export { IconPicker } from './components/IconPicker';
|
69
69
|
export { ThemeSelector } from './components/ThemeSelector';
|
package/react/index.js
CHANGED
@@ -166,8 +166,8 @@ var Toast_1 = require("./components/Toast");
|
|
166
166
|
Object.defineProperty(exports, "toasted", { enumerable: true, get: function () { return Toast_1.toasted; } });
|
167
167
|
var Menu_1 = require("./components/Menu");
|
168
168
|
Object.defineProperty(exports, "Menu", { enumerable: true, get: function () { return Menu_1.Menu; } });
|
169
|
-
var
|
170
|
-
Object.defineProperty(exports, "ToggleBox", { enumerable: true, get: function () { return
|
169
|
+
var index_1 = require("./components/ToggleBox/index");
|
170
|
+
Object.defineProperty(exports, "ToggleBox", { enumerable: true, get: function () { return index_1.ToggleBox; } });
|
171
171
|
var SelectGrid_1 = require("./components/SelectGrid");
|
172
172
|
Object.defineProperty(exports, "SelectGrid", { enumerable: true, get: function () { return SelectGrid_1.SelectGrid; } });
|
173
173
|
var IconPicker_1 = require("./components/IconPicker");
|
@@ -1,28 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
interface IProps {
|
3
|
-
title: string;
|
4
|
-
badge?: JSX.Element;
|
5
|
-
children: any;
|
6
|
-
hideUsingCSS?: boolean;
|
7
|
-
initiallyOpen?: boolean;
|
8
|
-
className?: string;
|
9
|
-
margin?: 'none' | 'small' | 'normal' | 'large';
|
10
|
-
onOpen?(): void;
|
11
|
-
onClose?(): void;
|
12
|
-
}
|
13
|
-
interface IState {
|
14
|
-
isOpen: boolean;
|
15
|
-
}
|
16
|
-
/**
|
17
|
-
* @ngdoc react
|
18
|
-
* @name ToggleBox
|
19
|
-
* @description ToggleBox used to open/close a set of details
|
20
|
-
*/
|
21
|
-
export declare class ToggleBox extends React.PureComponent<IProps, IState> {
|
22
|
-
htmlId: string;
|
23
|
-
constructor(props: IProps);
|
24
|
-
handleKeyDown: (event: React.KeyboardEvent<HTMLAnchorElement>) => void;
|
25
|
-
toggle: () => void;
|
26
|
-
render(): JSX.Element;
|
27
|
-
}
|
28
|
-
export {};
|