superdesk-ui-framework 3.0.1-beta.3 → 3.0.1-beta.4
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/_sd-tag-input.scss +201 -296
- package/app/styles/components/_list-item.scss +13 -1
- package/app/styles/components/_sd-photo-preview.scss +1 -1
- package/app/styles/design-tokens/_new-colors.scss +1 -1
- package/app/styles/form-elements/_forms-general.scss +22 -7
- package/app/styles/form-elements/_inputs.scss +131 -54
- package/app-typescript/components/Badge.tsx +3 -2
- package/app-typescript/components/DatePicker.tsx +40 -52
- package/app-typescript/components/DurationInput.tsx +306 -0
- package/app-typescript/components/Form/InputBase.tsx +85 -0
- package/app-typescript/components/Form/InputNew.tsx +105 -0
- package/app-typescript/components/Form/InputWrapper.tsx +79 -0
- package/app-typescript/components/Form/index.tsx +3 -0
- package/app-typescript/components/Input.tsx +28 -45
- package/app-typescript/components/Label.tsx +49 -10
- package/app-typescript/components/Layouts/Layout.tsx +1 -1
- package/app-typescript/components/Lists/ContentList.tsx +4 -4
- package/app-typescript/components/MultiSelect.tsx +37 -50
- package/app-typescript/components/Navigation/BottomNav.tsx +3 -2
- package/app-typescript/components/Select.tsx +23 -41
- package/app-typescript/components/SelectWithTemplate.tsx +32 -7
- package/app-typescript/components/TimePicker.tsx +48 -16
- package/app-typescript/components/TreeSelect.tsx +423 -195
- package/app-typescript/index.ts +3 -1
- package/dist/examples.bundle.js +16398 -15334
- package/dist/playgrounds/react-playgrounds/CoreLayout.tsx +64 -54
- package/dist/playgrounds/react-playgrounds/RundownEditor.tsx +24 -16
- package/dist/playgrounds/react-playgrounds/TestGround.tsx +76 -1
- package/dist/playgrounds/react-playgrounds/components/Layout.tsx +1 -1
- package/dist/react/Badges.tsx +18 -0
- package/dist/react/ContentList.tsx +15 -9
- package/dist/react/DatePicker.tsx +21 -1
- package/dist/react/DurationInput.tsx +104 -0
- package/dist/react/Index.tsx +5 -0
- package/dist/react/Inputs.tsx +153 -2
- package/dist/react/Labels.tsx +51 -1
- package/dist/react/MultiSelect.tsx +4 -1
- package/dist/react/SelectWithTemplate.tsx +6 -1
- package/dist/react/TableList.tsx +22 -44
- package/dist/react/TimePicker.tsx +16 -8
- package/dist/react/TreeSelect.tsx +301 -48
- package/dist/react/tree-select/TreeSelect.tsx +273 -0
- package/dist/react/tree-select/example-1.tsx +71 -0
- package/dist/react/tree-select/example-2.tsx +59 -0
- package/dist/superdesk-ui.bundle.css +411 -370
- package/dist/superdesk-ui.bundle.js +15554 -14493
- package/dist/vendor.bundle.js +27 -27
- package/examples/pages/playgrounds/react-playgrounds/CoreLayout.tsx +64 -54
- package/examples/pages/playgrounds/react-playgrounds/RundownEditor.tsx +24 -16
- package/examples/pages/playgrounds/react-playgrounds/TestGround.tsx +76 -1
- package/examples/pages/playgrounds/react-playgrounds/components/Layout.tsx +1 -1
- package/examples/pages/react/Badges.tsx +18 -0
- package/examples/pages/react/ContentList.tsx +15 -9
- package/examples/pages/react/DatePicker.tsx +21 -1
- package/examples/pages/react/DurationInput.tsx +104 -0
- package/examples/pages/react/Index.tsx +5 -0
- package/examples/pages/react/Inputs.tsx +153 -2
- package/examples/pages/react/Labels.tsx +51 -1
- package/examples/pages/react/MultiSelect.tsx +4 -1
- package/examples/pages/react/SelectWithTemplate.tsx +6 -1
- package/examples/pages/react/TableList.tsx +22 -44
- package/examples/pages/react/TimePicker.tsx +16 -8
- package/examples/pages/react/TreeSelect.tsx +301 -48
- package/examples/pages/react/tree-select/TreeSelect.tsx +273 -0
- package/examples/pages/react/tree-select/example-1.tsx +71 -0
- package/examples/pages/react/tree-select/example-2.tsx +59 -0
- package/package.json +2 -1
- package/react/components/Badge.d.ts +1 -0
- package/react/components/Badge.js +2 -2
- package/react/components/DatePicker.d.ts +1 -0
- package/react/components/DatePicker.js +6 -22
- package/react/components/DurationInput.d.ts +38 -0
- package/react/components/DurationInput.js +271 -0
- package/react/components/Form/InputBase.d.ts +42 -0
- package/react/components/Form/InputBase.js +72 -0
- package/react/components/Form/InputNew.d.ts +45 -0
- package/react/components/Form/InputNew.js +73 -0
- package/react/components/Form/InputWrapper.d.ts +28 -0
- package/react/components/Form/InputWrapper.js +91 -0
- package/react/components/Form/index.d.ts +3 -0
- package/react/components/Form/index.js +7 -1
- package/react/components/Input.js +5 -34
- package/react/components/Label.d.ts +1 -0
- package/react/components/Label.js +18 -2
- package/react/components/Layouts/Layout.js +1 -1
- package/react/components/Lists/ContentList.d.ts +45 -0
- package/react/components/Lists/ContentList.js +85 -0
- package/react/components/Navigation/BottomNav.d.ts +1 -0
- package/react/components/Navigation/BottomNav.js +2 -2
- package/react/components/Select.d.ts +1 -1
- package/react/components/Select.js +4 -26
- package/react/components/SelectWithTemplate.d.ts +11 -1
- package/react/components/SelectWithTemplate.js +19 -10
- package/react/components/TimePicker.d.ts +15 -2
- package/react/components/TimePicker.js +15 -4
- package/react/components/TreeSelect.d.ts +75 -0
- package/react/components/TreeSelect.js +448 -0
- package/react/index.d.ts +3 -0
- package/react/index.js +8 -3
@@ -81,13 +81,6 @@
|
|
81
81
|
margin-bottom: 1rem;
|
82
82
|
margin-right: 0;
|
83
83
|
}
|
84
|
-
& + div {
|
85
|
-
margin-top: .4rem;
|
86
|
-
|
87
|
-
.label {
|
88
|
-
margin-bottom: .3rem;
|
89
|
-
}
|
90
|
-
}
|
91
84
|
}
|
92
85
|
}
|
93
86
|
.label--active {
|
@@ -260,3 +253,25 @@
|
|
260
253
|
background-color: var(--color-form-bg);
|
261
254
|
color: var(--color-text);
|
262
255
|
}
|
256
|
+
|
257
|
+
|
258
|
+
/// ---------------------------- NEW FORM LAYOUT TEST---------------------------- ///
|
259
|
+
|
260
|
+
|
261
|
+
|
262
|
+
.form__group-new {
|
263
|
+
display: flex;
|
264
|
+
flex-direction: row;
|
265
|
+
width:100%;
|
266
|
+
align-items: flex-start;
|
267
|
+
gap: $sd-base-increment * 2;
|
268
|
+
.sd-input {
|
269
|
+
flex: 1 1 0;
|
270
|
+
min-width: 12rem;
|
271
|
+
margin: 0;
|
272
|
+
}
|
273
|
+
.btn {
|
274
|
+
flex: 0 0 auto;
|
275
|
+
margin-top: $form-label-height;
|
276
|
+
}
|
277
|
+
}
|
@@ -471,12 +471,18 @@
|
|
471
471
|
grid-template-rows: $form-label-height auto auto;
|
472
472
|
grid-gap: 0;
|
473
473
|
position: relative;
|
474
|
+
align-self: stretch;
|
475
|
+
|
474
476
|
|
475
477
|
.sd-input__input {
|
476
478
|
@include Line-input-base;
|
477
479
|
grid-row: 2/3;
|
478
480
|
grid-column: 2/4;
|
479
481
|
}
|
482
|
+
.sd-input__input-container {
|
483
|
+
grid-row: 2/3;
|
484
|
+
grid-column: 2/4;
|
485
|
+
}
|
480
486
|
|
481
487
|
textarea {
|
482
488
|
&.sd-input__input {
|
@@ -687,6 +693,24 @@
|
|
687
693
|
}
|
688
694
|
}
|
689
695
|
}
|
696
|
+
div {
|
697
|
+
&.sd-input__duration-input, &.sd-input__duration-input:hover, &.sd-input__duration-input:focus {
|
698
|
+
opacity: 0.5;
|
699
|
+
//background-color: var(--color-input-bg);
|
700
|
+
//border-bottom: 1px dotted var(--color-input-border);
|
701
|
+
cursor: not-allowed !important;
|
702
|
+
box-shadow: none;
|
703
|
+
}
|
704
|
+
input {
|
705
|
+
&.duration-input, &.duration-input:hover, &.duration-input:focus {
|
706
|
+
opacity: 0.5;
|
707
|
+
//background-color: var(--color-input-bg);
|
708
|
+
//border-bottom: 1px dotted var(--color-input-border);
|
709
|
+
cursor: not-allowed !important;
|
710
|
+
box-shadow: none;
|
711
|
+
}
|
712
|
+
}
|
713
|
+
}
|
690
714
|
.sd-input__label, .sd-input__message-box, .sd-input__char-count {
|
691
715
|
opacity: 0.5 !important;
|
692
716
|
pointer-events: none !important;
|
@@ -704,6 +728,54 @@
|
|
704
728
|
flex-grow: 1;
|
705
729
|
width: 100%;
|
706
730
|
}
|
731
|
+
|
732
|
+
&--medium {
|
733
|
+
&.sd-input--boxed-style {
|
734
|
+
.sd-input__input,
|
735
|
+
.sd-input__select {
|
736
|
+
border-radius: var(--b-radius--medium);
|
737
|
+
&:focus {
|
738
|
+
box-shadow: inset 0 0 0 3px var(--sd-colour-interactive--alpha-20);
|
739
|
+
}
|
740
|
+
}
|
741
|
+
}
|
742
|
+
}
|
743
|
+
&--large {
|
744
|
+
.sd-input__input,
|
745
|
+
.sd-input__select {
|
746
|
+
padding: 0 1.6rem;
|
747
|
+
min-height: 4.8rem;
|
748
|
+
font-size: 2.4rem;
|
749
|
+
font-weight: 500;
|
750
|
+
}
|
751
|
+
.sd-input__select {
|
752
|
+
line-height: 2.4rem;
|
753
|
+
option {
|
754
|
+
color: var(--color-text);
|
755
|
+
font-size: 1.4rem !important;
|
756
|
+
line-height: 2rem;
|
757
|
+
background-color: var(--color-dropdown-menu-Bg);
|
758
|
+
}
|
759
|
+
}
|
760
|
+
}
|
761
|
+
&--x-large {
|
762
|
+
.sd-input__input,
|
763
|
+
.sd-input__select {
|
764
|
+
padding: 0 1.6rem;
|
765
|
+
min-height: 5.6rem;
|
766
|
+
font-size: 3.2rem;
|
767
|
+
font-weight: 500;
|
768
|
+
}
|
769
|
+
.sd-input__select {
|
770
|
+
line-height: 3.2rem;
|
771
|
+
option {
|
772
|
+
color: var(--color-text);
|
773
|
+
font-size: 1.4rem !important;
|
774
|
+
line-height: 2rem;
|
775
|
+
background-color: var(--color-dropdown-menu-Bg);
|
776
|
+
}
|
777
|
+
}
|
778
|
+
}
|
707
779
|
&--boxed-style {
|
708
780
|
.sd-input__input,
|
709
781
|
.sd-input__select {
|
@@ -724,18 +796,23 @@
|
|
724
796
|
background-color: transparent;
|
725
797
|
}
|
726
798
|
}
|
799
|
+
|
727
800
|
&.sd-input--disabled {
|
728
|
-
input,
|
729
|
-
|
801
|
+
input,
|
802
|
+
textarea {
|
803
|
+
&.sd-input__input,
|
804
|
+
&.sd-input__input:hover,
|
805
|
+
&.sd-input__input:focus {
|
730
806
|
opacity: 0.5;
|
731
807
|
background-color: transparent;
|
732
808
|
border: 2px solid var(--color-input-border) !important;
|
733
|
-
//cursor: not-allowed !important;
|
734
809
|
box-shadow: none;
|
735
810
|
}
|
736
811
|
}
|
737
812
|
select {
|
738
|
-
&.sd-input__select,
|
813
|
+
&.sd-input__select,
|
814
|
+
&.sd-input__select:hover,
|
815
|
+
&.sd-input__select:focus {
|
739
816
|
opacity: 0.5;
|
740
817
|
background-color: transparent;
|
741
818
|
border: 2px solid var(--color-input-border) !important;
|
@@ -743,8 +820,17 @@
|
|
743
820
|
box-shadow: none;
|
744
821
|
}
|
745
822
|
}
|
746
|
-
.
|
747
|
-
|
823
|
+
.tags-input__add-button {
|
824
|
+
pointer-events: none;
|
825
|
+
}
|
826
|
+
.sd-input__label,
|
827
|
+
.sd-input__message-box,
|
828
|
+
.sd-input__char-count {
|
829
|
+
.sd-input__label,
|
830
|
+
.sd-input__message-box,
|
831
|
+
.sd-input__char-count {
|
832
|
+
opacity: 0.5;
|
833
|
+
}
|
748
834
|
}
|
749
835
|
.sd-input__hint,
|
750
836
|
.sd-input__message,
|
@@ -752,6 +838,7 @@
|
|
752
838
|
pointer-events: none;
|
753
839
|
}
|
754
840
|
}
|
841
|
+
|
755
842
|
&.sd-input--invalid {
|
756
843
|
input, textarea {
|
757
844
|
&.sd-input__input {
|
@@ -774,53 +861,6 @@
|
|
774
861
|
}
|
775
862
|
}
|
776
863
|
}
|
777
|
-
&--medium {
|
778
|
-
&.sd-input--boxed-style {
|
779
|
-
.sd-input__input,
|
780
|
-
.sd-input__select {
|
781
|
-
border-radius: var(--b-radius--medium);
|
782
|
-
&:focus {
|
783
|
-
box-shadow: inset 0 0 0 3px var(--sd-colour-interactive--alpha-20);
|
784
|
-
}
|
785
|
-
}
|
786
|
-
}
|
787
|
-
}
|
788
|
-
&--large {
|
789
|
-
.sd-input__input,
|
790
|
-
.sd-input__select {
|
791
|
-
padding: 0 1.6rem;
|
792
|
-
min-height: 4.8rem;
|
793
|
-
font-size: 2.4rem;
|
794
|
-
font-weight: 500;
|
795
|
-
}
|
796
|
-
.sd-input__select {
|
797
|
-
line-height: 2.4rem;
|
798
|
-
option {
|
799
|
-
color: var(--color-text);
|
800
|
-
font-size: 1.4rem !important;
|
801
|
-
line-height: 2rem;
|
802
|
-
background-color: var(--color-dropdown-menu-Bg);
|
803
|
-
}
|
804
|
-
}
|
805
|
-
}
|
806
|
-
&--x-large {
|
807
|
-
.sd-input__input,
|
808
|
-
.sd-input__select {
|
809
|
-
padding: 0 1.6rem;
|
810
|
-
min-height: 5.6rem;
|
811
|
-
font-size: 3.2rem;
|
812
|
-
font-weight: 500;
|
813
|
-
}
|
814
|
-
.sd-input__select {
|
815
|
-
line-height: 3.2rem;
|
816
|
-
option {
|
817
|
-
color: var(--color-text);
|
818
|
-
font-size: 1.4rem !important;
|
819
|
-
line-height: 2rem;
|
820
|
-
background-color: var(--color-dropdown-menu-Bg);
|
821
|
-
}
|
822
|
-
}
|
823
|
-
}
|
824
864
|
&--boxed-label {
|
825
865
|
grid-template-columns: auto 1fr auto;
|
826
866
|
grid-template-rows: auto auto auto;
|
@@ -850,10 +890,17 @@
|
|
850
890
|
}
|
851
891
|
}
|
852
892
|
}
|
893
|
+
|
853
894
|
}
|
854
895
|
|
855
896
|
///////////////// -------------------- Duration & Time-Date input --------------------- /////////////////
|
856
897
|
|
898
|
+
|
899
|
+
|
900
|
+
|
901
|
+
|
902
|
+
|
903
|
+
|
857
904
|
.sd-input__duration-input,
|
858
905
|
.sd-input__time-date-input {
|
859
906
|
@include Line-input-base;
|
@@ -867,6 +914,7 @@
|
|
867
914
|
background-color: var(--sd-colour-interactive--alpha-20);
|
868
915
|
}
|
869
916
|
}
|
917
|
+
|
870
918
|
.sd-input__duration-input {
|
871
919
|
input {
|
872
920
|
-webkit-appearance: none;
|
@@ -879,6 +927,7 @@
|
|
879
927
|
color: var(--color-text);
|
880
928
|
text-align: end;
|
881
929
|
width: 2.5ch;
|
930
|
+
font-size: 1.4rem;
|
882
931
|
&::-webkit-outer-spin-button,
|
883
932
|
&::-webkit-inner-spin-button {
|
884
933
|
-webkit-appearance: none;
|
@@ -888,6 +937,10 @@
|
|
888
937
|
-moz-appearance: textfield;
|
889
938
|
}
|
890
939
|
}
|
940
|
+
span {
|
941
|
+
display: flex;
|
942
|
+
align-items: center;
|
943
|
+
}
|
891
944
|
.sd-input__suffix {
|
892
945
|
height: 3.2rem;
|
893
946
|
line-height: 3.2rem;
|
@@ -908,5 +961,29 @@
|
|
908
961
|
.tags-input {
|
909
962
|
grid-row: 2/3;
|
910
963
|
grid-column: 2/4;
|
964
|
+
width: 100%;
|
965
|
+
}
|
966
|
+
&.sd-input--disabled,
|
967
|
+
&.sd-input--disabled:hover {
|
968
|
+
.p-multiselect,
|
969
|
+
.p-calendar,
|
970
|
+
.p-multiselect,
|
971
|
+
.p-dropdown,
|
972
|
+
.tags-input {
|
973
|
+
opacity: 0.5;
|
974
|
+
cursor: not-allowed;
|
975
|
+
}
|
976
|
+
.p-calendar {
|
977
|
+
.p-calendar-icon {
|
978
|
+
pointer-events: none;
|
979
|
+
}
|
980
|
+
border-bottom: 1px dotted var(--color-input-border);
|
981
|
+
background-color: var(--color-input-bg);
|
982
|
+
}
|
911
983
|
}
|
912
|
-
}
|
984
|
+
}
|
985
|
+
|
986
|
+
//&--boxed-style
|
987
|
+
|
988
|
+
|
989
|
+
|
@@ -6,6 +6,7 @@ interface IProps {
|
|
6
6
|
color?: string; // https://ui-framework.superdesk.org/#/components/colors
|
7
7
|
shape?: 'round' | 'square'; // defaults to 'round'
|
8
8
|
children?: React.ReactNode;
|
9
|
+
hexColor?: string;
|
9
10
|
'data-test-id'?: string;
|
10
11
|
}
|
11
12
|
|
@@ -21,11 +22,11 @@ export class Badge extends React.PureComponent<IProps> {
|
|
21
22
|
return (
|
22
23
|
<div className='element-with-badge' data-test-id={this.props['data-test-id']}>
|
23
24
|
{this.props.children}
|
24
|
-
<span className={classes} data-test-id="badge-content">{this.props.text}</span>
|
25
|
+
<span className={classes} style={{backgroundColor: this.props.hexColor}} data-test-id="badge-content">{this.props.text}</span>
|
25
26
|
</div>
|
26
27
|
);
|
27
28
|
} else {
|
28
|
-
return <span className={classes} data-test-id={this.props['data-test-id']}>{this.props.text}</span>;
|
29
|
+
return <span className={classes} style={{backgroundColor: this.props.hexColor}} data-test-id={this.props['data-test-id']}>{this.props.text}</span>;
|
29
30
|
}
|
30
31
|
}
|
31
32
|
}
|
@@ -3,8 +3,9 @@ import addDays from 'date-fns/addDays';
|
|
3
3
|
import format from 'date-fns/format';
|
4
4
|
import {Calendar, LocaleSettings, CalendarProps} from '@superdesk/primereact/calendar';
|
5
5
|
import {throttle} from 'lodash';
|
6
|
-
import classNames from 'classnames';
|
6
|
+
// import classNames from 'classnames';
|
7
7
|
import nextId from "react-id-generator";
|
8
|
+
import { InputWrapper } from './Form';
|
8
9
|
|
9
10
|
export type DatePickerLocaleSettings = Omit<LocaleSettings, 'today' | 'clear'>;
|
10
11
|
|
@@ -79,7 +80,6 @@ function parseFromPrimeReactCalendarFormat(value: CalendarProps['value']): IDate
|
|
79
80
|
return null;
|
80
81
|
} else {
|
81
82
|
// at this point value is a free input string that can't be parsed to a Date inside primereact/calendar
|
82
|
-
|
83
83
|
return 'failed-to-parse';
|
84
84
|
}
|
85
85
|
}
|
@@ -91,10 +91,10 @@ function parseToPrimeReactCalendarFormat(value: IDatePicker['value']): CalendarP
|
|
91
91
|
export class DatePicker extends React.PureComponent<IDatePicker, IState> {
|
92
92
|
private instance: IPrivatePrimeReactCalendarApi | undefined;
|
93
93
|
hidePopupOnScroll: () => void;
|
94
|
+
private htmlId = nextId();
|
94
95
|
|
95
96
|
constructor(props: IDatePicker) {
|
96
97
|
super(props);
|
97
|
-
|
98
98
|
this.state = {
|
99
99
|
value: parseToPrimeReactCalendarFormat(this.props.value),
|
100
100
|
valid: true,
|
@@ -137,7 +137,6 @@ export class DatePicker extends React.PureComponent<IDatePicker, IState> {
|
|
137
137
|
|
138
138
|
render() {
|
139
139
|
let locale: LocaleSettings | undefined;
|
140
|
-
|
141
140
|
if (this.props.locale != null) {
|
142
141
|
locale = {
|
143
142
|
...this.props.locale,
|
@@ -145,26 +144,23 @@ export class DatePicker extends React.PureComponent<IDatePicker, IState> {
|
|
145
144
|
clear: 'clear',
|
146
145
|
};
|
147
146
|
}
|
148
|
-
const classes = classNames('sd-input', {
|
149
|
-
'sd-input--inline-label': this.props.inlineLabel,
|
150
|
-
'sd-input--required': this.props.required,
|
151
|
-
'sd-input--disabled': this.props.disabled,
|
152
|
-
'sd-input--full-width': this.props.fullWidth,
|
153
|
-
'sd-input--invalid': this.props.invalid || this.state.invalid,
|
154
|
-
});
|
155
|
-
const labelClasses = classNames('sd-input__label', {
|
156
|
-
'a11y-only': this.props.labelHidden,
|
157
|
-
});
|
158
|
-
|
159
|
-
let htmlId = nextId();
|
160
147
|
|
161
148
|
return (
|
162
|
-
<
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
149
|
+
<InputWrapper
|
150
|
+
label={this.props.label}
|
151
|
+
error={this.props.error}
|
152
|
+
required={this.props.required}
|
153
|
+
disabled={this.props.disabled}
|
154
|
+
invalid={this.state.invalid}
|
155
|
+
info={this.props.info}
|
156
|
+
inlineLabel={this.props.inlineLabel}
|
157
|
+
labelHidden={this.props.labelHidden}
|
158
|
+
fullWidth={this.props.fullWidth}
|
159
|
+
htmlId={this.htmlId}
|
160
|
+
tabindex={this.props.tabindex}>
|
167
161
|
<Calendar
|
162
|
+
inputId={this.htmlId}
|
163
|
+
ariaLabelledBy={this.htmlId + 'label'}
|
168
164
|
ref={(ref) => {
|
169
165
|
this.instance = ref as unknown as IPrivatePrimeReactCalendarApi;
|
170
166
|
}}
|
@@ -214,16 +210,8 @@ export class DatePicker extends React.PureComponent<IDatePicker, IState> {
|
|
214
210
|
// restoring internal state to current props value
|
215
211
|
this.setState({valid: true, value: parseToPrimeReactCalendarFormat(this.props.value)});
|
216
212
|
}
|
217
|
-
}}
|
218
|
-
|
219
|
-
<div className='sd-input__message-box'>
|
220
|
-
{this.props.info && !this.props.invalid && !this.state.invalid ?
|
221
|
-
<div className='sd-input__hint'>{this.props.info}</div> : null}
|
222
|
-
{this.props.invalid || this.state.invalid ?
|
223
|
-
<div className='sd-input__message'>{this.props.error}</div>
|
224
|
-
: null}
|
225
|
-
</div>
|
226
|
-
</div>
|
213
|
+
}} />
|
214
|
+
</InputWrapper>
|
227
215
|
);
|
228
216
|
}
|
229
217
|
}
|
@@ -237,27 +225,27 @@ export class DatePickerISO extends React.PureComponent<IDatePickerISO> {
|
|
237
225
|
render() {
|
238
226
|
return (
|
239
227
|
<DatePicker
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
228
|
+
value={new Date(this.props.value)}
|
229
|
+
onChange={(value) => {
|
230
|
+
if (value === null) {
|
231
|
+
this.props.onChange('');
|
232
|
+
} else {
|
233
|
+
this.props.onChange(format(value, 'yyyy-MM-dd'));
|
234
|
+
}
|
235
|
+
}}
|
236
|
+
disabled={this.props.disabled}
|
237
|
+
shortcuts={this.props.shortcuts}
|
238
|
+
dateFormat={this.props.dateFormat}
|
239
|
+
locale={this.props.locale}
|
240
|
+
inlineLabel={this.props.inlineLabel}
|
241
|
+
required={this.props.required}
|
242
|
+
fullWidth={this.props.fullWidth}
|
243
|
+
invalid={this.props.invalid}
|
244
|
+
labelHidden={this.props.labelHidden}
|
245
|
+
tabindex={this.props.tabindex}
|
246
|
+
label={this.props.label}
|
247
|
+
info={this.props.info}
|
248
|
+
error={this.props.error}
|
261
249
|
/>
|
262
250
|
);
|
263
251
|
}
|