@cashub/ui 0.4.1 → 0.5.0
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/Tab/Tab.js +28 -0
- package/Tab/TabContext.js +12 -0
- package/Tab/TabList.js +47 -0
- package/Tab/TabPanel.js +85 -0
- package/Tab/TabTab.js +63 -0
- package/Tab/index.js +24 -0
- package/assets/font/helvetica/Helvetica.ttf +0 -0
- package/assets/font/nanumGothic/NanumGothic-Bold.ttf +0 -0
- package/assets/font/nanumGothic/NanumGothic-ExtraBold.ttf +0 -0
- package/assets/font/nanumGothic/NanumGothic-Regular.ttf +0 -0
- package/assets/icons/app-management.png +0 -0
- package/assets/icons/burger.png +0 -0
- package/assets/icons/file.svg +1 -0
- package/assets/icons/map_icon1.png +0 -0
- package/assets/icons/map_icon4.png +0 -0
- package/assets/images/bg-chart-circle.png +0 -0
- package/assets/images/bg-chart-triangle.png +0 -0
- package/assets/images/cashub-logo-only.png +0 -0
- package/assets/images/default-user.jpg +0 -0
- package/assets/images/logo-cashub.png +0 -0
- package/assets/images/map.png +0 -0
- package/assets/images/qrcode.png +0 -0
- package/billing/BarChart.js +58 -0
- package/billing/Grid.js +49 -0
- package/billing/Header2.js +28 -0
- package/billing/Header3.js +44 -0
- package/billing/Paragraph.js +39 -0
- package/billing/ParagraphGroup.js +25 -0
- package/billing/ParagraphText.js +31 -0
- package/billing/Section.js +60 -0
- package/billing/SectionBody.js +20 -0
- package/billing/SectionHeader.js +31 -0
- package/billing/__stories__/BarChart.stories.js_bak +46 -0
- package/billing/__stories__/Grid.stories.js_bak +57 -0
- package/billing/__stories__/Header2.stories.js_bak +62 -0
- package/billing/__stories__/Header3.stories.js_bak +69 -0
- package/billing/__stories__/Paragraph.stories.js_bak +84 -0
- package/billing/__stories__/ParagraphGroup.stories.js_bak +68 -0
- package/billing/__stories__/ParagraphText.stories.js_bak +64 -0
- package/billing/__stories__/Section.stories.js_bak +115 -0
- package/billing/__stories__/SectionBody.stories.js_bak +62 -0
- package/billing/__stories__/SectionHeader.stories.js-bak +68 -0
- package/callout/Callout.js +36 -0
- package/callout/index.js +15 -0
- package/chart/BarChart.js +130 -0
- package/chart/DoughnutChart.js +59 -0
- package/chart/LineChart.js +121 -0
- package/chart/SingleBarChart.js +31 -0
- package/chart/index.js +39 -0
- package/container/FlexContainer.js +25 -0
- package/container/index.js +15 -0
- package/datetimePicker/Accordion.js +342 -0
- package/datetimePicker/CustomTimeInput.js +77 -0
- package/datetimePicker/DatePicker.js +401 -0
- package/datetimePicker/DatePickerV2.js +432 -0
- package/datetimePicker/DateTimePickerContext.js +12 -0
- package/datetimePicker/DatetimePicker.js +80 -0
- package/datetimePicker/DatetimePickerV2.js +438 -0
- package/datetimePicker/TimeInput.js +37 -0
- package/datetimePicker/TimePicker.js +324 -0
- package/datetimePicker/accordion/Month.js +188 -0
- package/datetimePicker/accordion/Year.js +247 -0
- package/datetimePicker/hooks/index.js +31 -0
- package/datetimePicker/hooks/useChangeNumber.js +55 -0
- package/datetimePicker/hooks/useDecrease.js +54 -0
- package/datetimePicker/hooks/useIncrease.js +54 -0
- package/datetimePicker/index.js +47 -0
- package/datetimePicker/provider/constant.js +44 -0
- package/datetimePicker/utils/pad.js +17 -0
- package/descriptionList/DescriptionDetail.js +22 -0
- package/descriptionList/DescriptionList.js +22 -0
- package/descriptionList/DescriptionTerm.js +19 -0
- package/descriptionList/index.js +31 -0
- package/divider/Divider.js +22 -0
- package/divider/index.js +15 -0
- package/dropdown/Dropdown.js +92 -0
- package/dropdown/DropdownButtonOption.js +19 -0
- package/dropdown/DropdownContent.js +94 -0
- package/dropdown/DropdownContext.js +12 -0
- package/dropdown/DropdownDivOption.js +19 -0
- package/dropdown/DropdownItem.js +32 -0
- package/dropdown/DropdownLinkOption.js +20 -0
- package/dropdown/DropdownToggle.js +58 -0
- package/dropdown/index.js +53 -0
- package/geolocation/MapInteractor.js +41 -0
- package/geolocation/MapSearchBoxControl.js +100 -0
- package/geolocation/ReverseGeolocation.js +160 -0
- package/geolocation/index.js +23 -0
- package/grid/Column.js +33 -0
- package/grid/Grid.js +28 -0
- package/grid/index.js +23 -0
- package/heading/Heading1.js +22 -0
- package/heading/Heading2.js +25 -0
- package/heading/Heading3.js +4 -4
- package/heading/index.js +31 -0
- package/icon/IconFigure.js +36 -0
- package/icon/index.js +15 -0
- package/iconbox/ApplicationIconBox.js +51 -0
- package/iconbox/IconBox.js +56 -0
- package/iconbox/IconBoxFigure.js +37 -0
- package/iconbox/IconBoxImage.js +32 -0
- package/iconbox/IconBoxV2.js +42 -0
- package/iconbox/index.js +31 -0
- package/index.js +377 -0
- package/jsoneditor/JsonEditor.js +53 -0
- package/jsoneditor/index.js +15 -0
- package/layout/Backdrop.js +25 -0
- package/layout/Container.js +34 -0
- package/layout/Footer.js +32 -0
- package/layout/Logo.js +34 -0
- package/layout/MenuIcon.js +43 -0
- package/link/LinkSpan.js +57 -0
- package/link/index.js +15 -0
- package/map/CustomLeafletMapContainer.js +23 -0
- package/map/LeafletMap.js +224 -0
- package/map/index.js +23 -0
- package/module/geolocation/api.js +51 -0
- package/module/message/index.js +59 -0
- package/package.json +16 -1
- package/paginate/Paginate.js +110 -0
- package/paginate/index.js +15 -0
- package/popover/Popover.js +122 -0
- package/popover/index.js +15 -0
- package/qrcode/QRCode.js +57 -0
- package/qrcode/QRCodeContainter.js +34 -0
- package/qrcode/index.js +23 -0
- package/ribbon/Ribbon.js +28 -0
- package/ribbon/index.js +15 -0
- package/section/Section.js +64 -0
- package/section/SectionBody.js +38 -0
- package/section/SectionHeader.js +42 -0
- package/section/SectionToolbar.js +22 -0
- package/section/index.js +50 -0
- package/select/ListBox.js +26 -0
- package/select/Option.js +28 -0
- package/select/OptionGroup.js +20 -0
- package/select/Options.js +25 -0
- package/select/SearchBox.js +52 -0
- package/select/Select.js +625 -0
- package/select/SelectedMultiple.js +34 -0
- package/select/SelectedSingle.js +20 -0
- package/select/index.js +15 -0
- package/services/api/index.js +73 -0
- package/styles/header.style.js +11 -0
- package/styles/sidebar.style.js +18 -0
- package/styles/theme/dark.theme.js +95 -0
- package/styles/theme/index.js +16 -0
- package/table/ImageBox.js +39 -0
- package/table/Logo.js +40 -0
- package/table/PermissionTable.js +42 -0
- package/table/Table.js +377 -0
- package/table/TableFooter.js +19 -0
- package/table/TableFooterInfo.js +19 -0
- package/table/TableFooterPager.js +19 -0
- package/table/TableHeadCell.js +39 -0
- package/table/TableSort.js +34 -0
- package/table/hooks/index.js +31 -0
- package/table/hooks/useLimitChange.js +34 -0
- package/table/hooks/usePageChange.js +33 -0
- package/table/hooks/useSortChange.js +35 -0
- package/table/index.js +31 -0
- package/tagify/Tags.js +55 -0
- package/tagify/index.js +15 -0
- package/text/Paragraph.js +34 -0
- package/text/index.js +15 -0
- package/timeline/Timeline.js +51 -0
- package/timeline/index.js +15 -0
- package/toast/CustomToastContainer.js +20 -0
- package/toast/index.js +23 -0
- package/tooltip/Tooltip.js +154 -0
- package/tooltip/index.js +15 -0
- package/utils/array/generateRange.js +19 -0
- package/utils/chart/customTooltip.js +89 -0
- package/utils/chart/padEmptyChartBar.js +48 -0
- package/utils/format/datetimeFormat.js +71 -0
- package/utils/format/formatDate.js +46 -0
- package/utils/hooks/useCustomPopper.js +50 -0
- package/utils/hooks/useForkRef.js +28 -0
- package/utils/hooks/usePagination.js +86 -0
- package/utils/react/setRef.js +17 -0
- package/utils/regex/check.js +13 -0
- package/wizard/Wizard.js +217 -0
- package/wizard/index.js +15 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
|
+
|
|
10
|
+
var _IconButton = _interopRequireDefault(require("../button/IconButton"));
|
|
11
|
+
|
|
12
|
+
var _IconFigure = _interopRequireDefault(require("../icon/IconFigure"));
|
|
13
|
+
|
|
14
|
+
var _ImageFluid = _interopRequireDefault(require("../image/ImageFluid"));
|
|
15
|
+
|
|
16
|
+
var _burger = _interopRequireDefault(require("../assets/icons/burger.png"));
|
|
17
|
+
|
|
18
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
19
|
+
|
|
20
|
+
var _templateObject;
|
|
21
|
+
|
|
22
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
|
+
|
|
24
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
25
|
+
|
|
26
|
+
var MenuIcon = function MenuIcon(_ref) {
|
|
27
|
+
var toggleSidebar = _ref.toggleSidebar;
|
|
28
|
+
console.log("toggleSidebar", toggleSidebar);
|
|
29
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Wrapper, {
|
|
30
|
+
onClick: toggleSidebar,
|
|
31
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_IconFigure.default, {
|
|
32
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_ImageFluid.default, {
|
|
33
|
+
crossOrigin: "anonymous",
|
|
34
|
+
src: _burger.default,
|
|
35
|
+
alt: "Sidebar toggler"
|
|
36
|
+
})
|
|
37
|
+
})
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
var Wrapper = (0, _styledComponents.default)(_IconButton.default)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin: 0;\n margin-right: calc(var(--spacing) - 0.5rem);\n"])));
|
|
42
|
+
var _default = MenuIcon;
|
|
43
|
+
exports.default = _default;
|
package/link/LinkSpan.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
|
+
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
|
|
12
|
+
var _templateObject;
|
|
13
|
+
|
|
14
|
+
var _excluded = ["children"];
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
19
|
+
|
|
20
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
21
|
+
|
|
22
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
23
|
+
|
|
24
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
25
|
+
|
|
26
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
27
|
+
|
|
28
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
29
|
+
|
|
30
|
+
var LinkSpan = function LinkSpan(_ref) {
|
|
31
|
+
var children = _ref.children,
|
|
32
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
33
|
+
|
|
34
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Link, _objectSpread(_objectSpread({}, props), {}, {
|
|
35
|
+
children: children
|
|
36
|
+
}));
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
var Link = _styledComponents.default.span.attrs(function (props) {
|
|
40
|
+
return {
|
|
41
|
+
fontSize: props.fontSmall ? "1rem" : "9rem",
|
|
42
|
+
color: props.light ? "#fff" : "rgba(255, 255, 255, 0.5)",
|
|
43
|
+
borderColor: props.light ? "#e6e6e6" : "#3e5fff"
|
|
44
|
+
};
|
|
45
|
+
})(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n font-size: ", ";\n line-height: 1.5;\n font-weight: 500;\n color: ", ";\n cursor: pointer;\n position: relative;\n display: inline-block;\n\n &:after {\n display: block;\n content: \"\";\n position: absolute;\n bottom: 0;\n top: 1rem;\n left: 0;\n width: 0%;\n transition: width 0.3s ease;\n }\n\n &:hover {\n &:after {\n width: 100%;\n border-bottom: 1px solid ", ";\n opacity: 0.5;\n }\n }\n"])), function (_ref2) {
|
|
46
|
+
var fontSize = _ref2.fontSize;
|
|
47
|
+
return fontSize;
|
|
48
|
+
}, function (_ref3) {
|
|
49
|
+
var color = _ref3.color;
|
|
50
|
+
return color;
|
|
51
|
+
}, function (_ref4) {
|
|
52
|
+
var borderColor = _ref4.borderColor;
|
|
53
|
+
return borderColor;
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
var _default = LinkSpan;
|
|
57
|
+
exports.default = _default;
|
package/link/index.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "LinkSpan", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _LinkSpan.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
var _LinkSpan = _interopRequireDefault(require("./LinkSpan"));
|
|
14
|
+
|
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
9
|
+
|
|
10
|
+
var _reactLeaflet = require("react-leaflet");
|
|
11
|
+
|
|
12
|
+
var _templateObject;
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
17
|
+
|
|
18
|
+
var CustomLeafletMapContainer = (0, _styledComponents.default)(_reactLeaflet.MapContainer)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n height: ", "px;\n border-radius: var(--border-radius);\n z-index: 1;\n\n &:focus {\n border: 1px solid var(--border-color);\n box-shadow: var(--box-shadow);\n }\n\n .leaflet-control-container {\n .leaflet-bar {\n box-shadow: var(--box-shadow);\n border-radius: var(--border-radius);\n\n a {\n background: transparent;\n border-bottom: 1px solid var(--border-color);\n color: #fff;\n\n &:last-child {\n border-bottom: none;\n }\n\n &.leaflet-disabled {\n opacity: 0.5;\n }\n }\n }\n\n .leaflet-left .leaflet-control {\n margin-left: var(--spacing-s);\n }\n\n .leaflet-right .leaflet-control {\n margin-right: var(--spacing-s);\n }\n\n .leaflet-top .leaflet-control {\n margin-top: var(--spacing-s);\n }\n\n .leaflet-control {\n font-weight: bold;\n background: var(--color-background1);\n\n &.leaflet-control-attribution {\n background: var(--font-on-mute);\n margin: 0;\n }\n }\n }\n\n &.leaflet-touch {\n .leaflet-bar {\n border: none;\n\n a {\n width: 24px;\n height: 24px;\n line-height: 24px;\n }\n }\n\n .leaflet-left .leaflet-control {\n margin-left: var(--spacing-s);\n }\n\n .leaflet-right .leaflet-control {\n margin-right: var(--spacing-s);\n }\n\n .leaflet-top .leaflet-control {\n margin-top: var(--spacing-s);\n }\n }\n\n .marker-cluster {\n background: var(--color-primary) a1;\n\n div {\n background: var(--color-primary);\n }\n }\n\n .leaflet-popup-content-wrapper {\n background: transparent;\n box-shadow: unset;\n }\n\n .leaflet-popup-tip {\n display: none;\n }\n"])), function (_ref) {
|
|
19
|
+
var height = _ref.height;
|
|
20
|
+
return height;
|
|
21
|
+
});
|
|
22
|
+
var _default = CustomLeafletMapContainer;
|
|
23
|
+
exports.default = _default;
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
|
|
10
|
+
var _leaflet = _interopRequireDefault(require("leaflet"));
|
|
11
|
+
|
|
12
|
+
var _reactLeaflet = require("react-leaflet");
|
|
13
|
+
|
|
14
|
+
var _reactLeafletMarkercluster = _interopRequireDefault(require("react-leaflet-markercluster"));
|
|
15
|
+
|
|
16
|
+
require("leaflet/dist/leaflet.css");
|
|
17
|
+
|
|
18
|
+
require("react-leaflet-markercluster/dist/styles.min.css");
|
|
19
|
+
|
|
20
|
+
var _CustomLeafletMapContainer = _interopRequireDefault(require("./CustomLeafletMapContainer"));
|
|
21
|
+
|
|
22
|
+
var _map_icon = _interopRequireDefault(require("../assets/icons/map_icon1.png"));
|
|
23
|
+
|
|
24
|
+
var _map_icon2 = _interopRequireDefault(require("../assets/icons/map_icon4.png"));
|
|
25
|
+
|
|
26
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
27
|
+
|
|
28
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
29
|
+
|
|
30
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
31
|
+
|
|
32
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
33
|
+
|
|
34
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
35
|
+
|
|
36
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
37
|
+
|
|
38
|
+
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
39
|
+
|
|
40
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
41
|
+
|
|
42
|
+
var LeafletMap = function LeafletMap(_ref) {
|
|
43
|
+
var _ref$height = _ref.height,
|
|
44
|
+
height = _ref$height === void 0 ? 512 : _ref$height,
|
|
45
|
+
_ref$zoom = _ref.zoom,
|
|
46
|
+
zoom = _ref$zoom === void 0 ? 10 : _ref$zoom,
|
|
47
|
+
_ref$data = _ref.data,
|
|
48
|
+
data = _ref$data === void 0 ? {
|
|
49
|
+
defaultPosition: null,
|
|
50
|
+
position: null,
|
|
51
|
+
locations: []
|
|
52
|
+
} : _ref$data,
|
|
53
|
+
onError = _ref.onError,
|
|
54
|
+
customPopup = _ref.customPopup,
|
|
55
|
+
checkPrimaryLocation = _ref.checkPrimaryLocation;
|
|
56
|
+
|
|
57
|
+
var _useState = (0, _react.useState)(true),
|
|
58
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
59
|
+
hasError = _useState2[0],
|
|
60
|
+
setHasError = _useState2[1];
|
|
61
|
+
|
|
62
|
+
var _useState3 = (0, _react.useState)([]),
|
|
63
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
64
|
+
validLocations = _useState4[0],
|
|
65
|
+
setValidLocations = _useState4[1];
|
|
66
|
+
|
|
67
|
+
var _useState5 = (0, _react.useState)([]),
|
|
68
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
69
|
+
validBound = _useState6[0],
|
|
70
|
+
setValidBound = _useState6[1];
|
|
71
|
+
|
|
72
|
+
var _useState7 = (0, _react.useState)([]),
|
|
73
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
74
|
+
markers = _useState8[0],
|
|
75
|
+
setMarkers = _useState8[1];
|
|
76
|
+
|
|
77
|
+
var handleError = (0, _react.useCallback)(function (errorCode) {
|
|
78
|
+
if (onError) {
|
|
79
|
+
onError(errorCode);
|
|
80
|
+
}
|
|
81
|
+
}, [onError]);
|
|
82
|
+
(0, _react.useEffect)(function () {
|
|
83
|
+
var defaultPosition = data.defaultPosition,
|
|
84
|
+
position = data.position,
|
|
85
|
+
locations = data.locations;
|
|
86
|
+
var arrLatLngs = [];
|
|
87
|
+
var bounds = [];
|
|
88
|
+
var markers = [];
|
|
89
|
+
|
|
90
|
+
if (!position && !defaultPosition) {
|
|
91
|
+
handleError("NO_COORDINATES");
|
|
92
|
+
setHasError(true);
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
locations.forEach(function (e, index) {
|
|
97
|
+
if (!e.latitude && e.latitude !== 0 || !e.longitude && e.longitude !== 0 || e.latitude === 0 && e.longitude === 0) {
|
|
98
|
+
return;
|
|
99
|
+
} // prevent duplicate LatLngBounds
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
if (!bounds.some(function (LatLng) {
|
|
103
|
+
return e.latitude === LatLng[0] && e.longitude === LatLng[1];
|
|
104
|
+
})) {
|
|
105
|
+
bounds.push([e.latitude, e.longitude]);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
arrLatLngs.push([e.latitude, e.longitude]);
|
|
109
|
+
var popupContent = null;
|
|
110
|
+
|
|
111
|
+
if (customPopup) {
|
|
112
|
+
popupContent = /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactLeaflet.Popup, {
|
|
113
|
+
maxWidth: 400,
|
|
114
|
+
closeButton: false,
|
|
115
|
+
children: customPopup(e)
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
var Icon = _leaflet.default.icon({
|
|
120
|
+
iconUrl: _map_icon2.default,
|
|
121
|
+
iconSize: [40, 50]
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
if (checkPrimaryLocation && checkPrimaryLocation(e)) {
|
|
125
|
+
Icon = _leaflet.default.icon({
|
|
126
|
+
iconUrl: _map_icon.default,
|
|
127
|
+
iconSize: [40, 50]
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
markers.push( /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactLeaflet.Marker, {
|
|
132
|
+
position: [e.latitude, e.longitude],
|
|
133
|
+
icon: Icon,
|
|
134
|
+
children: popupContent
|
|
135
|
+
}, index));
|
|
136
|
+
}); // pass all checking
|
|
137
|
+
|
|
138
|
+
setHasError(false);
|
|
139
|
+
setValidLocations(arrLatLngs);
|
|
140
|
+
setValidBound(bounds);
|
|
141
|
+
setMarkers(markers);
|
|
142
|
+
}, [data, handleError, customPopup, checkPrimaryLocation]);
|
|
143
|
+
|
|
144
|
+
if (!hasError) {
|
|
145
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_CustomLeafletMapContainer.default, {
|
|
146
|
+
height: height,
|
|
147
|
+
center: [1, 1],
|
|
148
|
+
zoom: zoom,
|
|
149
|
+
scrollWheelZoom: false,
|
|
150
|
+
maxBounds: [[-90, -180], [90, 180]],
|
|
151
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(MapInteractor, {
|
|
152
|
+
zoom: zoom,
|
|
153
|
+
locations: validLocations,
|
|
154
|
+
bounds: validBound,
|
|
155
|
+
markers: markers,
|
|
156
|
+
defaultPosition: data.defaultPosition,
|
|
157
|
+
position: data.position
|
|
158
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactLeaflet.TileLayer, {
|
|
159
|
+
attribution: "Map data \xA9 <a href=\"https://www.openstreetmap.org/\">OpenStreetMap</a> contributors",
|
|
160
|
+
url: "https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",
|
|
161
|
+
minZoom: 3,
|
|
162
|
+
maxZoom: 20,
|
|
163
|
+
noWrap: true,
|
|
164
|
+
bounds: [[-90, -180], [90, 180]]
|
|
165
|
+
}), markers.length > 0 && /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactLeafletMarkercluster.default, {
|
|
166
|
+
maxClusterRadius: 120,
|
|
167
|
+
iconCreateFunction: function iconCreateFunction(cluster) {
|
|
168
|
+
return _leaflet.default.divIcon({
|
|
169
|
+
html: "<div><span>".concat(cluster.getChildCount(), "</span></div>"),
|
|
170
|
+
className: "marker-cluster",
|
|
171
|
+
iconSize: _leaflet.default.point(40, 40)
|
|
172
|
+
});
|
|
173
|
+
},
|
|
174
|
+
children: markers
|
|
175
|
+
})]
|
|
176
|
+
});
|
|
177
|
+
} else {
|
|
178
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {});
|
|
179
|
+
}
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
var MapInteractor = function MapInteractor(_ref2) {
|
|
183
|
+
var zoom = _ref2.zoom,
|
|
184
|
+
locations = _ref2.locations,
|
|
185
|
+
bounds = _ref2.bounds,
|
|
186
|
+
markers = _ref2.markers,
|
|
187
|
+
defaultPosition = _ref2.defaultPosition,
|
|
188
|
+
position = _ref2.position;
|
|
189
|
+
var map = (0, _reactLeaflet.useMapEvents)({
|
|
190
|
+
focus: function focus() {
|
|
191
|
+
map.scrollWheelZoom.enable();
|
|
192
|
+
},
|
|
193
|
+
blur: function blur() {
|
|
194
|
+
map.scrollWheelZoom.disable();
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
(0, _react.useEffect)(function () {
|
|
198
|
+
if (bounds.length === 1) {
|
|
199
|
+
map.setView(bounds[0]);
|
|
200
|
+
} else if (locations.length > 0) {
|
|
201
|
+
map.fitBounds(bounds); // check current view has marker, if not set view to first marker
|
|
202
|
+
|
|
203
|
+
var currentBounds = map.getBounds();
|
|
204
|
+
var found = locations.find(function (LatLng) {
|
|
205
|
+
var tmpLat = parseFloat(LatLng[0]);
|
|
206
|
+
var tmpLng = parseFloat(LatLng[1]);
|
|
207
|
+
if (Number.isNaN(tmpLat) || Number.isNaN(tmpLng)) return false;
|
|
208
|
+
return currentBounds.contains([tmpLat, tmpLng]);
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
if (!found) {
|
|
212
|
+
map.setView(locations[0]);
|
|
213
|
+
}
|
|
214
|
+
} else {
|
|
215
|
+
map.setView([position && position.latitude || defaultPosition.latitude, position && position.longitude || defaultPosition.longitude]);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
map.setZoom(zoom);
|
|
219
|
+
}, [map, zoom, locations, bounds, markers, defaultPosition, position]);
|
|
220
|
+
return null;
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
var _default = LeafletMap;
|
|
224
|
+
exports.default = _default;
|
package/map/index.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "CustomLeafletMapContainer", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _CustomLeafletMapContainer.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "LeafletMap", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _LeafletMap.default;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
var _CustomLeafletMapContainer = _interopRequireDefault(require("./CustomLeafletMapContainer"));
|
|
20
|
+
|
|
21
|
+
var _LeafletMap = _interopRequireDefault(require("./LeafletMap"));
|
|
22
|
+
|
|
23
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getReverseGeolocation = exports.getGeolocationByAddress = void 0;
|
|
7
|
+
|
|
8
|
+
var _api = require("../../services/api");
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* call osm nominatim reverse geolocation service
|
|
12
|
+
*
|
|
13
|
+
* @param {Object} coordinates The coordinates to convert
|
|
14
|
+
* @param {Object.latitude}
|
|
15
|
+
* @param {Object.longitude}
|
|
16
|
+
*
|
|
17
|
+
* @fires cashub.reverse.geo.done
|
|
18
|
+
*/
|
|
19
|
+
var getReverseGeolocation = function getReverseGeolocation(coordinates) {
|
|
20
|
+
return _api.callApi.get('https://nominatim.openstreetmap.org/reverse', {
|
|
21
|
+
params: {
|
|
22
|
+
lat: coordinates.lat,
|
|
23
|
+
lon: coordinates.lng,
|
|
24
|
+
format: 'json',
|
|
25
|
+
'accept-language': window.navigator.language || window.navigator.languages[0]
|
|
26
|
+
},
|
|
27
|
+
external: true
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* call osm nominatim search geolocation service
|
|
32
|
+
*
|
|
33
|
+
* @param {String} address The address to convert
|
|
34
|
+
*
|
|
35
|
+
* @fires cashub.reverse.geo.done
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
exports.getReverseGeolocation = getReverseGeolocation;
|
|
40
|
+
|
|
41
|
+
var getGeolocationByAddress = function getGeolocationByAddress(address) {
|
|
42
|
+
return _api.callApi.get('https://nominatim.openstreetmap.org/search', {
|
|
43
|
+
params: {
|
|
44
|
+
q: address,
|
|
45
|
+
format: 'json'
|
|
46
|
+
},
|
|
47
|
+
external: true
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
exports.getGeolocationByAddress = getGeolocationByAddress;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.warning = exports.success = exports.error = void 0;
|
|
7
|
+
|
|
8
|
+
var _reactToastify = require("react-toastify");
|
|
9
|
+
|
|
10
|
+
var _MessageContainer = _interopRequireDefault(require("../../toast/MessageContainer"));
|
|
11
|
+
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
+
|
|
16
|
+
var success = function success(_ref) {
|
|
17
|
+
var title = _ref.title,
|
|
18
|
+
message = _ref.message,
|
|
19
|
+
_ref$containHTML = _ref.containHTML,
|
|
20
|
+
containHTML = _ref$containHTML === void 0 ? false : _ref$containHTML;
|
|
21
|
+
|
|
22
|
+
_reactToastify.toast.success( /*#__PURE__*/(0, _jsxRuntime.jsx)(_MessageContainer.default, {
|
|
23
|
+
title: title,
|
|
24
|
+
message: message,
|
|
25
|
+
containHTML: containHTML
|
|
26
|
+
}));
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
exports.success = success;
|
|
30
|
+
|
|
31
|
+
var error = function error(_ref2) {
|
|
32
|
+
var title = _ref2.title,
|
|
33
|
+
message = _ref2.message,
|
|
34
|
+
_ref2$containHTML = _ref2.containHTML,
|
|
35
|
+
containHTML = _ref2$containHTML === void 0 ? false : _ref2$containHTML;
|
|
36
|
+
|
|
37
|
+
_reactToastify.toast.error( /*#__PURE__*/(0, _jsxRuntime.jsx)(_MessageContainer.default, {
|
|
38
|
+
title: title,
|
|
39
|
+
message: message,
|
|
40
|
+
containHTML: containHTML
|
|
41
|
+
}));
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
exports.error = error;
|
|
45
|
+
|
|
46
|
+
var warning = function warning(_ref3) {
|
|
47
|
+
var title = _ref3.title,
|
|
48
|
+
message = _ref3.message,
|
|
49
|
+
_ref3$containHTML = _ref3.containHTML,
|
|
50
|
+
containHTML = _ref3$containHTML === void 0 ? false : _ref3$containHTML;
|
|
51
|
+
|
|
52
|
+
_reactToastify.toast.warning( /*#__PURE__*/(0, _jsxRuntime.jsx)(_MessageContainer.default, {
|
|
53
|
+
title: title,
|
|
54
|
+
message: message,
|
|
55
|
+
containHTML: containHTML
|
|
56
|
+
}));
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
exports.warning = warning;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cashub/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "CASHUB Team",
|
|
6
6
|
"description": "CASHUB UI components library",
|
|
@@ -10,6 +10,21 @@
|
|
|
10
10
|
],
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"dependencies": {
|
|
13
|
+
"@popperjs/core": "^2.11.5",
|
|
14
|
+
"@yaireo/tagify": "^4.12.0",
|
|
15
|
+
"chart.js": "^3.8.0",
|
|
16
|
+
"cropperjs": "^1.5.12",
|
|
17
|
+
"leaflet": "^1.7.1",
|
|
18
|
+
"lodash.uniqueid": "^4.0.1",
|
|
19
|
+
"moment": "^2.29.3",
|
|
20
|
+
"qrcode.react": "^3.0.2",
|
|
21
|
+
"rc-time-picker": "^3.7.3",
|
|
22
|
+
"react-chartjs-2": "^3.3.0",
|
|
23
|
+
"react-datepicker": "^4.8.0",
|
|
24
|
+
"react-leaflet": "^3.1.0",
|
|
25
|
+
"react-leaflet-markercluster": "^3.0.0-rc1",
|
|
26
|
+
"react-outside-click-handler": "^1.3.0",
|
|
27
|
+
"react-popper": "^2.3.0",
|
|
13
28
|
"styled-components": "^5.3.0"
|
|
14
29
|
},
|
|
15
30
|
"peerDependencies": {
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
11
|
+
|
|
12
|
+
var _fa = require("react-icons/fa");
|
|
13
|
+
|
|
14
|
+
var _usePagination = require("../utils/hooks/usePagination");
|
|
15
|
+
|
|
16
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
+
|
|
18
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
|
|
19
|
+
|
|
20
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
+
|
|
22
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
+
|
|
24
|
+
function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
|
|
25
|
+
|
|
26
|
+
var Paginate = function Paginate(props) {
|
|
27
|
+
var currentPage = props.currentPage,
|
|
28
|
+
totalCount = props.totalCount,
|
|
29
|
+
pageSize = props.pageSize,
|
|
30
|
+
_props$siblingCount = props.siblingCount,
|
|
31
|
+
siblingCount = _props$siblingCount === void 0 ? 1 : _props$siblingCount,
|
|
32
|
+
onPageChange = props.onPageChange,
|
|
33
|
+
alignRight = props.alignRight;
|
|
34
|
+
var paginationRange = (0, _usePagination.usePagination)({
|
|
35
|
+
currentPage: currentPage,
|
|
36
|
+
totalCount: totalCount,
|
|
37
|
+
siblingCount: siblingCount,
|
|
38
|
+
pageSize: pageSize
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
var onNext = function onNext() {
|
|
42
|
+
if (currentPage === lastPage) return;
|
|
43
|
+
onPageChange(currentPage + 1);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
var onPrevious = function onPrevious() {
|
|
47
|
+
if (currentPage === 1) return;
|
|
48
|
+
onPageChange(currentPage - 1);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
if (currentPage === 0 || paginationRange.length < 1) {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
var lastPage = paginationRange[paginationRange.length - 1];
|
|
56
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Container, {
|
|
57
|
+
alignRight: alignRight,
|
|
58
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Link, {
|
|
59
|
+
disabled: currentPage === 1,
|
|
60
|
+
onClick: onPrevious,
|
|
61
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Icon, {
|
|
62
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_fa.FaAngleLeft, {})
|
|
63
|
+
})
|
|
64
|
+
}), paginationRange.map(function (pageNumber, index) {
|
|
65
|
+
if (pageNumber === _usePagination.DOTS) {
|
|
66
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Link, {
|
|
67
|
+
className: "paginationDots",
|
|
68
|
+
children: "\u2026"
|
|
69
|
+
}, index);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Link, {
|
|
73
|
+
active: pageNumber === currentPage,
|
|
74
|
+
onClick: function onClick() {
|
|
75
|
+
return onPageChange(pageNumber);
|
|
76
|
+
},
|
|
77
|
+
children: pageNumber
|
|
78
|
+
}, index);
|
|
79
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(Link, {
|
|
80
|
+
disabled: currentPage === lastPage,
|
|
81
|
+
onClick: onNext,
|
|
82
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(Icon, {
|
|
83
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_fa.FaAngleRight, {})
|
|
84
|
+
})
|
|
85
|
+
})]
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
var Container = _styledComponents.default.ul(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n text-align: center;\n\n ", ";\n"])), function (_ref) {
|
|
90
|
+
var alignRight = _ref.alignRight;
|
|
91
|
+
return alignRight && "justify-content: flex-end";
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
var Link = _styledComponents.default.li(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 36px;\n line-height: 37px;\n font-size: var(--font-body1);\n color: var(--font-on-primary);\n border-radius: var(--border-radius-round);\n cursor: pointer;\n transition: 0.3s;\n\n &:not(:last-child) {\n margin-right: var(--spacing-xs);\n }\n\n ", ";\n\n ", "\n\n &:hover {\n ", "\n }\n &.paginationDots {\n cursor: default;\n }\n"])), function (_ref2) {
|
|
95
|
+
var disabled = _ref2.disabled;
|
|
96
|
+
return disabled && (0, _styledComponents.css)(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n opacity: 0.5;\n cursor: no-drop;\n "])));
|
|
97
|
+
}, function (_ref3) {
|
|
98
|
+
var disabled = _ref3.disabled,
|
|
99
|
+
active = _ref3.active;
|
|
100
|
+
return !disabled && active && (0, _styledComponents.css)(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n background-color: var(--color-primary);\n "])));
|
|
101
|
+
}, function (_ref4) {
|
|
102
|
+
var disabled = _ref4.disabled,
|
|
103
|
+
className = _ref4.className;
|
|
104
|
+
return !disabled && !className && (0, _styledComponents.css)(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n background-color: var(--color-primary);\n "])));
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
var Icon = _styledComponents.default.span(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n font-size: var(--font-body1);\n display: flex;\n justify-content: center;\n align-items: center;\n height: 100%;\n"])));
|
|
108
|
+
|
|
109
|
+
var _default = Paginate;
|
|
110
|
+
exports.default = _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "Paginate", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _Paginate.default;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
var _Paginate = _interopRequireDefault(require("./Paginate"));
|
|
14
|
+
|
|
15
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|