@cashub/ui 0.26.2 → 0.26.4

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/index.js CHANGED
@@ -500,6 +500,18 @@ Object.keys(_wizard).forEach(function (key) {
500
500
  }
501
501
  });
502
502
  });
503
+ var _xmleditor = require("./xmleditor");
504
+ Object.keys(_xmleditor).forEach(function (key) {
505
+ if (key === "default" || key === "__esModule") return;
506
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
507
+ if (key in exports && exports[key] === _xmleditor[key]) return;
508
+ Object.defineProperty(exports, key, {
509
+ enumerable: true,
510
+ get: function () {
511
+ return _xmleditor[key];
512
+ }
513
+ });
514
+ });
503
515
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
504
516
  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); }
505
517
  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; }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cashub/ui",
3
- "version": "0.26.2",
3
+ "version": "0.26.4",
4
4
  "private": false,
5
5
  "author": "CasHUB Team",
6
6
  "description": "CasHUB UI components library",
@@ -14,6 +14,7 @@
14
14
  "@cashub/utils": "^0.5.0",
15
15
  "@googlemaps/markerclusterer": "^2.5.1",
16
16
  "@googlemaps/react-wrapper": "^1.1.35",
17
+ "@monaco-editor/react": "^4.6.0",
17
18
  "@popperjs/core": "^2.11.5",
18
19
  "@yaireo/tagify": "^4.12.0",
19
20
  "brace": "^0.11.1",
package/select/Select.js CHANGED
@@ -44,7 +44,8 @@ const Select = _ref => {
44
44
  fill,
45
45
  fillReverse,
46
46
  onBlur,
47
- onSearch
47
+ onSearch,
48
+ flexGrow
48
49
  } = _ref;
49
50
  const {
50
51
  t
@@ -494,64 +495,70 @@ const Select = _ref => {
494
495
  }
495
496
  }
496
497
  }, [setupFocus, display, allowSearch]);
497
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactOutsideClickHandler.default, {
498
- onOutsideClick: () => {
499
- setDisplay(false);
500
- if (onBlur) onBlur();
501
- setIsFocusCombobox(false);
498
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
499
+ style: {
500
+ flexGrow: flexGrow ? 1 : 0
502
501
  },
503
- disabled: !isFocusCombobox,
504
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(Combobox, {
505
- role: "combobox",
506
- tabIndex: "0",
507
- "aria-haspopup": "listbox",
508
- "aria-expanded": display,
509
- "aria-owns": id,
510
- ref: setComboboxElement,
511
- onClick: handleToggle,
512
- onKeyUp: handleKeyUp,
513
- onKeyDown: handleKeyDown,
514
- $display: display,
515
- disabled: disabled,
516
- fullWidth: fullWidth,
517
- large: large,
518
- $fill: fill,
519
- fillReverse: fillReverse,
520
- onFocus: handleFocus,
521
- placeholder: placeholder,
522
- children: [selectedItem, selectedOptions.length > 0 && !multiple && !disabled && allowClear && /*#__PURE__*/(0, _jsxRuntime.jsx)(CloseButton, {
523
- onClick: () => {
524
- onSelect('');
525
- }
526
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(ExpandArrow, {
502
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactOutsideClickHandler.default, {
503
+ onOutsideClick: () => {
504
+ setDisplay(false);
505
+ if (onBlur) onBlur();
506
+ setIsFocusCombobox(false);
507
+ },
508
+ disabled: !isFocusCombobox,
509
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(Combobox, {
510
+ flexGrow: flexGrow,
511
+ role: "combobox",
512
+ tabIndex: "0",
527
513
  "aria-haspopup": "listbox",
528
- "aria-expanded": display
529
- })]
530
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ListBox.default, {
531
- role: "listbox",
532
- tabIndex: "0",
533
- id: id,
534
- ref: setListBoxElement,
535
- onKeyUp: handleKeyUp,
536
- onKeyDown: handleKeyDown,
537
- width: listBoxWidth,
538
- $display: display,
539
- style: styles.popper,
540
- ...attributes.popper,
541
- placement: state && state.placement,
542
- children: [allowSearch && /*#__PURE__*/(0, _jsxRuntime.jsx)(_SearchBox.default, {
543
- ref: searchBoxElement,
544
- placeholder: "Search",
545
- onChange: handleSearchChange,
546
- value: search
547
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Options.default, {
548
- ref: optionsElementRef,
549
- allowSearch: allowSearch,
550
- children: optionItem || /*#__PURE__*/(0, _jsxRuntime.jsx)(Message, {
551
- children: "No results found"
552
- })
514
+ "aria-expanded": display,
515
+ "aria-owns": id,
516
+ ref: setComboboxElement,
517
+ onClick: handleToggle,
518
+ onKeyUp: handleKeyUp,
519
+ onKeyDown: handleKeyDown,
520
+ $display: display,
521
+ disabled: disabled,
522
+ fullWidth: fullWidth,
523
+ large: large,
524
+ $fill: fill,
525
+ fillReverse: fillReverse,
526
+ onFocus: handleFocus,
527
+ placeholder: placeholder,
528
+ children: [selectedItem, selectedOptions.length > 0 && !multiple && !disabled && allowClear && /*#__PURE__*/(0, _jsxRuntime.jsx)(CloseButton, {
529
+ onClick: () => {
530
+ onSelect('');
531
+ }
532
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(ExpandArrow, {
533
+ "aria-haspopup": "listbox",
534
+ "aria-expanded": display
535
+ })]
536
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_ListBox.default, {
537
+ role: "listbox",
538
+ tabIndex: "0",
539
+ id: id,
540
+ ref: setListBoxElement,
541
+ onKeyUp: handleKeyUp,
542
+ onKeyDown: handleKeyDown,
543
+ width: listBoxWidth,
544
+ $display: display,
545
+ style: styles.popper,
546
+ ...attributes.popper,
547
+ placement: state && state.placement,
548
+ children: [allowSearch && /*#__PURE__*/(0, _jsxRuntime.jsx)(_SearchBox.default, {
549
+ ref: searchBoxElement,
550
+ placeholder: "Search",
551
+ onChange: handleSearchChange,
552
+ value: search
553
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_Options.default, {
554
+ ref: optionsElementRef,
555
+ allowSearch: allowSearch,
556
+ children: optionItem || /*#__PURE__*/(0, _jsxRuntime.jsx)(Message, {
557
+ children: "No results found"
558
+ })
559
+ })]
553
560
  })]
554
- })]
561
+ })
555
562
  });
556
563
  };
557
564
  const Icon = _ref2 => {
@@ -570,45 +577,50 @@ const Icon = _ref2 => {
570
577
  }), "\xA0"]
571
578
  });
572
579
  };
573
- const Combobox = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n min-height: 36px;\n min-width: 160px;\n cursor: pointer;\n position: relative;\n background: transparent;\n color: var(--font-on-background);\n font-size: var(--font-body1);\n border: var(--border-width) solid var(--border-color);\n border-radius: var(--border-radius-l);\n padding: 0 calc(var(--spacing-s) * 2 + 8px) 0 var(--spacing-s);\n\n &:focus {\n ", ";\n }\n\n ", "\n\n ", "\n ", "\n \n ", ";\n\n ", "\n\n ", "\n\n ", "\n"])), _ref3 => {
580
+ const Combobox = _styledComponents.default.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n min-height: 36px;\n cursor: pointer;\n position: relative;\n background: transparent;\n color: var(--font-on-background);\n font-size: var(--font-body1);\n border: var(--border-width) solid var(--border-color);\n border-radius: var(--border-radius-l);\n padding: 0 calc(var(--spacing-s) * 2 + 8px) 0 var(--spacing-s);\n\n &:focus {\n ", ";\n }\n\n ", "\n\n ", "\n\n ", "\n ", "\n \n ", ";\n\n ", "\n\n ", "\n\n ", "\n"])), _ref3 => {
574
581
  let {
575
582
  disabled
576
583
  } = _ref3;
577
584
  return !disabled && "\n border-color: var(--color-primary);\n outline: none;\n ";
578
585
  }, _ref4 => {
579
586
  let {
580
- $display
587
+ flexGrow
581
588
  } = _ref4;
582
- return $display && "\n border-color: var(--color-primary);\n outline: none;\n ";
589
+ return !flexGrow && 'min-width: 160px;';
583
590
  }, _ref5 => {
584
591
  let {
585
- disabled
592
+ $display
586
593
  } = _ref5;
587
- return disabled && 'cursor: not-allowed;opacity: 0.5;';
594
+ return $display && "\n border-color: var(--color-primary);\n outline: none;\n ";
588
595
  }, _ref6 => {
589
596
  let {
590
- placeholder
597
+ disabled
591
598
  } = _ref6;
592
- return placeholder && 'color: var(--font-on-mute);';
599
+ return disabled && 'cursor: not-allowed;opacity: 0.5;';
593
600
  }, _ref7 => {
594
601
  let {
595
- fullWidth
602
+ placeholder
596
603
  } = _ref7;
597
- return fullWidth ? 'width: 100%' : 'max-width: 320px';
604
+ return placeholder && 'color: var(--font-on-mute);';
598
605
  }, _ref8 => {
599
606
  let {
600
- large
607
+ fullWidth
601
608
  } = _ref8;
602
- return large && "\n height: 40px;\n padding: 12px calc(var(--spacing-s) * 2 + 8px) 12px var(--spacing-s);\n ";
609
+ return fullWidth ? 'width: 100%' : 'max-width: 320px';
603
610
  }, _ref9 => {
604
611
  let {
605
- $fill
612
+ large
606
613
  } = _ref9;
607
- return $fill && "\n background: var(--color-background2);\n border-color: transparent;\n ";
614
+ return large && "\n height: 40px;\n padding: 12px calc(var(--spacing-s) * 2 + 8px) 12px var(--spacing-s);\n ";
608
615
  }, _ref10 => {
609
616
  let {
610
- fillReverse
617
+ $fill
611
618
  } = _ref10;
619
+ return $fill && "\n background: var(--color-background2);\n border-color: transparent;\n ";
620
+ }, _ref11 => {
621
+ let {
622
+ fillReverse
623
+ } = _ref11;
612
624
  return fillReverse && "\n background: var(--color-background1);\n border-color: transparent;\n ";
613
625
  });
614
626
  Combobox.displayName = 'Combobox';
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("@monaco-editor/react"));
8
+ var _src = require("../../../utils/src");
9
+ var _jsxRuntime = require("react/jsx-runtime");
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+ const XmlEditor = _ref => {
12
+ let {
13
+ mode,
14
+ initialValue,
15
+ onXmlEditorMounted
16
+ } = _ref;
17
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
18
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.default, {
19
+ height: "150px",
20
+ theme: "vs-dark",
21
+ defaultLanguage: "xml",
22
+ defaultValue: initialValue ? (0, _src.xmlFormatter)(initialValue) : '',
23
+ options: {
24
+ readOnly: mode === 'view',
25
+ minimap: {
26
+ enabled: false
27
+ },
28
+ tabSize: 2
29
+ },
30
+ onMount: onXmlEditorMounted
31
+ })
32
+ });
33
+ };
34
+ var _default = exports.default = XmlEditor;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "XmlEditor", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _XmlEditor.default;
10
+ }
11
+ });
12
+ var _XmlEditor = _interopRequireDefault(require("./XmlEditor"));
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }