@longline/aqua-ui 1.0.319 → 1.0.321
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/containers/Form/Field.d.ts +2 -2
- package/containers/Form/Field.js +3 -3
- package/containers/Form/elements/Hint.d.ts +0 -8
- package/containers/Form/elements/Hint.js +3 -6
- package/containers/Form/elements/Label.d.ts +7 -2
- package/containers/Form/elements/Label.js +1 -1
- package/controls/ListButton/ListButton.js +1 -1
- package/package.json +1 -1
|
@@ -34,10 +34,10 @@ interface IFieldProps {
|
|
|
34
34
|
*/
|
|
35
35
|
forceupdate?: boolean;
|
|
36
36
|
/**
|
|
37
|
-
* If true,
|
|
37
|
+
* If true, suppress the asterisk for required fields.
|
|
38
38
|
* @default false
|
|
39
39
|
*/
|
|
40
|
-
|
|
40
|
+
noAsterisk?: boolean;
|
|
41
41
|
/**
|
|
42
42
|
* If true, apply ghost state to Field and the control in it.
|
|
43
43
|
* @default false
|
package/containers/Form/Field.js
CHANGED
|
@@ -143,13 +143,13 @@ var Field = function (props) {
|
|
|
143
143
|
};
|
|
144
144
|
var getLabel = function () {
|
|
145
145
|
return props.label &&
|
|
146
|
-
React.createElement(Label, { required: !!props.rules && !!props.rules.required,
|
|
146
|
+
React.createElement(Label, { required: !!props.rules && !!props.rules.required, noAsterisk: props.noAsterisk, ghost: ghost, disabled: props.disabled }, props.label);
|
|
147
147
|
};
|
|
148
148
|
var getHintOrError = function () {
|
|
149
149
|
if (hasError && validation)
|
|
150
|
-
return React.createElement(Hint, {
|
|
150
|
+
return React.createElement(Hint, { error: true }, validation);
|
|
151
151
|
if (props.hint)
|
|
152
|
-
return React.createElement(Hint,
|
|
152
|
+
return React.createElement(Hint, null, props.hint);
|
|
153
153
|
return null;
|
|
154
154
|
};
|
|
155
155
|
var dirty = form ? form.dirty : !pristine;
|
|
@@ -4,14 +4,6 @@ interface IFormHintProps {
|
|
|
4
4
|
className?: string;
|
|
5
5
|
/** @ignore */
|
|
6
6
|
children?: React.ReactNode;
|
|
7
|
-
/**
|
|
8
|
-
* Is the field optional?
|
|
9
|
-
*/
|
|
10
|
-
optional?: boolean;
|
|
11
|
-
/**
|
|
12
|
-
* Is the field ghosted?
|
|
13
|
-
*/
|
|
14
|
-
ghost?: boolean;
|
|
15
7
|
/**
|
|
16
8
|
* Is this an error message?
|
|
17
9
|
*/
|
|
@@ -5,11 +5,8 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import styled from 'styled-components';
|
|
7
7
|
var HintBase = function (props) {
|
|
8
|
-
return React.createElement("div", { tabIndex: -1, className: props.className },
|
|
9
|
-
props.optional && React.createElement(Optional, null, "Optional:"),
|
|
10
|
-
props.children);
|
|
8
|
+
return React.createElement("div", { tabIndex: -1, className: props.className }, props.children);
|
|
11
9
|
};
|
|
12
|
-
var
|
|
13
|
-
var Hint = styled(HintBase)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n font: ", ";\n color: ", ";\n user-select: none;\n // Hints don't wrap and are ellipsized:\n white-space: nowrap;\n overflow-x: hidden;\n text-overflow: ellipsis;\n ", " {\n color: ", ";\n margin-right: 0.25em;\n }\n"], ["\n font: ", ";\n color: ", ";\n user-select: none;\n // Hints don't wrap and are ellipsized:\n white-space: nowrap;\n overflow-x: hidden;\n text-overflow: ellipsis;\n ", " {\n color: ", ";\n margin-right: 0.25em;\n }\n"])), function (p) { return p.theme.font.bodySmall; }, function (p) { return p.error ? p.theme.colors.negative : p.theme.colors.font; }, Optional, function (p) { return p.ghost ? 'inherit' : p.theme.colors.primary[1]; });
|
|
10
|
+
var Hint = styled(HintBase)(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n font: ", ";\n color: ", ";\n user-select: none;\n // Hints don't wrap and are ellipsized:\n white-space: nowrap;\n overflow-x: hidden;\n text-overflow: ellipsis;\n"], ["\n font: ", ";\n color: ", ";\n user-select: none;\n // Hints don't wrap and are ellipsized:\n white-space: nowrap;\n overflow-x: hidden;\n text-overflow: ellipsis;\n"])), function (p) { return p.theme.font.bodySmall; }, function (p) { return p.error ? p.theme.colors.negative : p.theme.colors.font; });
|
|
14
11
|
export { Hint };
|
|
15
|
-
var templateObject_1
|
|
12
|
+
var templateObject_1;
|
|
@@ -14,9 +14,14 @@ interface ILabelProps {
|
|
|
14
14
|
*/
|
|
15
15
|
required?: boolean;
|
|
16
16
|
/**
|
|
17
|
-
* If true,
|
|
17
|
+
* If true, suppress the asterisk for required fields.
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
noAsterisk?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Is the field ghosted?
|
|
18
23
|
*/
|
|
19
|
-
|
|
24
|
+
ghost?: boolean;
|
|
20
25
|
}
|
|
21
26
|
declare const Label: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<ILabelProps, never>> & string & Omit<(props: ILabelProps) => React.JSX.Element, keyof React.Component<any, {}, any>>;
|
|
22
27
|
export { Label };
|
|
@@ -8,7 +8,7 @@ var Required = styled.span(templateObject_1 || (templateObject_1 = __makeTemplat
|
|
|
8
8
|
var LabelBase = function (props) {
|
|
9
9
|
return React.createElement("label", { tabIndex: -1, className: props.className },
|
|
10
10
|
props.children,
|
|
11
|
-
props.required && props.
|
|
11
|
+
props.required && !props.ghost && !props.noAsterisk && !props.disabled && React.createElement(Required, null, "*"));
|
|
12
12
|
};
|
|
13
13
|
var Label = styled(LabelBase)(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n // Position:\n position: relative;\n display: block;\n margin-right: 1em;\n\n // Appearance:\n font: ", ";\n text-transform: uppercase;\n color: ", ";\n\n // Content:\n white-space: nowrap;\n overflow-x: hidden;\n overflow-y: hidden;\n text-overflow: ellipsis;\n"], ["\n // Position:\n position: relative;\n display: block;\n margin-right: 1em;\n\n // Appearance:\n font: ", ";\n text-transform: uppercase;\n color: ", ";\n\n // Content:\n white-space: nowrap;\n overflow-x: hidden;\n overflow-y: hidden;\n text-overflow: ellipsis;\n"])), function (p) { return p.theme.font.labelCaps; }, function (p) { return p.theme.colors.font; });
|
|
14
14
|
export { Label };
|