aio-popup 8.0.1 → 8.1.0

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.css CHANGED
@@ -572,6 +572,7 @@
572
572
 
573
573
  .aio-popup-confirm {
574
574
  overflow: hidden;
575
+ background: #fff;
575
576
  }
576
577
 
577
578
  .aio-popup-confirm .aio-popup-body {
package/index.d.ts CHANGED
@@ -102,6 +102,7 @@ export type AP_confirm = {
102
102
  export type AP_prompt = {
103
103
  title?: string;
104
104
  text: string;
105
+ placeholder?: string;
105
106
  subtitle?: string;
106
107
  submitText?: string;
107
108
  canselText?: string;
package/index.js CHANGED
@@ -195,7 +195,7 @@ const usePopup = (props) => {
195
195
  };
196
196
  const addPrompt = (obj) => {
197
197
  const id = 'a' + (Math.round(Math.random() * 100000));
198
- let { title, text = '', subtitle, submitText = 'Submit', canselText = 'close', onSubmit, onCansel = () => { }, modalAttrs, backdropAttrs, headerAttrs, footerAttrs, bodyAttrs } = obj;
198
+ let { title, text = '', subtitle, submitText = 'Submit', placeholder = '', canselText = 'close', onSubmit, onCansel = () => { }, modalAttrs, backdropAttrs, headerAttrs, footerAttrs, bodyAttrs } = obj;
199
199
  const submitAttrs = AddToAttrs(obj.submitAttrs, {
200
200
  className: 'active', attrs: {
201
201
  onClick: () => __awaiter(void 0, void 0, void 0, function* () {
@@ -230,7 +230,7 @@ const usePopup = (props) => {
230
230
  position: 'center', header: { title, subtitle },
231
231
  modalAttrs: AddToAttrs(modalAttrs, { className: 'aio-popup-prompt' }),
232
232
  backdropAttrs, headerAttrs, footerAttrs, bodyAttrs,
233
- body: _jsx(Prompt, { change: (value) => promptTexts.current = Object.assign(Object.assign({}, promptTexts.current), { [id]: value }), placeholder: text }),
233
+ body: _jsx(Prompt, { change: (value) => promptTexts.current = Object.assign(Object.assign({}, promptTexts.current), { [id]: value }), placeholder: placeholder, text: text }),
234
234
  footer: (_jsxs(_Fragment, { children: [_jsx("button", Object.assign({}, canselAttrs, { children: canselText })), _jsx("button", Object.assign({}, submitAttrs, { children: submitText }))] }))
235
235
  };
236
236
  addModal(config);
@@ -251,9 +251,9 @@ const usePopup = (props) => {
251
251
  return { addAlert, addSnackebar, removeModal, addModal, getModals, addHighlight, removeHighlight, render, addConfirm, addPrompt, portal };
252
252
  };
253
253
  export default usePopup;
254
- const Prompt = ({ change, placeholder }) => {
255
- const [text, setText] = useState('');
256
- return (_jsx("textarea", { placeholder: placeholder, value: text, onChange: (e) => { const value = e.target.value; setText(value); change(value); } }));
254
+ const Prompt = ({ change, placeholder, text = '' }) => {
255
+ const [value, setValue] = useState(text);
256
+ return (_jsx("textarea", { placeholder: placeholder, value: value, onChange: (e) => { const value = e.target.value; setValue(value); change(value); } }));
257
257
  };
258
258
  const POPUPCTX = createContext({});
259
259
  const Popup = ({ modal, isLast }) => {
@@ -742,16 +742,16 @@ function getEasing(highlight) {
742
742
  const { easing } = highlight;
743
743
  var easingNames = [
744
744
  'linear',
745
- 'easeInQuad',
746
- 'easeInSine',
747
- 'easeInCirc',
748
- 'easeInBack',
749
- 'easeOutQuad',
750
- 'easeOutSine',
751
- 'easeOutCirc',
752
- 'easeInOutQuad',
753
- 'easeInOutSine',
754
- 'easeInOutBack',
745
+ 'easeInQuad', //1
746
+ 'easeInSine', //5
747
+ 'easeInCirc', //7
748
+ 'easeInBack', //8
749
+ 'easeOutQuad', //9
750
+ 'easeOutSine', //13
751
+ 'easeOutCirc', //15
752
+ 'easeInOutQuad', //18
753
+ 'easeInOutSine', //22
754
+ 'easeInOutBack', //25
755
755
  'easeOutBounce', //27
756
756
  ];
757
757
  if (typeof easing === 'number') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aio-popup",
3
- "version": "8.0.1",
3
+ "version": "8.1.0",
4
4
  "description": "handle all types of popup and modals in react",
5
5
  "main": "index.js",
6
6
  "scripts": {