@rpg-engine/long-bow 0.7.86 → 0.7.88

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.
@@ -30584,47 +30584,52 @@ var StyledInput = /*#__PURE__*/styled.input.withConfig({
30584
30584
  componentId: "sc-z4ut57-3"
30585
30585
  })(["width:100%;padding:0.5rem;background-color:rgba(0,0,0,0.25);border:none;color:white;font-size:1rem;text-align:center;&::-webkit-inner-spin-button,&::-webkit-outer-spin-button{-webkit-appearance:none;margin:0;}&[type='number']{-moz-appearance:textfield;}"]);
30586
30586
 
30587
- var ItemQuantitySelector = function ItemQuantitySelector(_ref) {
30588
- var quantity = _ref.quantity,
30589
- onConfirm = _ref.onConfirm,
30590
- onClose = _ref.onClose;
30591
- return React.createElement(QuantitySelector, {
30592
- maxQuantity: quantity,
30593
- initialQuantity: quantity,
30594
- title: "Select quantity to move",
30595
- onConfirm: onConfirm,
30596
- onClose: onClose
30587
+ var validateQuantitySelect = function validateQuantitySelect(quantitySelect) {
30588
+ return _extends({}, quantitySelect, {
30589
+ maxQuantity: Math.max(1, quantitySelect.maxQuantity),
30590
+ initialQuantity: quantitySelect.initialQuantity ? Math.max(1, Math.min(quantitySelect.maxQuantity, quantitySelect.initialQuantity)) : undefined
30597
30591
  });
30598
30592
  };
30599
-
30600
- var ItemQuantitySelectorModal = function ItemQuantitySelectorModal(_ref) {
30593
+ var QuantitySelectorModal = function QuantitySelectorModal(_ref) {
30601
30594
  var quantitySelect = _ref.quantitySelect,
30602
30595
  setQuantitySelect = _ref.setQuantitySelect;
30603
- return React.createElement(ModalPortal, null, React.createElement(QuantitySelectorContainer, null, React.createElement(ItemQuantitySelector, {
30604
- quantity: quantitySelect.maxQuantity,
30596
+ var resetQuantitySelect = function resetQuantitySelect() {
30597
+ setQuantitySelect({
30598
+ isOpen: false,
30599
+ maxQuantity: 1,
30600
+ callback: function callback() {}
30601
+ });
30602
+ };
30603
+ // Validate the input values
30604
+ var validatedQuantitySelect = validateQuantitySelect(quantitySelect);
30605
+ return React.createElement(ModalPortal, null, React.createElement(QuantitySelectorContainer, null, React.createElement(QuantitySelector, {
30606
+ maxQuantity: validatedQuantitySelect.maxQuantity,
30607
+ initialQuantity: validatedQuantitySelect.initialQuantity,
30608
+ title: validatedQuantitySelect.title,
30605
30609
  onConfirm: function onConfirm(quantity) {
30606
- quantitySelect.callback(quantity);
30607
- setQuantitySelect({
30608
- isOpen: false,
30609
- maxQuantity: 1,
30610
- callback: function callback() {}
30611
- });
30610
+ validatedQuantitySelect.callback(quantity);
30611
+ resetQuantitySelect();
30612
30612
  },
30613
30613
  onClose: function onClose() {
30614
- quantitySelect.callback(-1);
30615
- setQuantitySelect({
30616
- isOpen: false,
30617
- maxQuantity: 1,
30618
- callback: function callback() {}
30619
- });
30614
+ validatedQuantitySelect.callback(-1);
30615
+ resetQuantitySelect();
30620
30616
  }
30621
30617
  })));
30622
30618
  };
30623
30619
  var QuantitySelectorContainer = /*#__PURE__*/styled.div.withConfig({
30624
- displayName: "ItemQuantitySelectorModal__QuantitySelectorContainer",
30625
- componentId: "sc-1b8cosc-0"
30620
+ displayName: "QuantitySelectorModal__QuantitySelectorContainer",
30621
+ componentId: "sc-aye686-0"
30626
30622
  })(["position:absolute;top:0;left:0;width:100vw;height:100vh;z-index:100;display:flex;justify-content:center;align-items:center;background-color:rgba(0,0,0,0.5);"]);
30627
30623
 
30624
+ var ItemQuantitySelectorModal = function ItemQuantitySelectorModal(_ref) {
30625
+ var quantitySelect = _ref.quantitySelect,
30626
+ setQuantitySelect = _ref.setQuantitySelect;
30627
+ return React.createElement(QuantitySelectorModal, {
30628
+ quantitySelect: quantitySelect,
30629
+ setQuantitySelect: setQuantitySelect
30630
+ });
30631
+ };
30632
+
30628
30633
  var MIN_SLOTS_FOR_SCROLL = 20;
30629
30634
  var ItemContainer$1 = /*#__PURE__*/React.memo(function (_ref) {
30630
30635
  var itemContainer = _ref.itemContainer,
@@ -34081,5 +34086,5 @@ var LessonContainer = /*#__PURE__*/styled.div.withConfig({
34081
34086
  componentId: "sc-7tgzv2-6"
34082
34087
  })(["display:flex;flex-direction:column;justify-content:space-between;min-height:200px;p{font-size:0.7rem !important;}"]);
34083
34088
 
34084
- export { ActionButtons, AsyncDropdown, Button, ButtonTypes, CharacterSelection, Chat, ChatDeprecated, ChatRevamp, CheckButton, CheckItem, CircularController, CraftBook, DraggableContainer, Dropdown, DropdownSelectorContainer, DynamicText, EquipmentSet, EquipmentSlotSpriteByType, ErrorBoundary, FriendList, HistoryDialog, ImageCarousel, ImgSide, Input, InputRadio$1 as InputRadio, InternalTabs, ItemContainer$1 as ItemContainer, ItemQuantitySelectorModal, ItemSelector, ItemSlot, Leaderboard, ListMenu, Marketplace, MarketplaceRows, MultitabType, NPCDialog, NPCDialogType, NPCMultiDialog, PartyCreate, PartyDashboard, PartyInvite, PartyManager, PartyManagerRow, PartyRow, PlayersRow, ProgressBar, PropertySelect, QuestInfo, QuestList, QuestionDialog, RPGUIContainer, RPGUIContainerTypes, RPGUIRoot, RangeSlider, RangeSliderType, SelectArrow, Shortcuts, SimpleImageCarousel, SkillProgressBar, SkillsContainer, Spellbook, SpriteFromAtlas, Stepper, TabBody, Table, TableCell, TableHeader, TableRow, TabsContainer, TextArea, TimeWidget, Tooltip, TradingMenu, Truncate, TutorialStepper, UserActionLink, _RPGUI, formatQuestStatus, formatQuestText, getMockedPlayersRowsLeader, getMockedPlayersRowsNotLeader, getQuestStatusColor, mockedPartyManager, mockedPartyRows, mockedPlayersRows, mockedPlayersRows2, useEventListener };
34089
+ export { ActionButtons, AsyncDropdown, Button, ButtonTypes, CharacterSelection, Chat, ChatDeprecated, ChatRevamp, CheckButton, CheckItem, CircularController, CraftBook, DraggableContainer, Dropdown, DropdownSelectorContainer, DynamicText, EquipmentSet, EquipmentSlotSpriteByType, ErrorBoundary, FriendList, HistoryDialog, ImageCarousel, ImgSide, Input, InputRadio$1 as InputRadio, InternalTabs, ItemContainer$1 as ItemContainer, ItemQuantitySelectorModal, ItemSelector, ItemSlot, Leaderboard, ListMenu, Marketplace, MarketplaceRows, MultitabType, NPCDialog, NPCDialogType, NPCMultiDialog, PartyCreate, PartyDashboard, PartyInvite, PartyManager, PartyManagerRow, PartyRow, PlayersRow, ProgressBar, PropertySelect, QuantitySelectorModal, QuestInfo, QuestList, QuestionDialog, RPGUIContainer, RPGUIContainerTypes, RPGUIRoot, RangeSlider, RangeSliderType, SelectArrow, Shortcuts, SimpleImageCarousel, SkillProgressBar, SkillsContainer, Spellbook, SpriteFromAtlas, Stepper, TabBody, Table, TableCell, TableHeader, TableRow, TabsContainer, TextArea, TimeWidget, Tooltip, TradingMenu, Truncate, TutorialStepper, UserActionLink, _RPGUI, formatQuestStatus, formatQuestText, getMockedPlayersRowsLeader, getMockedPlayersRowsNotLeader, getQuestStatusColor, mockedPartyManager, mockedPartyRows, mockedPlayersRows, mockedPlayersRows2, useEventListener };
34085
34090
  //# sourceMappingURL=long-bow.esm.js.map