@rpg-engine/long-bow 0.7.86 → 0.7.87
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/dist/components/Item/Inventory/ItemQuantitySelectorModal.d.ts +2 -6
- package/dist/components/QuantitySelector/QuantitySelectorModal.d.ts +14 -0
- package/dist/index.d.ts +0 -1
- package/dist/long-bow.cjs.development.js +33 -29
- package/dist/long-bow.cjs.development.js.map +1 -1
- package/dist/long-bow.cjs.production.min.js +1 -1
- package/dist/long-bow.cjs.production.min.js.map +1 -1
- package/dist/long-bow.esm.js +34 -29
- package/dist/long-bow.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Item/Inventory/ItemQuantitySelector.tsx +126 -9
- package/src/components/Item/Inventory/ItemQuantitySelectorModal.tsx +7 -45
- package/src/components/QuantitySelector/QuantitySelectorModal.tsx +79 -0
- package/src/index.tsx +0 -1
package/dist/long-bow.esm.js
CHANGED
|
@@ -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
|
|
30588
|
-
|
|
30589
|
-
|
|
30590
|
-
|
|
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
|
-
|
|
30604
|
-
|
|
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
|
-
|
|
30607
|
-
|
|
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
|
-
|
|
30615
|
-
|
|
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: "
|
|
30625
|
-
componentId: "sc-
|
|
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,
|
|
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, 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 };
|
|
34085
34090
|
//# sourceMappingURL=long-bow.esm.js.map
|