@teselagen/ui 0.5.19 → 0.5.20

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/src/index.js CHANGED
@@ -18,11 +18,11 @@ export {
18
18
  } from "./DataTable/utils/withSelectedEntities";
19
19
  export {
20
20
  default as DataTable,
21
- ConnectedPagingTool as PagingTool
21
+ ConnectedPagingTool as PagingTool,
22
+ removeCleanRows
22
23
  } from "./DataTable";
23
- export { removeCleanRows } from "./DataTable/utils";
24
24
 
25
- export { getIdOrCodeOrIndex } from "./DataTable/utils";
25
+ export { default as getIdOrCodeOrIndex } from "./DataTable/utils/getIdOrCodeOrIndex";
26
26
  export { default as convertSchema } from "./DataTable/utils/convertSchema";
27
27
  export { default as Loading } from "./Loading";
28
28
  export { throwFormError } from "./throwFormError";
@@ -1,4 +1,4 @@
1
- import { createRoot } from "react-dom/client";
1
+ import ReactDOM from "react-dom";
2
2
  import React from "react";
3
3
  // import withDialog from "./enhancers/withDialog";
4
4
  import { Dialog } from "@blueprintjs/core";
@@ -19,15 +19,19 @@ export default function showDialogOnDocBody(DialogComp, options = {}) {
19
19
  DialogCompToUse = props => {
20
20
  return (
21
21
  <Dialog usePortal={false} title="pass a {title} prop" isOpen {...props}>
22
- <DialogComp {...props} hideModal={onClose} onClose={onClose} />
22
+ <DialogComp
23
+ {...props}
24
+ hideModal={onClose}
25
+ onClose={onClose}
26
+ ></DialogComp>
23
27
  </Dialog>
24
28
  );
25
29
  };
26
30
  } else {
27
31
  DialogCompToUse = DialogComp;
28
32
  }
29
- const root = createRoot(dialogHolder);
30
- root.render(
31
- <DialogCompToUse hideModal={onClose} onClose={onClose} {...options} />
33
+ ReactDOM.render(
34
+ <DialogCompToUse hideModal={onClose} onClose={onClose} {...options} />,
35
+ dialogHolder
32
36
  );
33
37
  }
package/src/useDialog.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import React, { useState } from "react";
2
2
 
3
- /*
3
+ /*
4
4
 
5
5
  const {toggleDialog, comp} = useDialog({
6
6
  ModalComponent: SimpleInsertData,
@@ -31,14 +31,12 @@ export const useDialog = ({ ModalComponent, ...rest }) => {
31
31
  ...rest?.dialogProps,
32
32
  ...additionalProps?.dialogProps
33
33
  }}
34
- />
34
+ ></ModalComponent>
35
35
  );
36
-
37
36
  const toggleDialog = () => {
38
37
  setOpen(!isOpen);
39
38
  };
40
-
41
- const showDialogPromise = async (handlerName, moreProps = {}) => {
39
+ async function showDialogPromise(handlerName, moreProps = {}) {
42
40
  return new Promise(resolve => {
43
41
  //return a promise that can be awaited
44
42
  setAdditionalProps({
@@ -61,7 +59,6 @@ export const useDialog = ({ ModalComponent, ...rest }) => {
61
59
  });
62
60
  setOpen(true); //open the dialog
63
61
  });
64
- };
65
-
62
+ }
66
63
  return { comp, showDialogPromise, toggleDialog, setAdditionalProps };
67
64
  };
@@ -1,32 +1,29 @@
1
- import { createRoot } from "react-dom/client";
1
+ import ReactDOM from "react-dom";
2
2
 
3
3
  export function renderOnDoc(fn) {
4
4
  const elemDiv = document.createElement("div");
5
5
  elemDiv.style.cssText =
6
6
  "position:absolute;width:100%;height:100%;top:0px;opacity:0.3;z-index:0;";
7
7
  document.body.appendChild(elemDiv);
8
- const root = createRoot(elemDiv);
9
8
  const handleClose = () => {
10
9
  setTimeout(() => {
11
- root.unmount(elemDiv);
10
+ ReactDOM.unmountComponentAtNode(elemDiv);
12
11
  document.body.removeChild(elemDiv);
13
12
  });
14
13
  };
15
- root.render(fn(handleClose));
14
+ return ReactDOM.render(fn(handleClose), elemDiv);
16
15
  }
17
-
18
16
  export function renderOnDocSimple(el) {
19
17
  const elemDiv = document.createElement("div");
20
18
  elemDiv.style.cssText =
21
19
  "position:absolute;width:100%;height:100%;top:0px;opacity:1;z-index:10000;";
22
20
  document.body.appendChild(elemDiv);
23
- const root = createRoot(elemDiv);
24
- root.render(el);
25
21
  const handleClose = () => {
26
22
  setTimeout(() => {
27
- root.unmount();
23
+ ReactDOM.unmountComponentAtNode(elemDiv);
28
24
  document.body.removeChild(elemDiv);
29
25
  });
30
26
  };
27
+ ReactDOM.render(el, elemDiv);
31
28
  return handleClose;
32
29
  }
package/style.css CHANGED
@@ -9085,13 +9085,6 @@ button:not(:disabled):active {
9085
9085
  .rg-celleditor input {
9086
9086
  border: none;
9087
9087
  }
9088
- .bp3-popover.tg-info-helper-popover .bp3-popover-content {
9089
- max-width: 340px;
9090
- }
9091
-
9092
- .info-helper-clickable .bp3-popover-target {
9093
- cursor: pointer;
9094
- }
9095
9088
  .tg-select {
9096
9089
  width: 100%;
9097
9090
  min-width: 170px;
@@ -9153,6 +9146,13 @@ button:not(:disabled):active {
9153
9146
  max-height: 300px;
9154
9147
  overflow: auto;
9155
9148
  }
9149
+ .bp3-popover.tg-info-helper-popover .bp3-popover-content {
9150
+ max-width: 340px;
9151
+ }
9152
+
9153
+ .info-helper-clickable .bp3-popover-target {
9154
+ cursor: pointer;
9155
+ }
9156
9156
  .ReactTable{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border:1px solid rgba(0,0,0,0.1);}.ReactTable *{box-sizing:border-box}.ReactTable .rt-table{-ms-flex:auto 1;flex:auto 1;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:stretch;align-items:stretch;width:100%;border-collapse:collapse;overflow:auto}.ReactTable .rt-thead{-ms-flex:1 0 auto;flex:1 0 auto;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}.ReactTable .rt-thead.-headerGroups{background:rgba(0,0,0,0.03);border-bottom:1px solid rgba(0,0,0,0.05)}.ReactTable .rt-thead.-filters{border-bottom:1px solid rgba(0,0,0,0.05);}.ReactTable .rt-thead.-filters input,.ReactTable .rt-thead.-filters select{border:1px solid rgba(0,0,0,0.1);background:#fff;padding:5px 7px;font-size:inherit;border-radius:3px;font-weight:normal;outline-width:0}.ReactTable .rt-thead.-filters .rt-th{border-right:1px solid rgba(0,0,0,0.02)}.ReactTable .rt-thead.-header{box-shadow:0 2px 15px 0 rgba(0,0,0,0.15)}.ReactTable .rt-thead .rt-tr{text-align:center}.ReactTable .rt-thead .rt-th,.ReactTable .rt-thead .rt-td{padding:5px 5px;line-height:normal;position:relative;border-right:1px solid rgba(0,0,0,0.05);transition:box-shadow .3s cubic-bezier(.175,.885,.32,1.275);box-shadow:inset 0 0 0 0 transparent;}.ReactTable .rt-thead .rt-th.-sort-asc,.ReactTable .rt-thead .rt-td.-sort-asc{box-shadow:inset 0 3px 0 0 rgba(0,0,0,0.6)}.ReactTable .rt-thead .rt-th.-sort-desc,.ReactTable .rt-thead .rt-td.-sort-desc{box-shadow:inset 0 -3px 0 0 rgba(0,0,0,0.6)}.ReactTable .rt-thead .rt-th.-cursor-pointer,.ReactTable .rt-thead .rt-td.-cursor-pointer{cursor:pointer}.ReactTable .rt-thead .rt-th:last-child,.ReactTable .rt-thead .rt-td:last-child{border-right:0}.ReactTable .rt-thead .rt-th:focus{outline-width:0}.ReactTable .rt-thead .rt-resizable-header{overflow:visible;}.ReactTable .rt-thead .rt-resizable-header:last-child{overflow:hidden}.ReactTable .rt-thead .rt-resizable-header-content{overflow:hidden;text-overflow:ellipsis}.ReactTable .rt-thead .rt-header-pivot{border-right-color:#f7f7f7}.ReactTable .rt-thead .rt-header-pivot:after,.ReactTable .rt-thead .rt-header-pivot:before{left:100%;top:50%;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none}.ReactTable .rt-thead .rt-header-pivot:after{border-color:rgba(255,255,255,0);border-left-color:#fff;border-width:8px;margin-top:-8px}.ReactTable .rt-thead .rt-header-pivot:before{border-color:rgba(102,102,102,0);border-left-color:#f7f7f7;border-width:10px;margin-top:-10px}.ReactTable .rt-tbody{-ms-flex:99999 1 auto;flex:99999 1 auto;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:auto;}.ReactTable .rt-tbody .rt-tr-group{border-bottom:solid 1px rgba(0,0,0,0.05);}.ReactTable .rt-tbody .rt-tr-group:last-child{border-bottom:0}.ReactTable .rt-tbody .rt-td{border-right:1px solid rgba(0,0,0,0.02);}.ReactTable .rt-tbody .rt-td:last-child{border-right:0}.ReactTable .rt-tbody .rt-expandable{cursor:pointer;text-overflow:clip}.ReactTable .rt-tr-group{-ms-flex:1 0 auto;flex:1 0 auto;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:stretch;align-items:stretch}.ReactTable .rt-tr{-ms-flex:1 0 auto;flex:1 0 auto;display:-ms-inline-flexbox;display:inline-flex}.ReactTable .rt-th,.ReactTable .rt-td{-ms-flex:1 0 0px;flex:1 0 0;white-space:nowrap;text-overflow:ellipsis;padding:7px 5px;overflow:hidden;transition:.3s ease;transition-property:width,min-width,padding,opacity;}.ReactTable .rt-th.-hidden,.ReactTable .rt-td.-hidden{width:0 !important;min-width:0 !important;padding:0 !important;border:0 !important;opacity:0 !important}.ReactTable .rt-expander{display:inline-block;position:relative;margin:0;color:transparent;margin:0 10px;}.ReactTable .rt-expander:after{content:'';position:absolute;width:0;height:0;top:50%;left:50%;transform:translate(-50%,-50%) rotate(-90deg);border-left:5.04px solid transparent;border-right:5.04px solid transparent;border-top:7px solid rgba(0,0,0,0.8);transition:all .3s cubic-bezier(.175,.885,.32,1.275);cursor:pointer}.ReactTable .rt-expander.-open:after{transform:translate(-50%,-50%) rotate(0)}.ReactTable .rt-resizer{display:inline-block;position:absolute;width:36px;top:0;bottom:0;right:-18px;cursor:col-resize;z-index:10}.ReactTable .rt-tfoot{-ms-flex:1 0 auto;flex:1 0 auto;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;box-shadow:0 0 15px 0 rgba(0,0,0,0.15);}.ReactTable .rt-tfoot .rt-td{border-right:1px solid rgba(0,0,0,0.05);}.ReactTable .rt-tfoot .rt-td:last-child{border-right:0}.ReactTable.-striped .rt-tr.-odd{background:rgba(0,0,0,0.03)}.ReactTable.-highlight .rt-tbody .rt-tr:not(.-padRow):hover{background:rgba(0,0,0,0.05)}.ReactTable .-pagination{z-index:1;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:stretch;align-items:stretch;-ms-flex-wrap:wrap;flex-wrap:wrap;padding:3px;box-shadow:0 0 15px 0 rgba(0,0,0,0.1);border-top:2px solid rgba(0,0,0,0.1);}.ReactTable .-pagination input,.ReactTable .-pagination select{border:1px solid rgba(0,0,0,0.1);background:#fff;padding:5px 7px;font-size:inherit;border-radius:3px;font-weight:normal;outline-width:0}.ReactTable .-pagination .-btn{-webkit-appearance:none;-moz-appearance:none;appearance:none;display:block;width:100%;height:100%;border:0;border-radius:3px;padding:6px;font-size:1em;color:rgba(0,0,0,0.6);background:rgba(0,0,0,0.1);transition:all .1s ease;cursor:pointer;outline-width:0;}.ReactTable .-pagination .-btn[disabled]{opacity:.5;cursor:default}.ReactTable .-pagination .-btn:not([disabled]):hover{background:rgba(0,0,0,0.3);color:#fff}.ReactTable .-pagination .-previous,.ReactTable .-pagination .-next{-ms-flex:1;flex:1;text-align:center}.ReactTable .-pagination .-center{-ms-flex:1.5;flex:1.5;text-align:center;margin-bottom:0;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;-ms-flex-align:center;align-items:center;-ms-flex-pack:distribute;justify-content:space-around}.ReactTable .-pagination .-pageInfo{display:inline-block;margin:3px 10px;white-space:nowrap}.ReactTable .-pagination .-pageJump{display:inline-block;}.ReactTable .-pagination .-pageJump input{width:70px;text-align:center}.ReactTable .-pagination .-pageSizeOptions{margin:3px 10px}.ReactTable .rt-noData{display:block;position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);background:rgba(255,255,255,0.8);transition:all .3s ease;z-index:1;pointer-events:none;padding:20px;color:rgba(0,0,0,0.5)}.ReactTable .-loading{display:block;position:absolute;left:0;right:0;top:0;bottom:0;background:rgba(255,255,255,0.8);transition:all .3s ease;z-index:-1;opacity:0;pointer-events:none;}.ReactTable .-loading > div{position:absolute;display:block;text-align:center;width:100%;top:50%;left:0;font-size:15px;color:rgba(0,0,0,0.6);transform:translateY(-52%);transition:all .3s cubic-bezier(.25,.46,.45,.94)}.ReactTable .-loading.-active{opacity:1;z-index:2;pointer-events:all;}.ReactTable .-loading.-active > div{transform:translateY(50%)}.ReactTable .rt-resizing .rt-th,.ReactTable .rt-resizing .rt-td{transition:none !important;cursor:col-resize;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}/* DataTable style.css */
9157
9157
  .custom-menu-item {
9158
9158
  text-overflow: ellipsis;
@@ -1,2 +1,2 @@
1
- export function renderOnDoc(fn: any): void;
1
+ export function renderOnDoc(fn: any): Element;
2
2
  export function renderOnDocSimple(el: any): () => void;
package/src/ExcelCell.js DELETED
@@ -1,38 +0,0 @@
1
- /* eslint react/jsx-no-bind: 0 */
2
- import { Popover } from "@blueprintjs/core";
3
- import React, { useState } from "react";
4
-
5
- export default function ExcelCell() {
6
- const [v, setV] = useState("");
7
- const [isPopoverOpen, setIsPopoverOpen] = useState(false);
8
- return (
9
- <Popover
10
- onClose={() => {
11
- setIsPopoverOpen(false);
12
- }}
13
- isOpen={isPopoverOpen}
14
- content={<div>Sum</div>}
15
- >
16
- <div
17
- style={{
18
- border: "1px solid #ccc",
19
- padding: 5,
20
- width: 100,
21
- height: 30
22
- }}
23
- contentEditable
24
- onInput={e => {
25
- const text = e.currentTarget.textContent;
26
-
27
- if (text === "=") {
28
- // open a popover
29
- setIsPopoverOpen(true);
30
- }
31
- setV(text);
32
- }}
33
- >
34
- {v}
35
- </div>
36
- </Popover>
37
- );
38
- }