superdesk-ui-framework 2.4.20 → 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-typescript/components/Input.tsx +2 -1
- package/app-typescript/components/Tag.tsx +3 -3
- package/dist/components/checkbox.html +1 -1
- package/dist/examples.bundle.js +764 -577
- package/dist/react/Inputs.tsx +1 -0
- package/dist/react/Tags.tsx +9 -7
- package/dist/superdesk-ui.bundle.js +718 -561
- package/dist/vendor.bundle.js +10 -10
- package/examples/pages/components/checkbox.html +1 -1
- package/examples/pages/react/Inputs.tsx +1 -0
- package/examples/pages/react/Tags.tsx +9 -7
- package/package.json +1 -1
- package/react/components/Input.d.ts +1 -0
- package/react/components/Input.js +2 -1
- package/react/components/Tag.d.ts +2 -2
- package/react/components/Tag.js +2 -2
package/app/scripts/check.js
CHANGED
@@ -64,7 +64,7 @@ function sdCheck($parse) {
|
|
64
64
|
value = ngModel.$viewValue === attrs.ngTrueValue;
|
65
65
|
}
|
66
66
|
|
67
|
-
if (attrs.disabled) {
|
67
|
+
if (attrs.disabled || attrs.disabled === '') {
|
68
68
|
checkbox.addClass('sd-checkbox sd-checkbox--disabled');
|
69
69
|
label.addClass('sd-label--disabled');
|
70
70
|
}
|
@@ -4,6 +4,7 @@ import nextId from "react-id-generator";
|
|
4
4
|
|
5
5
|
interface IProps {
|
6
6
|
value?: string;
|
7
|
+
type?: 'text' | 'number' | 'password';
|
7
8
|
label: string;
|
8
9
|
maxLength?: number;
|
9
10
|
info?: string;
|
@@ -72,7 +73,7 @@ export class Input extends React.Component<IProps, IState> {
|
|
72
73
|
</label>
|
73
74
|
|
74
75
|
<input className='sd-input__input'
|
75
|
-
type='text'
|
76
|
+
type={this.props.type ?? 'text'}
|
76
77
|
id={this.htmlId}
|
77
78
|
value={this.state.value}
|
78
79
|
aria-label={this.props.label}
|
@@ -7,10 +7,10 @@ interface IProps {
|
|
7
7
|
shade?: 'light' | 'darker' | 'highlight1' | 'highlight2'; // default light
|
8
8
|
shape?: 'round' | 'square'; // default round
|
9
9
|
readOnly?: boolean;
|
10
|
-
|
10
|
+
onRemove?(): void;
|
11
11
|
}
|
12
12
|
|
13
|
-
export const Tag = ({ text, keyValue, shade, shape, readOnly,
|
13
|
+
export const Tag = ({ text, keyValue, shade, shape, readOnly, onRemove }: IProps) => {
|
14
14
|
let classes = classNames('tag-label', {
|
15
15
|
[`tag-label--${shade}`]: shade && shade !== 'light',
|
16
16
|
'tag-label--square': shape === 'square',
|
@@ -18,7 +18,7 @@ export const Tag = ({ text, keyValue, shade, shape, readOnly, onClick }: IProps)
|
|
18
18
|
return (
|
19
19
|
<span className={classes} key={keyValue}>
|
20
20
|
{text}
|
21
|
-
{!readOnly ? <button className='tag-label__remove' onClick={
|
21
|
+
{!readOnly ? <button className='tag-label__remove' onClick={onRemove}>
|
22
22
|
<i className='icon-close-small'></i>
|
23
23
|
</button> : null}
|
24
24
|
</span>
|
@@ -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
|
|