@app-studio/web 0.3.7 → 0.3.11
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/GlobalStyle.d.ts +2 -1
- package/dist/assets/svg/index.d.ts +2 -0
- package/dist/components/File/File.d.ts +8 -0
- package/dist/components/Form/Checkbox/Checkbox/Checkbox.state.d.ts +1 -1
- package/dist/components/Form/Select/Select/Select.state.d.ts +1 -1
- package/dist/components/Form/TextArea/TextArea/TextArea.state.d.ts +1 -1
- package/dist/components/Form/TextField/TextField/TextField.state.d.ts +1 -1
- package/dist/components/Layout/View/View.d.ts +7 -1
- package/dist/components/Message/Examples/CloseButtonMessage.d.ts +2 -0
- package/dist/components/Message/Examples/DefaultMessage.d.ts +2 -0
- package/dist/components/Message/Examples/VariantMessage.d.ts +2 -0
- package/dist/components/Message/Examples/index.d.ts +3 -0
- package/dist/components/Message/Message/Message.layout.d.ts +3 -0
- package/dist/components/Message/Message/Message.props.d.ts +115 -0
- package/dist/components/Message/Message/Message.store.d.ts +10 -0
- package/dist/components/Message/Message/Message.style.d.ts +5 -0
- package/dist/components/Message/Message/Message.view.d.ts +19 -0
- package/dist/components/Message/Message.d.ts +2 -0
- package/dist/components/Modal/Modal/Modal.layout.d.ts +3 -0
- package/dist/components/Modal/Modal/Modal.props.d.ts +9 -0
- package/dist/components/Modal/Modal/Modal.store.d.ts +11 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/pages/message.page.d.ts +3 -0
- package/dist/web.cjs.development.js +131 -48
- 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 +117 -37
- package/dist/web.esm.js.map +1 -1
- package/package.json +7 -6
package/dist/web.esm.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import React, { useState, useRef, useEffect, useMemo, useCallback } from 'react';
|
|
2
|
-
import { View, Element, Typography, useTheme, Input } from 'app-studio';
|
|
3
|
-
export { View } from 'app-studio';
|
|
1
|
+
import React, { useState, useRef, useEffect, useMemo, useCallback, Fragment } from 'react';
|
|
2
|
+
import { View as View$1, Element, Typography, useTheme, Input, Image } from 'app-studio';
|
|
4
3
|
import { Link as Link$1 } from 'react-router-dom';
|
|
5
4
|
import format from 'date-fns/format';
|
|
6
5
|
import { create } from 'zustand';
|
|
@@ -52,6 +51,34 @@ var useLinkState = function useLinkState() {
|
|
|
52
51
|
};
|
|
53
52
|
};
|
|
54
53
|
|
|
54
|
+
var Top = function Top(props) {
|
|
55
|
+
return React.createElement(View$1, Object.assign({
|
|
56
|
+
marginBottom: "auto"
|
|
57
|
+
}, props));
|
|
58
|
+
};
|
|
59
|
+
var Bottom = function Bottom(props) {
|
|
60
|
+
return React.createElement(View$1, Object.assign({
|
|
61
|
+
marginTop: "auto"
|
|
62
|
+
}, props));
|
|
63
|
+
};
|
|
64
|
+
var Left = function Left(props) {
|
|
65
|
+
return React.createElement(View$1, Object.assign({
|
|
66
|
+
marginRight: "auto"
|
|
67
|
+
}, props));
|
|
68
|
+
};
|
|
69
|
+
var Right = function Right(props) {
|
|
70
|
+
return React.createElement(View$1, Object.assign({
|
|
71
|
+
marginLeft: "auto"
|
|
72
|
+
}, props));
|
|
73
|
+
};
|
|
74
|
+
var Inline = function Inline(props) {
|
|
75
|
+
return React.createElement(View$1, Object.assign({
|
|
76
|
+
display: 'inline-flex',
|
|
77
|
+
wordBreak: "break-word"
|
|
78
|
+
}, props));
|
|
79
|
+
};
|
|
80
|
+
var View = View$1;
|
|
81
|
+
|
|
55
82
|
var _excluded = ["children", "wrap", "justify", "isReversed"];
|
|
56
83
|
var HorizontalView = function HorizontalView(_ref) {
|
|
57
84
|
var children = _ref.children,
|
|
@@ -2306,7 +2333,7 @@ var VerticalView = function VerticalView(_ref) {
|
|
|
2306
2333
|
_ref$isReversed = _ref.isReversed,
|
|
2307
2334
|
isReversed = _ref$isReversed === void 0 ? false : _ref$isReversed,
|
|
2308
2335
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$c);
|
|
2309
|
-
return React.createElement(View, Object.assign({
|
|
2336
|
+
return React.createElement(View$1, Object.assign({
|
|
2310
2337
|
display: "flex",
|
|
2311
2338
|
flexWrap: wrap,
|
|
2312
2339
|
flexDirection: isReversed ? 'column-reverse' : 'column',
|
|
@@ -4297,31 +4324,43 @@ var Loader = LoaderComponent;
|
|
|
4297
4324
|
|
|
4298
4325
|
var useModalStore = /*#__PURE__*/create(function (set) {
|
|
4299
4326
|
return {
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
|
|
4303
|
-
return set(function (state) {
|
|
4304
|
-
return {
|
|
4305
|
-
isOpen: !state.isOpen
|
|
4306
|
-
};
|
|
4307
|
-
});
|
|
4327
|
+
modal: false,
|
|
4328
|
+
modalProps: {
|
|
4329
|
+
isVisible: false
|
|
4308
4330
|
},
|
|
4309
|
-
|
|
4310
|
-
|
|
4311
|
-
|
|
4312
|
-
|
|
4313
|
-
|
|
4331
|
+
overlayProps: {},
|
|
4332
|
+
show: function show(modal, modalProps, overlayProps) {
|
|
4333
|
+
if (modalProps === void 0) {
|
|
4334
|
+
modalProps = {};
|
|
4335
|
+
}
|
|
4336
|
+
if (overlayProps === void 0) {
|
|
4337
|
+
overlayProps = {};
|
|
4338
|
+
}
|
|
4339
|
+
if (modal) {
|
|
4340
|
+
modalProps.isVisible = true;
|
|
4341
|
+
}
|
|
4342
|
+
set(function (state) {
|
|
4343
|
+
return _extends({}, state, {
|
|
4344
|
+
modal: modal,
|
|
4345
|
+
modalProps: modalProps,
|
|
4346
|
+
overlayProps: overlayProps
|
|
4347
|
+
});
|
|
4314
4348
|
});
|
|
4315
4349
|
},
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
return {
|
|
4319
|
-
|
|
4320
|
-
|
|
4350
|
+
hide: function hide() {
|
|
4351
|
+
set(function (state) {
|
|
4352
|
+
return _extends({}, state, {
|
|
4353
|
+
modalProps: {
|
|
4354
|
+
isVisible: false
|
|
4355
|
+
}
|
|
4356
|
+
});
|
|
4321
4357
|
});
|
|
4322
4358
|
}
|
|
4323
4359
|
};
|
|
4324
4360
|
});
|
|
4361
|
+
var hideModal = function hideModal() {
|
|
4362
|
+
useModalStore.getState().hide();
|
|
4363
|
+
};
|
|
4325
4364
|
|
|
4326
4365
|
var ContainerShapes = {
|
|
4327
4366
|
sharp: {
|
|
@@ -4376,17 +4415,6 @@ var ModalOverlay = function ModalOverlay(_ref) {
|
|
|
4376
4415
|
_ref$position = _ref.position,
|
|
4377
4416
|
position = _ref$position === void 0 ? 'center' : _ref$position,
|
|
4378
4417
|
props = _objectWithoutPropertiesLoose(_ref, _excluded$s);
|
|
4379
|
-
var setOpen = useModalStore(function (state) {
|
|
4380
|
-
return state.setOpen;
|
|
4381
|
-
});
|
|
4382
|
-
var setOnClose = useModalStore(function (state) {
|
|
4383
|
-
return state.setOnClose;
|
|
4384
|
-
});
|
|
4385
|
-
useEffect(function () {
|
|
4386
|
-
setOnClose(onClose);
|
|
4387
|
-
if (isOpen) setOpen();
|
|
4388
|
-
});
|
|
4389
|
-
if (!isOpen) return null;
|
|
4390
4418
|
var handleClick = function handleClick() {
|
|
4391
4419
|
if (!isClosePrevented) onClose();
|
|
4392
4420
|
};
|
|
@@ -4454,9 +4482,7 @@ var ModalHeader = function ModalHeader(_ref3) {
|
|
|
4454
4482
|
_ref3$buttonPosition = _ref3.buttonPosition,
|
|
4455
4483
|
buttonPosition = _ref3$buttonPosition === void 0 ? 'right' : _ref3$buttonPosition,
|
|
4456
4484
|
props = _objectWithoutPropertiesLoose(_ref3, _excluded3$2);
|
|
4457
|
-
var onClose =
|
|
4458
|
-
return state.onClose;
|
|
4459
|
-
});
|
|
4485
|
+
var onClose = props.onClose ? props.onClose : hideModal;
|
|
4460
4486
|
var buttonIcon = React.createElement(Button, {
|
|
4461
4487
|
onClick: onClose,
|
|
4462
4488
|
colorScheme: "transparent",
|
|
@@ -4503,6 +4529,33 @@ var ModalFooter = function ModalFooter(_ref5) {
|
|
|
4503
4529
|
}, props), children);
|
|
4504
4530
|
};
|
|
4505
4531
|
|
|
4532
|
+
var ModalLayout = function ModalLayout(_ref) {
|
|
4533
|
+
var modals = _ref.modals;
|
|
4534
|
+
var modalStore = useModalStore(function (_ref2) {
|
|
4535
|
+
var modal = _ref2.modal,
|
|
4536
|
+
modalProps = _ref2.modalProps,
|
|
4537
|
+
overlayProps = _ref2.overlayProps;
|
|
4538
|
+
return {
|
|
4539
|
+
modal: modal,
|
|
4540
|
+
modalProps: modalProps,
|
|
4541
|
+
overlayProps: overlayProps
|
|
4542
|
+
};
|
|
4543
|
+
});
|
|
4544
|
+
if (typeof modalStore.modal === 'boolean') {
|
|
4545
|
+
return null;
|
|
4546
|
+
}
|
|
4547
|
+
var Modal = modals[modalStore.modal];
|
|
4548
|
+
if (!Modal) {
|
|
4549
|
+
console.error(modalStore.modal + " modal doesn't exist");
|
|
4550
|
+
return null;
|
|
4551
|
+
}
|
|
4552
|
+
return React.createElement(Fragment, null, React.createElement(ModalOverlay, Object.assign({
|
|
4553
|
+
isOpen: modalStore.modalProps.isVisible,
|
|
4554
|
+
onClose: hideModal,
|
|
4555
|
+
blur: 10
|
|
4556
|
+
}, modalStore.overlayProps), Modal !== undefined && React.createElement(Modal, Object.assign({}, modalStore.modalProps))));
|
|
4557
|
+
};
|
|
4558
|
+
|
|
4506
4559
|
/**
|
|
4507
4560
|
* It is a custom content overlay that appears on top of the main screen.
|
|
4508
4561
|
*/
|
|
@@ -4516,6 +4569,33 @@ Modal.Container = ModalContainer;
|
|
|
4516
4569
|
Modal.Header = ModalHeader;
|
|
4517
4570
|
Modal.Body = ModalBody;
|
|
4518
4571
|
Modal.Footer = ModalFooter;
|
|
4572
|
+
Modal.Layout = ModalLayout;
|
|
4573
|
+
|
|
4574
|
+
var _excluded$t = ["src", "color"],
|
|
4575
|
+
_excluded2$3 = ["path"];
|
|
4576
|
+
var FileSVG = function FileSVG(_ref) {
|
|
4577
|
+
var src = _ref.src,
|
|
4578
|
+
color = _ref.color,
|
|
4579
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded$t);
|
|
4580
|
+
var _useTheme = useTheme(),
|
|
4581
|
+
getColor = _useTheme.getColor;
|
|
4582
|
+
var Colorprops = color ? {
|
|
4583
|
+
fill: getColor(color),
|
|
4584
|
+
stroke: getColor(color)
|
|
4585
|
+
} : {};
|
|
4586
|
+
return React.createElement(Center, Object.assign({}, props), React.createElement(Image, Object.assign({}, Colorprops, {
|
|
4587
|
+
content: 'url("' + src + '")',
|
|
4588
|
+
width: "100%",
|
|
4589
|
+
height: "100%"
|
|
4590
|
+
})));
|
|
4591
|
+
};
|
|
4592
|
+
var FileImage = function FileImage(_ref2) {
|
|
4593
|
+
var path = _ref2.path,
|
|
4594
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded2$3);
|
|
4595
|
+
return React.createElement(Image, Object.assign({
|
|
4596
|
+
src: path
|
|
4597
|
+
}, props));
|
|
4598
|
+
};
|
|
4519
4599
|
|
|
4520
|
-
export { Button, Center, Checkbox, CountryPicker, DatePicker, Horizontal, Link, Loader, Modal, Password, Select, Switch, Text, TextArea, TextField, Vertical };
|
|
4600
|
+
export { Bottom, Button, Center, Checkbox, CountryPicker, DatePicker, FileImage, FileSVG, Horizontal, Inline, Left, Link, Loader, Modal, Password, Right, Select, Switch, Text, TextArea, TextField, Top, Vertical, View };
|
|
4521
4601
|
//# sourceMappingURL=web.esm.js.map
|