@steroidsjs/bootstrap 3.0.0-beta.7 → 3.0.0-beta.71
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 +252 -0
- package/content/Accordion/AccordionView.d.ts +2 -0
- package/content/{Collapse/CollapseView.js → Accordion/AccordionView.js} +3 -3
- package/content/Accordion/AccordionView.scss +28 -0
- package/content/Alert/AlertView.js +3 -2
- package/content/Alert/AlertView.scss +65 -20
- 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 +141 -0
- package/content/Calendar/CalendarView.js +1 -1
- package/content/Calendar/CalendarView.scss +244 -161
- package/content/Calendar/CaptionElement.js +23 -15
- package/content/Calendar/CaptionElement.scss +164 -106
- package/content/Card/CardView.js +37 -14
- package/content/Card/CardView.scss +139 -107
- package/content/CopyToClipboard/CopyToClipboardView.d.ts +3 -0
- package/content/CopyToClipboard/CopyToClipboardView.js +19 -0
- package/content/CopyToClipboard/CopyToClipboardView.scss +41 -0
- package/content/Detail/DetailView.scss +72 -52
- package/content/DropDown/DropDownView.d.ts +0 -1
- package/content/DropDown/DropDownView.js +7 -4
- package/content/DropDown/DropDownView.scss +208 -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 +174 -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 +7 -6
- package/form/DateField/DateFieldView.scss +12 -71
- package/form/DateRangeField/DateRangeFieldView.js +10 -13
- package/form/DateRangeField/DateRangeFieldView.scss +32 -77
- package/form/DateTimeField/DateTimeFieldView.d.ts +1 -2
- package/form/DateTimeField/DateTimeFieldView.js +6 -6
- package/form/DateTimeField/DateTimeFieldView.scss +10 -107
- package/form/DateTimeRangeField/DateTimeRangeFieldView.js +10 -8
- package/form/DateTimeRangeField/DateTimeRangeFieldView.scss +28 -88
- package/form/DropDownField/DropDownFieldView.js +35 -47
- package/form/DropDownField/DropDownFieldView.scss +381 -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 +81 -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 +114 -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 +72 -24
- 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 +43 -13
- 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 +15 -3
- package/form/ImageField/ImageFieldView.scss +7 -24
- package/form/InputField/InputFieldView.d.ts +1 -2
- package/form/InputField/InputFieldView.js +33 -14
- 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 +236 -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/RateField/RateFieldView.scss +3 -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/SliderField/SliderFieldView.js +1 -1
- package/form/SliderField/SliderFieldView.scss +336 -299
- 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/form/TimeField/TimeFieldView.js +16 -14
- package/form/TimeField/TimeFieldView.scss +19 -68
- package/form/TimeField/TimePanelView.scss +62 -68
- package/form/TimeRangeField/TimeRangeFieldView.d.ts +2 -0
- package/form/TimeRangeField/TimeRangeFieldView.js +67 -0
- package/form/TimeRangeField/TimeRangeFieldView.scss +77 -0
- 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 +32 -2
- package/index.js +34 -4
- package/index.scss +19 -3
- package/layout/Header/HeaderView.js +1 -1
- package/layout/Header/HeaderView.scss +12 -5
- 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/NotificationsItemView.js +9 -8
- package/layout/Notifications/NotificationsItemView.scss +1 -39
- package/layout/Notifications/NotificationsView.d.ts +1 -2
- package/layout/Notifications/NotificationsView.scss +3 -0
- package/layout/ProgressBar/CircleProgressBarView.d.ts +1 -2
- package/layout/ProgressBar/LineProgressBarView.d.ts +1 -2
- package/layout/ProgressBar/LineProgressBarView.scss +1 -1
- 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/ControlsColumnView/ControlsColumnView.scss +7 -1
- package/list/Empty/EmptyView.js +1 -1
- package/list/Empty/EmptyView.scss +5 -1
- package/list/FlexGrid/FlexGridView.d.ts +2 -0
- package/list/FlexGrid/FlexGridView.js +71 -0
- package/list/FlexGrid/FlexGridView.scss +57 -0
- package/list/Grid/GridView.js +8 -4
- package/list/Grid/GridView.scss +151 -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 +28 -1
- package/list/Pagination/PaginationButtonView.js +34 -5
- package/list/Pagination/PaginationButtonView.scss +263 -1
- package/list/Pagination/PaginationMoreView.js +1 -1
- package/list/Pagination/PaginationMoreView.scss +4 -1
- package/list/PaginationSize/PaginationSizeView.js +5 -5
- package/list/PaginationSize/PaginationSizeView.scss +0 -8
- package/modal/Modal/ModalView.d.ts +1 -2
- package/modal/Modal/ModalView.js +5 -8
- package/modal/Modal/ModalView.scss +138 -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/ButtonGroup/ButtonGroupView.d.ts +2 -0
- package/nav/ButtonGroup/ButtonGroupView.js +33 -0
- package/nav/ButtonGroup/ButtonGroupView.scss +83 -0
- package/nav/Controls/ControlsView.d.ts +1 -2
- package/nav/Controls/ControlsView.scss +17 -3
- package/nav/Nav/NavBarView.d.ts +1 -2
- package/nav/Nav/NavBarView.js +9 -4
- package/nav/Nav/NavBarView.scss +32 -1
- package/nav/Nav/NavButtonView.d.ts +1 -2
- package/nav/Nav/NavButtonView.js +8 -2
- package/nav/Nav/NavButtonView.scss +6 -5
- package/nav/Nav/NavIconView.d.ts +1 -2
- package/nav/Nav/NavIconView.js +7 -2
- package/nav/Nav/NavIconView.scss +6 -7
- package/nav/Nav/NavLinkView.d.ts +1 -2
- package/nav/Nav/NavLinkView.js +8 -2
- package/nav/Nav/NavLinkView.scss +14 -5
- package/nav/Nav/NavListView.d.ts +1 -2
- package/nav/Nav/NavListView.js +11 -7
- package/nav/Nav/NavListView.scss +11 -10
- package/nav/Nav/NavTabsView.d.ts +1 -2
- package/nav/Nav/NavTabsView.js +9 -4
- package/nav/Nav/NavTabsView.scss +47 -1
- package/nav/Tree/TreeView.d.ts +1 -2
- package/nav/Tree/TreeView.scss +58 -51
- 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/date.scss +422 -0
- package/scss/mixins/index.scss +5 -1
- package/scss/mixins/navs.scss +39 -0
- package/scss/mixins/scroll.scss +31 -0
- package/scss/mixins/typography.scss +26 -0
- package/scss/variables/common/colors.scss +150 -82
- package/scss/variables/common/media.scss +3 -0
- package/scss/variables/common/typography.scss +96 -28
- package/scss/variables/common/variables.scss +1 -0
- package/scss/variables/components/calendar.scss +0 -1
- 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/content/Collapse/CollapseView.scss +0 -15
- package/icons/fontawesome.d.ts +0 -2
- package/icons/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,18 +33,23 @@ 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
|
-
};
|
|
39
36
|
exports.__esModule = true;
|
|
40
37
|
var React = __importStar(require("react"));
|
|
41
|
-
var get_1 = __importDefault(require("lodash-es/get"));
|
|
42
|
-
var Button_1 = __importDefault(require("@steroidsjs/core/ui/form/Button"));
|
|
43
38
|
var hooks_1 = require("@steroidsjs/core/hooks");
|
|
44
39
|
function SwitcherFieldView(props) {
|
|
45
40
|
var bem = (0, hooks_1.useBem)('SwitcherFieldView');
|
|
46
|
-
|
|
41
|
+
var prefix = (0, hooks_1.useUniqueId)('switcher');
|
|
42
|
+
var renderLabel = React.useCallback(function (item) {
|
|
43
|
+
if (typeof item.label === 'object') {
|
|
44
|
+
return props.selectedIds.includes(item.id) ? item.label.checked : item.label.unchecked;
|
|
45
|
+
}
|
|
46
|
+
return item.label;
|
|
47
|
+
}, [props.selectedIds]);
|
|
48
|
+
return (React.createElement("div", { className: bem(bem.block(), props.className), style: props.style }, props.items.map(function (switcher, switcherIndex) { return (React.createElement("label", { key: switcherIndex, className: bem.element('switcher', {
|
|
47
49
|
size: props.size
|
|
48
|
-
}),
|
|
50
|
+
}), htmlFor: "".concat(prefix, "_").concat(switcher.id) },
|
|
51
|
+
React.createElement("input", __assign({}, props.inputProps, { id: "".concat(prefix, "_").concat(switcher.id), onChange: function () { return props.onItemSelect(switcher.id); }, checked: props.selectedIds.includes(switcher.id), className: bem.element('input') })),
|
|
52
|
+
React.createElement("span", { className: bem.element('slider') }),
|
|
53
|
+
React.createElement("span", { className: bem.element('label') }, renderLabel(switcher)))); })));
|
|
49
54
|
}
|
|
50
55
|
exports["default"] = SwitcherFieldView;
|
|
@@ -1,2 +1,189 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--switcher-dot-disabled-color: #dbe2e6;
|
|
3
|
+
--switcher-slider-disabled-color: #f1f5f7;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
html[data-theme="dark"] {
|
|
7
|
+
--switcher-dot-disabled-color: #4e4f57;
|
|
8
|
+
--switcher-slider-disabled-color: #5b5c6b;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
$switcher-dot-disabled-color: var(--switcher-dot-disabled-color);
|
|
12
|
+
$switcher-slider-disabled-color: var(--switcher-slider-disabled-color);
|
|
13
|
+
|
|
14
|
+
$background-color-transition-timing: 150ms;
|
|
15
|
+
|
|
1
16
|
.SwitcherFieldView {
|
|
2
|
-
|
|
17
|
+
$root: &;
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-flow: column nowrap;
|
|
20
|
+
align-items: flex-start;
|
|
21
|
+
row-gap: 10px;
|
|
22
|
+
|
|
23
|
+
&__switcher {
|
|
24
|
+
display: inline-flex;
|
|
25
|
+
column-gap: 12px;
|
|
26
|
+
align-items: center;
|
|
27
|
+
position: relative;
|
|
28
|
+
cursor: pointer;
|
|
29
|
+
|
|
30
|
+
$sizes: () !default;
|
|
31
|
+
$sizes: map-merge(
|
|
32
|
+
(
|
|
33
|
+
"lg": (
|
|
34
|
+
"width": 40px,
|
|
35
|
+
"height": 24px,
|
|
36
|
+
"dotSize": 18px,
|
|
37
|
+
"dotTranslateDefault": translateY(-50%) translateX(4px),
|
|
38
|
+
"dotTranslateActive": translateY(-50%) translateX(16px),
|
|
39
|
+
"font-size": $font-size-lg,
|
|
40
|
+
"line-height": $line-height-lg,
|
|
41
|
+
),
|
|
42
|
+
"md": (
|
|
43
|
+
"width": 34px,
|
|
44
|
+
"height": 20px,
|
|
45
|
+
"dotSize": 14px,
|
|
46
|
+
"dotTranslateDefault": translateY(-50%) translateX(3px),
|
|
47
|
+
"dotTranslateActive": translateY(-50%) translateX(15px),
|
|
48
|
+
"font-size": $font-size-base,
|
|
49
|
+
"line-height": $line-height-base,
|
|
50
|
+
),
|
|
51
|
+
"sm": (
|
|
52
|
+
"width": 28px,
|
|
53
|
+
"height": 16px,
|
|
54
|
+
"dotSize": 12px,
|
|
55
|
+
"dotTranslateDefault": translateY(-50%) translateX(2px),
|
|
56
|
+
"dotTranslateActive": translateY(-50%) translateX(12px),
|
|
57
|
+
"font-size": $font-size-sm,
|
|
58
|
+
"line-height": $line-height-sm,
|
|
59
|
+
),
|
|
60
|
+
),
|
|
61
|
+
$sizes
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
&_size {
|
|
65
|
+
@each $size, $sizeMap in $sizes {
|
|
66
|
+
&_#{$size} {
|
|
67
|
+
#{$root}__slider {
|
|
68
|
+
width: map-get($sizeMap, width);
|
|
69
|
+
height: map-get($sizeMap, height);
|
|
70
|
+
|
|
71
|
+
&::before {
|
|
72
|
+
width: map-get($sizeMap, dotSize);
|
|
73
|
+
height: map-get($sizeMap, dotSize);
|
|
74
|
+
transform: map-get($sizeMap, dotTranslateDefault);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
#{$root}__input:checked + #{$root}__slider {
|
|
79
|
+
&::before {
|
|
80
|
+
transform: map-get($sizeMap, dotTranslateActive);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
#{$root}__label {
|
|
85
|
+
font-size: map-get($sizeMap, font-size);
|
|
86
|
+
line-height: map-get($sizeMap, line-height);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
&__input {
|
|
94
|
+
position: absolute;
|
|
95
|
+
cursor: pointer;
|
|
96
|
+
z-index: 3;
|
|
97
|
+
opacity: 0;
|
|
98
|
+
top: 0;
|
|
99
|
+
left: 0;
|
|
100
|
+
right: 0;
|
|
101
|
+
bottom: 0;
|
|
102
|
+
|
|
103
|
+
&:checked + #{$root}__slider {
|
|
104
|
+
background-color: $primary;
|
|
105
|
+
border-color: transparent;
|
|
106
|
+
|
|
107
|
+
&::before {
|
|
108
|
+
background-color: $white;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
&::after {
|
|
112
|
+
border-color: $primary-light;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
&:hover:not(:checked):not(:disabled) + #{$root}__slider {
|
|
117
|
+
&::before {
|
|
118
|
+
background-color: $gray-dark;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
&:checked:hover + #{$root}__slider {
|
|
123
|
+
background-color: $primary-dark;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
&:focus:not(:active) + #{$root}__slider {
|
|
127
|
+
&:after {
|
|
128
|
+
opacity: 1;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
&:disabled {
|
|
133
|
+
cursor: not-allowed;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
&:disabled ~ #{$root}__label {
|
|
137
|
+
color: $gray;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
&:disabled + #{$root}__slider {
|
|
141
|
+
background-color: $switcher-slider-disabled-color;
|
|
142
|
+
|
|
143
|
+
&::before {
|
|
144
|
+
background-color: $switcher-dot-disabled-color;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
&__slider {
|
|
150
|
+
width: 100%;
|
|
151
|
+
height: 100%;
|
|
152
|
+
position: relative;
|
|
153
|
+
display: inline-block;
|
|
154
|
+
border: 1px solid $gray;
|
|
155
|
+
border-radius: 200px;
|
|
156
|
+
transition: background-color $background-color-transition-timing ease-in-out;
|
|
157
|
+
|
|
158
|
+
&::after {
|
|
159
|
+
position: absolute;
|
|
160
|
+
content: "";
|
|
161
|
+
top: 0;
|
|
162
|
+
left: 0;
|
|
163
|
+
right: 0;
|
|
164
|
+
bottom: 0;
|
|
165
|
+
display: inline-block;
|
|
166
|
+
height: calc(100% + 2px);
|
|
167
|
+
width: calc(100% + 2px);
|
|
168
|
+
border-radius: inherit;
|
|
169
|
+
border: 4px solid $gray;
|
|
170
|
+
transform: translateX(-5px) translateY(-5px);
|
|
171
|
+
opacity: 0;
|
|
172
|
+
pointer-events: none;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
&::before {
|
|
176
|
+
position: absolute;
|
|
177
|
+
content: "";
|
|
178
|
+
display: inline-block;
|
|
179
|
+
top: 50%;
|
|
180
|
+
border-radius: $radius-circle;
|
|
181
|
+
background-color: $gray;
|
|
182
|
+
transition: transform 100ms ease-in-out, background-color $background-color-transition-timing ease-in-out;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
&__label {
|
|
187
|
+
color: $text-color;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { IBemHocOutput } from '@steroidsjs/core/hoc/bem';
|
|
2
1
|
import { ITextFieldViewProps } from '@steroidsjs/core/ui/form/TextField/TextField';
|
|
3
|
-
export default function TextFieldView(props: ITextFieldViewProps
|
|
2
|
+
export default function TextFieldView(props: ITextFieldViewProps): JSX.Element;
|
|
@@ -33,13 +33,21 @@ 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"));
|
|
39
43
|
function TextFieldView(props) {
|
|
40
44
|
var bem = (0, hooks_1.useBem)('TextFieldView');
|
|
41
|
-
return (React.createElement("
|
|
45
|
+
return (React.createElement("div", { className: bem(bem.block({
|
|
46
|
+
hasErrors: !!props.errors,
|
|
47
|
+
filled: !!props.inputProps.value,
|
|
42
48
|
size: props.size
|
|
43
|
-
}),
|
|
49
|
+
}), props.className) },
|
|
50
|
+
React.createElement("textarea", __assign({ className: bem.element('textarea'), id: props.id }, props.inputProps)),
|
|
51
|
+
props.showClear && (React.createElement(Icon_1["default"], { className: bem.element('clear'), name: "cross_8x8", onClick: props.onClear }))));
|
|
44
52
|
}
|
|
45
53
|
exports["default"] = TextFieldView;
|
|
@@ -1,4 +1,146 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--text-field-disabled-clear-color: #e5e9eb;
|
|
3
|
+
--text-field-active-clear-color: #323232;
|
|
4
|
+
--text-field-background-color: #ffffff;
|
|
5
|
+
--text-field-border-color:
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
html[data-theme="dark"] {
|
|
9
|
+
--text-field-background-color: #414141;
|
|
10
|
+
--text-field-disabled-clear-color: #4e4f57;
|
|
11
|
+
--text-field-active-clear-color: #ffffff;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
$text-field-background-color: var(--text-field-background-color);
|
|
15
|
+
$text-field-disabled-clear-color: var(--text-field-disabled-clear-color);
|
|
16
|
+
$text-field-active-clear-color: var(--text-field-active-clear-color);
|
|
17
|
+
|
|
1
18
|
.TextFieldView {
|
|
2
|
-
|
|
3
|
-
|
|
19
|
+
$root: &;
|
|
20
|
+
|
|
21
|
+
position: relative;
|
|
22
|
+
font-family: $font-family-nunito;
|
|
23
|
+
|
|
24
|
+
&_hasErrors {
|
|
25
|
+
#{$root}__textarea {
|
|
26
|
+
border-color: $danger;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&__clear {
|
|
31
|
+
position: absolute;
|
|
32
|
+
width: 24px;
|
|
33
|
+
height: 24px;
|
|
34
|
+
z-index: 3;
|
|
35
|
+
top: 3%;
|
|
36
|
+
right: 10px;
|
|
37
|
+
|
|
38
|
+
transition: opacity 150ms ease-in-out;
|
|
39
|
+
opacity: 0;
|
|
40
|
+
pointer-events: none;
|
|
41
|
+
|
|
42
|
+
svg {
|
|
43
|
+
path {
|
|
44
|
+
stroke: $element-background-color-disabled;
|
|
45
|
+
stroke-width: 1.5px;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
&:focus {
|
|
50
|
+
outline: none;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&__textarea {
|
|
55
|
+
width: 100%;
|
|
56
|
+
min-width: 240px;
|
|
57
|
+
min-height: 80px;
|
|
58
|
+
height: 80px;
|
|
59
|
+
|
|
60
|
+
border-radius: $radius-small;
|
|
61
|
+
background-color: $element-field-background-color;
|
|
62
|
+
|
|
63
|
+
padding: 5px 40px 8px 8px;
|
|
64
|
+
|
|
65
|
+
font-size: $font-size-sm;
|
|
66
|
+
font-weight: 400;
|
|
67
|
+
line-height: 24px;
|
|
68
|
+
z-index: 2;
|
|
69
|
+
outline: none;
|
|
70
|
+
color: $text-color;
|
|
71
|
+
border: 1px solid $element-border-color;
|
|
72
|
+
|
|
73
|
+
&::placeholder {
|
|
74
|
+
color: $element-placeholder-color;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
&:hover {
|
|
78
|
+
border-color: $element-border-color-hover;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
&:focus {
|
|
82
|
+
border: 4px solid $primary-light;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&:active {
|
|
86
|
+
border: 1px solid $primary;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
&:disabled {
|
|
90
|
+
background-color: $element-background-color-disabled;
|
|
91
|
+
border: none;
|
|
92
|
+
resize: none;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
&:disabled::placeholder {
|
|
96
|
+
color: $element-placeholder-color-disabled;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
&:disabled + #{$root}__clear {
|
|
100
|
+
display: none;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
&:not(:disabled):focus + #{$root}__clear {
|
|
104
|
+
svg {
|
|
105
|
+
path {
|
|
106
|
+
stroke: $text-field-active-clear-color;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
&_size {
|
|
113
|
+
&_lg {
|
|
114
|
+
#{$root}__textarea {
|
|
115
|
+
height: 130px;
|
|
116
|
+
min-height: 130px;
|
|
117
|
+
border-radius: $radius-large;
|
|
118
|
+
font-size: $font-size-lg;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
&_md {
|
|
123
|
+
#{$root}__textarea {
|
|
124
|
+
height: 100px;
|
|
125
|
+
min-height: 100px;
|
|
126
|
+
border-radius: $radius-large;
|
|
127
|
+
font-size: $font-size-base;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
&_sm {
|
|
132
|
+
#{$root}__textarea {
|
|
133
|
+
height: 80px;
|
|
134
|
+
border-radius: $radius-small;
|
|
135
|
+
font-size: $font-size-sm;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
&_filled {
|
|
141
|
+
#{$root}__clear {
|
|
142
|
+
opacity: 1;
|
|
143
|
+
pointer-events: all;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
4
146
|
}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { IBemHocOutput } from '@steroidsjs/core/hoc/bem';
|
|
2
1
|
import { ITimeFieldViewProps } from '@steroidsjs/core/ui/form/TimeField/TimeField';
|
|
3
|
-
export default function TimeFieldView(props: ITimeFieldViewProps
|
|
2
|
+
export default function TimeFieldView(props: ITimeFieldViewProps): JSX.Element;
|
|
@@ -45,19 +45,21 @@ var DropDown_1 = __importDefault(require("@steroidsjs/core/ui/content/DropDown")
|
|
|
45
45
|
var TimePanelView_1 = __importDefault(require("./TimePanelView"));
|
|
46
46
|
function TimeFieldView(props) {
|
|
47
47
|
var bem = (0, hooks_1.useBem)('TimeFieldView');
|
|
48
|
-
var renderContent = (0, react_1.useCallback)(function () { return (React.createElement(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
48
|
+
var renderContent = (0, react_1.useCallback)(function () { return (React.createElement("div", { className: bem.element('panel-container') },
|
|
49
|
+
React.createElement(TimePanelView_1["default"], __assign({}, props.timePanelViewProps)))); }, [bem, props.timePanelViewProps]);
|
|
50
|
+
return (React.createElement(DropDown_1["default"], { position: 'bottomLeft', content: renderContent, visible: props.isOpened, onClose: props.onClose, className: bem.element('dropdown'), hasArrow: false },
|
|
51
|
+
React.createElement("div", { className: bem(bem.block({
|
|
52
|
+
size: props.size,
|
|
53
|
+
disabled: props.disabled,
|
|
54
|
+
'is-invalid': !!props.errors
|
|
55
|
+
}), props.className), style: props.style },
|
|
56
|
+
React.createElement("div", { className: bem.element('body') },
|
|
57
|
+
React.createElement("input", __assign({}, props.inputProps, { className: bem(bem.element('input'), props.inputProps.className), onChange: function (e) { return props.inputProps.onChange(e.target.value); } })),
|
|
58
|
+
React.createElement("div", { className: bem.element('icon-container') },
|
|
59
|
+
!props.inputProps.value && props.icon && (React.createElement(Icon_1["default"], { className: bem.element('date-icon'), name: typeof props.icon === 'string' ? props.icon : 'calendar_range', tabIndex: -1 })),
|
|
60
|
+
props.showRemove && props.inputProps.value && props.icon !== false && (React.createElement(Icon_1["default"], { className: bem.element('close-icon'), onClick: function (e) {
|
|
61
|
+
e.preventDefault();
|
|
62
|
+
props.onClear();
|
|
63
|
+
}, name: 'cross_8x8' })))))));
|
|
62
64
|
}
|
|
63
65
|
exports["default"] = TimeFieldView;
|
|
@@ -1,83 +1,34 @@
|
|
|
1
1
|
.TimeFieldView {
|
|
2
|
+
$root: &;
|
|
3
|
+
position: relative;
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
padding: 0 8px;
|
|
6
|
-
position: relative;
|
|
7
|
-
|
|
8
|
-
background-color: $white;
|
|
9
|
-
border: 1px solid $border-default;
|
|
10
|
-
border-radius: 4px;
|
|
11
|
-
|
|
12
|
-
&:focus-within{
|
|
13
|
-
outline: 0;
|
|
14
|
-
border-color: $border-action;
|
|
15
|
-
box-shadow: 0 0 0 1px $border-typing;
|
|
16
|
-
}
|
|
17
|
-
*:focus {
|
|
18
|
-
outline: none;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
&_disabled {
|
|
22
|
-
color: rgba(0, 0, 0, .25);
|
|
23
|
-
background-color: $back-disabled;
|
|
24
|
-
cursor: not-allowed;
|
|
25
|
-
input {
|
|
26
|
-
cursor: inherit;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
&_no-border {
|
|
30
|
-
border: unset;
|
|
31
|
-
}
|
|
5
|
+
@include date-default-input();
|
|
32
6
|
|
|
33
|
-
|
|
34
|
-
height: 100%;
|
|
35
|
-
display: flex;
|
|
36
|
-
flex-flow: row nowrap;
|
|
37
|
-
align-items: center;
|
|
7
|
+
@include date-default-body();
|
|
38
8
|
|
|
39
|
-
|
|
40
|
-
opacity: 1;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
9
|
+
@include icon-container($root);
|
|
43
10
|
|
|
44
|
-
|
|
45
|
-
width: 100%;
|
|
46
|
-
flex-grow: 1;
|
|
47
|
-
border: none;
|
|
48
|
-
outline: none;
|
|
49
|
-
background-color: transparent;
|
|
11
|
+
@include date-default-sizes($root);
|
|
50
12
|
|
|
51
|
-
|
|
52
|
-
}
|
|
13
|
+
@include date-default-effects($root);
|
|
53
14
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
display: flex;
|
|
57
|
-
align-items: center;
|
|
58
|
-
justify-content: center;
|
|
59
|
-
}
|
|
60
|
-
&__icon {
|
|
61
|
-
display: flex;
|
|
15
|
+
&__dropdown {
|
|
16
|
+
background: $element-background-color;
|
|
62
17
|
|
|
63
|
-
|
|
64
|
-
fill: $border-default;
|
|
65
|
-
transition: fill .1s ease-in;
|
|
18
|
+
@include calendar-border();
|
|
66
19
|
}
|
|
67
20
|
|
|
68
|
-
|
|
69
|
-
position: absolute;
|
|
70
|
-
background-color: $white;
|
|
21
|
+
@include date-time-panel($root);
|
|
71
22
|
|
|
72
|
-
|
|
73
|
-
transition: opacity .2s ease-in;
|
|
23
|
+
&__panel-container {
|
|
74
24
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
25
|
+
.TimePanelView__footer {
|
|
26
|
+
padding: 0;
|
|
27
|
+
padding-top: 10px;
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-flow: row nowrap;
|
|
30
|
+
column-gap: 10px;
|
|
78
31
|
}
|
|
79
|
-
}
|
|
80
32
|
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
33
|
}
|
|
34
|
+
|