@kwiz/fluentui 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,8 +2,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Dialog, DialogActions, DialogBody, DialogContent, DialogSurface, DialogTitle, DialogTrigger } from '@fluentui/react-components';
3
3
  import { isNullOrEmptyString } from '@kwiz/common';
4
4
  import React from 'react';
5
+ import { useKWIZFluentContextContext } from '../helpers/context';
5
6
  import { ButtonEXSecondary } from './button';
6
7
  export const Prompter = (props) => {
8
+ const ctx = useKWIZFluentContextContext();
7
9
  let okProps = Object.assign(Object.assign({}, (props.okButtonProps || {})), { onClick: () => props.onOK(), title: props.okButtonText || 'yes' });
8
10
  let cancelProps = Object.assign(Object.assign({}, (props.cancelButtonProps || {})), { onClick: () => props.onCancel(), title: props.cancelButtonText || 'no' });
9
11
  React.useEffect(() => {
@@ -16,6 +18,6 @@ export const Prompter = (props) => {
16
18
  document.addEventListener("keydown", handler);
17
19
  return () => document.removeEventListener("keydown", handler);
18
20
  });
19
- return (_jsx(Dialog, { open: true, children: _jsxs(DialogSurface, { children: [!isNullOrEmptyString(props.title) && _jsx(DialogTitle, { children: props.title }), _jsxs(DialogBody, { children: [_jsx(DialogContent, { children: props.children }), _jsxs(DialogActions, { children: [props.hideOk ? undefined : _jsx(DialogTrigger, { disableButtonEnhancement: true, children: _jsx(ButtonEXSecondary, Object.assign({}, okProps)) }), props.hideCancel ? undefined : _jsx(DialogTrigger, { disableButtonEnhancement: true, children: _jsx(ButtonEXSecondary, Object.assign({}, cancelProps)) })] })] })] }) }));
21
+ return (_jsx(Dialog, { open: true, children: _jsxs(DialogSurface, { mountNode: ctx.mountNode, children: [!isNullOrEmptyString(props.title) && _jsx(DialogTitle, { children: props.title }), _jsxs(DialogBody, { children: [_jsx(DialogContent, { children: props.children }), _jsxs(DialogActions, { children: [props.hideOk ? undefined : _jsx(DialogTrigger, { disableButtonEnhancement: true, children: _jsx(ButtonEXSecondary, Object.assign({}, okProps)) }), props.hideCancel ? undefined : _jsx(DialogTrigger, { disableButtonEnhancement: true, children: _jsx(ButtonEXSecondary, Object.assign({}, cancelProps)) })] })] })] }) }));
20
22
  };
21
23
  //# sourceMappingURL=prompt.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../src/controls/prompt.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AACzI,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAiB,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAe5D,MAAM,CAAC,MAAM,QAAQ,GAAqE,CAAC,KAAK,EAAE,EAAE;IAChG,IAAI,OAAO,mCACJ,CAAC,KAAK,CAAC,aAAoB,IAAI,EAAE,CAAC,KACrC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,EAC3B,KAAK,EAAE,KAAK,CAAC,YAAY,IAAI,KAAK,GACrC,CAAC;IACF,IAAI,WAAW,mCACR,CAAC,KAAK,CAAC,iBAAwB,IAAI,EAAE,CAAC,KACzC,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,QAAQ,EAAE,EAC/B,KAAK,EAAE,KAAK,CAAC,gBAAgB,IAAI,IAAI,GACxC,CAAC;IACF,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACjB,IAAI,OAAO,GAAG,CAAC,CAAgB,EAAE,EAAE;YAC/B,IAAI,CAAC,CAAC,GAAG,KAAK,OAAO;gBAAE,KAAK,CAAC,IAAI,EAAE,CAAC;iBAC/B,IAAI,CAAC,CAAC,GAAG,KAAK,QAAQ;gBAAE,KAAK,CAAC,QAAQ,EAAE,CAAC;QAElD,CAAC,CAAC;QACF,QAAQ,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EAAI,GACtB,EACf,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAC,aAAa,IAAC,wBAAwB,kBACnE,KAAC,iBAAiB,oBAAK,WAAW,EAAI,GAC1B,IACJ,IACP,IACD,GACX,CACZ,CAAC;AACN,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kwiz/fluentui",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "KWIZ common controls for FluentUI",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,6 +1,7 @@
1
1
  import { Dialog, DialogActions, DialogBody, DialogContent, DialogSurface, DialogTitle, DialogTrigger } from '@fluentui/react-components';
2
2
  import { isNullOrEmptyString } from '@kwiz/common';
3
3
  import React from 'react';
4
+ import { useKWIZFluentContextContext } from '../helpers/context';
4
5
  import { ButtonEXProps, ButtonEXSecondary } from './button';
5
6
 
6
7
  export interface IPrompterProps {
@@ -17,6 +18,8 @@ export interface IPrompterProps {
17
18
  children?: JSX.Element;
18
19
  }
19
20
  export const Prompter: React.FunctionComponent<React.PropsWithChildren<IPrompterProps>> = (props) => {
21
+ const ctx = useKWIZFluentContextContext();
22
+
20
23
  let okProps: ButtonEXProps = {
21
24
  ...(props.okButtonProps as any || {}),
22
25
  onClick: () => props.onOK(),
@@ -38,7 +41,7 @@ export const Prompter: React.FunctionComponent<React.PropsWithChildren<IPrompter
38
41
  });
39
42
  return (
40
43
  <Dialog open>
41
- <DialogSurface>
44
+ <DialogSurface mountNode={ctx.mountNode}>
42
45
  {!isNullOrEmptyString(props.title) && <DialogTitle>{props.title}</DialogTitle>}
43
46
  <DialogBody>
44
47
  <DialogContent>