@bbl-digital/snorre 3.1.21 → 3.1.23
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/bundle.js +485 -432
- package/esm/core/Autocomplete/index.d.js +1 -0
- package/esm/core/DatepickerRange/YearMonthForm.js +56 -0
- package/esm/core/Input/index.js +35 -32
- package/esm/core/Input/styles.js +28 -28
- package/esm/core/Tooltip/index.js +42 -0
- package/esm/core/Tooltip/styles.js +15 -0
- package/esm/index.js +2 -1
- package/lib/core/Autocomplete/index.d.js +1 -0
- package/lib/core/DatepickerRange/YearMonthForm.d.ts +10 -0
- package/lib/core/DatepickerRange/YearMonthForm.d.ts.map +1 -0
- package/lib/core/DatepickerRange/YearMonthForm.js +56 -0
- package/lib/core/Input/index.d.ts +1 -1
- package/lib/core/Input/index.d.ts.map +1 -1
- package/lib/core/Input/index.js +35 -32
- package/lib/core/Input/styles.d.ts +2 -2
- package/lib/core/Input/styles.d.ts.map +1 -1
- package/lib/core/Input/styles.js +28 -28
- package/lib/core/Tooltip/index.d.ts +12 -0
- package/lib/core/Tooltip/index.d.ts.map +1 -0
- package/lib/core/Tooltip/index.js +42 -0
- package/lib/core/Tooltip/styles.d.ts +6 -0
- package/lib/core/Tooltip/styles.d.ts.map +1 -0
- package/lib/core/Tooltip/styles.js +15 -0
- package/lib/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -1
- package/package.json +3 -1
- package/esm/enums/ModifierKey.js +0 -13
- package/lib/enums/ModifierKey.d.ts +0 -12
- package/lib/enums/ModifierKey.d.ts.map +0 -1
- package/lib/enums/ModifierKey.js +0 -13
@@ -0,0 +1,15 @@
|
|
1
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
2
|
+
|
3
|
+
import { css } from '@emotion/react';
|
4
|
+
export const styles = {
|
5
|
+
default: process.env.NODE_ENV === "production" ? {
|
6
|
+
name: "bjn8wh",
|
7
|
+
styles: "position:relative"
|
8
|
+
} : {
|
9
|
+
name: "1qtb3fn-default",
|
10
|
+
styles: "position:relative;label:default;",
|
11
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9wYWNrYWdlcy9jb3JlL1Rvb2x0aXAvc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUljIiwiZmlsZSI6Ii4uLy4uLy4uL3NyYy9wYWNrYWdlcy9jb3JlL1Rvb2x0aXAvc3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnXG5pbXBvcnQgeyBJQXBwVGhlbWUgfSBmcm9tICcuLi8uLi9hcHAtc2hlbGwvdGhlbWUnXG5cbmV4cG9ydCBjb25zdCBzdHlsZXMgPSB7XG4gIGRlZmF1bHQ6IGNzc2BcbiAgICBwb3NpdGlvbjogcmVsYXRpdmU7XG4gIGAsXG4gIHRvb2x0aXA6ICh0aGVtZTogSUFwcFRoZW1lKSA9PiBjc3NgXG4gICAgcG9zaXRpb246IGFic29sdXRlO1xuICAgIGxlZnQ6IDA7XG4gICAgdG9wOiAxMDAlO1xuICAgIG1heC13aWR0aDogMTUwcHg7XG4gICAgbWFyZ2luLXRvcDogMC41ZW07XG4gICAgcGFkZGluZzogMC41ZW07XG4gICAgYm9yZGVyOiAxcHggc29saWQgJHt0aGVtZS5ib3JkZXJ9O1xuICAgIGJveC1zaGFkb3c6ICR7dGhlbWUuc2hhZG93U21hbGxEYXJrZXJ9O1xuICAgIGJvcmRlci1yYWRpdXM6IDVweDtcblxuICAgICY6OmJlZm9yZSB7XG4gICAgICBjb250ZW50OiAnJztcbiAgICAgIHBvc2l0aW9uOiBhYnNvbHV0ZTtcbiAgICAgIGxlZnQ6IDEwcHg7XG4gICAgICB0b3A6IC03cHg7XG4gICAgICB3aWR0aDogMDtcbiAgICAgIGhlaWdodDogMDtcbiAgICAgIGJvcmRlci1zdHlsZTogc29saWQ7XG4gICAgICBib3JkZXItd2lkdGg6IDAgN3B4IDdweCA3cHg7XG4gICAgICBib3JkZXItY29sb3I6IHRyYW5zcGFyZW50IHRyYW5zcGFyZW50ICR7dGhlbWUuYm9yZGVyfSB0cmFuc3BhcmVudDtcbiAgICAgIHotaW5kZXg6IDk5OTg7XG4gICAgfVxuXG4gICAgJjo6YWZ0ZXIge1xuICAgICAgY29udGVudDogJyc7XG4gICAgICBwb3NpdGlvbjogYWJzb2x1dGU7XG4gICAgICBsZWZ0OiAxMnB4O1xuICAgICAgdG9wOiAtNXB4OyAvKnN1cHBvc2UgdG8gYmUgaWRlbnRpY2FsIHRvIGJvcmRlci13aWR0aCovXG4gICAgICB3aWR0aDogMDtcbiAgICAgIGhlaWdodDogMDtcbiAgICAgIGJvcmRlci1zdHlsZTogc29saWQ7XG4gICAgICBib3JkZXItd2lkdGg6IDAgNXB4IDZweCA1cHg7XG4gICAgICBib3JkZXItY29sb3I6IHRyYW5zcGFyZW50IHRyYW5zcGFyZW50ICNmZmYgdHJhbnNwYXJlbnQ7XG4gICAgICB6LWluZGV4OiA5OTk5O1xuICAgIH1cbiAgYCxcbn1cbiJdfQ== */",
|
12
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
13
|
+
},
|
14
|
+
tooltip: theme => /*#__PURE__*/css("position:absolute;left:0;top:100%;max-width:150px;margin-top:0.5em;padding:0.5em;border:1px solid ", theme.border, ";box-shadow:", theme.shadowSmallDarker, ";border-radius:5px;&::before{content:'';position:absolute;left:10px;top:-7px;width:0;height:0;border-style:solid;border-width:0 7px 7px 7px;border-color:transparent transparent ", theme.border, " transparent;z-index:9998;}&::after{content:'';position:absolute;left:12px;top:-5px;width:0;height:0;border-style:solid;border-width:0 5px 6px 5px;border-color:transparent transparent #fff transparent;z-index:9999;}" + (process.env.NODE_ENV === "production" ? "" : ";label:tooltip;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9wYWNrYWdlcy9jb3JlL1Rvb2x0aXAvc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQU9vQyIsImZpbGUiOiIuLi8uLi8uLi9zcmMvcGFja2FnZXMvY29yZS9Ub29sdGlwL3N0eWxlcy50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNzcyB9IGZyb20gJ0BlbW90aW9uL3JlYWN0J1xuaW1wb3J0IHsgSUFwcFRoZW1lIH0gZnJvbSAnLi4vLi4vYXBwLXNoZWxsL3RoZW1lJ1xuXG5leHBvcnQgY29uc3Qgc3R5bGVzID0ge1xuICBkZWZhdWx0OiBjc3NgXG4gICAgcG9zaXRpb246IHJlbGF0aXZlO1xuICBgLFxuICB0b29sdGlwOiAodGhlbWU6IElBcHBUaGVtZSkgPT4gY3NzYFxuICAgIHBvc2l0aW9uOiBhYnNvbHV0ZTtcbiAgICBsZWZ0OiAwO1xuICAgIHRvcDogMTAwJTtcbiAgICBtYXgtd2lkdGg6IDE1MHB4O1xuICAgIG1hcmdpbi10b3A6IDAuNWVtO1xuICAgIHBhZGRpbmc6IDAuNWVtO1xuICAgIGJvcmRlcjogMXB4IHNvbGlkICR7dGhlbWUuYm9yZGVyfTtcbiAgICBib3gtc2hhZG93OiAke3RoZW1lLnNoYWRvd1NtYWxsRGFya2VyfTtcbiAgICBib3JkZXItcmFkaXVzOiA1cHg7XG5cbiAgICAmOjpiZWZvcmUge1xuICAgICAgY29udGVudDogJyc7XG4gICAgICBwb3NpdGlvbjogYWJzb2x1dGU7XG4gICAgICBsZWZ0OiAxMHB4O1xuICAgICAgdG9wOiAtN3B4O1xuICAgICAgd2lkdGg6IDA7XG4gICAgICBoZWlnaHQ6IDA7XG4gICAgICBib3JkZXItc3R5bGU6IHNvbGlkO1xuICAgICAgYm9yZGVyLXdpZHRoOiAwIDdweCA3cHggN3B4O1xuICAgICAgYm9yZGVyLWNvbG9yOiB0cmFuc3BhcmVudCB0cmFuc3BhcmVudCAke3RoZW1lLmJvcmRlcn0gdHJhbnNwYXJlbnQ7XG4gICAgICB6LWluZGV4OiA5OTk4O1xuICAgIH1cblxuICAgICY6OmFmdGVyIHtcbiAgICAgIGNvbnRlbnQ6ICcnO1xuICAgICAgcG9zaXRpb246IGFic29sdXRlO1xuICAgICAgbGVmdDogMTJweDtcbiAgICAgIHRvcDogLTVweDsgLypzdXBwb3NlIHRvIGJlIGlkZW50aWNhbCB0byBib3JkZXItd2lkdGgqL1xuICAgICAgd2lkdGg6IDA7XG4gICAgICBoZWlnaHQ6IDA7XG4gICAgICBib3JkZXItc3R5bGU6IHNvbGlkO1xuICAgICAgYm9yZGVyLXdpZHRoOiAwIDVweCA2cHggNXB4O1xuICAgICAgYm9yZGVyLWNvbG9yOiB0cmFuc3BhcmVudCB0cmFuc3BhcmVudCAjZmZmIHRyYW5zcGFyZW50O1xuICAgICAgei1pbmRleDogOTk5OTtcbiAgICB9XG4gIGAsXG59XG4iXX0= */")
|
15
|
+
};
|
package/esm/index.js
CHANGED
@@ -304,4 +304,5 @@ import IconAuditorOutline from './icons/General/IconAuditorOutline';
|
|
304
304
|
import IconJanitorFilled from './icons/General/IconJanitorFilled';
|
305
305
|
import IconJanitorOutline from './icons/General/IconJanitorOutline';
|
306
306
|
import ImagePicker from './core/ImagePicker';
|
307
|
-
|
307
|
+
import Tooltip from './core/Tooltip';
|
308
|
+
export { Topbar, Layout, LayoutShell, AppShell, AppLoader, Alert, Button, Card, Divider, Dropdown, Header, Input, Image, Checkbox, Link, List, ListItem, Tag, Text, Footer, FooterCol, FooterGroup, FooterLabel, FooterLink, FooterButton, Radio, Skeleton, Html, CustomText, Select, SearchSelect, Option, UserMenu, UserMenuOption, Modal, NotificationsMenu, NotificationRow, Table, Cell, Row, FileInput, Datepicker, DatepickerRange, Menu, AppPicker, MainMenu, MenuItem, MenuTop, SecondaryMenu, SecondaryMenuItem, MenuSpacer, Submenu, SubmenuItem, PreemptionCard, PreemptionCardLoading, PieChart, SimpleBarChart, SimpleLineChart, BarAndLineComposedChart, BarChartWithCustomizedEvent, IconApartment, IconArchives, IconArea, IconChoice, IconReply, IconReplyAll, IconForward, IconArrowDown, IconArrowLeft, IconArrowRight, IconArrowUp, IconAttachment, IconBack, IconBath, IconBoard, IconBookmarkOutline, IconBookmarkFilled, IconBus, IconBlock, IconCar, IconCaretDown, IconCaretLeft, IconCaretUp, IconCases, IconCaretRight, IconCheck, IconCheckedOutline, IconCheckedFilled, IconChevronLeft, IconChevronRight, IconChevronDown, IconClose, IconCloseAlt, IconComment, IconCompanyBuilding, IconDelete, IconDoor, IconDotFilled, IconDotOutline, IconDownload, IconDraft, IconElevator, IconErrorOutline, IconErrorFilled, IconExternalLink, IconEye, IconEyeDeny, IconFamily, IconFerry, IconFile, IconFileEdit, IconFileAdd, IconFileExcel, IconFilePDF, IconFileWord, IconFillOut, IconFloor, IconGarage, IconGrid, IconGym, IconHearth, IconHearthOutline, IconHelp, IconHistory, IconHouse, IconHomeFilled, IconHomeOutline, IconHouseBlockFilled, IconHouseBlockOutline, IconHumans, IconImportantComment, IconInbox, IconLabel, IconJointcost, IconJointcost2, IconKey, IconKitchen, IconLeafFilled, IconLeafOutline, IconLeisureTime, IconLock, IconLockLocked, IconLockOpen, IconMap, IconMail, IconMenu, IconMinus, IconMoney, IconPinned, IconParking, IconPaymentCard, IconPlus, IconPortalUser, IconReciept, IconRedo, IconRefresh, IconRoom, IconSave, IconSearch, IconSend, IconSettings, IconShopping, IconSign, IconStarFilled, IconStarHalf, IconStarOutline, IconStore, IconSubway, IconSwitch, IconSliders, IconTrain, IconTram, IconPrint, IconTransport, IconTypeOfBuilding, IconTypeOfBuildingOutline, IconUpload, IconUser, IconUserThin, IconVote, IconWalk, IconWarning, IconWarningBell, IconZip, IconSort, IconFilterList, IconBellOutline, IconPlusAlt, IconPhone, IconHouseOutline, IconMembership, IconMembershipFilled, IconCalendar, IconInfoOutline, IconInfoFilled, IconCamera, IllustrationHouse, IllustrationHighHouseComposition, IllustrationHighHouse, IllustrationHouseComposition, IllustrationLowHouse, IllustrationLowHouseComposition, IllustrationSemiDetachedHouse, IllustrationSemiDetachedHouseComposition, IllustrationSmallHouse, IllustrationSmallHouseComposition, IllustrationTerraceBlock, IllustrationTerraceBlockComposition, IllustrationTownHouse, IllustrationTownHouseComposition, IllustrationHousesBackground, IllustrationHousesBackgroundWithComposition, IllustrationHouseMissing, IllustrationError, IllustrationErrorGeneric, IllustrationPaperCompleted, IllustrationPaperMissing, IllustrationMySiteBuilding, IllustrationMySiteCoffeeBook, IllustrationMySiteComputer, IllustrationMySiteGift, IllustrationMySitePapers, IllustrationMySitePiggyBank, IllustrationMySiteTransfer, IconCommunication, IconCommunicationFilled, IconCompanyBuildingOutline, IconCompanyBuildingFilled, IconDashboard, IconDashboardFilled, IconEconomy, IconEconomyFilled, IconWork, IconWorkFilled, IconProfile, IconProfileFilled, IconLookup, IconLookupFilled, IconDocument, IconDocumentFilled, IconEarth, IconEdit, IconMinusAlt, IconMinusAltFilled, IconUndo, IconVisa, IconMasterCard, IconBankAxept, IconAmericanExpress, IconFileCopy, IconBblFlame, IconBblWater, IconBblShield, IconFullscreenOpen, IconFullscreenClose, IconGmail, IconOffice365, IconAuditorFilled, IconAuditorOutline, IconJanitorFilled, IconJanitorOutline, useIsMobile, useScreenOrientation, getDomainFromUrl, getFormatedPhone, getUrlWithProtocol, getFormattedPrice, getFormattedPriceWithEnding, getFormattedDate, getTitleString, getDateIsValid, getReducedArray, getFormattedAccountNumber, getFormattedOrganizationNumber, isValidAccountNumber, getFormattedCardNumber, getFormattedTime, alpha, getCurrentPage, getSkippedItems, getHasPreviousPages, getHasMorePages, getFirstButtonIndex, getFormattedDateTimePretty, datesAreOnSameDay, Box, Textarea, InfoButton, CommentsTimeline, CommentLine, HeaderCell, RowCell, TableHeader, TableRow, BoxedTable, DraggableRow, CollapseList, CollapseListItem, Banner, Calendar, YearWheel, DropdownMenu, DropdownMenuOption, Timeline, Timepicker, TimelineStep, HighlightText, TabBar, TabItem, Editor, TabNav, TabNavItem, NoticeCard, ListPager, Spinner, Autocomplete, GoogleButton, NotificationCounter, SearchFilter, Key, ImagePicker, Tooltip };
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"YearMonthForm.d.ts","sourceRoot":"","sources":["../../../src/packages/core/DatepickerRange/YearMonthForm.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,UAAU,MAAM;IACd,IAAI,EAAE,IAAI,CAAA;IACV,QAAQ,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,IAAI,CAAA;IAC3B,QAAQ,EAAE,IAAI,CAAA;IACd,MAAM,EAAE,IAAI,CAAA;CACb;AAED,QAAA,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,CAmDnC,CAAA;AAED,eAAe,aAAa,CAAA"}
|
@@ -0,0 +1,56 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { MONTHS } from '../../utils/dates';
|
3
|
+
import { StyledSelect, Div } from './styles';
|
4
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
5
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
6
|
+
|
7
|
+
const YearMonthForm = ({
|
8
|
+
onChange,
|
9
|
+
date,
|
10
|
+
fromDate,
|
11
|
+
toDate
|
12
|
+
}) => {
|
13
|
+
const months = MONTHS;
|
14
|
+
const years = [];
|
15
|
+
|
16
|
+
for (let i = fromDate.getFullYear(); i <= toDate.getFullYear(); i += 1) {
|
17
|
+
years.push(i);
|
18
|
+
}
|
19
|
+
|
20
|
+
const changeMonth = e => {
|
21
|
+
let newDate = date;
|
22
|
+
newDate.setMonth(e.target.value);
|
23
|
+
if (newDate > toDate) newDate = toDate;
|
24
|
+
onChange(newDate);
|
25
|
+
};
|
26
|
+
|
27
|
+
const changeYear = e => {
|
28
|
+
let newDate = date;
|
29
|
+
newDate.setFullYear(e.target.value);
|
30
|
+
if (newDate > toDate) newDate = toDate;
|
31
|
+
onChange(newDate);
|
32
|
+
};
|
33
|
+
|
34
|
+
return /*#__PURE__*/_jsxs(Div, {
|
35
|
+
className: "DayPicker-Caption",
|
36
|
+
children: [/*#__PURE__*/_jsx(StyledSelect, {
|
37
|
+
name: "month",
|
38
|
+
onChange: changeMonth,
|
39
|
+
value: date.getMonth(),
|
40
|
+
children: months.map((month, i) => /*#__PURE__*/_jsx("option", {
|
41
|
+
value: i,
|
42
|
+
children: month
|
43
|
+
}, month))
|
44
|
+
}), /*#__PURE__*/_jsx(StyledSelect, {
|
45
|
+
name: "year",
|
46
|
+
onChange: changeYear,
|
47
|
+
value: date.getFullYear(),
|
48
|
+
children: years.map(year => /*#__PURE__*/_jsx("option", {
|
49
|
+
value: year,
|
50
|
+
children: year
|
51
|
+
}, year))
|
52
|
+
})]
|
53
|
+
});
|
54
|
+
};
|
55
|
+
|
56
|
+
export default YearMonthForm;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/packages/core/Input/index.tsx"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,OAAO,KAAmB,MAAM,OAAO,CAAA;AAUvC,UAAU,MAAM;IACd,iBAAiB;IACjB,IAAI,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAA;IACzD,kBAAkB;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,mBAAmB;IACnB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,iCAAiC;IACjC,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,gBAAgB;IAChB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,uBAAu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;IACjB,sEAAsE;IACtE,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,4BAA4B;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,iFAAiF;IACjF,aAAa,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAA;CACpD;AAED,oBAAY,GAAG,GAAG,GAAG,CAAA;AAErB,QAAA,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,GAAG,GAAG,CAkHjC,CAAA;AAED,eAAe,KAAK,CAAA"}
|
package/lib/core/Input/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/** @jsxImportSource @emotion/react */
|
2
2
|
import React, { useState } from 'react';
|
3
|
-
import { styles
|
3
|
+
import { styles } from './styles';
|
4
4
|
import IconSearch from '../../icons/General/IconSearch';
|
5
5
|
import { useEffect } from 'react';
|
6
6
|
import { useDebounce } from '../utils/debounce';
|
@@ -62,38 +62,41 @@ const Input = /*#__PURE__*/React.forwardRef(({
|
|
62
62
|
|
63
63
|
handleDebounceChange(debouncedValue); // eslint-disable-next-line react-hooks/exhaustive-deps
|
64
64
|
}, [debouncedValue]);
|
65
|
-
return _jsxs("
|
66
|
-
css:
|
67
|
-
children: [
|
68
|
-
css:
|
69
|
-
children: props.label
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
65
|
+
return _jsxs("div", {
|
66
|
+
css: styles.relative,
|
67
|
+
children: [_jsxs("label", {
|
68
|
+
css: theme => [styles.default(theme), props.highlight && styles.highligted(height), type === 'search' && styles.searchLabel(theme), (props.invalid || props.invalidMessage) && styles.invalid(theme), height && styles.height(height)],
|
69
|
+
children: [props.label && _jsx("span", {
|
70
|
+
css: info && styles.pr4,
|
71
|
+
children: props.label
|
72
|
+
}), _jsx("input", {
|
73
|
+
type: type,
|
74
|
+
...(type !== 'password' && {
|
75
|
+
value
|
76
|
+
}),
|
77
|
+
placeholder: props.placeholder,
|
78
|
+
disabled: props.disabled,
|
79
|
+
autoFocus: props.focus,
|
80
|
+
onBlur: props.onBlur,
|
81
|
+
onFocus: props.onFocus,
|
82
|
+
onChange: onInputChange,
|
83
|
+
maxLength: maxlength,
|
84
|
+
ref: ref,
|
85
|
+
name: props.name,
|
86
|
+
css: theme => [type === 'text' && styles.text(theme), type === 'search' && styles.search(theme), type === 'password' && styles.password(theme), type === 'number' && styles.number(theme), type === 'file' && styles.file, props.disabled && styles.disabled(theme), props.cardInput && styles.cardInput],
|
87
|
+
children: React.Children.map(props.children, child => {
|
88
|
+
if (!child) {
|
89
|
+
return null;
|
90
|
+
}
|
89
91
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
92
|
+
return child;
|
93
|
+
})
|
94
|
+
}), type === 'search' && _jsx(IconSearch, {}), props.invalidMessage && _jsx(IconErrorOutline, {
|
95
|
+
size: "16px"
|
96
|
+
}), props.invalidMessage && _jsx("span", {
|
97
|
+
css: styles.errorMessage,
|
98
|
+
children: props.invalidMessage
|
99
|
+
})]
|
97
100
|
}), info && _jsx("span", {
|
98
101
|
css: styles.infoButton,
|
99
102
|
children: _jsx(InfoButton, {
|
@@ -10,13 +10,13 @@ declare const styles: {
|
|
10
10
|
file: import("@emotion/react").SerializedStyles;
|
11
11
|
disabled: (theme: IAppTheme) => import("@emotion/react").SerializedStyles;
|
12
12
|
cardInput: import("@emotion/react").SerializedStyles;
|
13
|
-
validation: import("@emotion/react").SerializedStyles;
|
14
13
|
invalid: (theme: IAppTheme) => import("@emotion/react").SerializedStyles;
|
15
14
|
height: (height: string) => import("@emotion/react").SerializedStyles;
|
15
|
+
errorMessage: (theme: IAppTheme) => import("@emotion/react").SerializedStyles;
|
16
16
|
pr4: import("@emotion/react").SerializedStyles;
|
17
17
|
infoButton: import("@emotion/react").SerializedStyles;
|
18
|
+
relative: import("@emotion/react").SerializedStyles;
|
18
19
|
};
|
19
|
-
export declare const ErrorMessage: (theme: IAppTheme) => import("@emotion/react").SerializedStyles;
|
20
20
|
export default styles;
|
21
21
|
export { styles };
|
22
22
|
//# sourceMappingURL=styles.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/packages/core/Input/styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEjD,QAAA,MAAM,MAAM;qBACO,SAAS;;
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/packages/core/Input/styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAA;AAEjD,QAAA,MAAM,MAAM;qBACO,SAAS;;oBA4DV,SAAS;kBAKX,SAAS;sBAKL,SAAS;oBAMX,SAAS;yBAaJ,SAAS;;sBAgBZ,SAAS;;qBAeV,SAAS;qBAkCT,MAAM;0BAKD,SAAS;;;;CAwBhC,CAAA;AAED,eAAe,MAAM,CAAA;AAErB,OAAO,EAAE,MAAM,EAAE,CAAA"}
|