@app-studio/web 0.8.40 → 0.8.42
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/Modal/Modal/Modal.layout.d.ts +1 -1
- package/dist/components/Modal/Modal/Modal.store.d.ts +10 -7
- package/dist/web.cjs.development.js +51 -49
- package/dist/web.cjs.development.js.map +1 -1
- package/dist/web.cjs.production.min.js +1 -1
- package/dist/web.cjs.production.min.js.map +1 -1
- package/dist/web.esm.js +51 -49
- package/dist/web.esm.js.map +1 -1
- package/dist/web.umd.development.js +51 -49
- package/dist/web.umd.development.js.map +1 -1
- package/dist/web.umd.production.min.js +1 -1
- package/dist/web.umd.production.min.js.map +1 -1
- package/package.json +4 -4
package/dist/web.esm.js
CHANGED
|
@@ -2396,7 +2396,7 @@ var ButtonView = _ref => {
|
|
|
2396
2396
|
ariaLabel,
|
|
2397
2397
|
// Initializes default values for the ButtonProps object; useful for defining states like isAuto, isFilled, etc.
|
|
2398
2398
|
externalHref,
|
|
2399
|
-
isAuto,
|
|
2399
|
+
isAuto = false,
|
|
2400
2400
|
// Determines if button should be active based on isDisabled and isLoading properties.
|
|
2401
2401
|
isFilled = false,
|
|
2402
2402
|
// Prepares default properties for the native button element based on isActive state.
|
|
@@ -2474,7 +2474,8 @@ var ButtonView = _ref => {
|
|
|
2474
2474
|
var buttonSizeStyles = ButtonSizes[size];
|
|
2475
2475
|
var buttonVariant = ButtonVariants[variant];
|
|
2476
2476
|
var scaleWidth = {
|
|
2477
|
-
|
|
2477
|
+
width: isAuto === true ? 'fit-content' : isFilled ? '100%' : buttonSizeStyles.width,
|
|
2478
|
+
minWidth: isAuto === true ? 'fit-content' : isFilled ? '100%' : buttonSizeStyles.width
|
|
2478
2479
|
};
|
|
2479
2480
|
var changePadding = isIconRounded ? IconSizes$1[size] : ButtonSizes[size];
|
|
2480
2481
|
var content = /*#__PURE__*/React.createElement(Horizontal, {
|
|
@@ -6622,46 +6623,51 @@ var MessageLayout = _ref => {
|
|
|
6622
6623
|
};
|
|
6623
6624
|
|
|
6624
6625
|
var useModalStore = /*#__PURE__*/create(set => ({
|
|
6625
|
-
|
|
6626
|
-
|
|
6627
|
-
isVisible: false
|
|
6628
|
-
},
|
|
6629
|
-
overlayProps: {},
|
|
6630
|
-
show: function show(modal, modalProps, overlayProps) {
|
|
6626
|
+
modals: [],
|
|
6627
|
+
show: function show(name, modalProps, overlayProps) {
|
|
6631
6628
|
if (modalProps === void 0) {
|
|
6632
6629
|
modalProps = {};
|
|
6633
6630
|
}
|
|
6634
6631
|
if (overlayProps === void 0) {
|
|
6635
6632
|
overlayProps = {};
|
|
6636
6633
|
}
|
|
6637
|
-
|
|
6638
|
-
|
|
6639
|
-
|
|
6640
|
-
|
|
6641
|
-
|
|
6642
|
-
|
|
6643
|
-
|
|
6634
|
+
set(state => ({
|
|
6635
|
+
modals: [...state.modals, {
|
|
6636
|
+
name,
|
|
6637
|
+
props: Object.assign({}, modalProps, {
|
|
6638
|
+
isVisible: true
|
|
6639
|
+
}),
|
|
6640
|
+
overlayProps
|
|
6641
|
+
}]
|
|
6644
6642
|
}));
|
|
6645
6643
|
},
|
|
6646
|
-
hide:
|
|
6647
|
-
set(state =>
|
|
6648
|
-
|
|
6649
|
-
|
|
6650
|
-
|
|
6651
|
-
|
|
6644
|
+
hide: name => {
|
|
6645
|
+
set(state => {
|
|
6646
|
+
if (!name) {
|
|
6647
|
+
// Hide all modals
|
|
6648
|
+
return {
|
|
6649
|
+
modals: []
|
|
6650
|
+
};
|
|
6651
|
+
}
|
|
6652
|
+
// Hide specific modal by name
|
|
6653
|
+
return {
|
|
6654
|
+
modals: state.modals.filter(modal => modal.name !== name)
|
|
6655
|
+
};
|
|
6656
|
+
});
|
|
6652
6657
|
}
|
|
6653
6658
|
}));
|
|
6654
|
-
var showModal = function showModal(
|
|
6659
|
+
var showModal = function showModal(name, modalProps, overlayProps) {
|
|
6655
6660
|
if (modalProps === void 0) {
|
|
6656
6661
|
modalProps = {};
|
|
6657
6662
|
}
|
|
6658
6663
|
if (overlayProps === void 0) {
|
|
6659
6664
|
overlayProps = {};
|
|
6660
6665
|
}
|
|
6661
|
-
useModalStore.getState().show(
|
|
6666
|
+
useModalStore.getState().show(name, modalProps, overlayProps);
|
|
6662
6667
|
};
|
|
6663
|
-
var hideModal =
|
|
6664
|
-
|
|
6668
|
+
var hideModal = name => {
|
|
6669
|
+
console.log('hideModal', name);
|
|
6670
|
+
useModalStore.getState().hide(typeof name === 'string' ? name : undefined);
|
|
6665
6671
|
};
|
|
6666
6672
|
|
|
6667
6673
|
var ContainerShapes = {
|
|
@@ -6831,33 +6837,29 @@ var ModalFooter = _ref5 => {
|
|
|
6831
6837
|
|
|
6832
6838
|
var ModalLayout = _ref => {
|
|
6833
6839
|
var {
|
|
6834
|
-
modals
|
|
6840
|
+
modals: availableModals
|
|
6835
6841
|
} = _ref;
|
|
6836
|
-
var
|
|
6837
|
-
|
|
6838
|
-
modal,
|
|
6839
|
-
modalProps,
|
|
6840
|
-
overlayProps
|
|
6841
|
-
} = _ref2;
|
|
6842
|
-
return {
|
|
6843
|
-
modal,
|
|
6844
|
-
modalProps,
|
|
6845
|
-
overlayProps
|
|
6846
|
-
};
|
|
6847
|
-
});
|
|
6848
|
-
if (typeof modalStore.modal === 'boolean') {
|
|
6849
|
-
return null;
|
|
6850
|
-
}
|
|
6851
|
-
var Modal = modals[modalStore.modal];
|
|
6852
|
-
if (!Modal) {
|
|
6853
|
-
console.error(modalStore.modal + " modal doesn't exist");
|
|
6842
|
+
var activeModals = useModalStore(state => state.modals);
|
|
6843
|
+
if (activeModals.length === 0) {
|
|
6854
6844
|
return null;
|
|
6855
6845
|
}
|
|
6856
|
-
return /*#__PURE__*/React.createElement(Fragment, null,
|
|
6857
|
-
|
|
6858
|
-
|
|
6859
|
-
|
|
6860
|
-
|
|
6846
|
+
return /*#__PURE__*/React.createElement(Fragment, null, activeModals.map((modal, index) => {
|
|
6847
|
+
var ModalComponent = availableModals[modal.name];
|
|
6848
|
+
if (!ModalComponent) {
|
|
6849
|
+
console.error(modal.name + " modal doesn't exist");
|
|
6850
|
+
return null;
|
|
6851
|
+
}
|
|
6852
|
+
return /*#__PURE__*/React.createElement(ModalOverlay, Object.assign({
|
|
6853
|
+
key: index,
|
|
6854
|
+
isOpen: modal.props.isVisible,
|
|
6855
|
+
onClose: () => hideModal(modal.name),
|
|
6856
|
+
blur: 5
|
|
6857
|
+
}, modal.overlayProps, {
|
|
6858
|
+
style: {
|
|
6859
|
+
zIndex: 1000 + index
|
|
6860
|
+
}
|
|
6861
|
+
}), /*#__PURE__*/React.createElement(ModalComponent, Object.assign({}, modal.props)));
|
|
6862
|
+
}));
|
|
6861
6863
|
};
|
|
6862
6864
|
|
|
6863
6865
|
/**
|