superdesk-ui-framework 3.1.9 → 3.1.13

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.
Files changed (113) hide show
  1. package/app/styles/_helpers.scss +926 -776
  2. package/app/styles/_master-desk.scss +2 -2
  3. package/app/styles/_toggle-box.scss +45 -28
  4. package/app/styles/components/_sd-collapse-box.scss +113 -0
  5. package/app/styles/components/_subnav.scss +0 -1
  6. package/app/styles/design-tokens/_design-tokens-general.scss +19 -5
  7. package/app/styles/design-tokens/_new-colors.scss +11 -1
  8. package/app/styles/form-elements/_inputs.scss +14 -0
  9. package/app/styles/grids/_grid-layout.scss +3 -0
  10. package/app-typescript/components/DatePicker.tsx +6 -0
  11. package/app-typescript/components/Layouts/LayoutContainer.tsx +7 -1
  12. package/app-typescript/components/Layouts/PageLayout.tsx +2 -1
  13. package/app-typescript/components/TimePickerV2.tsx +222 -0
  14. package/app-typescript/components/ToggleBox/CustomHeaderToggleBox.tsx +61 -0
  15. package/app-typescript/components/{Togglebox.tsx → ToggleBox/SimpleToggleBox.tsx} +13 -34
  16. package/app-typescript/components/ToggleBox/index.tsx +43 -0
  17. package/app-typescript/components/TreeMenu.tsx +12 -7
  18. package/app-typescript/components/TreeSelect/TreeSelect.tsx +13 -12
  19. package/app-typescript/components/TreeSelect/TreeSelectItem.tsx +11 -1
  20. package/app-typescript/index.ts +2 -1
  21. package/dist/components/Alerts.tsx +1 -1
  22. package/dist/components/ContentDivider.tsx +1 -1
  23. package/dist/components/DragHandleDocs.tsx +2 -2
  24. package/dist/components/Index.tsx +105 -50
  25. package/dist/components/Panel.tsx +13 -13
  26. package/dist/components/Tags.tsx +2 -2
  27. package/dist/components/TimePicker.tsx +43 -1
  28. package/dist/components/Togglebox.tsx +171 -17
  29. package/dist/components/TreeMenu.tsx +2 -0
  30. package/dist/components/utilities/BorderRadiusUtilities.tsx +56 -0
  31. package/dist/components/utilities/BorderUtilities.tsx +170 -0
  32. package/dist/components/utilities/DisplayUtilities.tsx +116 -0
  33. package/dist/components/utilities/FlexAndGridUtilities.tsx +551 -0
  34. package/dist/components/utilities/ObjectFitUtilities.tsx +53 -0
  35. package/dist/components/utilities/ObjectPositionUtilities.tsx +68 -0
  36. package/dist/components/utilities/OpacityUtilities.tsx +64 -0
  37. package/dist/components/utilities/OverflowUtilities.tsx +93 -0
  38. package/dist/components/utilities/PositionUtilities.tsx +52 -0
  39. package/dist/components/utilities/ShadowUtilities.tsx +123 -0
  40. package/dist/components/utilities/SpacingUtilities.tsx +2 -2
  41. package/dist/components/utilities/TextUtilities.tsx +83 -4
  42. package/dist/components.html +2 -4
  43. package/dist/components_deprecated/modals.html +2 -2
  44. package/dist/components_deprecated.html +1 -0
  45. package/dist/design-patterns/Index.tsx +1 -42
  46. package/dist/design-patterns/ThreePaneLayoutPattern.tsx +1 -1
  47. package/dist/design-patterns.html +2 -4
  48. package/dist/design.html +1 -0
  49. package/dist/examples.bundle.css +15 -7
  50. package/dist/examples.bundle.js +4283 -2189
  51. package/dist/main.html +1 -0
  52. package/dist/playgrounds/react-playgrounds/Rundowns.tsx +1 -1
  53. package/dist/playgrounds/react-playgrounds/TestGround.tsx +214 -2
  54. package/dist/playgrounds.html +1 -0
  55. package/dist/superdesk-ui.bundle.css +1397 -1019
  56. package/dist/superdesk-ui.bundle.js +2039 -1653
  57. package/dist/vendor.bundle.js +16 -16
  58. package/examples/css/docs-page.css +15 -7
  59. package/examples/js/doc.js +13 -1
  60. package/examples/pages/components/Alerts.tsx +1 -1
  61. package/examples/pages/components/ContentDivider.tsx +1 -1
  62. package/examples/pages/components/DragHandleDocs.tsx +2 -2
  63. package/examples/pages/components/Index.tsx +105 -50
  64. package/examples/pages/components/Panel.tsx +13 -13
  65. package/examples/pages/components/Tags.tsx +2 -2
  66. package/examples/pages/components/TimePicker.tsx +43 -1
  67. package/examples/pages/components/Togglebox.tsx +171 -17
  68. package/examples/pages/components/TreeMenu.tsx +2 -0
  69. package/examples/pages/components/utilities/BorderRadiusUtilities.tsx +56 -0
  70. package/examples/pages/components/utilities/BorderUtilities.tsx +170 -0
  71. package/examples/pages/components/utilities/DisplayUtilities.tsx +116 -0
  72. package/examples/pages/components/utilities/FlexAndGridUtilities.tsx +551 -0
  73. package/examples/pages/components/utilities/ObjectFitUtilities.tsx +53 -0
  74. package/examples/pages/components/utilities/ObjectPositionUtilities.tsx +68 -0
  75. package/examples/pages/components/utilities/OpacityUtilities.tsx +64 -0
  76. package/examples/pages/components/utilities/OverflowUtilities.tsx +93 -0
  77. package/examples/pages/components/utilities/PositionUtilities.tsx +52 -0
  78. package/examples/pages/components/utilities/ShadowUtilities.tsx +123 -0
  79. package/examples/pages/components/utilities/SpacingUtilities.tsx +2 -2
  80. package/examples/pages/components/utilities/TextUtilities.tsx +83 -4
  81. package/examples/pages/components.html +2 -4
  82. package/examples/pages/components_deprecated/modals.html +2 -2
  83. package/examples/pages/components_deprecated.html +1 -0
  84. package/examples/pages/design-patterns/Index.tsx +1 -42
  85. package/examples/pages/design-patterns/ThreePaneLayoutPattern.tsx +1 -1
  86. package/examples/pages/design-patterns.html +2 -4
  87. package/examples/pages/design.html +1 -0
  88. package/examples/pages/main.html +1 -0
  89. package/examples/pages/playgrounds/react-playgrounds/Rundowns.tsx +1 -1
  90. package/examples/pages/playgrounds/react-playgrounds/TestGround.tsx +214 -2
  91. package/examples/pages/playgrounds.html +1 -0
  92. package/package.json +1 -1
  93. package/react/components/DatePicker.d.ts +3 -0
  94. package/react/components/DatePicker.js +2 -2
  95. package/react/components/Layouts/LayoutContainer.d.ts +1 -0
  96. package/react/components/Layouts/LayoutContainer.js +8 -1
  97. package/react/components/Layouts/PageLayout.d.ts +1 -0
  98. package/react/components/Layouts/PageLayout.js +1 -1
  99. package/react/components/TimePickerV2.d.ts +28 -0
  100. package/react/components/TimePickerV2.js +189 -0
  101. package/react/components/ToggleBox/CustomHeaderToggleBox.d.ts +12 -0
  102. package/react/components/ToggleBox/CustomHeaderToggleBox.js +81 -0
  103. package/react/components/ToggleBox/SimpleToggleBox.d.ts +18 -0
  104. package/react/components/{Togglebox.js → ToggleBox/SimpleToggleBox.js} +15 -13
  105. package/react/components/ToggleBox/index.d.ts +27 -0
  106. package/react/components/ToggleBox/index.js +71 -0
  107. package/react/components/TreeMenu.js +9 -7
  108. package/react/components/TreeSelect/TreeSelect.js +9 -11
  109. package/react/components/TreeSelect/TreeSelectItem.d.ts +1 -0
  110. package/react/components/TreeSelect/TreeSelectItem.js +7 -4
  111. package/react/index.d.ts +2 -1
  112. package/react/index.js +7 -5
  113. package/react/components/Togglebox.d.ts +0 -28
@@ -8,9 +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"><a class="docs-page__header-nav-link" href="#/playgrounds">Playground</a></li>
10
10
  </ul>
11
- <button class="docs-page__header-button" aria-label="Change theme" aria-haspopup="menu" aria-expanded="false">
12
- <i role="presentation" class="icon-adjust"></i>
13
- </button>
11
+ <doc-theme-picker></doc-theme-picker>
14
12
  </header>
15
13
 
16
- <doc-design-patterns class="sd-wrap-helper"></doc-react>
14
+ <doc-design-patterns class="d-contents"></doc-react>
@@ -8,6 +8,7 @@
8
8
  <li class="docs-page__header-nav-item docs-page__header-nav-item--active"><a class="docs-page__header-nav-link" href="#/design">Design guidelines</a></li>
9
9
  <li class="docs-page__header-nav-item"><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
 
13
14
  <aside class="docs-page__sidebar">
@@ -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"><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
 
13
14
  <main class="docs-page__content">
@@ -728,7 +728,7 @@ export class Rundowns extends React.Component<IProps, IState> {
728
728
  contentBg='medium'
729
729
  size='medium' onHide={() => {this.setState({modalNewShowSuccess: false})}}
730
730
  >
731
- <Container direction='column' className='sd-flex--justify-center sd-flex--items-center sd-padding-y--2' gap='medium'>
731
+ <Container direction='column' className='justify-center items-center py-2' gap='medium'>
732
732
  <Icon name='checkmark-circle' type='success' size='big' scale='3x' />
733
733
  <Text align='center' size='medium'>
734
734
  The show <strong>Marker</strong> has been successfully created.<br />
@@ -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 sd-display--flex ms-2 gap-0-5'>
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "superdesk-ui-framework",
3
- "version": "3.1.9",
3
+ "version": "3.1.13",
4
4
  "license": "AGPL-3.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -13,6 +13,9 @@ interface IDatePickerBase extends IInputWrapper {
13
13
  interface IDatePicker extends IDatePickerBase {
14
14
  value: Date | null;
15
15
  onChange(valueNext: Date | null): void;
16
+ maxDate?: Date;
17
+ minDate?: Date;
18
+ showButtonBar?: boolean;
16
19
  'data-test-id'?: string;
17
20
  }
18
21
  interface IState {
@@ -137,7 +137,7 @@ var DatePicker = /** @class */ (function (_super) {
137
137
  React.createElement("span", null, (0, moment_1.default)(this.state.value).format(this.props.dateFormat))));
138
138
  }
139
139
  return (React.createElement(Form_1.InputWrapper, { label: this.props.label, error: this.props.error, invalid: this.props.error != null, required: this.props.required, disabled: this.props.disabled, info: this.props.info, inlineLabel: this.props.inlineLabel, labelHidden: this.props.labelHidden, htmlId: this.htmlId, tabindex: this.props.tabindex },
140
- React.createElement(calendar_1.Calendar, { inputId: this.htmlId, ariaLabelledBy: this.htmlId + 'label', ref: function (ref) {
140
+ React.createElement(calendar_1.Calendar, { showButtonBar: this.props.showButtonBar, inputId: this.htmlId, ariaLabelledBy: this.htmlId + 'label', ref: function (ref) {
141
141
  _this.instance = ref;
142
142
  var refAny = ref;
143
143
  if (_this.props['data-test-id'] != null && (refAny === null || refAny === void 0 ? void 0 : refAny.inputElement) != null) {
@@ -162,7 +162,7 @@ var DatePicker = /** @class */ (function (_super) {
162
162
  _this.instance.hideOverlay();
163
163
  }
164
164
  } }, label));
165
- }))); }, appendTo: document.body, disabled: this.props.disabled, onBlur: function (event) {
165
+ }))); }, appendTo: document.body, disabled: this.props.disabled, minDate: this.props.minDate, maxDate: this.props.maxDate, onBlur: function (event) {
166
166
  // @ts-ignore: Object is possibly 'null'.
167
167
  if (!(event === null || event === void 0 ? void 0 : event.target.value)) {
168
168
  // @ts-ignore: Object is possibly 'null'.
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  interface IProps {
3
3
  children?: React.ReactNode;
4
+ fullHeight?: boolean;
4
5
  }
5
6
  export declare class LayoutContainer extends React.PureComponent<IProps> {
6
7
  render(): JSX.Element;
@@ -37,16 +37,23 @@ var __importStar = (this && this.__importStar) || function (mod) {
37
37
  __setModuleDefault(result, mod);
38
38
  return result;
39
39
  };
40
+ var __importDefault = (this && this.__importDefault) || function (mod) {
41
+ return (mod && mod.__esModule) ? mod : { "default": mod };
42
+ };
40
43
  Object.defineProperty(exports, "__esModule", { value: true });
41
44
  exports.LayoutContainer = void 0;
42
45
  var React = __importStar(require("react"));
46
+ var classnames_1 = __importDefault(require("classnames"));
43
47
  var LayoutContainer = /** @class */ (function (_super) {
44
48
  __extends(LayoutContainer, _super);
45
49
  function LayoutContainer() {
46
50
  return _super !== null && _super.apply(this, arguments) || this;
47
51
  }
48
52
  LayoutContainer.prototype.render = function () {
49
- return (React.createElement("div", { className: 'sd-content-wrapper__main-content-area sd-main-content-grid comfort' }, this.props.children));
53
+ var classes = (0, classnames_1.default)('sd-content-wrapper__main-content-area sd-main-content-grid comfort', {
54
+ 'sd-main-content-grid--full-height': this.props.fullHeight,
55
+ });
56
+ return (React.createElement("div", { className: classes }, this.props.children));
50
57
  };
51
58
  return LayoutContainer;
52
59
  }(React.PureComponent));
@@ -9,6 +9,7 @@ interface IProps {
9
9
  rightPanelOpen?: boolean;
10
10
  leftPanel?: React.ReactNode;
11
11
  leftPanelOpen?: boolean;
12
+ fullHeight?: boolean;
12
13
  }
13
14
  export declare class PageLayout extends React.PureComponent<IProps> {
14
15
  render(): JSX.Element;
@@ -59,7 +59,7 @@ var PageLayout = /** @class */ (function (_super) {
59
59
  return _super !== null && _super.apply(this, arguments) || this;
60
60
  }
61
61
  PageLayout.prototype.render = function () {
62
- return (React.createElement(Layouts_1.LayoutContainer, null,
62
+ return (React.createElement(Layouts_1.LayoutContainer, { fullHeight: this.props.fullHeight },
63
63
  this.props.header && (React.createElement(Layouts_1.HeaderPanel, null, this.props.header)),
64
64
  this.props.leftPanel && (React.createElement(Layouts_1.LeftPanel, { open: this.props.leftPanelOpen }, this.props.leftPanel)),
65
65
  this.props.main && (React.createElement(Layouts_1.MainPanel, __assign({ className: this.props.mainClassName }, this.props.mainProps), this.props.main)),
@@ -0,0 +1,28 @@
1
+ import * as React from 'react';
2
+ import { IInputWrapper } from './Form/InputWrapper';
3
+ interface IProps extends IInputWrapper {
4
+ value: string;
5
+ allowSeconds?: boolean;
6
+ disabledOptions: {
7
+ hours?: Array<number>;
8
+ minutes?: Array<number>;
9
+ seconds?: Array<number>;
10
+ };
11
+ 'data-test-id'?: string;
12
+ onChange(valueNext: string): void;
13
+ }
14
+ export declare class TimePickerV2 extends React.PureComponent<IProps> {
15
+ private is12HourFormat;
16
+ constructor(props: IProps);
17
+ /**
18
+ * in case initial time is not valid according to disabled options, we return first valid option
19
+ */
20
+ private getCorrectedTime;
21
+ private getOptionsForTimeUnit;
22
+ private handleTimeChange;
23
+ componentDidMount(): void;
24
+ padValue(value: number): string;
25
+ updatedTimeUnit(): string[];
26
+ render(): JSX.Element;
27
+ }
28
+ export {};
@@ -0,0 +1,189 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
41
+ exports.TimePickerV2 = void 0;
42
+ var React = __importStar(require("react"));
43
+ var Form_1 = require("./Form");
44
+ var lodash_1 = require("lodash");
45
+ var TimePickerV2 = /** @class */ (function (_super) {
46
+ __extends(TimePickerV2, _super);
47
+ function TimePickerV2(props) {
48
+ var _this = _super.call(this, props) || this;
49
+ _this.handleTimeChange = _this.handleTimeChange.bind(_this);
50
+ _this.getCorrectedTime = _this.getCorrectedTime.bind(_this);
51
+ _this.getOptionsForTimeUnit = _this.getOptionsForTimeUnit.bind(_this);
52
+ _this.padValue = _this.padValue.bind(_this);
53
+ var hour = new Date().toLocaleTimeString([], { hour: 'numeric' });
54
+ _this.is12HourFormat = hour.includes('AM') || hour.includes('PM');
55
+ return _this;
56
+ }
57
+ /**
58
+ * in case initial time is not valid according to disabled options, we return first valid option
59
+ */
60
+ TimePickerV2.prototype.getCorrectedTime = function (timeUnit, timeStringArray) {
61
+ var _a;
62
+ var dividedValue = this.props.value.split(':');
63
+ var value = (function () {
64
+ if (timeUnit === 'hours') {
65
+ return dividedValue[0];
66
+ }
67
+ else if (timeUnit === 'minutes') {
68
+ return dividedValue[1];
69
+ }
70
+ return dividedValue[2];
71
+ })();
72
+ if (!((_a = this.props.disabledOptions[timeUnit]) !== null && _a !== void 0 ? _a : []).includes(parseInt(value, 10)) && value != null) {
73
+ return value;
74
+ }
75
+ return timeStringArray[0];
76
+ };
77
+ TimePickerV2.prototype.getOptionsForTimeUnit = function (timeUnit) {
78
+ var _this = this;
79
+ var format12HourArr = (0, lodash_1.range)(1, 13);
80
+ format12HourArr.unshift(format12HourArr.pop());
81
+ var timeUnitArray = (function () {
82
+ if (timeUnit === 'hours') {
83
+ if (_this.is12HourFormat) {
84
+ return format12HourArr;
85
+ }
86
+ else {
87
+ return (0, lodash_1.range)(24);
88
+ }
89
+ }
90
+ else {
91
+ return (0, lodash_1.range)(60);
92
+ }
93
+ })();
94
+ return timeUnitArray
95
+ .filter(function (item) { var _a; return !((_a = _this.props.disabledOptions[timeUnit]) !== null && _a !== void 0 ? _a : []).includes(item); })
96
+ .map(function (value) { return (0, lodash_1.padStart)(value.toString(), 2, '0'); });
97
+ };
98
+ TimePickerV2.prototype.handleTimeChange = function (index, newValue) {
99
+ var current = this.props.value.split(':');
100
+ var updated12HourValue = (function () {
101
+ if (parseInt(current[0], 10) >= 12) {
102
+ if (newValue === '12') {
103
+ return newValue;
104
+ }
105
+ else {
106
+ return (parseInt(newValue, 10) + 12).toString();
107
+ }
108
+ }
109
+ else {
110
+ if (newValue === '12') {
111
+ return '00';
112
+ }
113
+ else {
114
+ return newValue;
115
+ }
116
+ }
117
+ })();
118
+ current[index] = this.is12HourFormat ? updated12HourValue : newValue;
119
+ this.props.onChange(current.join(':'));
120
+ };
121
+ TimePickerV2.prototype.componentDidMount = function () {
122
+ var correctedTime = [
123
+ this.getCorrectedTime('hours', this.getOptionsForTimeUnit('hours')),
124
+ ':',
125
+ this.getCorrectedTime('minutes', this.getOptionsForTimeUnit('minutes')),
126
+ this.props.allowSeconds
127
+ ? ":".concat(this.getCorrectedTime('seconds', this.getOptionsForTimeUnit('seconds')))
128
+ : '',
129
+ ].join('');
130
+ if (this.props.value !== correctedTime) {
131
+ this.props.onChange(correctedTime);
132
+ }
133
+ };
134
+ TimePickerV2.prototype.padValue = function (value) {
135
+ return (0, lodash_1.padStart)((value).toString(), 2, '0');
136
+ };
137
+ TimePickerV2.prototype.updatedTimeUnit = function () {
138
+ var timeUnitValuesArray = this.props.value.split(':');
139
+ /**
140
+ * updating the initial value from props
141
+ */
142
+ if (this.is12HourFormat) {
143
+ if (parseInt(timeUnitValuesArray[0], 10) > 12) {
144
+ timeUnitValuesArray[0] = this.padValue(parseInt(timeUnitValuesArray[0], 10) - 12);
145
+ }
146
+ }
147
+ return timeUnitValuesArray;
148
+ };
149
+ TimePickerV2.prototype.render = function () {
150
+ var _this = this;
151
+ var timeUnitValuesArray = this.updatedTimeUnit();
152
+ return (React.createElement(Form_1.InputWrapper, { label: this.props.label, error: this.props.error, invalid: this.props.error != null, required: this.props.required, disabled: this.props.disabled, info: this.props.info, inlineLabel: this.props.inlineLabel, labelHidden: this.props.labelHidden, tabindex: this.props.tabindex },
153
+ React.createElement("div", { className: 'sd__input__time-picker-v2', "data-test-id": this.props['data-test-id'] },
154
+ React.createElement("div", { className: 'input-wrapper__time-picker-v2' },
155
+ React.createElement("select", { className: 'sd-input__select', value: timeUnitValuesArray[0], onChange: function (_a) {
156
+ var target = _a.target;
157
+ _this.handleTimeChange(0, target.value);
158
+ } }, this.getOptionsForTimeUnit('hours').map(function (hour) { return (React.createElement("option", { value: hour, label: hour, key: hour })); })),
159
+ React.createElement("span", { className: 'time-picker-v2-suffix' }, ":")),
160
+ React.createElement("div", { className: 'input-wrapper__time-picker-v2' },
161
+ React.createElement("select", { className: 'sd-input__select', value: timeUnitValuesArray[1], onChange: function (_a) {
162
+ var target = _a.target;
163
+ _this.handleTimeChange(1, target.value);
164
+ } }, this.getOptionsForTimeUnit('minutes').map(function (minute) { return (React.createElement("option", { value: minute, label: minute, key: minute })); })),
165
+ this.props.allowSeconds && (React.createElement("span", { className: 'time-picker-v2-suffix' }, ":"))),
166
+ this.props.allowSeconds && (React.createElement("div", { className: 'input-wrapper__time-picker-v2' },
167
+ React.createElement("select", { className: 'sd-input__select', value: timeUnitValuesArray[2], onChange: function (_a) {
168
+ var target = _a.target;
169
+ _this.handleTimeChange(2, target.value);
170
+ } }, this.getOptionsForTimeUnit('seconds').map(function (second) { return (React.createElement("option", { value: second, label: second, key: second })); })))),
171
+ this.is12HourFormat && (React.createElement("div", { className: 'input-wrapper__time-picker-v2' },
172
+ React.createElement("span", { className: 'time-picker-v2-suffix' }),
173
+ React.createElement("select", { className: 'sd-input__select', value: (parseInt(this.props.value.split(':')[0], 10) >= 12) ? 'PM' : 'AM', onChange: function (_a) {
174
+ var target = _a.target;
175
+ var splitValue = _this.props.value.split(':');
176
+ if (target.value === 'PM') {
177
+ splitValue[0] = _this.padValue(parseInt(splitValue[0], 10) + 12);
178
+ }
179
+ else {
180
+ splitValue[0] = _this.padValue(parseInt(splitValue[0], 10) - 12);
181
+ }
182
+ _this.props.onChange(splitValue.join(':'));
183
+ } },
184
+ React.createElement("option", { value: 'AM', label: 'AM' }),
185
+ React.createElement("option", { value: 'PM', label: 'PM' })))))));
186
+ };
187
+ return TimePickerV2;
188
+ }(React.PureComponent));
189
+ exports.TimePickerV2 = TimePickerV2;
@@ -0,0 +1,12 @@
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
+ htmlId: string;
8
+ constructor(props: IPropsCustomHeader);
9
+ toggle: () => void;
10
+ render(): JSX.Element;
11
+ }
12
+ export {};