@steroidsjs/bootstrap 3.0.0-beta.4 → 3.0.0-beta.40
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} +46 -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.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/CaptionElement.scss +5 -4
- 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.js +6 -3
- package/content/DropDown/DropDownView.scss +196 -27
- package/content/Icon/IconView.js +2 -2
- package/form/Button/ButtonView.js +12 -8
- package/form/Button/ButtonView.scss +166 -68
- package/form/CheckboxField/CheckboxFieldView.js +6 -3
- package/form/CheckboxField/CheckboxFieldView.scss +183 -36
- package/form/CheckboxListField/CheckboxListFieldView.js +19 -15
- package/form/CheckboxListField/CheckboxListFieldView.scss +7 -41
- package/form/DropDownField/DropDownFieldView.js +31 -47
- package/form/DropDownField/DropDownFieldView.scss +390 -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 +216 -0
- package/form/FieldLayout/FieldLayoutView.js +13 -9
- package/form/FieldLayout/FieldLayoutView.scss +129 -24
- package/form/FieldList/FieldListView.js +1 -1
- package/form/FileField/FileFieldView.js +1 -1
- package/form/Form/FormView.js +1 -4
- package/form/Form/FormView.scss +1 -14
- package/form/InputField/InputFieldView.js +30 -13
- package/form/InputField/InputFieldView.scss +245 -99
- package/form/NumberField/NumberFieldView.js +19 -13
- package/form/NumberField/NumberFieldView.scss +195 -89
- package/form/PasswordField/PasswordFieldView.js +11 -9
- package/form/PasswordField/PasswordFieldView.scss +231 -63
- package/form/RadioField/RadioFieldView.d.ts +3 -0
- package/form/RadioField/RadioFieldView.js +57 -0
- package/form/RadioField/RadioFieldView.scss +226 -0
- package/form/RadioListField/RadioListFieldView.js +20 -16
- package/form/RadioListField/RadioListFieldView.scss +11 -1
- package/form/ReCaptchaField/ReCaptchaFieldView.js +2 -2
- package/form/SwitcherField/SwitcherFieldView.js +1 -1
- package/form/TextField/TextFieldView.js +10 -2
- package/form/TextField/TextFieldView.scss +143 -2
- package/icons/index.d.ts +2 -0
- package/{icon/fontawesome.js → icons/index.js} +40 -11
- package/icons/svgs/accordion-chevron.svg +4 -0
- package/icons/svgs/arrow-left.svg +3 -0
- package/icons/svgs/arrow.svg +3 -0
- package/icons/svgs/badge-close.svg +3 -0
- package/icons/svgs/close.svg +4 -0
- package/icons/svgs/crossed-out-eye.svg +5 -0
- package/icons/svgs/default.svg +11 -0
- package/icons/svgs/dots.svg +5 -0
- package/icons/svgs/double-arrow-left.svg +4 -0
- package/icons/svgs/error.svg +12 -0
- package/icons/svgs/field-close.svg +4 -0
- package/icons/svgs/home.svg +4 -0
- package/icons/svgs/info.svg +12 -0
- package/icons/svgs/loader.svg +3 -0
- package/icons/svgs/search.svg +4 -0
- package/icons/svgs/success.svg +4 -0
- package/icons/svgs/user.svg +4 -0
- package/icons/svgs/visible-eye.svg +4 -0
- package/icons/svgs/warning.svg +12 -0
- package/index.d.ts +11 -2
- package/index.js +13 -4
- package/index.scss +8 -3
- package/layout/Header/HeaderView.scss +3 -3
- package/layout/Tooltip/TooltipView.js +6 -6
- package/layout/Tooltip/TooltipView.scss +45 -37
- package/list/Grid/GridView.js +1 -1
- package/list/Grid/GridView.scss +28 -30
- package/list/List/ListView.d.ts +1 -0
- package/list/List/ListView.js +5 -5
- package/list/List/ListView.scss +9 -0
- package/list/Pagination/PaginationButtonView.js +34 -5
- package/list/Pagination/PaginationButtonView.scss +258 -1
- package/list/Pagination/PaginationMoreView.js +1 -1
- package/list/Pagination/PaginationMoreView.scss +4 -1
- package/nav/Breadcrubms/BreadcrumbsView.js +9 -1
- package/nav/Breadcrubms/BreadcrumbsView.scss +51 -0
- package/nav/Nav/NavIconView.js +1 -1
- package/nav/Nav/NavListView.js +1 -1
- package/nav/Nav/NavTabsView.js +1 -1
- package/nav/Tree/TreeView.scss +14 -11
- package/package.json +56 -56
- package/scss/fonts.scss +6 -0
- package/scss/mixins/button.scss +61 -24
- package/scss/mixins/index.scss +2 -1
- package/scss/mixins/scroll.scss +31 -0
- package/scss/mixins/typography.scss +26 -0
- package/scss/variables/common/colors.scss +95 -70
- package/scss/variables/common/media.scss +2 -0
- package/scss/variables/common/typography.scss +96 -28
- package/scss/variables/components/input.scss +7 -6
- package/scss/variables/index.scss +2 -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/content/Icon/IconView.scss +0 -25
- package/icon/fontawesome.d.ts +0 -2
- package/list/List/ListItemView.scss +0 -3
- package/scss/mixins/card.scss +0 -26
- package/scss/variables/components/card.scss +0 -20
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
+
};
|
|
16
|
+
exports.__esModule = true;
|
|
17
|
+
var react_1 = __importDefault(require("react"));
|
|
18
|
+
var useBem_1 = __importDefault(require("@steroidsjs/core/hooks/useBem"));
|
|
19
|
+
var DropDownField_1 = require("@steroidsjs/core/ui/form/DropDownField/DropDownField");
|
|
20
|
+
var renderIcon_1 = __importDefault(require("../../utils/renderIcon"));
|
|
21
|
+
var AccordionItemView_1 = __importDefault(require("../../content/Accordion/AccordionItemView"));
|
|
22
|
+
var CheckboxFieldView_1 = __importDefault(require("../CheckboxField/CheckboxFieldView"));
|
|
23
|
+
var RadioFieldView_1 = __importDefault(require("../RadioField/RadioFieldView"));
|
|
24
|
+
function DropDownItemView(props) {
|
|
25
|
+
var _a;
|
|
26
|
+
var bem = (0, useBem_1["default"])('DropDownItemView');
|
|
27
|
+
var commonProps = {
|
|
28
|
+
className: bem.element('option', {
|
|
29
|
+
hover: props.hoveredId === props.item[props.primaryKey],
|
|
30
|
+
select: props.selectedIds.includes(props.item[props.primaryKey]),
|
|
31
|
+
size: props.size
|
|
32
|
+
}),
|
|
33
|
+
onFocus: function () { return props.onItemHover(props.item[props.primaryKey]); },
|
|
34
|
+
onMouseOver: function () { return props.onItemHover(props.item[props.primaryKey]); },
|
|
35
|
+
onClick: function (e) {
|
|
36
|
+
e.preventDefault();
|
|
37
|
+
props.onItemSelect(props.item[props.primaryKey]);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
switch (props.type) {
|
|
41
|
+
case DropDownField_1.GROUP_CONTENT_TYPE:
|
|
42
|
+
return (react_1["default"].createElement(AccordionItemView_1["default"], { isShowMore: props.isShowMore, childIndex: props.childIndex, toggleCollapse: props.toggleCollapse, toggleAccordion: function () { }, showIcon: true, title: props.item.label, position: "middle", key: props.item[props.primaryKey], className: bem.element('group', {
|
|
43
|
+
size: props.size
|
|
44
|
+
}) }, (_a = props.item[props.groupAttribute]) === null || _a === void 0 ? void 0 : _a.map(function (subItem, itemIndex) { return (react_1["default"].createElement(DropDownItemView, __assign({}, props, { type: subItem.type ? subItem.type : props.itemsContent.type, key: itemIndex, item: subItem }))); })));
|
|
45
|
+
case DropDownField_1.ICON_CONTENT_TYPE:
|
|
46
|
+
return (react_1["default"].createElement("div", __assign({}, commonProps, { key: props.item[props.primaryKey] }),
|
|
47
|
+
(0, renderIcon_1["default"])(props.item.contentSrc, { className: bem.element('icon') }),
|
|
48
|
+
react_1["default"].createElement("span", null, props.item.label)));
|
|
49
|
+
case DropDownField_1.CHECKBOX_CONTENT_TYPE:
|
|
50
|
+
return (react_1["default"].createElement("div", __assign({}, commonProps, { key: props.item[props.primaryKey] }),
|
|
51
|
+
react_1["default"].createElement(CheckboxFieldView_1["default"], { label: props.item.label, className: bem.element('checkbox'), size: props.size, inputProps: {
|
|
52
|
+
disabled: false,
|
|
53
|
+
name: props.item.label,
|
|
54
|
+
checked: false,
|
|
55
|
+
onChange: function () { },
|
|
56
|
+
type: 'checkbox'
|
|
57
|
+
}, checked: props.selectedIds.includes(props.item[props.primaryKey]) })));
|
|
58
|
+
case DropDownField_1.RADIO_CONTENT_TYPE:
|
|
59
|
+
return (react_1["default"].createElement("div", __assign({}, commonProps, { key: props.item[props.primaryKey] }),
|
|
60
|
+
react_1["default"].createElement(RadioFieldView_1["default"], { label: props.item.label, className: bem.element('radio', {
|
|
61
|
+
size: props.size
|
|
62
|
+
}), size: props.size, inputProps: {
|
|
63
|
+
disabled: false,
|
|
64
|
+
name: props.item.label,
|
|
65
|
+
checked: null,
|
|
66
|
+
onChange: function () { },
|
|
67
|
+
type: 'radio'
|
|
68
|
+
}, checked: props.selectedIds.includes(props.item[props.primaryKey]) })));
|
|
69
|
+
case DropDownField_1.IMG_CONTENT_TYPE:
|
|
70
|
+
return (react_1["default"].createElement("div", __assign({}, commonProps, { key: props.item[props.primaryKey] }),
|
|
71
|
+
react_1["default"].createElement("span", { className: bem.element('img') },
|
|
72
|
+
react_1["default"].createElement("img", { src: props.item.contentSrc, alt: "custom source for item" })),
|
|
73
|
+
react_1["default"].createElement("span", null, props.item.label)));
|
|
74
|
+
default:
|
|
75
|
+
return (react_1["default"].createElement("div", __assign({}, commonProps, { key: props.item[props.primaryKey] }), props.item.label));
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
exports["default"] = DropDownItemView;
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
|
|
2
|
+
:root {
|
|
3
|
+
--drop-down-item-hover-background-color: #f5f8fa;
|
|
4
|
+
--drop-down-item-select-background-color: #eef1f2;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
html[data-theme="dark"] {
|
|
8
|
+
--drop-down-item-select-background-color: #5b5c6b;
|
|
9
|
+
--drop-down-item-hover-background-color: #4e4f57;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
$drop-down-item-select-background-color: var(--drop-down-item-select-background-color);
|
|
13
|
+
$drop-down-item-hover-background-color: var(--drop-down-item-hover-background-color);
|
|
14
|
+
|
|
15
|
+
@mixin statements {
|
|
16
|
+
&_select {
|
|
17
|
+
background-color: $drop-down-item-select-background-color;
|
|
18
|
+
}
|
|
19
|
+
&_hover {
|
|
20
|
+
background-color: $drop-down-item-hover-background-color;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
%fontProperties {
|
|
25
|
+
font-size: $font-size-base;
|
|
26
|
+
font-weight: 400;
|
|
27
|
+
line-height: 22px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.DropDownItemView {
|
|
31
|
+
$root: &;
|
|
32
|
+
|
|
33
|
+
&__icon {
|
|
34
|
+
display: inline-block;
|
|
35
|
+
width: 24px;
|
|
36
|
+
height: 24px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&__option {
|
|
40
|
+
display: flex;
|
|
41
|
+
flex-flow: row wrap;
|
|
42
|
+
position: relative;
|
|
43
|
+
column-gap: 12px;
|
|
44
|
+
align-items: center;
|
|
45
|
+
background-color: $element-background-color;
|
|
46
|
+
color: $text-color;
|
|
47
|
+
|
|
48
|
+
&_size {
|
|
49
|
+
&_lg {
|
|
50
|
+
padding: 16px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
&_md {
|
|
54
|
+
padding: 12px;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&_sm {
|
|
58
|
+
padding: 8px;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
@include statements;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
&__checkbox {
|
|
66
|
+
width: 100%;
|
|
67
|
+
height: 24px;
|
|
68
|
+
pointer-events: none;
|
|
69
|
+
|
|
70
|
+
label {
|
|
71
|
+
width: 100%;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
&__img {
|
|
76
|
+
width: 24px;
|
|
77
|
+
height: 24px;
|
|
78
|
+
border-radius: $radius-small;
|
|
79
|
+
overflow: hidden;
|
|
80
|
+
|
|
81
|
+
img {
|
|
82
|
+
width: 100%;
|
|
83
|
+
height: 100%;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
&__radio {
|
|
88
|
+
pointer-events: none;
|
|
89
|
+
width: 100%;
|
|
90
|
+
|
|
91
|
+
div {
|
|
92
|
+
width: 100%;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
label {
|
|
96
|
+
width: 100%;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
label::before {
|
|
100
|
+
position: absolute;
|
|
101
|
+
right: 0;
|
|
102
|
+
margin-right: 0;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
label::after {
|
|
106
|
+
position: absolute;
|
|
107
|
+
right: 0;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.RadioFieldView__label .RadioFieldView__ellipse {
|
|
111
|
+
left: auto;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&_size {
|
|
115
|
+
&_lg {
|
|
116
|
+
span {
|
|
117
|
+
right: 13.5px;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
&_md {
|
|
122
|
+
span {
|
|
123
|
+
right: 12.5px;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
&_sm {
|
|
128
|
+
span {
|
|
129
|
+
right: 11.5px;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
&__group {
|
|
136
|
+
width: auto;
|
|
137
|
+
border-radius: none;
|
|
138
|
+
|
|
139
|
+
.AccordionItemView {
|
|
140
|
+
&__content {
|
|
141
|
+
padding: 0;
|
|
142
|
+
border: none;
|
|
143
|
+
|
|
144
|
+
&_visible {
|
|
145
|
+
border-bottom: 1px solid $border-color;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
&__header-container {
|
|
150
|
+
display: flex;
|
|
151
|
+
flex-flow: row nowrap;
|
|
152
|
+
justify-content: space-between;
|
|
153
|
+
align-items: center;
|
|
154
|
+
|
|
155
|
+
border: none;
|
|
156
|
+
background-color: $element-background-color;
|
|
157
|
+
|
|
158
|
+
&:hover {
|
|
159
|
+
background-color: $drop-down-item-hover-background-color;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
&__title-container {
|
|
164
|
+
padding: inherit;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
&__icon-wrapper {
|
|
168
|
+
position: static;
|
|
169
|
+
margin-right: 12px;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
&__icon-chevron {
|
|
173
|
+
box-shadow: none;
|
|
174
|
+
svg {
|
|
175
|
+
border: 1px solid $border-color;
|
|
176
|
+
border-radius: $radius-small;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
&_size {
|
|
182
|
+
&_lg {
|
|
183
|
+
font-size: $font-size-lg;
|
|
184
|
+
line-height: 24px;
|
|
185
|
+
|
|
186
|
+
.AccordionItemView__title-container {
|
|
187
|
+
font-size: inherit;
|
|
188
|
+
line-height: inherit;
|
|
189
|
+
padding: 16px;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
&_md {
|
|
194
|
+
font-size: $font-size-base;
|
|
195
|
+
line-height: 22px;
|
|
196
|
+
|
|
197
|
+
.AccordionItemView__title-container {
|
|
198
|
+
font-size: inherit;
|
|
199
|
+
line-height: inherit;
|
|
200
|
+
padding: 12px;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
&_sm {
|
|
205
|
+
font-size: $font-size-sm;
|
|
206
|
+
line-height: 18px;
|
|
207
|
+
|
|
208
|
+
.AccordionItemView__title-container {
|
|
209
|
+
font-size: inherit;
|
|
210
|
+
line-height: inherit;
|
|
211
|
+
padding: 8px;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
@@ -29,17 +29,21 @@ exports.__esModule = true;
|
|
|
29
29
|
var React = __importStar(require("react"));
|
|
30
30
|
var isEmpty_1 = __importDefault(require("lodash-es/isEmpty"));
|
|
31
31
|
var hooks_1 = require("@steroidsjs/core/hooks");
|
|
32
|
+
var Icon_1 = __importDefault(require("@steroidsjs/core/ui/content/Icon"));
|
|
32
33
|
function FieldLayoutView(props) {
|
|
33
34
|
var bem = (0, hooks_1.useBem)('FieldLayoutView');
|
|
34
|
-
return (React.createElement("div", { className: bem
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
React.createElement("div", { className: bem(bem.element('field'), props.layout.layout === 'horizontal' && 'col-' + props.layout.cols[1], props.layout.layout === 'horizontal' && !props.label && 'offset-' + props.layout.cols[0], props.layout.layout === 'inline' && 'w-100') },
|
|
35
|
+
return (React.createElement("div", { className: bem.block() },
|
|
36
|
+
props.label && (React.createElement("label", { htmlFor: props.id, className: bem.element('label', {
|
|
37
|
+
required: props.required,
|
|
38
|
+
size: props.size
|
|
39
|
+
}) }, props.label + ':')),
|
|
40
|
+
React.createElement("div", { className: bem.element('field') },
|
|
41
41
|
props.children,
|
|
42
|
-
!(0, isEmpty_1["default"])(props.errors) && (React.createElement("div", { className: bem
|
|
43
|
-
|
|
42
|
+
!(0, isEmpty_1["default"])(props.errors) && (React.createElement("div", { className: bem.element('invalid-feedback') }, props.errors.filter(function (error) { return typeof error === 'string'; }).map(function (error, index) { return (React.createElement("div", { key: index, className: bem.element('error-message') },
|
|
43
|
+
React.createElement(Icon_1["default"], { name: "error", className: bem.element('icon_error'), tabIndex: -1 }),
|
|
44
|
+
React.createElement("span", { className: bem.element('error-text', {
|
|
45
|
+
size: props.size || 'md'
|
|
46
|
+
}) }, error))); }))),
|
|
47
|
+
(0, isEmpty_1["default"])(props.errors) && props.hint && (React.createElement("div", { className: bem.element('hint', { size: props.size }) }, props.hint)))));
|
|
44
48
|
}
|
|
45
49
|
exports["default"] = FieldLayoutView;
|
|
@@ -1,26 +1,131 @@
|
|
|
1
1
|
.FieldLayoutView {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
2
|
+
margin-bottom: 1rem;
|
|
3
|
+
$root: &;
|
|
4
|
+
font-family: $font-family-nunito;
|
|
5
|
+
|
|
6
|
+
&__label {
|
|
7
|
+
font-size: $font-size-sm;
|
|
8
|
+
line-height: 24px;
|
|
9
|
+
font-weight: $font-weight-sm;
|
|
10
|
+
color: $text-color;
|
|
11
|
+
margin-bottom: 8px;
|
|
12
|
+
|
|
13
|
+
&_size {
|
|
14
|
+
&_sm {
|
|
15
|
+
font-size: $font-size-sm;
|
|
16
|
+
}
|
|
17
|
+
&_md {
|
|
18
|
+
font-size: $font-size-base;
|
|
19
|
+
}
|
|
20
|
+
&_lg {
|
|
21
|
+
font-size: $font-size-lg;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
&_required:after {
|
|
26
|
+
display: inline-block;
|
|
27
|
+
content: "*";
|
|
28
|
+
color: $danger;
|
|
29
|
+
margin: 0 0 0 3px;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&__invalid-feedback {
|
|
34
|
+
display: block !important;
|
|
35
|
+
margin-top: 4.83px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
&__error-message {
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-flow: row nowrap;
|
|
41
|
+
align-items: center;
|
|
42
|
+
|
|
43
|
+
column-gap: 4px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&__hint {
|
|
47
|
+
width: 100%;
|
|
48
|
+
margin-top: 4px;
|
|
49
|
+
font-size: 80%;
|
|
50
|
+
|
|
51
|
+
color: $text-color;
|
|
52
|
+
font-size: $font-size-sm;
|
|
53
|
+
line-height: 16px;
|
|
54
|
+
font-weight: $font-weight-sm;
|
|
55
|
+
|
|
56
|
+
display: flex;
|
|
57
|
+
align-items: center;
|
|
58
|
+
column-gap: 4px;
|
|
59
|
+
|
|
60
|
+
&_size {
|
|
61
|
+
&_lg {
|
|
62
|
+
font-size: $font-size-base;
|
|
63
|
+
line-height: 22px;
|
|
64
|
+
font-weight: $font-weight-sm;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&_md {
|
|
68
|
+
font-size: $font-size-sm;
|
|
69
|
+
line-height: 18px;
|
|
70
|
+
font-weight: $font-weight-sm;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&_sm {
|
|
74
|
+
font-size: $font-size-xs;
|
|
75
|
+
line-height: 16px;
|
|
76
|
+
font-weight: $font-weight-sm;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@mixin svgSize() {
|
|
82
|
+
svg {
|
|
83
|
+
width: 16px;
|
|
84
|
+
height: 16px;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
&__icon_error {
|
|
89
|
+
width: 16px;
|
|
90
|
+
height: 16px;
|
|
91
|
+
|
|
92
|
+
display: flex;
|
|
93
|
+
justify-content: center;
|
|
94
|
+
align-items: center;
|
|
95
|
+
@include svgSize;
|
|
96
|
+
|
|
97
|
+
svg rect {
|
|
98
|
+
color: $danger;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&__error-text {
|
|
103
|
+
color: $danger;
|
|
104
|
+
&_size {
|
|
105
|
+
&_lg {
|
|
106
|
+
font-size: $font-size-base;
|
|
107
|
+
line-height: 22px;
|
|
108
|
+
font-weight: $font-weight-sm;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
&_md {
|
|
112
|
+
font-size: $font-size-sm;
|
|
113
|
+
line-height: 18px;
|
|
114
|
+
font-weight: $font-weight-sm;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
&_sm {
|
|
118
|
+
font-size: $font-size-xs;
|
|
119
|
+
line-height: 16px;
|
|
120
|
+
font-weight: $font-weight-sm;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
&__field {
|
|
126
|
+
.form-control,
|
|
127
|
+
input {
|
|
128
|
+
width: 100%;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
26
131
|
}
|
|
@@ -39,7 +39,7 @@ function FieldListView(props) {
|
|
|
39
39
|
React.createElement("tbody", null, props.children),
|
|
40
40
|
React.createElement("tfoot", null,
|
|
41
41
|
React.createElement("tr", null,
|
|
42
|
-
React.createElement("td", { colSpan: props.items.length }, props.showAdd && !props.disabled && (React.createElement(form_1.Button, { formId: false,
|
|
42
|
+
React.createElement("td", { colSpan: props.items.length }, props.showAdd && !props.disabled && (React.createElement(form_1.Button, { formId: false, color: 'secondary', className: bem.element('button-add'), onClick: function (e) {
|
|
43
43
|
e.preventDefault();
|
|
44
44
|
props.onAdd();
|
|
45
45
|
} }, __('Добавить ещё')))))))));
|
|
@@ -48,7 +48,7 @@ function FileFieldView(props) {
|
|
|
48
48
|
return (React.createElement("div", { className: bem.block() },
|
|
49
49
|
React.createElement("div", { className: bem(bem.element('files')) }, props.items.map(function (item) { return (React.createElement(FileItemView, __assign({ key: item.uid }, item, props.itemProps))); })),
|
|
50
50
|
React.createElement("div", { className: bem.element('button') },
|
|
51
|
-
React.createElement(ButtonComponent, __assign({}, props.buttonProps, {
|
|
51
|
+
React.createElement(ButtonComponent, __assign({}, props.buttonProps, { label: null }),
|
|
52
52
|
React.createElement(Icon_1["default"], { className: bem.element('button-icon'), name: props.imagesOnly ? 'file-image' : 'upload' }),
|
|
53
53
|
React.createElement("span", { className: bem.element('button-label') }, props.buttonProps.label)))));
|
|
54
54
|
}
|
package/form/Form/FormView.js
CHANGED
|
@@ -58,10 +58,7 @@ function FormView(props) {
|
|
|
58
58
|
}, 10);
|
|
59
59
|
}
|
|
60
60
|
});
|
|
61
|
-
return (React.createElement("form", { ref: formRef, className: bem(bem.block(
|
|
62
|
-
border: props.isBordered,
|
|
63
|
-
inline: props.layout.layout === 'inline'
|
|
64
|
-
}), props.className, props.layout.layout === 'horizontal' && 'form-horizontal'), onSubmit: props.onSubmit, style: props.style },
|
|
61
|
+
return (React.createElement("form", { ref: formRef, className: bem(bem.block(), props.className), onSubmit: props.onSubmit, style: props.style },
|
|
65
62
|
props.children,
|
|
66
63
|
(props.fields || []).map(function (field, index) { return (React.createElement(Field_1["default"], __assign({ key: index }, ((0, isString_1["default"])(field) ? { attribute: field } : field)))); }),
|
|
67
64
|
props.submitLabel && (React.createElement(Button_1["default"], { type: 'submit', label: props.submitLabel }))));
|
package/form/Form/FormView.scss
CHANGED
|
@@ -1,17 +1,4 @@
|
|
|
1
1
|
.FormView {
|
|
2
|
-
&_border {
|
|
3
|
-
padding: 20px;
|
|
4
|
-
border: 1px solid $border-default;
|
|
5
|
-
box-sizing: border-box;
|
|
6
|
-
box-shadow: $shadow-default;
|
|
7
|
-
border-radius: 0.5rem;
|
|
8
|
-
}
|
|
9
|
-
&_inline {
|
|
10
2
|
display: flex;
|
|
11
|
-
|
|
12
|
-
align-items: flex-start;
|
|
13
|
-
}
|
|
14
|
-
.form-control {
|
|
15
|
-
display: flex;
|
|
16
|
-
}
|
|
3
|
+
flex-flow: column nowrap;
|
|
17
4
|
}
|
|
@@ -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: "field-close", 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
|
}
|