@steroidsjs/bootstrap 3.0.0-beta.5 → 3.0.0-beta.50
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/README.md +1 -2
- package/content/Accordion/AccordionItemView.d.ts +2 -0
- package/content/{Collapse/CollapseItemView.js → Accordion/AccordionItemView.js} +47 -22
- package/content/Accordion/AccordionItemView.scss +209 -0
- package/content/Accordion/AccordionView.d.ts +2 -0
- package/content/{Collapse/CollapseView.js → Accordion/AccordionView.js} +3 -3
- package/content/{Collapse/CollapseView.scss → Accordion/AccordionView.scss} +3 -4
- package/content/Alert/AlertView.js +3 -2
- package/content/Alert/AlertView.scss +19 -4
- package/content/Avatar/AvatarView.js +2 -3
- package/content/Avatar/AvatarView.scss +32 -39
- package/content/Badge/BadgeView.d.ts +3 -0
- package/content/Badge/BadgeView.js +25 -0
- package/content/Badge/BadgeView.scss +135 -0
- package/content/Calendar/CalendarView.scss +209 -176
- package/content/Calendar/CaptionElement.js +23 -15
- package/content/Calendar/CaptionElement.scss +124 -103
- package/content/Card/CardView.js +36 -14
- package/content/Card/CardView.scss +139 -107
- package/content/Detail/DetailView.scss +75 -52
- package/content/DropDown/DropDownView.d.ts +0 -1
- package/content/DropDown/DropDownView.js +6 -4
- package/content/DropDown/DropDownView.scss +196 -27
- package/content/Icon/IconView.d.ts +1 -2
- package/content/Icon/IconView.js +2 -2
- package/content/Icon/IconView.scss +1 -23
- package/content/Menu/MenuItemView.d.ts +2 -0
- package/content/Menu/MenuItemView.js +15 -0
- package/content/Menu/MenuItemView.scss +63 -0
- package/content/Menu/MenuView.d.ts +2 -0
- package/content/Menu/MenuView.js +30 -0
- package/content/Menu/MenuView.scss +43 -0
- package/form/AutoCompleteField/AutoCompleteFieldView.d.ts +1 -2
- package/form/AutoCompleteField/AutoCompleteFieldView.js +62 -8
- package/form/AutoCompleteField/AutoCompleteFieldView.scss +199 -142
- package/form/Button/ButtonView.d.ts +1 -2
- package/form/Button/ButtonView.js +13 -9
- package/form/Button/ButtonView.scss +168 -68
- package/form/CheckboxField/CheckboxFieldView.d.ts +1 -2
- package/form/CheckboxField/CheckboxFieldView.js +6 -4
- package/form/CheckboxField/CheckboxFieldView.scss +195 -36
- package/form/CheckboxListField/CheckboxListFieldView.d.ts +1 -2
- package/form/CheckboxListField/CheckboxListFieldView.js +18 -15
- package/form/CheckboxListField/CheckboxListFieldView.scss +7 -41
- package/form/DateField/DateFieldView.js +5 -5
- package/form/DateField/DateFieldView.scss +155 -71
- package/form/DateTimeField/DateTimeFieldView.d.ts +1 -2
- package/form/DropDownField/DropDownFieldView.js +31 -47
- package/form/DropDownField/DropDownFieldView.scss +388 -182
- package/form/DropDownField/utils.d.ts +2 -0
- package/form/DropDownField/utils.js +15 -0
- package/form/DropDownFieldItem/DropDownFieldItemView.d.ts +2 -0
- package/form/DropDownFieldItem/DropDownFieldItemView.js +78 -0
- package/form/DropDownFieldItem/DropDownFieldItemView.scss +218 -0
- package/form/FieldLayout/FieldLayoutView.d.ts +1 -2
- package/form/FieldLayout/FieldLayoutView.js +13 -9
- package/form/FieldLayout/FieldLayoutView.scss +119 -19
- package/form/FieldList/FieldListItemView.js +6 -4
- package/form/FieldList/FieldListItemView.scss +17 -39
- package/form/FieldList/FieldListView.js +9 -8
- package/form/FieldList/FieldListView.scss +58 -18
- package/form/FieldSet/FieldSetView.js +4 -2
- package/form/FieldSet/FieldSetView.scss +39 -0
- package/form/FileField/FileFieldItemView.d.ts +1 -2
- package/form/FileField/FileFieldItemView.js +31 -6
- package/form/FileField/FileFieldItemView.scss +254 -13
- package/form/FileField/FileFieldView.d.ts +1 -2
- package/form/FileField/FileFieldView.js +6 -8
- package/form/FileField/FileFieldView.scss +33 -4
- package/form/Form/FormView.js +1 -4
- package/form/Form/FormView.scss +1 -14
- package/form/HtmlField/HtmlFieldView.d.ts +1 -2
- package/form/HtmlField/HtmlFieldView.scss +6 -3
- package/form/ImageField/ImageFieldView.js +1 -1
- package/form/InputField/InputFieldView.d.ts +1 -2
- package/form/InputField/InputFieldView.js +30 -13
- package/form/InputField/InputFieldView.scss +265 -99
- package/form/NumberField/NumberFieldView.d.ts +1 -2
- package/form/NumberField/NumberFieldView.js +19 -13
- package/form/NumberField/NumberFieldView.scss +195 -89
- package/form/PasswordField/PasswordFieldView.d.ts +1 -2
- package/form/PasswordField/PasswordFieldView.js +11 -9
- package/form/PasswordField/PasswordFieldView.scss +231 -63
- package/form/RadioField/RadioFieldView.d.ts +2 -0
- package/form/RadioField/RadioFieldView.js +57 -0
- package/form/RadioField/RadioFieldView.scss +226 -0
- package/form/RadioListField/RadioListFieldView.d.ts +1 -2
- package/form/RadioListField/RadioListFieldView.js +20 -16
- package/form/RadioListField/RadioListFieldView.scss +11 -1
- package/form/ReCaptchaField/ReCaptchaFieldView.d.ts +1 -2
- package/form/ReCaptchaField/ReCaptchaFieldView.js +2 -2
- package/form/SliderField/SliderFieldView.d.ts +1 -2
- package/form/SwitcherField/SwitcherFieldView.d.ts +1 -2
- package/form/SwitcherField/SwitcherFieldView.js +12 -7
- package/form/SwitcherField/SwitcherFieldView.scss +188 -1
- package/form/TextField/TextFieldView.d.ts +1 -2
- package/form/TextField/TextFieldView.js +10 -2
- package/form/TextField/TextFieldView.scss +144 -2
- package/form/TimeField/TimeFieldView.d.ts +1 -2
- package/icons/index.d.ts +2 -0
- package/icons/index.js +103 -0
- package/icons/svgs/add.svg +4 -0
- package/icons/svgs/add_square.svg +5 -0
- package/icons/svgs/arrow_down_18x18.svg +4 -0
- package/icons/svgs/arrow_down_24x24.svg +4 -0
- package/icons/svgs/arrow_drop_down_10x10.svg +3 -0
- package/icons/svgs/arrow_left_18x18.svg +4 -0
- package/icons/svgs/arrow_left_24x24.svg +4 -0
- package/icons/svgs/arrow_right_18x18.svg +4 -0
- package/icons/svgs/arrow_right_24x24.svg +4 -0
- package/icons/svgs/arrow_up_18x18.svg +4 -0
- package/icons/svgs/arrow_up_24x24.svg +4 -0
- package/icons/svgs/blank.svg +4 -0
- package/icons/svgs/calendar_check.svg +5 -0
- package/icons/svgs/calendar_range.svg +8 -0
- package/icons/svgs/cancel_ellips.svg +4 -0
- package/icons/svgs/chart.svg +6 -0
- package/icons/svgs/checkmark_12x12.svg +4 -0
- package/icons/svgs/checkmark_8x8.svg +4 -0
- package/icons/svgs/circle_cross_12x12.svg +4 -0
- package/icons/svgs/circle_cross_16x16.svg +4 -0
- package/icons/svgs/circle_cross_18x18.svg +4 -0
- package/icons/svgs/clip.svg +3 -0
- package/icons/svgs/copy.svg +5 -0
- package/icons/svgs/cross_12x12.svg +4 -0
- package/icons/svgs/cross_4x4.svg +3 -0
- package/icons/svgs/cross_8x8.svg +4 -0
- package/icons/svgs/cut.svg +3 -0
- package/icons/svgs/date_range.svg +8 -0
- package/icons/svgs/default_16x16.svg +4 -0
- package/icons/svgs/default_24x24.svg +11 -0
- package/icons/svgs/double_arrow_down.svg +5 -0
- package/icons/svgs/double_arrow_left.svg +5 -0
- package/icons/svgs/double_arrow_right.svg +5 -0
- package/icons/svgs/double_arrow_up.svg +5 -0
- package/icons/svgs/doughnut_chart.svg +5 -0
- package/icons/svgs/edit.svg +4 -0
- package/icons/svgs/error_16x16.svg +5 -0
- package/icons/svgs/error_24x24.svg +12 -0
- package/icons/svgs/expand_down.svg +3 -0
- package/icons/svgs/expand_left.svg +3 -0
- package/icons/svgs/expand_left_double.svg +4 -0
- package/icons/svgs/expand_right.svg +3 -0
- package/icons/svgs/expand_right_double.svg +4 -0
- package/icons/svgs/expand_up.svg +3 -0
- package/icons/svgs/file_dock.svg +6 -0
- package/icons/svgs/filter.svg +3 -0
- package/icons/svgs/fluid.svg +4 -0
- package/icons/svgs/folder.svg +3 -0
- package/icons/svgs/group.svg +8 -0
- package/icons/svgs/home.svg +4 -0
- package/icons/svgs/img_box.svg +5 -0
- package/icons/svgs/import.svg +4 -0
- package/icons/svgs/info_16x16.svg +5 -0
- package/icons/svgs/info_24x24.svg +12 -0
- package/icons/svgs/left_12x12.svg +3 -0
- package/icons/svgs/loading_default.svg +3 -0
- package/icons/svgs/loading_icon_thick.svg +3 -0
- package/icons/svgs/loading_purple.svg +9 -0
- package/icons/svgs/map.svg +7 -0
- package/icons/svgs/menu_dots.svg +5 -0
- package/icons/svgs/menu_left.svg +5 -0
- package/icons/svgs/minis_sq.svg +4 -0
- package/icons/svgs/paste.svg +8 -0
- package/icons/svgs/pie_chart.svg +5 -0
- package/icons/svgs/pin.svg +4 -0
- package/icons/svgs/sad.svg +6 -0
- package/icons/svgs/search.svg +4 -0
- package/icons/svgs/setting_line.svg +3 -0
- package/icons/svgs/share.svg +7 -0
- package/icons/svgs/star.svg +3 -0
- package/icons/svgs/success_16x16.svg +4 -0
- package/icons/svgs/success_24x24.svg +11 -0
- package/icons/svgs/support.svg +3 -0
- package/icons/svgs/trash.svg +6 -0
- package/icons/svgs/upload.svg +4 -0
- package/icons/svgs/user.svg +4 -0
- package/icons/svgs/view.svg +4 -0
- package/icons/svgs/view_hide.svg +5 -0
- package/icons/svgs/warning_16x16.svg +5 -0
- package/icons/svgs/warning_24x24.svg +12 -0
- package/index.d.ts +20 -2
- package/index.js +22 -4
- package/index.scss +14 -3
- package/layout/Header/HeaderView.scss +3 -3
- package/layout/Loader/LoaderView.d.ts +2 -2
- package/layout/Loader/LoaderView.js +6 -2
- package/layout/Loader/LoaderView.scss +67 -22
- package/layout/Notifications/NotificationsItemView.d.ts +1 -2
- package/layout/Notifications/NotificationsView.d.ts +1 -2
- package/layout/ProgressBar/CircleProgressBarView.d.ts +1 -2
- package/layout/ProgressBar/LineProgressBarView.d.ts +1 -2
- package/layout/Tooltip/TooltipView.d.ts +1 -2
- package/layout/Tooltip/TooltipView.js +6 -6
- package/layout/Tooltip/TooltipView.scss +45 -37
- package/list/CheckboxColumn/CheckboxColumnView.d.ts +1 -2
- package/list/CheckboxColumn/CheckboxColumnView.js +2 -1
- package/list/ControlsColumnView/ControlsColumnView.d.ts +1 -2
- package/list/Grid/GridView.js +8 -4
- package/list/Grid/GridView.scss +148 -37
- package/list/Grid/views/ContentColumnView/ContentColumnView.d.ts +3 -0
- package/list/Grid/views/ContentColumnView/ContentColumnView.js +51 -0
- package/list/Grid/views/ContentColumnView/ContentColumnView.scss +88 -0
- package/list/Grid/views/ContentColumnView/index.d.ts +2 -0
- package/list/Grid/views/ContentColumnView/index.js +7 -0
- package/list/List/ListItemView.d.ts +1 -2
- package/list/List/ListView.js +5 -7
- package/list/List/ListView.scss +32 -1
- package/list/Pagination/PaginationButtonView.js +34 -5
- package/list/Pagination/PaginationButtonView.scss +265 -1
- package/list/Pagination/PaginationMoreView.js +1 -1
- package/list/Pagination/PaginationMoreView.scss +4 -1
- package/modal/Modal/ModalView.d.ts +1 -2
- package/modal/Modal/ModalView.js +4 -7
- package/modal/Modal/ModalView.scss +129 -93
- package/modal/TwoFactorModal/TwoFactorModalView.d.ts +1 -2
- package/nav/Breadcrubms/BreadcrumbsView.js +9 -1
- package/nav/Breadcrubms/BreadcrumbsView.scss +49 -0
- package/nav/Controls/ControlsView.d.ts +1 -2
- package/nav/Controls/ControlsView.scss +9 -3
- package/nav/Nav/NavBarView.d.ts +1 -2
- package/nav/Nav/NavButtonView.d.ts +1 -2
- package/nav/Nav/NavIconView.d.ts +1 -2
- package/nav/Nav/NavIconView.js +1 -1
- package/nav/Nav/NavLinkView.d.ts +1 -2
- package/nav/Nav/NavListView.d.ts +1 -2
- package/nav/Nav/NavListView.js +1 -1
- package/nav/Nav/NavTabsView.d.ts +1 -2
- package/nav/Nav/NavTabsView.js +1 -1
- package/nav/Tree/TreeView.d.ts +1 -2
- package/nav/Tree/TreeView.scss +14 -11
- package/package.json +56 -56
- package/scss/animations/index.scss +1 -0
- package/scss/animations/loading.scss +13 -0
- package/scss/fonts.scss +6 -0
- package/scss/mixins/button.scss +80 -24
- package/scss/mixins/customMixins.scss +5 -0
- package/scss/mixins/index.scss +3 -1
- package/scss/mixins/scroll.scss +31 -0
- package/scss/mixins/typography.scss +26 -0
- package/scss/variables/common/colors.scss +119 -69
- package/scss/variables/common/media.scss +2 -0
- package/scss/variables/common/typography.scss +96 -28
- package/scss/variables/common/variables.scss +1 -0
- package/scss/variables/components/input.scss +7 -6
- package/scss/variables/index.scss +3 -2
- package/scss/variables/normalize.scss +25 -0
- package/typography/Text/TextView.d.ts +3 -0
- package/typography/Text/TextView.js +46 -0
- package/typography/Text/TextView.scss +16 -0
- package/typography/Title/TitleView.d.ts +3 -0
- package/typography/Title/TitleView.js +50 -0
- package/typography/Title/TitleView.scss +16 -0
- package/utils/renderIcon.d.ts +9 -0
- package/utils/renderIcon.js +27 -0
- package/content/Collapse/CollapseItemView.d.ts +0 -2
- package/content/Collapse/CollapseItemView.scss +0 -88
- package/content/Collapse/CollapseView.d.ts +0 -2
- package/icon/fontawesome.d.ts +0 -2
- package/icon/fontawesome.js +0 -254
- package/list/List/ListItemView.scss +0 -3
- package/scss/mixins/card.scss +0 -26
- package/scss/variables/components/card.scss +0 -20
|
@@ -33,28 +33,45 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
33
33
|
__setModuleDefault(result, mod);
|
|
34
34
|
return result;
|
|
35
35
|
};
|
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
36
39
|
exports.__esModule = true;
|
|
37
40
|
var React = __importStar(require("react"));
|
|
38
41
|
var hooks_1 = require("@steroidsjs/core/hooks");
|
|
42
|
+
var Icon_1 = __importDefault(require("@steroidsjs/core/ui/content/Icon"));
|
|
43
|
+
var renderIcon_1 = __importDefault(require("../../utils/renderIcon"));
|
|
39
44
|
function InputFieldView(props) {
|
|
40
45
|
var bem = (0, hooks_1.useBem)('InputFieldView');
|
|
41
46
|
return (React.createElement("div", { className: bem(bem.block({
|
|
42
47
|
disabled: props.inputProps.disabled,
|
|
43
|
-
size: props.size
|
|
44
|
-
|
|
48
|
+
size: props.size,
|
|
49
|
+
hasError: !!props.errors,
|
|
50
|
+
hasLeadIcon: !!props.leadIcon,
|
|
51
|
+
hasClearIcon: props.showClear && !props.disabled,
|
|
52
|
+
filled: !!props.inputProps.value,
|
|
53
|
+
hasAddonAfter: !!props.addonAfter,
|
|
54
|
+
hasAddonBefore: !!props.addonBefore,
|
|
55
|
+
hasAddon: !!props.addonAfter || !!props.addonBefore,
|
|
56
|
+
hasTextAddon: !!props.textAfter || !!props.textBefore,
|
|
57
|
+
hasTextAddonBefore: !!props.textBefore,
|
|
58
|
+
hasTextAddonAfter: !!props.textAfter
|
|
59
|
+
}), props.className), style: props.style },
|
|
45
60
|
props.addonBefore && (React.createElement("span", { className: bem.element('addon-before') }, props.addonBefore)),
|
|
46
61
|
props.textBefore && (React.createElement("span", { className: bem.element('text-before') }, props.textBefore)),
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
62
|
+
React.createElement("div", { className: bem.element('input-wrapper') },
|
|
63
|
+
props.leadIcon && (0, renderIcon_1["default"])(props.leadIcon, {
|
|
64
|
+
className: bem.element('lead-icon'),
|
|
65
|
+
tabIndex: -1
|
|
66
|
+
}),
|
|
67
|
+
props.maskProps
|
|
68
|
+
? (React.createElement("input", __assign({ onBlur: props.onBlur, onFocus: props.onFocus, onMouseDown: props.onMouseDown, className: bem(bem.element('input', {
|
|
69
|
+
size: props.size
|
|
70
|
+
})) }, props.inputProps, { type: props.type, placeholder: props.placeholder, disabled: props.disabled, required: props.required, id: props.id })))
|
|
71
|
+
: (React.createElement("input", __assign({ className: bem(bem.element('input', {
|
|
72
|
+
size: props.size
|
|
73
|
+
})) }, props.inputProps, { onChange: function (e) { return props.input.onChange(e.target.value); }, type: props.type, placeholder: props.placeholder, disabled: props.disabled, required: props.required, id: props.id }))),
|
|
74
|
+
!props.disabled && props.showClear && !props.maskProps && (React.createElement(Icon_1["default"], { name: "cross_8x8", className: bem.element('icon-clear'), tabIndex: -1, onClick: props.onClear }))),
|
|
58
75
|
props.textAfter && (React.createElement("span", { className: bem.element('text-after') }, props.textAfter)),
|
|
59
76
|
props.addonAfter && (React.createElement("span", { className: bem.element('addon-after') }, props.addonAfter))));
|
|
60
77
|
}
|
|
@@ -1,134 +1,300 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--lead-icon-default-color: #e5e9eb;
|
|
3
|
+
--lead-icon-focus-color: #323232;
|
|
4
|
+
--lead-icon-disabled-color: rgba(0, 0, 0, 0.1);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
html[data-theme="dark"] {
|
|
8
|
+
--lead-icon-default-color: #5b5c6b;
|
|
9
|
+
--lead-icon-focus-color: #ffffff;
|
|
10
|
+
--lead-icon-disabled-color: rgba(255, 255, 255, 0.1);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
$lead-icon-default-color: var(--lead-icon-default-color);
|
|
14
|
+
$lead-icon-focus-color: var(--lead-icon-focus-color);
|
|
15
|
+
$lead-icon-disabled-color: var(--lead-icon-disabled-color);
|
|
16
|
+
|
|
1
17
|
.InputFieldView {
|
|
2
|
-
|
|
18
|
+
$root: &;
|
|
3
19
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
border: $input-border;
|
|
9
|
-
border-radius: $input-border-radius;
|
|
20
|
+
position: relative;
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-flow: row nowrap;
|
|
23
|
+
align-items: center;
|
|
10
24
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
25
|
+
height: 34px;
|
|
26
|
+
|
|
27
|
+
font-family: $font-family-nunito;
|
|
28
|
+
font-weight: $font-weight-sm;
|
|
29
|
+
line-height: 24px;
|
|
30
|
+
|
|
31
|
+
&__input-wrapper {
|
|
32
|
+
position: relative;
|
|
33
|
+
width: 100%;
|
|
34
|
+
height: 100%;
|
|
20
35
|
}
|
|
21
|
-
}
|
|
22
36
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
box-shadow: 0 0 0 3px $border-typing, 0 0 0 3px $border-typing;
|
|
27
|
-
}
|
|
37
|
+
&__input {
|
|
38
|
+
color: $text-color;
|
|
39
|
+
font-family: $font-family-nunito;
|
|
28
40
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
box-shadow: 0 0 0 3px $border-typing, 0 0 0 3px $border-typing;
|
|
32
|
-
}
|
|
41
|
+
width: 100%;
|
|
42
|
+
height: 100%;
|
|
33
43
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
background-color: $back-disabled;
|
|
37
|
-
cursor: not-allowed;
|
|
44
|
+
padding: 0 8px;
|
|
45
|
+
outline: none;
|
|
38
46
|
|
|
39
|
-
|
|
40
|
-
|
|
47
|
+
background-color: $element-background-color;
|
|
48
|
+
border: 1px solid $border-color;
|
|
49
|
+
border-radius: inherit;
|
|
50
|
+
|
|
51
|
+
&::placeholder {
|
|
52
|
+
color: $placeholder-color;
|
|
53
|
+
font-size: inherit;
|
|
54
|
+
}
|
|
41
55
|
}
|
|
42
56
|
|
|
43
|
-
|
|
44
|
-
|
|
57
|
+
|
|
58
|
+
//Statements
|
|
59
|
+
&::before {
|
|
60
|
+
content: '';
|
|
61
|
+
position: absolute;
|
|
62
|
+
z-index: 2;
|
|
63
|
+
top: 0;
|
|
64
|
+
left: 0;
|
|
65
|
+
width: 100%;
|
|
66
|
+
height: 100%;
|
|
67
|
+
|
|
68
|
+
pointer-events: none;
|
|
69
|
+
transform: translate(-1px, -1px);
|
|
70
|
+
opacity: 0;
|
|
71
|
+
transition: opacity 150ms ease-in-out;
|
|
45
72
|
}
|
|
46
|
-
}
|
|
47
73
|
|
|
48
|
-
|
|
74
|
+
&:not(#{$root}_disabled):focus-within::before {
|
|
75
|
+
border: 4px solid $primary-light;
|
|
76
|
+
transform: translateX(-4px) translateY(-4px);
|
|
77
|
+
border-radius: 16px;
|
|
78
|
+
opacity: 1;
|
|
79
|
+
}
|
|
49
80
|
|
|
50
|
-
|
|
81
|
+
&:not(#{$root}_disabled):active {
|
|
82
|
+
#{$root}__input {
|
|
83
|
+
border-color: transparent;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
&::before {
|
|
87
|
+
transform: none;
|
|
88
|
+
border: 1px solid $primary;
|
|
89
|
+
opacity: 1;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
51
92
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
93
|
+
&_disabled {
|
|
94
|
+
#{$root}__input {
|
|
95
|
+
background-color: $background-disabled-color;
|
|
96
|
+
border-color: transparent;
|
|
97
|
+
}
|
|
57
98
|
}
|
|
58
|
-
}
|
|
59
99
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
100
|
+
&_hasError {
|
|
101
|
+
#{$root}__input {
|
|
102
|
+
border-color: transparent;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
&::before {
|
|
107
|
+
border: 1px solid $danger;
|
|
108
|
+
border-radius: 16px;
|
|
109
|
+
transform: translateX(-1px) translateY(-1px);
|
|
110
|
+
opacity: 1;
|
|
111
|
+
}
|
|
65
112
|
}
|
|
66
|
-
}
|
|
67
113
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
114
|
+
//Sizes
|
|
115
|
+
&_size {
|
|
116
|
+
&_lg {
|
|
117
|
+
color: $text-color;
|
|
118
|
+
height: $input-height-lg;
|
|
119
|
+
border-radius: $radius-large;
|
|
120
|
+
|
|
121
|
+
#{$root}__input {
|
|
122
|
+
font-size: $font-size-lg;
|
|
123
|
+
border-radius: $radius-large;
|
|
124
|
+
}
|
|
77
125
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
126
|
+
#{$root}__addon-before,
|
|
127
|
+
#{$root}__addon-after {
|
|
128
|
+
padding: 16px;
|
|
129
|
+
}
|
|
130
|
+
#{$root}__text-before,
|
|
131
|
+
#{$root}__text-after {
|
|
132
|
+
padding: 16px 3px;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
&::before {
|
|
136
|
+
border-radius: 14px;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
&_md {
|
|
141
|
+
color: $text-color;
|
|
142
|
+
height: $input-height-md;
|
|
143
|
+
border-radius: $radius-large;
|
|
144
|
+
|
|
145
|
+
#{$root}__input {
|
|
146
|
+
border-radius: $radius-large;
|
|
147
|
+
font-size: $font-size-base;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
#{$root}__addon-before,
|
|
151
|
+
#{$root}__addon-after,
|
|
152
|
+
#{$root}__text-before,
|
|
153
|
+
#{$root}__text-after {
|
|
154
|
+
padding: 11px 12px;
|
|
155
|
+
}
|
|
82
156
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
157
|
+
#{$root}__text-before,
|
|
158
|
+
#{$root}__text-after {
|
|
159
|
+
padding: 11px 3px;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
&::before {
|
|
163
|
+
border-radius: 14px;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
&_sm {
|
|
168
|
+
color: $text-color;
|
|
169
|
+
height: $input-height-sm;
|
|
170
|
+
border-radius: $radius-small;
|
|
171
|
+
|
|
172
|
+
#{$root}__input {
|
|
173
|
+
font-size: $font-size-sm;
|
|
174
|
+
border-radius: $radius-small;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
#{$root}__addon-before,
|
|
178
|
+
#{$root}__addon-after {
|
|
179
|
+
padding: 5px 8px;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
#{$root}__text-before,
|
|
183
|
+
#{$root}__text-after {
|
|
184
|
+
padding: 5px 3px;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
&::before {
|
|
188
|
+
border-radius: 10px;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
86
191
|
}
|
|
87
192
|
|
|
88
|
-
|
|
89
|
-
|
|
193
|
+
//LEAD ICON
|
|
194
|
+
&_hasLeadIcon {
|
|
195
|
+
#{$root}__input {
|
|
196
|
+
padding-left: 40px;
|
|
197
|
+
}
|
|
90
198
|
}
|
|
91
199
|
|
|
92
|
-
|
|
93
|
-
|
|
200
|
+
&__lead-icon {
|
|
201
|
+
width: 24px;
|
|
202
|
+
height: 24px;
|
|
203
|
+
position: absolute;
|
|
204
|
+
top: 50%;
|
|
205
|
+
left: 8px;
|
|
206
|
+
transform: translateY(-50%);
|
|
207
|
+
pointer-events: none;
|
|
208
|
+
outline: none;
|
|
209
|
+
|
|
210
|
+
svg circle,
|
|
211
|
+
path {
|
|
212
|
+
transition: stroke 150ms ease-in-out;
|
|
213
|
+
stroke: $lead-icon-default-color;
|
|
214
|
+
}
|
|
94
215
|
}
|
|
95
|
-
|
|
96
|
-
|
|
216
|
+
|
|
217
|
+
//CLEAR ICON
|
|
218
|
+
&_hasClearIcon {
|
|
219
|
+
#{$root}__input {
|
|
220
|
+
padding-right: 40px;
|
|
221
|
+
}
|
|
97
222
|
}
|
|
98
|
-
}
|
|
99
223
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
224
|
+
&__icon-clear {
|
|
225
|
+
svg > * {
|
|
226
|
+
stroke: $text-color
|
|
227
|
+
}
|
|
104
228
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
229
|
+
width: 24px;
|
|
230
|
+
height: 24px;
|
|
231
|
+
position: absolute;
|
|
232
|
+
top: 50%;
|
|
233
|
+
right: 8px;
|
|
234
|
+
transform: translateY(-50%);
|
|
109
235
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
236
|
+
opacity: 0;
|
|
237
|
+
transition: opacity 150ms ease-in-out;
|
|
238
|
+
pointer-events: none;
|
|
114
239
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
240
|
+
&:focus {
|
|
241
|
+
opacity: 1;
|
|
242
|
+
pointer-events: all;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
119
245
|
|
|
246
|
+
&_filled {
|
|
247
|
+
#{$root}__icon-clear {
|
|
248
|
+
opacity: 1;
|
|
249
|
+
pointer-events: all;
|
|
250
|
+
cursor: pointer;
|
|
251
|
+
}
|
|
120
252
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
253
|
+
#{$root}__lead-icon {
|
|
254
|
+
svg circle,
|
|
255
|
+
path {
|
|
256
|
+
stroke: $lead-icon-focus-color;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
}
|
|
125
260
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
261
|
+
&_hasAddonBefore {
|
|
262
|
+
#{$root}__input {
|
|
263
|
+
border-top-left-radius: 0;
|
|
264
|
+
border-bottom-left-radius: 0;
|
|
265
|
+
border: none;
|
|
266
|
+
}
|
|
267
|
+
&::before {
|
|
268
|
+
border: 1px solid $border-color;
|
|
269
|
+
opacity: 1;
|
|
270
|
+
}
|
|
271
|
+
}
|
|
129
272
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
273
|
+
&_hasAddonAfter {
|
|
274
|
+
#{$root}__input {
|
|
275
|
+
border-top-right-radius: 0;
|
|
276
|
+
border-bottom-right-radius: 0;
|
|
277
|
+
}
|
|
278
|
+
&::before {
|
|
279
|
+
border: 1px solid $border-color;
|
|
280
|
+
opacity: 1;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
133
283
|
|
|
134
|
-
|
|
284
|
+
&__addon-before,
|
|
285
|
+
&__addon-after {
|
|
286
|
+
padding: 11px 12px;
|
|
287
|
+
background-color: $background-disabled-color;
|
|
288
|
+
color: $text-color;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
&__addon-before {
|
|
292
|
+
border-top-left-radius: inherit;
|
|
293
|
+
border-bottom-left-radius: inherit;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
&__addon-after {
|
|
297
|
+
border-top-right-radius: inherit;
|
|
298
|
+
border-bottom-right-radius: inherit;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { IBemHocOutput } from '@steroidsjs/core/hoc/bem';
|
|
2
1
|
import { INumberFieldViewProps } from '@steroidsjs/core/ui/form/NumberField/NumberField';
|
|
3
|
-
export default function NumberFieldView(props: INumberFieldViewProps
|
|
2
|
+
export default function NumberFieldView(props: INumberFieldViewProps): JSX.Element;
|
|
@@ -33,38 +33,44 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
33
33
|
__setModuleDefault(result, mod);
|
|
34
34
|
return result;
|
|
35
35
|
};
|
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
36
39
|
exports.__esModule = true;
|
|
37
40
|
var React = __importStar(require("react"));
|
|
38
41
|
var react_1 = require("react");
|
|
42
|
+
var isNumber_1 = __importDefault(require("lodash-es/isNumber"));
|
|
39
43
|
var hooks_1 = require("@steroidsjs/core/hooks");
|
|
44
|
+
var Icon_1 = __importDefault(require("@steroidsjs/core/ui/content/Icon"));
|
|
40
45
|
function NumberFieldView(props) {
|
|
46
|
+
var _a;
|
|
41
47
|
// Input ref
|
|
42
48
|
var inputRef = (0, react_1.useRef)(null);
|
|
43
49
|
var onStepUp = (0, react_1.useCallback)(function () {
|
|
44
50
|
inputRef.current.stepUp();
|
|
45
51
|
props.inputProps.onChange(inputRef.current.value);
|
|
46
|
-
}, [
|
|
52
|
+
}, [props.inputProps]);
|
|
47
53
|
var onStepDown = (0, react_1.useCallback)(function () {
|
|
48
54
|
inputRef.current.stepDown();
|
|
49
55
|
props.inputProps.onChange(inputRef.current.value);
|
|
50
|
-
}, [
|
|
56
|
+
}, [props.inputProps]);
|
|
51
57
|
var bem = (0, hooks_1.useBem)('NumberFieldView');
|
|
52
58
|
return (React.createElement("div", { className: bem(bem.block({
|
|
53
|
-
disabled: props.inputProps.disabled
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
59
|
+
disabled: props.inputProps.disabled,
|
|
60
|
+
size: props.size,
|
|
61
|
+
hasErrors: !!props.errors,
|
|
62
|
+
filled: !!((_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.value)
|
|
63
|
+
}), props.className) },
|
|
64
|
+
React.createElement("input", __assign({ ref: inputRef, className: bem(bem.element('input')) }, props.inputProps, { onChange: function (e) { return props.input.onChange(e.target.value); }, id: props.id })),
|
|
58
65
|
!props.disabled && !props.errors && (React.createElement("div", { className: bem.element('arrows-container') },
|
|
59
66
|
React.createElement("button", { className: bem.element('arrow', {
|
|
60
|
-
disabled: props.inputProps.max && props.inputProps.value >= props.inputProps.max
|
|
67
|
+
disabled: (0, isNumber_1["default"])(props.inputProps.max) && props.inputProps.value >= props.inputProps.max
|
|
61
68
|
}), type: 'button', onClick: onStepUp },
|
|
62
|
-
React.createElement("
|
|
63
|
-
React.createElement("path", { d: 'M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140\n 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1\n 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z' }))),
|
|
69
|
+
React.createElement(Icon_1["default"], { name: 'expand_up', tabIndex: -1 })),
|
|
64
70
|
React.createElement("button", { className: bem.element('arrow', {
|
|
65
|
-
disabled: props.inputProps.min && props.inputProps.value <= props.inputProps.min
|
|
71
|
+
disabled: (0, isNumber_1["default"])(props.inputProps.min) && props.inputProps.value <= props.inputProps.min
|
|
66
72
|
}), type: 'button', onClick: onStepDown },
|
|
67
|
-
React.createElement("
|
|
68
|
-
|
|
73
|
+
React.createElement(Icon_1["default"], { name: 'expand_up', tabIndex: -1 })))),
|
|
74
|
+
React.createElement("span", { className: bem.element('input-effects') })));
|
|
69
75
|
}
|
|
70
76
|
exports["default"] = NumberFieldView;
|