@cashub/ui 0.46.1 → 0.48.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.
Files changed (179) hide show
  1. package/Tab/TabList.js +38 -26
  2. package/Tab/TabPanel.js +13 -20
  3. package/Tab/TabTab.js +36 -24
  4. package/Tab/index.js +15 -1
  5. package/Tab/subComponent/TabListV2.js +25 -0
  6. package/Tab/subComponent/TabPanelV2.js +52 -0
  7. package/Tab/subComponent/TabTabV2.js +63 -0
  8. package/VerticalTab/TabList.js +13 -18
  9. package/VerticalTab/TabPanel.js +16 -20
  10. package/VerticalTab/TabTab.js +40 -21
  11. package/VerticalTab/VerticalTab.js +8 -4
  12. package/alert/Alert.js +12 -5
  13. package/animate/Collapse.js +5 -7
  14. package/animate/Loader.js +18 -7
  15. package/animate/PulseRing.js +18 -5
  16. package/animate/Spinner.js +8 -3
  17. package/backdrop/BaseBackdrop.js +9 -3
  18. package/backdrop/LoadingBackdrop.js +7 -3
  19. package/backdrop/ModalBackdrop.js +5 -3
  20. package/badge/Badge.js +15 -3
  21. package/badge/BadgeDot.js +8 -3
  22. package/badge/BadgeFill.js +24 -6
  23. package/badge/BadgeWithText.js +13 -3
  24. package/billing/BarChart.js +1 -1
  25. package/breadcrumb/Breadcrumb.js +42 -3
  26. package/button/Button.js +88 -20
  27. package/button/ButtonGroup.js +33 -9
  28. package/button/IconButton.js +37 -10
  29. package/button/ScrollToTopButton.js +12 -4
  30. package/callout/Callout.js +37 -8
  31. package/chart/BarChart.js +10 -17
  32. package/chart/DoughnutChart.js +34 -20
  33. package/chart/LineChart.js +14 -20
  34. package/chart/SingleBarChart.js +22 -5
  35. package/chart/utils/centerTextPlugin.js +2 -2
  36. package/chart/utils/customTooltip.js +7 -7
  37. package/chart/utils/htmlLegendPlugin.js +1 -1
  38. package/container/FlexContainer.js +15 -7
  39. package/cropper/Cropper.js +1 -2
  40. package/datetimePicker/DatePicker.js +80 -26
  41. package/datetimePicker/DatePickerV2.js +95 -36
  42. package/datetimePicker/DatetimePicker.js +174 -11
  43. package/datetimePicker/DatetimePickerV2.js +87 -33
  44. package/datetimePicker/DatetimePickerV3.js +174 -11
  45. package/datetimePicker/TimeInput.js +35 -10
  46. package/datetimePicker/TimePicker.js +77 -22
  47. package/datetimePicker/TimePickerStyle.js +53 -3
  48. package/datetimePicker/TimePickerV2.js +54 -21
  49. package/datetimePicker/accordion/Month.js +93 -16
  50. package/datetimePicker/accordion/Year.js +96 -18
  51. package/datetimePicker/hooks/useChangeNumber.js +3 -6
  52. package/datetimePicker/hooks/useDecrease.js +3 -6
  53. package/datetimePicker/hooks/useIncrease.js +3 -6
  54. package/datetimePicker/subComponent/Accordion.js +101 -20
  55. package/descriptionList/DescriptionDetail.js +15 -4
  56. package/descriptionList/DescriptionList.js +12 -4
  57. package/descriptionList/DescriptionTerm.js +5 -3
  58. package/divider/Divider.js +15 -6
  59. package/dropdown/DropdownButtonOption.js +22 -6
  60. package/dropdown/DropdownContent.js +29 -15
  61. package/dropdown/DropdownDivOption.js +17 -3
  62. package/dropdown/DropdownLinkOption.js +14 -3
  63. package/dropdown/DropdownToggle.js +7 -15
  64. package/dropzone/FileDropzone.js +121 -22
  65. package/dropzone/ImageDropzone.js +83 -14
  66. package/dropzone/subComponent/Message.js +11 -4
  67. package/figure/IconFigure.js +16 -7
  68. package/figure/ImageFigure.js +19 -6
  69. package/file/HiddenFileInput.js +3 -3
  70. package/form/Checkbox.js +74 -13
  71. package/form/Fieldset.js +9 -3
  72. package/form/FormItem.js +10 -5
  73. package/form/Input.js +40 -7
  74. package/form/Label.js +34 -10
  75. package/form/MutedText.js +8 -4
  76. package/form/PasswordInput.js +20 -13
  77. package/form/RadioButton.js +55 -8
  78. package/form/SearchSelect.js +64 -12
  79. package/form/Searchbox.js +45 -19
  80. package/form/Slider.js +28 -10
  81. package/form/SwitchButton.js +48 -14
  82. package/form/Textarea.js +30 -3
  83. package/form/TreeView.js +13 -6
  84. package/grid/Column.js +23 -10
  85. package/grid/Grid.js +14 -6
  86. package/heading/Heading1.js +8 -4
  87. package/heading/Heading2.js +11 -5
  88. package/heading/Heading3.js +20 -8
  89. package/iconbox/ApplicationIconBox.js +48 -12
  90. package/iconbox/IconBox.js +31 -7
  91. package/iconbox/IconBoxV2.js +33 -8
  92. package/iconbox/subComponent/IconBoxFigure.js +17 -9
  93. package/iconbox/subComponent/IconBoxImage.js +21 -8
  94. package/image/ImageFluid.js +7 -3
  95. package/image/UploadImage.js +66 -18
  96. package/index.js +8 -1
  97. package/jsoneditor/JsonEditor.js +121 -15
  98. package/keyframe/Pulse.js +13 -3
  99. package/keyframe/Spin.js +5 -3
  100. package/layout/Aside.js +30 -5
  101. package/layout/Backdrop.js +8 -4
  102. package/layout/Container.js +21 -5
  103. package/layout/Footer.js +26 -7
  104. package/layout/Sidebar.jsx +33 -3
  105. package/link/LinkSpan.js +37 -19
  106. package/map/GoogleMap.js +3 -7
  107. package/map/GoogleReverseGeolocation.js +6 -3
  108. package/map/LeafletMap.js +2 -2
  109. package/map/subComponent/GoogleMapContainer.js +16 -4
  110. package/map/subComponent/GoogleMapPopup.js +7 -10
  111. package/map/subComponent/GoogleMapWrapper.js +8 -15
  112. package/map/subComponent/LeafletDrawControl.js +9 -7
  113. package/map/subComponent/LeafletMapContainer.js +159 -4
  114. package/modal/StateModal.js +49 -28
  115. package/modal/TitleModal.js +70 -29
  116. package/package.json +1 -1
  117. package/page/Disclaimer.js +119 -3
  118. package/paginate/Paginate.js +54 -12
  119. package/popover/Popover.js +30 -25
  120. package/qrcode/QRCode.js +20 -6
  121. package/qrcode/QRCodeContainter.js +12 -4
  122. package/ribbon/Ribbon.js +29 -4
  123. package/section/Section.js +68 -20
  124. package/section/SectionBody.js +29 -8
  125. package/section/SectionHeader.js +36 -11
  126. package/section/SectionToolbar.js +9 -3
  127. package/section/SectionToolbarItem.js +8 -3
  128. package/select/InputSelect.js +16 -23
  129. package/select/Select.js +112 -43
  130. package/select/subComponent/Checkbox.js +24 -5
  131. package/select/subComponent/Footer.js +4 -3
  132. package/select/subComponent/ListBox.js +12 -5
  133. package/select/subComponent/Option.js +27 -7
  134. package/select/subComponent/OptionGroup.js +13 -3
  135. package/select/subComponent/Options.js +18 -5
  136. package/select/subComponent/SearchBox.js +34 -12
  137. package/select/subComponent/SelectedMultipleTags.js +21 -3
  138. package/select/subComponent/SelectedMultipleText.js +19 -4
  139. package/select/subComponent/SelectedSingle.js +7 -3
  140. package/styles/GlobalStyle.js +156 -45
  141. package/styles/mixin/backgroundColor.js +16 -8
  142. package/styles/mixin/borderColor.js +13 -7
  143. package/styles/mixin/color.js +13 -7
  144. package/styles/mixin/colorOnBackground.js +13 -7
  145. package/styles/mixin/inputPlaceholder.js +20 -3
  146. package/styles/mixin/media.js +5 -3
  147. package/styles/mixin/rounded.js +10 -6
  148. package/styles/mixin/scrollbar.js +13 -3
  149. package/styles/theme/dark.theme.js +15 -14
  150. package/styles/theme/light.theme.js +15 -14
  151. package/styles/theme/white.theme.js +15 -14
  152. package/table/GridTable.js +71 -33
  153. package/table/ImageBox.js +15 -5
  154. package/table/InfiniteGridTable.js +92 -46
  155. package/table/PermissionTable.js +32 -10
  156. package/table/SimpleGridTable.js +143 -0
  157. package/table/Table.js +198 -48
  158. package/table/__mock__/columns.js +1 -1
  159. package/table/index.js +7 -0
  160. package/table/subComponent/BaseTableHeadCell.js +37 -8
  161. package/table/subComponent/GridTableFooter.js +10 -4
  162. package/table/subComponent/GridTableHeadCell.js +6 -4
  163. package/table/subComponent/Resizer.js +19 -4
  164. package/table/subComponent/TableFooter.js +15 -6
  165. package/table/subComponent/TableFooterInfo.js +4 -3
  166. package/table/subComponent/TableFooterPager.js +19 -6
  167. package/table/subComponent/TableHeadCell.js +9 -3
  168. package/table/subComponent/TableSort.js +17 -7
  169. package/tagify/TagifyStyle.js +49 -3
  170. package/tagify/Tags.js +37 -21
  171. package/tagify/templates/getCreateButtonTemplate.js +5 -2
  172. package/text/Paragraph.js +50 -12
  173. package/timeline/Timeline.js +94 -17
  174. package/toast/CustomToastContainer.js +35 -3
  175. package/toast/MessageContainer.js +22 -4
  176. package/tooltip/Tooltip.js +47 -19
  177. package/treeView/TreeViewV2.js +1 -1
  178. package/treeView/TreeflexStyle.js +38 -3
  179. package/wizard/Wizard.js +115 -6
package/map/GoogleMap.js CHANGED
@@ -16,11 +16,6 @@ var _jsxRuntime = require("react/jsx-runtime");
16
16
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
17
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
18
18
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
19
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
20
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
21
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
22
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
23
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
24
19
  const GoogleMap = _ref => {
25
20
  let {
26
21
  apiKey,
@@ -84,10 +79,11 @@ const GoogleMap = _ref => {
84
79
  lng: longitude
85
80
  });
86
81
  }
87
- validLocations.push(_objectSpread(_objectSpread({}, location), {}, {
82
+ validLocations.push({
83
+ ...location,
88
84
  latitude,
89
85
  longitude
90
- }));
86
+ });
91
87
  });
92
88
 
93
89
  // pass all checking
@@ -11,9 +11,7 @@ var _GoogleMapContainer = _interopRequireDefault(require("./subComponent/GoogleM
11
11
  var _Searchbox = _interopRequireDefault(require("../form/Searchbox"));
12
12
  var _map_icon = _interopRequireDefault(require("../assets/icons/map_icon4.png"));
13
13
  var _jsxRuntime = require("react/jsx-runtime");
14
- var _templateObject;
15
14
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
16
- function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
17
15
  const GoogleReverseGeolocation = _ref => {
18
16
  let {
19
17
  apiKey,
@@ -193,5 +191,10 @@ const Map = _ref2 => {
193
191
  })]
194
192
  });
195
193
  };
196
- const MapSearchBoxControl = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n position: absolute;\n top: var(--spacing-s);\n right: var(--spacing-s);\n z-index: 1;\n"])));
194
+ const MapSearchBoxControl = _styledComponents.default.div`
195
+ position: absolute;
196
+ top: var(--spacing-s);
197
+ right: var(--spacing-s);
198
+ z-index: 1;
199
+ `;
197
200
  var _default = exports.default = GoogleReverseGeolocation;
package/map/LeafletMap.js CHANGED
@@ -59,7 +59,7 @@ const LeafletMap = _ref => {
59
59
  }
60
60
  const tooltips = event.target._panes.popupPane.getElementsByClassName('leaflet-draw-tooltip');
61
61
  for (let index = 0; index < tooltips.length; index += 1) {
62
- tooltips[index].textContent = "Radius: ".concat(parseInt(radius, 10));
62
+ tooltips[index].textContent = `Radius: ${parseInt(radius, 10)}`;
63
63
  }
64
64
  if (eventHandlers.edit) {
65
65
  eventHandlers.edit(radius);
@@ -154,7 +154,7 @@ const LeafletMap = _ref => {
154
154
  maxClusterRadius: 120,
155
155
  iconCreateFunction: cluster => {
156
156
  return _leaflet.default.divIcon({
157
- html: "<div><span>".concat(cluster.getChildCount(), "</span></div>"),
157
+ html: `<div><span>${cluster.getChildCount()}</span></div>`,
158
158
  className: 'marker-cluster',
159
159
  iconSize: _leaflet.default.point(40, 40)
160
160
  });
@@ -5,13 +5,25 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _styledComponents = _interopRequireDefault(require("styled-components"));
8
- var _templateObject;
9
8
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
- function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
11
- const GoogleMapContainer = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n height: ", "px;\n border: 1px solid transparent;\n border-radius: var(--border-radius);\n\n &:focus {\n border-color: var(--border-color);\n box-shadow: var(--box-shadow);\n }\n\n .google-popup-content-wrapper {\n position: absolute;\n transform: translate(-50%, -100%);\n }\n"])), _ref => {
9
+ const GoogleMapContainer = _styledComponents.default.div`
10
+ height: ${_ref => {
12
11
  let {
13
12
  height
14
13
  } = _ref;
15
14
  return height;
16
- });
15
+ }}px;
16
+ border: 1px solid transparent;
17
+ border-radius: var(--border-radius);
18
+
19
+ &:focus {
20
+ border-color: var(--border-color);
21
+ box-shadow: var(--box-shadow);
22
+ }
23
+
24
+ .google-popup-content-wrapper {
25
+ position: absolute;
26
+ transform: translate(-50%, -100%);
27
+ }
28
+ `;
17
29
  var _default = exports.default = GoogleMapContainer;
@@ -4,9 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
8
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
9
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
10
7
  // custom popup
11
8
  // https://developers.google.com/maps/documentation/javascript/examples/overlay-popup
12
9
  class GoogleMapPopup {
@@ -14,6 +11,10 @@ class GoogleMapPopup {
14
11
  // wrap class to prevent cannot reference maps during runtime
15
12
  // because google map library will load after render map only
16
13
  class MapPopup extends window.google.maps.OverlayView {
14
+ position;
15
+ containerDiv;
16
+ offset = 16;
17
+ justRendered = false;
17
18
  constructor() {
18
19
  let {
19
20
  maxWidth,
@@ -22,14 +23,10 @@ class GoogleMapPopup {
22
23
  super();
23
24
 
24
25
  // This zero-height div is positioned at the bottom of the tip.
25
- _defineProperty(this, "position", void 0);
26
- _defineProperty(this, "containerDiv", void 0);
27
- _defineProperty(this, "offset", 16);
28
- _defineProperty(this, "justRendered", false);
29
26
  this.containerDiv = document.createElement('div');
30
27
  this.containerDiv.classList.add('google-popup-content-wrapper');
31
28
  if (maxWidth) {
32
- this.containerDiv.style.maxWidth = "".concat(maxWidth, "px");
29
+ this.containerDiv.style.maxWidth = `${maxWidth}px`;
33
30
  }
34
31
  if (offset) {
35
32
  this.offset = offset;
@@ -60,8 +57,8 @@ class GoogleMapPopup {
60
57
  this.fitMap();
61
58
  this.justRendered = false;
62
59
  }
63
- this.containerDiv.style.left = "".concat(divPosition.x, "px");
64
- this.containerDiv.style.top = "".concat(divPosition.y - this.offset, "px");
60
+ this.containerDiv.style.left = `${divPosition.x}px`;
61
+ this.containerDiv.style.top = `${divPosition.y - this.offset}px`;
65
62
  }
66
63
  }
67
64
  setPosition(position) {
@@ -7,21 +7,13 @@ exports.default = void 0;
7
7
  var _react = require("react");
8
8
  var _reactWrapper = require("@googlemaps/react-wrapper");
9
9
  var _jsxRuntime = require("react/jsx-runtime");
10
- const _excluded = ["children", "apiKey", "onError"];
11
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
12
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
13
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
14
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
15
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
16
- function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
17
- function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
18
10
  const GoogleMapWrapper = _ref => {
19
11
  let {
20
- children,
21
- apiKey,
22
- onError
23
- } = _ref,
24
- props = _objectWithoutProperties(_ref, _excluded);
12
+ children,
13
+ apiKey,
14
+ onError,
15
+ ...props
16
+ } = _ref;
25
17
  const render = status => {
26
18
  switch (status) {
27
19
  case _reactWrapper.Status.LOADING:
@@ -39,9 +31,10 @@ const GoogleMapWrapper = _ref => {
39
31
  style: {
40
32
  position: 'relative'
41
33
  },
42
- children: /*#__PURE__*/(0, _react.cloneElement)(children, _objectSpread(_objectSpread({}, props), {}, {
34
+ children: /*#__PURE__*/(0, _react.cloneElement)(children, {
35
+ ...props,
43
36
  onError
44
- }))
37
+ })
45
38
  });
46
39
  };
47
40
  var _default = exports.default = GoogleMapWrapper;
@@ -13,11 +13,8 @@ var _fastDeepEqual = _interopRequireDefault(require("fast-deep-equal"));
13
13
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
14
14
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
15
15
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
16
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
17
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
18
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
19
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
20
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } // eslint-disable-line
16
+ // eslint-disable-line
17
+
21
18
  const eventHandlers = {
22
19
  onEdited: 'draw:edited',
23
20
  onDrawStart: 'draw:drawstart',
@@ -109,13 +106,18 @@ const createDrawElement = (props, layerContainer) => {
109
106
  };
110
107
  if (draw !== undefined) {
111
108
  if (typeof draw === 'object') {
112
- options.draw = _objectSpread({}, draw);
109
+ options.draw = {
110
+ ...draw
111
+ };
113
112
  } else {
114
113
  options.draw = draw;
115
114
  }
116
115
  }
117
116
  if (edit) {
118
- options.edit = _objectSpread(_objectSpread({}, options.edit), edit);
117
+ options.edit = {
118
+ ...options.edit,
119
+ ...edit
120
+ };
119
121
  }
120
122
  if (position) {
121
123
  options.position = position;
@@ -6,13 +6,168 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.default = void 0;
7
7
  var _styledComponents = _interopRequireDefault(require("styled-components"));
8
8
  var _reactLeaflet = require("react-leaflet");
9
- var _templateObject;
10
9
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
- function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
12
- const LeafletMapContainer = (0, _styledComponents.default)(_reactLeaflet.MapContainer)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 100%;\n height: ", "px;\n border: 1px solid transparent;\n border-radius: var(--border-radius);\n z-index: 1;\n\n &:focus {\n border-color: var(--border-color);\n box-shadow: var(--box-shadow);\n }\n\n .leaflet-control-container {\n .leaflet-control-zoom {\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: var(--font-on-background);\n\n &:last-child {\n border-bottom: none;\n }\n\n &.leaflet-disabled {\n opacity: 0.5;\n }\n }\n }\n\n .leaflet-draw {\n box-shadow: var(--box-shadow);\n border-radius: var(--border-radius);\n\n a {\n background-color: var(--color-background1);\n }\n\n .leaflet-draw-draw-polyline {\n background-position: -3px -3px;\n }\n\n .leaflet-draw-draw-polygon {\n background-position: -32px -3px;\n }\n\n .leaflet-draw-draw-rectangle {\n background-position: -63px -3px;\n }\n\n .leaflet-draw-draw-circle {\n background-position: -93px -3px;\n }\n\n .leaflet-draw-draw-marker {\n background-position: -123px -3px;\n }\n\n .leaflet-draw-draw-circlemarker {\n background-position: -273px -3px;\n }\n\n .leaflet-draw-edit-edit {\n background-position: -213px -3px;\n }\n\n .leaflet-draw-edit-remove {\n background-position: -243px -3px;\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(--color-white);\n color: var(--color-dark);\n margin: 0;\n }\n }\n }\n\n .leaflet-edit-move {\n border-radius: 50px;\n border-color: var(--border-color);\n }\n\n .leaflet-edit-resize {\n border-radius: 50px;\n border-color: var(--border-color);\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 color: var(--font-on-primary);\n }\n }\n\n .leaflet-popup-content-wrapper {\n background: transparent;\n box-shadow: unset;\n }\n\n .leaflet-popup-content p {\n margin: 0;\n margin-bottom: var(--spacing-s);\n }\n\n .leaflet-popup-tip {\n display: none;\n }\n\n .sr-only {\n display: none;\n }\n"])), _ref => {
10
+ const LeafletMapContainer = (0, _styledComponents.default)(_reactLeaflet.MapContainer)`
11
+ width: 100%;
12
+ height: ${_ref => {
13
13
  let {
14
14
  height
15
15
  } = _ref;
16
16
  return height;
17
- });
17
+ }}px;
18
+ border: 1px solid transparent;
19
+ border-radius: var(--border-radius);
20
+ z-index: 1;
21
+
22
+ &:focus {
23
+ border-color: var(--border-color);
24
+ box-shadow: var(--box-shadow);
25
+ }
26
+
27
+ .leaflet-control-container {
28
+ .leaflet-control-zoom {
29
+ box-shadow: var(--box-shadow);
30
+ border-radius: var(--border-radius);
31
+
32
+ a {
33
+ background: transparent;
34
+ border-bottom: 1px solid var(--border-color);
35
+ color: var(--font-on-background);
36
+
37
+ &:last-child {
38
+ border-bottom: none;
39
+ }
40
+
41
+ &.leaflet-disabled {
42
+ opacity: 0.5;
43
+ }
44
+ }
45
+ }
46
+
47
+ .leaflet-draw {
48
+ box-shadow: var(--box-shadow);
49
+ border-radius: var(--border-radius);
50
+
51
+ a {
52
+ background-color: var(--color-background1);
53
+ }
54
+
55
+ .leaflet-draw-draw-polyline {
56
+ background-position: -3px -3px;
57
+ }
58
+
59
+ .leaflet-draw-draw-polygon {
60
+ background-position: -32px -3px;
61
+ }
62
+
63
+ .leaflet-draw-draw-rectangle {
64
+ background-position: -63px -3px;
65
+ }
66
+
67
+ .leaflet-draw-draw-circle {
68
+ background-position: -93px -3px;
69
+ }
70
+
71
+ .leaflet-draw-draw-marker {
72
+ background-position: -123px -3px;
73
+ }
74
+
75
+ .leaflet-draw-draw-circlemarker {
76
+ background-position: -273px -3px;
77
+ }
78
+
79
+ .leaflet-draw-edit-edit {
80
+ background-position: -213px -3px;
81
+ }
82
+
83
+ .leaflet-draw-edit-remove {
84
+ background-position: -243px -3px;
85
+ }
86
+ }
87
+
88
+ .leaflet-left .leaflet-control {
89
+ margin-left: var(--spacing-s);
90
+ }
91
+
92
+ .leaflet-right .leaflet-control {
93
+ margin-right: var(--spacing-s);
94
+ }
95
+
96
+ .leaflet-top .leaflet-control {
97
+ margin-top: var(--spacing-s);
98
+ }
99
+
100
+ .leaflet-control {
101
+ font-weight: bold;
102
+ background: var(--color-background1);
103
+
104
+ &.leaflet-control-attribution {
105
+ background: var(--color-white);
106
+ color: var(--color-dark);
107
+ margin: 0;
108
+ }
109
+ }
110
+ }
111
+
112
+ .leaflet-edit-move {
113
+ border-radius: 50px;
114
+ border-color: var(--border-color);
115
+ }
116
+
117
+ .leaflet-edit-resize {
118
+ border-radius: 50px;
119
+ border-color: var(--border-color);
120
+ }
121
+
122
+ &.leaflet-touch {
123
+ .leaflet-bar {
124
+ border: none;
125
+
126
+ a {
127
+ width: 24px;
128
+ height: 24px;
129
+ line-height: 24px;
130
+ }
131
+ }
132
+
133
+ .leaflet-left .leaflet-control {
134
+ margin-left: var(--spacing-s);
135
+ }
136
+
137
+ .leaflet-right .leaflet-control {
138
+ margin-right: var(--spacing-s);
139
+ }
140
+
141
+ .leaflet-top .leaflet-control {
142
+ margin-top: var(--spacing-s);
143
+ }
144
+ }
145
+
146
+ .marker-cluster {
147
+ background: var(--color-primary) a1;
148
+
149
+ div {
150
+ background: var(--color-primary);
151
+ color: var(--font-on-primary);
152
+ }
153
+ }
154
+
155
+ .leaflet-popup-content-wrapper {
156
+ background: transparent;
157
+ box-shadow: unset;
158
+ }
159
+
160
+ .leaflet-popup-content p {
161
+ margin: 0;
162
+ margin-bottom: var(--spacing-s);
163
+ }
164
+
165
+ .leaflet-popup-tip {
166
+ display: none;
167
+ }
168
+
169
+ .sr-only {
170
+ display: none;
171
+ }
172
+ `;
18
173
  var _default = exports.default = LeafletMapContainer;
@@ -15,24 +15,14 @@ var _ButtonGroup = _interopRequireDefault(require("../button/ButtonGroup"));
15
15
  var _Button = _interopRequireDefault(require("../button/Button"));
16
16
  var _ModalBackdrop = _interopRequireDefault(require("../backdrop/ModalBackdrop"));
17
17
  var _jsxRuntime = require("react/jsx-runtime");
18
- var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
19
- const _excluded = ["onClose"];
20
18
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
21
19
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
22
20
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
23
- function _taggedTemplateLiteral(e, t) { return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); }
24
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
25
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
26
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
27
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
28
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
29
- function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
30
- function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
31
21
  const StateModal = _ref => {
32
22
  let {
33
- onClose
34
- } = _ref,
35
- props = _objectWithoutProperties(_ref, _excluded);
23
+ onClose,
24
+ ...props
25
+ } = _ref;
36
26
  const rootElement = (0, _utils.appendElementTo)('StateModalContainer');
37
27
  const Container = document.createElement('div');
38
28
  rootElement.appendChild(Container);
@@ -42,9 +32,10 @@ const StateModal = _ref => {
42
32
  Container.remove();
43
33
  if (onClose) onClose();
44
34
  };
45
- _reactDom.default.render(/*#__PURE__*/(0, _jsxRuntime.jsx)(ModalContent, _objectSpread(_objectSpread({}, props), {}, {
35
+ _reactDom.default.render(/*#__PURE__*/(0, _jsxRuntime.jsx)(ModalContent, {
36
+ ...props,
46
37
  onClose: handleClose
47
- })), Container);
38
+ }), Container);
48
39
  };
49
40
  const ModalContent = _ref2 => {
50
41
  let {
@@ -83,7 +74,7 @@ const ModalContent = _ref2 => {
83
74
  ref: refWrapper,
84
75
  onClick: handleDismiss,
85
76
  role: "dialog",
86
- "aria-labelledby": "".concat(id, "-Title"),
77
+ "aria-labelledby": `${id}-Title`,
87
78
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(Container, {
88
79
  children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(Body, {
89
80
  type: type,
@@ -96,14 +87,16 @@ const ModalContent = _ref2 => {
96
87
  })]
97
88
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ButtonGroup.default, {
98
89
  alignRight: true,
99
- children: [showCancelButton === true && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, _objectSpread(_objectSpread(_objectSpread({}, cancelButtonType === 'danger' && {
100
- danger: true
101
- }), cancelButtonType === 'warning' && {
102
- warning: true
103
- }), {}, {
90
+ children: [showCancelButton === true && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
91
+ ...(cancelButtonType === 'danger' && {
92
+ danger: true
93
+ }),
94
+ ...(cancelButtonType === 'warning' && {
95
+ warning: true
96
+ }),
104
97
  onClick: handleCancel,
105
98
  children: cancelButtonText || 'Cancel'
106
- })), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
99
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.default, {
107
100
  success: true,
108
101
  onClick: handleConfirm,
109
102
  children: confirmButtonText || 'Confirm'
@@ -112,9 +105,28 @@ const ModalContent = _ref2 => {
112
105
  })
113
106
  });
114
107
  };
115
- const Wrapper = (0, _styledComponents.default)(_ModalBackdrop.default)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n z-index: 90;\n"])));
116
- const Container = _styledComponents.default.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n width: 500px;\n max-width: 90%;\n background: var(--color-background2);\n box-shadow: var(--box-shadow);\n padding: var(--spacing);\n border-radius: var(--border-radius);\n color: var(--font-on-background);\n border: var(--border-width) solid var(--border-color);\n text-align: center;\n"])));
117
- const Body = _styledComponents.default.div(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n margin-bottom: var(--spacing);\n\n > svg {\n font-size: 120px;\n margin-bottom: var(--spacing);\n\n ", "\n }\n"])), _ref3 => {
108
+ const Wrapper = (0, _styledComponents.default)(_ModalBackdrop.default)`
109
+ z-index: 90;
110
+ `;
111
+ const Container = _styledComponents.default.div`
112
+ width: 500px;
113
+ max-width: 90%;
114
+ background: var(--color-background2);
115
+ box-shadow: var(--box-shadow);
116
+ padding: var(--spacing);
117
+ border-radius: var(--border-radius);
118
+ color: var(--font-on-background);
119
+ border: var(--border-width) solid var(--border-color);
120
+ text-align: center;
121
+ `;
122
+ const Body = _styledComponents.default.div`
123
+ margin-bottom: var(--spacing);
124
+
125
+ > svg {
126
+ font-size: 120px;
127
+ margin-bottom: var(--spacing);
128
+
129
+ ${_ref3 => {
118
130
  let {
119
131
  type
120
132
  } = _ref3;
@@ -127,7 +139,16 @@ const Body = _styledComponents.default.div(_templateObject3 || (_templateObject3
127
139
  default:
128
140
  return 'color: var(--color-success);';
129
141
  }
130
- });
131
- const Title = _styledComponents.default.h2(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n font-size: var(--font-body1);\n font-weight: var(--font-bold);\n margin-bottom: var(--spacing-s);\n"])));
132
- const Message = _styledComponents.default.p(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n font-size: var(--font-body1);\n white-space: pre-line;\n"])));
142
+ }}
143
+ }
144
+ `;
145
+ const Title = _styledComponents.default.h2`
146
+ font-size: var(--font-body1);
147
+ font-weight: var(--font-bold);
148
+ margin-bottom: var(--spacing-s);
149
+ `;
150
+ const Message = _styledComponents.default.p`
151
+ font-size: var(--font-body1);
152
+ white-space: pre-line;
153
+ `;
133
154
  var _default = exports.default = StateModal;