@teppen/react-ui 1.9.0 → 1.10.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/README.md +14 -1
- package/dist/cjs/src/search-bar/condition-search-bar/input-form.js +1 -1
- package/dist/cjs/src/select-box/parts/input-area.js +1 -1
- package/dist/cjs/src/table/cell/ui/cell.js +1 -1
- package/dist/cjs/src/table/edit/ui/base-input.js +1 -1
- package/dist/cjs/src/table/edit/ui/select-input.js +1 -1
- package/dist/cjs/src/table/header/header.js +1 -1
- package/dist/cjs/src/table/pagenation/components.js +1 -1
- package/dist/cjs/src/table/range/provider.js +1 -1
- package/dist/cjs/src/table/range/provider.js.map +1 -1
- package/dist/cjs/src/table/sheet/components.js +1 -1
- package/dist/cjs/src/table/sheet/components.js.map +1 -1
- package/dist/cjs/src/table/table/base.js +1 -1
- package/dist/esm/src/search-bar/condition-search-bar/input-form.js +1 -1
- package/dist/esm/src/select-box/parts/input-area.js +1 -1
- package/dist/esm/src/table/cell/ui/cell.js +1 -1
- package/dist/esm/src/table/edit/ui/base-input.js +1 -1
- package/dist/esm/src/table/edit/ui/select-input.js +1 -1
- package/dist/esm/src/table/header/header.js +1 -1
- package/dist/esm/src/table/pagenation/components.js +1 -1
- package/dist/esm/src/table/range/provider.js +1 -1
- package/dist/esm/src/table/range/provider.js.map +1 -1
- package/dist/esm/src/table/sheet/components.js +1 -1
- package/dist/esm/src/table/sheet/components.js.map +1 -1
- package/dist/esm/src/table/table/base.js +1 -1
- package/package.json +20 -20
package/README.md
CHANGED
|
@@ -27,7 +27,20 @@ Please follow the installation procedure described in the following tailwindcss
|
|
|
27
27
|
|
|
28
28
|
- URL: https://tailwindcss.com/docs/installation/framework-guides
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
This library works with both Tailwind CSS v4 and v3. Tell Tailwind to scan the library's files so that the classes it uses are generated.
|
|
31
|
+
|
|
32
|
+
#### Tailwind CSS v4
|
|
33
|
+
|
|
34
|
+
Add an `@source` for the library to the CSS file that imports Tailwind CSS. The path is relative to that CSS file.
|
|
35
|
+
|
|
36
|
+
```css
|
|
37
|
+
@import "tailwindcss";
|
|
38
|
+
@source "../node_modules/@teppen/react-ui/dist";
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
#### Tailwind CSS v3
|
|
42
|
+
|
|
43
|
+
Add `"./node_modules/@teppen/react-ui/dist/**/*.js"` to `content` in `tailwind.config.js`.
|
|
31
44
|
|
|
32
45
|
```js
|
|
33
46
|
/** @type {import('tailwindcss').Config} */
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";var e=require("react/jsx-runtime"),
|
|
2
|
+
"use strict";var e=require("react/jsx-runtime"),t=require("react"),n=require("../../select-box/index.js"),i=require("./condition-input-management/context.js");require("../../../node_modules/tslib/tslib.es6.js");var o=require("../id-generator/context.js"),r=require("../../../node_modules/react-icons/ti/index.js");function u(){var t=o.useIdGenerator().generateId,r=i.useConditionInputState().targets,u=i.useConditionInputAction().inputTarget;return e.jsx(n.SelectBox,{id:t("TargetInput"),onSelect:function(e){u(e)},options:r.map((function(e){return{value:e.key,label:e.label}})),placeholder:"Select target",no_appearance:!0,no_icon:!0})}function a(){var t=o.useIdGenerator().generateId,r=i.useConditionInputState(),u=i.useConditionInputAction(),a=u.inputOperator,l=u.removeInputedTarget;if("inputted target"!==r.status)return null;var p=r.inputtingCondition.target,s=r.useableOperators;return e.jsxs(e.Fragment,{children:[e.jsx(f,{label:p.label,onClickDelete:function(){l()}}),e.jsx("div",{className:"w-full min-w-64",children:e.jsx(n.SelectBox,{id:t("OperatorInput"),onSelect:function(e){a(e),setTimeout((function(){var e=document.getElementById(t("ValueInput"));e&&e.focus()}),10)},options:s.map((function(e){return{value:e.key,label:e.label}})),defaultIsOpen:!0,placeholder:"Select operator",no_appearance:!0,no_icon:!0})})]})}function l(t){var n=i.useConditionInputState(),o=i.useConditionInputAction(),r=o.removeInputedOperator,u=o.removeInputedTarget;if("inputted operator"!==n.status)return null;var a=n.inputtingCondition.target,l=n.inputtingCondition.operator;return e.jsxs(e.Fragment,{children:[e.jsx(f,{label:a.label,onClickDelete:function(){u()}}),e.jsx(f,{label:l.label,onClickDelete:function(){r()}}),"single string"===n.inputtingCondition.operator.inputType?e.jsx(p,{inputType:n.inputtingCondition.operator.inputType,size:t.size}):"single number"===n.inputtingCondition.operator.inputType?e.jsx(s,{inputType:n.inputtingCondition.operator.inputType,size:t.size}):"select"===n.inputtingCondition.operator.inputType?e.jsx(c,{inputType:n.inputtingCondition.operator.inputType,options:"select"===n.inputtingCondition.target.type?n.inputtingCondition.target.options:[]}):"single datetime"===n.inputtingCondition.operator.inputType?e.jsx(d,{inputType:n.inputtingCondition.operator.inputType,size:t.size}):"single date"===n.inputtingCondition.operator.inputType?e.jsx(g,{inputType:n.inputtingCondition.operator.inputType,size:t.size}):console.error("Not implemented")]})}function p(n){var r=o.useIdGenerator().generateId,u=t.useState(""),a=u[0],l=u[1],p=i.useConditionInputAction().inputValue;return e.jsx("input",{id:r("ValueInput"),className:"appearance-none w-full min-w-64 border-none px-2 py-1 placeholder:text-gray-400 focus:outline-none focus-visible:outline-none bg-transparent ".concat("small"===n.size?"text-sm":"large"===n.size?"text-lg":""),type:"text",placeholder:"Search text",value:a,onChange:function(e){l(e.target.value)},onKeyDown:function(e){"Enter"===e.key&&(p({type:n.inputType,payload:{value:a}}),l(""))}})}function s(n){var r=o.useIdGenerator().generateId,u=t.useState(""),a=u[0],l=u[1],p=i.useConditionInputAction().inputValue;return e.jsx("input",{id:r("ValueInput"),className:"appearance-none w-full min-w-64 border-none px-2 py-1 placeholder:text-gray-400 focus:outline-none focus-visible:outline-none bg-transparent ".concat("small"===n.size?"text-sm":"large"===n.size?"text-lg":""),type:"text",placeholder:"Search text",value:a,onChange:function(e){l(e.target.value)},onKeyDown:function(e){"Enter"===e.key&&(p({type:n.inputType,payload:{value:Number(a)}}),l(""))}})}function c(t){var r=i.useConditionInputAction().inputValue,u=o.useIdGenerator().generateId;return e.jsx("div",{className:"w-full min-w-64",children:e.jsx(n.SelectBox,{id:u("ValueInput"),onSelect:function(e){r({type:t.inputType,payload:{value:e}})},options:t.options,defaultIsOpen:!0,placeholder:"Select value",no_appearance:!0,no_icon:!0})})}function d(n){var r=o.useIdGenerator().generateId,u=i.useConditionInputAction().inputValue,a=t.useRef(null);return t.useEffect((function(){if(a.current){var e=a.current;e.focus(),e.scrollIntoView(),e.click()}}),[]),e.jsx("input",{ref:a,id:r("ValueInput"),className:"appearance-none w-fit min-w-64 border-none px-2 py-1 focus:outline-none focus-visible:outline-none bg-transparent ".concat("small"===n.size?"text-sm":"large"===n.size?"text-lg":""),type:"datetime-local",defaultValue:new Date((new Date).getTime()-6e4*(new Date).getTimezoneOffset()).toISOString().slice(0,16),onKeyDown:function(e){var t,i;if("Enter"===e.key){var o=new Date(null!==(i=null===(t=a.current)||void 0===t?void 0:t.value)&&void 0!==i?i:"");if(isNaN(o.getTime()))return;u({type:n.inputType,payload:{value:o}})}},onClick:function(e){e.currentTarget.showPicker()}})}function g(n){var r=o.useIdGenerator().generateId,u=i.useConditionInputAction().inputValue,a=t.useRef(null),l=t.useRef(!1);return t.useEffect((function(){if(a.current){var e=a.current;e.focus(),e.scrollIntoView(),e.click()}}),[]),e.jsx("input",{ref:a,id:r("ValueInput"),className:"appearance-none w-fit min-w-64 border-none px-2 py-1 focus:outline-none focus-visible:outline-none bg-transparent ".concat("small"===n.size?"text-sm":"large"===n.size?"text-lg":""),type:"date",defaultValue:new Date((new Date).getTime()-6e4*(new Date).getTimezoneOffset()).toISOString().slice(0,10),onKeyDown:function(e){var t;if("Enter"===e.key){if(!(null===(t=a.current)||void 0===t?void 0:t.value))return;var i=a.current.value.split("-"),o=i[0],r=i[1],l=i[2],p=new Date(Number(o),Number(r)-1,Number(l));if(isNaN(p.getTime()))return;u({type:n.inputType,payload:{value:p}})}},onClick:function(e){l.current||(e.currentTarget.showPicker(),l.current=!0)}})}function f(t){return e.jsxs("div",{className:"flex items-center gap-2 w-fit px-2 border border-gray-200 rounded bg-slate-100",children:[e.jsx("p",{className:"whitespace-nowrap",children:t.label}),t.onClickDelete&&e.jsx("div",{children:e.jsx(r.TiDeleteOutline,{className:"bg-white hover:bg-slate-300 rounded-full cursor-pointer",onClick:t.onClickDelete})})]})}exports.SearchBarInputForm=function(t){switch(i.useConditionInputState().status){case"waiting for input":return e.jsx(u,{});case"inputted target":return e.jsx(a,{});case"inputted operator":return e.jsx(l,{size:t.size})}};
|
|
3
3
|
//# sourceMappingURL=input-form.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";var e=require("react/jsx-runtime"),
|
|
2
|
+
"use strict";var e=require("react/jsx-runtime"),t=require("react"),n=require("../id/provider.js"),r=require("../lib/id-generator.js"),o=require("../options-window/context.js");exports.InputArea=function(a){var i,s,u,c=n.useIdContext(),l=o.useOptionsWindow(),d=l.state,p=l.actions,f=t.useMemo((function(){return d.isOpen?a.options.filter((function(e){return e.searchText?e.searchText.toLowerCase().includes(d.searchText.toLowerCase()):e.searchLabel?e.searchLabel.toLowerCase().includes(d.searchText.toLowerCase()):e.label.toLowerCase().includes(d.searchText.toLowerCase())})):[]}),[a.options,d]);t.useEffect((function(){d.isOpen&&p.setSearchText(d.searchText)}),[d]),t.useEffect((function(){if(!d.isOpen){var e=document.getElementById(r.IdGenerator.generateIdSelectBoxInputArea(a.id));if(e){var t=function(e){"ArrowDown"===e.key&&(e.preventDefault(),a.open())};return e.addEventListener("keydown",t),function(){e.removeEventListener("keydown",t)}}}}),[d,f]);var v=null!==(s=null===(i=a.options.find((function(e){return e.value===a.value})))||void 0===i?void 0:i.label)&&void 0!==s?s:"";return e.jsx("input",{id:r.IdGenerator.generateIdSelectBoxInputArea(c),ref:a.inputRef,className:"px-2 py-1 placeholder:text-gray-400 ".concat(a.no_appearance?"appearance-none border-none focus:outline-none focus-visible:outline-none bg-transparent w-full":"border border-gray-300 w-full"),type:"text",placeholder:""===v?null!==(u=a.placeholder)&&void 0!==u?u:"選択してください":v,value:d.isOpen?d.searchText:v,onChange:function(e){e.preventDefault(),p.setSearchText(e.target.value)}})};
|
|
3
3
|
//# sourceMappingURL=input-area.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";var e=require("react/jsx-runtime"),o=require("../../id/provider.js"),l=require("../hooks.js");exports.TableCell=function(n){var s=o.useTableIdGenerator(),i=l.useCell(n.id,n.row),r=i.type,t=i.component,a=i.onDoubleClick,c=i.onMouseDown,u=i.onMouseEnter,d=s.extractCellIndexFromId(n.id);d[0];var
|
|
2
|
+
"use strict";var e=require("react/jsx-runtime"),o=require("../../id/provider.js"),l=require("../hooks.js");exports.TableCell=function(n){var s=o.useTableIdGenerator(),i=l.useCell(n.id,n.row),r=i.type,t=i.component,a=i.onDoubleClick,c=i.onMouseDown,u=i.onMouseEnter,d=s.extractCellIndexFromId(n.id);d[0];var x=d[1];return e.jsx("td",{id:n.id,className:"table-col-".concat(x," p-px ").concat(n.cellFormatClassName),onDoubleClick:n.isExistOnClickRow?void 0:a,onMouseDown:c,onMouseEnter:u,children:e.jsx("div",{className:"flex items-center gap-3 min-h-10 w-fit max-w-full p-2 cursor-default",onClick:function(e){e.stopPropagation()},children:"component"===r?t:e.jsx("div",{onDoubleClick:a,className:"max-w-full",children:e.jsx("p",{className:"text-left max-w-full select-none overflow-hidden whitespace-nowrap text-ellipsis",children:t})})})})};
|
|
3
3
|
//# sourceMappingURL=cell.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";var e=require("react/jsx-runtime"),t=require("react"),n=require("../../../icon/cancel-icon.js"),r=require("../../id/provider.js");exports.CellInput=function(u){var i,o=r.useTableIdGenerator(),s=t.useRef(null);return t.useEffect((function(){s.current&&s.current.focus()}),[s]),e.jsxs("div",{className:"flex justify-between gap-1 w-full items-center",onClick:function(e){e.preventDefault(),e.stopPropagation()},children:[e.jsx("input",{id:o.getEditorId(),ref:s,className:"w-full py-1 px-2 bg-white text-gray-900",type:null!==(i=u.type)&&void 0!==i?i:"text",value:u.value,onChange:u.onChange,onBlur:u.onBlur,onKeyUp:function(e){e.preventDefault(),"Enter"===e.key?e.target.blur():"Escape"===e.key&&(u.reset(),u.endEditing())}}),e.jsx("button",{onMouseDown:function(e){e.preventDefault(),e.stopPropagation(),setTimeout((function(){u.reset(),u.endEditing()}),300)},children:e.jsx(n.CancelIcon,{size:16})})]})};
|
|
2
|
+
"use strict";var e=require("react/jsx-runtime"),t=require("react"),n=require("../../../icon/cancel-icon.js"),r=require("../../id/provider.js");exports.CellInput=function(u){var i,o=r.useTableIdGenerator(),s=t.useRef(null);return t.useEffect((function(){s.current&&s.current.focus()}),[s]),e.jsxs("div",{className:"flex justify-between gap-1 w-full items-center",onClick:function(e){e.preventDefault(),e.stopPropagation()},children:[e.jsx("input",{id:o.getEditorId(),ref:s,className:"w-full py-1 px-2 bg-white text-gray-900",type:null!==(i=u.type)&&void 0!==i?i:"text",value:u.value,onChange:u.onChange,onBlur:u.onBlur,onKeyUp:function(e){e.preventDefault(),"Enter"===e.key?e.target.blur():"Escape"===e.key&&(u.reset(),u.endEditing())}}),e.jsx("button",{className:"cursor-pointer",onMouseDown:function(e){e.preventDefault(),e.stopPropagation(),setTimeout((function(){u.reset(),u.endEditing()}),300)},children:e.jsx(n.CancelIcon,{size:16})})]})};
|
|
3
3
|
//# sourceMappingURL=base-input.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";var e=require("../../../../node_modules/tslib/tslib.es6.js"),t=require("react/jsx-runtime"),n=require("react"),r=require("../provider.js"),o=require("../../../icon/cancel-icon.js"),u=require("../../../select-box/index.js"),i=require("../../id/provider.js");exports.SelectCellInput=function(s){var
|
|
2
|
+
"use strict";var e=require("../../../../node_modules/tslib/tslib.es6.js"),t=require("react/jsx-runtime"),n=require("react"),r=require("../provider.js"),o=require("../../../icon/cancel-icon.js"),u=require("../../../select-box/index.js"),i=require("../../id/provider.js");exports.SelectCellInput=function(s){var c=i.useTableIdGenerator(),l=s.col,a=r.useEditActionContext().endEditing,d=s.row[l.key],f=n.useState(d),p=f[0],v=f[1],m=n.useRef(null),j=n.useRef(null);n.useEffect((function(){j.current&&j.current.focus()}),[j]);var x=function(e){l.editable&&l.onCellBlur(l.key,e,s.row,a)};if(!l.editable)return t.jsx(t.Fragment,{});n.useEffect((function(){var e=function(e){var t=m.current,n=e.target;n instanceof Node&&(null==t?void 0:t.contains(n))||(p!==d?x(p):a())};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[p,x,a,d]);var b=n.useMemo((function(){return l.allowEmpty?e.__spreadArray([{value:"",label:""===d?"-- 未選択 --":"-- 選択解除 --"}],l.options,!0):l.options}),[l.options,l.allowEmpty,d]);return t.jsxs("div",{ref:m,className:"flex justify-between gap-1 w-full items-center",children:[t.jsx(u.SelectBox,{id:c.getEditorId(),inputRef:j,value:p,defaultIsOpen:!0,options:b,onSelect:function(e){v(e),x(e)}}),t.jsx("button",{className:"cursor-pointer",onMouseDown:function(e){e.preventDefault(),e.stopPropagation(),setTimeout((function(){v(d),a()}),300)},children:t.jsx(o.CancelIcon,{size:16})})]})};
|
|
3
3
|
//# sourceMappingURL=select-input.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";var e=require("react/jsx-runtime"),t=require("react"),r=require("./columns-width/context.js");require("../../../node_modules/tslib/tslib.es6.js");var
|
|
2
|
+
"use strict";var e=require("react/jsx-runtime"),t=require("react"),r=require("./columns-width/context.js");require("../../../node_modules/tslib/tslib.es6.js");var s=t.memo((function(t){var s=(0,r.useColumnsWidthState().getColumnWidth)(t.keyname);return e.jsx("th",{className:"p-px",style:{width:s,maxWidth:s,minWidth:s}})}));exports.TableHeaderElement=s;
|
|
3
3
|
//# sourceMappingURL=header.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";var e=require("react/jsx-runtime"),t=require("./providers.js");exports.DisplayRange=function(){var
|
|
2
|
+
"use strict";var e=require("react/jsx-runtime"),t=require("./providers.js");exports.DisplayRange=function(){var r=t.usePageContext(),n=r.enable,s=r.from,u=r.to,o=r.rowCount;return n?e.jsxs("p",{className:"text-center text-sm text-gray-600",children:[s+1," - ",u<o?u:o," of ",o]}):e.jsx(e.Fragment,{})},exports.Pagenation=function(){var r=t.usePageContext(),n=r.enable,s=r.current,u=r.pageCount,o=r.jump,a=r.prev,c=r.next;return n?e.jsxs("div",{className:"flex justify-center gap-2",children:[e.jsx("button",{className:"text-sm cursor-pointer disabled:cursor-default",onClick:function(){return o(1)},disabled:1===s,children:"≪"}),e.jsx("button",{className:"text-sm cursor-pointer disabled:cursor-default",onClick:function(){return a()},disabled:1===s,children:"<"}),Array.from({length:u},(function(e,t){return t+1})).filter((function(e){return s-2<=e&&e<=s+2})).map((function(t){return e.jsx("button",{className:"text-sm cursor-pointer disabled:cursor-default ".concat(s===t?"text-blue-600":""),onClick:function(){return o(t)},children:t},t)})),e.jsx("button",{className:"text-sm cursor-pointer disabled:cursor-default",onClick:function(){return c()},disabled:s===u,children:">"}),e.jsx("button",{className:"text-sm cursor-pointer disabled:cursor-default",onClick:function(){return o(u)},disabled:s===u,children:"≫"})]}):e.jsx(e.Fragment,{})};
|
|
3
3
|
//# sourceMappingURL=components.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("../../../node_modules/tslib/tslib.es6.js"),n=require("react/jsx-runtime"),t=require("react"),o=require("../lib/errors.js"),r=require("./hooks.js"),i=require("../table-property/provider.js"),m=require("../id/provider.js"),s=t.createContext({isSelecting:!1}),u=t.createContext({setMax:o.NoImplementeFunction,startSelectRange:o.NoImplementeFunction,moveSelectRange:o.NoImplementeFunction,endSelectRange:o.NoImplementeFunction,moveUp:o.NoImplementeFunction,moveDown:o.NoImplementeFunction,moveLeft:o.NoImplementeFunction,moveRight:o.NoImplementeFunction,moveTop:o.NoImplementeFunction,moveBottom:o.NoImplementeFunction,moveRightEnd:o.NoImplementeFunction,moveLeftEnd:o.NoImplementeFunction,extendUp:o.NoImplementeFunction,extendDown:o.NoImplementeFunction,extendLeft:o.NoImplementeFunction,extendRight:o.NoImplementeFunction,extendTop:o.NoImplementeFunction,extendBottom:o.NoImplementeFunction,extendRightEnd:o.NoImplementeFunction,extendLeftEnd:o.NoImplementeFunction,reset:o.NoImplementeFunction,setRange:o.NoImplementeFunction});function l(){return t.useContext(s)}function c(){return t.useContext(u)}function a(){var e=c().setMax,o=i.useTablePropertyStateContext(),r=o.maxDisplayRowCount,m=o.maxDisplayColCount;return t.useEffect((function(){e({maxRowIndex:r-1,maxColIndex:m-1})}),[r,m]),n.jsx(n.Fragment,{})}exports.RangeProvider=function(e){var t=e.children,o=r.useRangeReducer(),i=o.state,m=o.actions;return n.jsx(s.Provider,{value:i,children:n.jsxs(u.Provider,{value:m,children:[n.jsx(a,{}),t]})})},exports.TestRange=function(e){var o=m.useTableIdGenerator(),r=l();if(t.useEffect((function(){if(r.isSelecting){var e=document.getElementById(o.getTableCellId({rowIndex:r.end.rowIndex,columnIndex:r.end.colIndex}));e&&(e.scrollIntoView({behavior:"instant",block:"nearest",inline:"nearest"}),e.focus())}}),[r]),!r.isSelecting)return n.jsx(n.Fragment,{});var i=r.rangeBox,s=r.start,u=r.end;return s.xEnd<u.xEnd?u.xEnd:s.xEnd,s.yEnd<u.yEnd?u.yEnd:s.yEnd,n.jsx(n.Fragment,{children:n.jsx("div",{className:"absolute border border-gray-500 bg-gray-500
|
|
1
|
+
"use strict";var e=require("../../../node_modules/tslib/tslib.es6.js"),n=require("react/jsx-runtime"),t=require("react"),o=require("../lib/errors.js"),r=require("./hooks.js"),i=require("../table-property/provider.js"),m=require("../id/provider.js"),s=t.createContext({isSelecting:!1}),u=t.createContext({setMax:o.NoImplementeFunction,startSelectRange:o.NoImplementeFunction,moveSelectRange:o.NoImplementeFunction,endSelectRange:o.NoImplementeFunction,moveUp:o.NoImplementeFunction,moveDown:o.NoImplementeFunction,moveLeft:o.NoImplementeFunction,moveRight:o.NoImplementeFunction,moveTop:o.NoImplementeFunction,moveBottom:o.NoImplementeFunction,moveRightEnd:o.NoImplementeFunction,moveLeftEnd:o.NoImplementeFunction,extendUp:o.NoImplementeFunction,extendDown:o.NoImplementeFunction,extendLeft:o.NoImplementeFunction,extendRight:o.NoImplementeFunction,extendTop:o.NoImplementeFunction,extendBottom:o.NoImplementeFunction,extendRightEnd:o.NoImplementeFunction,extendLeftEnd:o.NoImplementeFunction,reset:o.NoImplementeFunction,setRange:o.NoImplementeFunction});function l(){return t.useContext(s)}function c(){return t.useContext(u)}function a(){var e=c().setMax,o=i.useTablePropertyStateContext(),r=o.maxDisplayRowCount,m=o.maxDisplayColCount;return t.useEffect((function(){e({maxRowIndex:r-1,maxColIndex:m-1})}),[r,m]),n.jsx(n.Fragment,{})}exports.RangeProvider=function(e){var t=e.children,o=r.useRangeReducer(),i=o.state,m=o.actions;return n.jsx(s.Provider,{value:i,children:n.jsxs(u.Provider,{value:m,children:[n.jsx(a,{}),t]})})},exports.TestRange=function(e){var o=m.useTableIdGenerator(),r=l();if(t.useEffect((function(){if(r.isSelecting){var e=document.getElementById(o.getTableCellId({rowIndex:r.end.rowIndex,columnIndex:r.end.colIndex}));e&&(e.scrollIntoView({behavior:"instant",block:"nearest",inline:"nearest"}),e.focus())}}),[r]),!r.isSelecting)return n.jsx(n.Fragment,{});var i=r.rangeBox,s=r.start,u=r.end;return s.xEnd<u.xEnd?u.xEnd:s.xEnd,s.yEnd<u.yEnd?u.yEnd:s.yEnd,n.jsx(n.Fragment,{children:n.jsx("div",{className:"absolute border border-gray-500 bg-gray-500/10 ".concat(e.isCopied?"border-dashed":"border-solid"),style:{top:i.top,left:i.left,width:i.width,height:i.height,pointerEvents:"none"}})})},exports.useRangeActionContext=c,exports.useRangeContext=function(){return e.__assign(e.__assign({},l()),c())},exports.useRangeStateContext=l;
|
|
2
2
|
//# sourceMappingURL=provider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.js","sources":["../../../../../src/table/range/provider.tsx"],"sourcesContent":["import { createContext, useContext, useEffect } from \"react\";\nimport { TRangeActionContext, TRangeStateContext } from \"./type\";\nimport { NoImplementeFunction } from \"../lib/errors\";\nimport { useRangeReducer } from \"./hooks\";\nimport { useTablePropertyStateContext } from \"../table-property/provider\";\nimport { useTableIdGenerator } from \"../id\";\n\nconst RangeStateContext = createContext<TRangeStateContext>({\n isSelecting: false,\n});\n\nconst RangeActionContext = createContext<TRangeActionContext>({\n setMax: NoImplementeFunction,\n startSelectRange: NoImplementeFunction,\n moveSelectRange: NoImplementeFunction,\n endSelectRange: NoImplementeFunction,\n moveUp: NoImplementeFunction,\n moveDown: NoImplementeFunction,\n moveLeft: NoImplementeFunction,\n moveRight: NoImplementeFunction,\n moveTop: NoImplementeFunction,\n moveBottom: NoImplementeFunction,\n moveRightEnd: NoImplementeFunction,\n moveLeftEnd: NoImplementeFunction,\n extendUp: NoImplementeFunction,\n extendDown: NoImplementeFunction,\n extendLeft: NoImplementeFunction,\n extendRight: NoImplementeFunction,\n extendTop: NoImplementeFunction,\n extendBottom: NoImplementeFunction,\n extendRightEnd: NoImplementeFunction,\n extendLeftEnd: NoImplementeFunction,\n reset: NoImplementeFunction,\n setRange: NoImplementeFunction,\n});\n\nexport function useRangeStateContext() {\n return useContext(RangeStateContext);\n}\n\nexport function useRangeActionContext() {\n return useContext(RangeActionContext);\n}\n\nexport function useRangeContext() {\n return { ...useRangeStateContext(), ...useRangeActionContext() };\n}\n\nfunction EffectSetMax() {\n const { setMax } = useRangeActionContext();\n const { maxDisplayRowCount, maxDisplayColCount } =\n useTablePropertyStateContext();\n\n useEffect(() => {\n setMax({\n maxRowIndex: maxDisplayRowCount - 1,\n maxColIndex: maxDisplayColCount - 1,\n });\n }, [maxDisplayRowCount, maxDisplayColCount]);\n\n return <></>;\n}\n\nexport function TestRange(props: { isCopied?: boolean }) {\n const IdGenerator = useTableIdGenerator();\n const state = useRangeStateContext();\n\n useEffect(() => {\n if (state.isSelecting) {\n const endElement = document.getElementById(\n IdGenerator.getTableCellId({\n rowIndex: state.end.rowIndex,\n columnIndex: state.end.colIndex,\n })\n );\n\n if (endElement) {\n endElement.scrollIntoView({\n behavior: \"instant\",\n block: \"nearest\",\n inline: \"nearest\",\n });\n endElement.focus();\n }\n }\n }, [state]);\n\n if (!state.isSelecting) {\n return <></>;\n }\n\n const { rangeBox, start, end } = state;\n\n const clickboxPoint = {\n x: start.xEnd < end.xEnd ? end.xEnd : start.xEnd,\n y: start.yEnd < end.yEnd ? end.yEnd : start.yEnd,\n };\n\n return (\n <>\n <div\n className={`absolute border border-gray-500 bg-gray-500
|
|
1
|
+
{"version":3,"file":"provider.js","sources":["../../../../../src/table/range/provider.tsx"],"sourcesContent":["import { createContext, useContext, useEffect } from \"react\";\nimport { TRangeActionContext, TRangeStateContext } from \"./type\";\nimport { NoImplementeFunction } from \"../lib/errors\";\nimport { useRangeReducer } from \"./hooks\";\nimport { useTablePropertyStateContext } from \"../table-property/provider\";\nimport { useTableIdGenerator } from \"../id\";\n\nconst RangeStateContext = createContext<TRangeStateContext>({\n isSelecting: false,\n});\n\nconst RangeActionContext = createContext<TRangeActionContext>({\n setMax: NoImplementeFunction,\n startSelectRange: NoImplementeFunction,\n moveSelectRange: NoImplementeFunction,\n endSelectRange: NoImplementeFunction,\n moveUp: NoImplementeFunction,\n moveDown: NoImplementeFunction,\n moveLeft: NoImplementeFunction,\n moveRight: NoImplementeFunction,\n moveTop: NoImplementeFunction,\n moveBottom: NoImplementeFunction,\n moveRightEnd: NoImplementeFunction,\n moveLeftEnd: NoImplementeFunction,\n extendUp: NoImplementeFunction,\n extendDown: NoImplementeFunction,\n extendLeft: NoImplementeFunction,\n extendRight: NoImplementeFunction,\n extendTop: NoImplementeFunction,\n extendBottom: NoImplementeFunction,\n extendRightEnd: NoImplementeFunction,\n extendLeftEnd: NoImplementeFunction,\n reset: NoImplementeFunction,\n setRange: NoImplementeFunction,\n});\n\nexport function useRangeStateContext() {\n return useContext(RangeStateContext);\n}\n\nexport function useRangeActionContext() {\n return useContext(RangeActionContext);\n}\n\nexport function useRangeContext() {\n return { ...useRangeStateContext(), ...useRangeActionContext() };\n}\n\nfunction EffectSetMax() {\n const { setMax } = useRangeActionContext();\n const { maxDisplayRowCount, maxDisplayColCount } =\n useTablePropertyStateContext();\n\n useEffect(() => {\n setMax({\n maxRowIndex: maxDisplayRowCount - 1,\n maxColIndex: maxDisplayColCount - 1,\n });\n }, [maxDisplayRowCount, maxDisplayColCount]);\n\n return <></>;\n}\n\nexport function TestRange(props: { isCopied?: boolean }) {\n const IdGenerator = useTableIdGenerator();\n const state = useRangeStateContext();\n\n useEffect(() => {\n if (state.isSelecting) {\n const endElement = document.getElementById(\n IdGenerator.getTableCellId({\n rowIndex: state.end.rowIndex,\n columnIndex: state.end.colIndex,\n })\n );\n\n if (endElement) {\n endElement.scrollIntoView({\n behavior: \"instant\",\n block: \"nearest\",\n inline: \"nearest\",\n });\n endElement.focus();\n }\n }\n }, [state]);\n\n if (!state.isSelecting) {\n return <></>;\n }\n\n const { rangeBox, start, end } = state;\n\n const clickboxPoint = {\n x: start.xEnd < end.xEnd ? end.xEnd : start.xEnd,\n y: start.yEnd < end.yEnd ? end.yEnd : start.yEnd,\n };\n\n return (\n <>\n <div\n className={`absolute border border-gray-500 bg-gray-500/10 ${\n props.isCopied ? \"border-dashed\" : \"border-solid\"\n }`}\n style={{\n top: rangeBox.top,\n left: rangeBox.left,\n width: rangeBox.width,\n height: rangeBox.height,\n pointerEvents: \"none\",\n }}\n ></div>\n {/* <div\n className=\"absolute bg-gray-700\"\n style={{\n top: clickboxPoint.y - 5,\n left: clickboxPoint.x - 5,\n width: 10,\n height: 10,\n pointerEvents: \"none\",\n }}\n /> */}\n </>\n );\n}\n\nexport function RangeProvider({\n children,\n}: {\n children: React.JSX.Element | React.JSX.Element[];\n}) {\n const { state, actions } = useRangeReducer();\n\n return (\n <RangeStateContext.Provider value={state}>\n <RangeActionContext.Provider value={actions}>\n <EffectSetMax />\n {children}\n </RangeActionContext.Provider>\n </RangeStateContext.Provider>\n );\n}\n"],"names":["RangeStateContext","createContext","isSelecting","RangeActionContext","setMax","NoImplementeFunction","startSelectRange","moveSelectRange","endSelectRange","moveUp","moveDown","moveLeft","moveRight","moveTop","moveBottom","moveRightEnd","moveLeftEnd","extendUp","extendDown","extendLeft","extendRight","extendTop","extendBottom","extendRightEnd","extendLeftEnd","reset","setRange","useRangeStateContext","useContext","useRangeActionContext","EffectSetMax","_a","useTablePropertyStateContext","maxDisplayRowCount","maxDisplayColCount","useEffect","maxRowIndex","maxColIndex","_jsx","children","_b","useRangeReducer","state","actions","Provider","value","_jsxs","props","IdGenerator","useTableIdGenerator","endElement","document","getElementById","getTableCellId","rowIndex","end","columnIndex","colIndex","scrollIntoView","behavior","block","inline","focus","rangeBox","start","xEnd","yEnd","className","concat","isCopied","style","top","left","width","height","pointerEvents","__assign"],"mappings":"yPAOMA,EAAoBC,EAAAA,cAAkC,CAC1DC,aAAa,IAGTC,EAAqBF,EAAAA,cAAmC,CAC5DG,OAAQC,EAAAA,qBACRC,iBAAkBD,EAAAA,qBAClBE,gBAAiBF,EAAAA,qBACjBG,eAAgBH,EAAAA,qBAChBI,OAAQJ,EAAAA,qBACRK,SAAUL,EAAAA,qBACVM,SAAUN,EAAAA,qBACVO,UAAWP,EAAAA,qBACXQ,QAASR,EAAAA,qBACTS,WAAYT,EAAAA,qBACZU,aAAcV,EAAAA,qBACdW,YAAaX,EAAAA,qBACbY,SAAUZ,EAAAA,qBACVa,WAAYb,EAAAA,qBACZc,WAAYd,EAAAA,qBACZe,YAAaf,EAAAA,qBACbgB,UAAWhB,EAAAA,qBACXiB,aAAcjB,EAAAA,qBACdkB,eAAgBlB,EAAAA,qBAChBmB,cAAenB,EAAAA,qBACfoB,MAAOpB,EAAAA,qBACPqB,SAAUrB,EAAAA,gCAGIsB,IACd,OAAOC,EAAAA,WAAW5B,EACpB,UAEgB6B,IACd,OAAOD,EAAAA,WAAWzB,EACpB,CAMA,SAAS2B,IACC,IAAA1B,EAAWyB,WACbE,EACJC,EAAAA,+BADMC,EAAkBF,EAAAE,mBAAEC,EAAkBH,EAAAG,mBAU9C,OAPAC,EAAAA,WAAU,WACR/B,EAAO,CACLgC,YAAaH,EAAqB,EAClCI,YAAaH,EAAqB,GAEtC,GAAG,CAACD,EAAoBC,IAEjBI,EAAAA,kBACT,uBAiEM,SAAwBP,GAC5B,IAAAQ,EAAQR,EAAAQ,SAIFC,EAAqBC,EAAAA,kBAAnBC,EAAKF,EAAAE,MAAEC,EAAOH,EAAAG,QAEtB,OACEL,EAAAA,IAACtC,EAAkB4C,SAAQ,CAACC,MAAOH,EAAKH,SACtCO,OAAC3C,EAAmByC,SAAQ,CAACC,MAAOF,EAAOJ,SAAA,CACzCD,MAACR,EAAY,CAAA,GACZS,MAIT,oBA9EM,SAAoBQ,GACxB,IAAMC,EAAcC,EAAAA,sBACdP,EAAQf,IAsBd,GApBAQ,EAAAA,WAAU,WACR,GAAIO,EAAMxC,YAAa,CACrB,IAAMgD,EAAaC,SAASC,eAC1BJ,EAAYK,eAAe,CACzBC,SAAUZ,EAAMa,IAAID,SACpBE,YAAad,EAAMa,IAAIE,YAIvBP,IACFA,EAAWQ,eAAe,CACxBC,SAAU,UACVC,MAAO,UACPC,OAAQ,YAEVX,EAAWY,QAEf,CACF,GAAG,CAACpB,KAECA,EAAMxC,YACT,OAAOoC,EAAAA,mBAGD,IAAAyB,EAAyBrB,EAAKqB,SAApBC,EAAetB,EAAKsB,MAAbT,EAAQb,MAOjC,OAJKsB,EAAMC,KAAOV,EAAIU,KAAOV,EAAIU,KAAOD,EAAMC,KACzCD,EAAME,KAAOX,EAAIW,KAAOX,EAAIW,KAAOF,EAAME,KAI5C5B,EAAAA,yBACEA,EAAAA,IAAA,MAAA,CACE6B,UAAW,kDAAAC,OACTrB,EAAMsB,SAAW,gBAAkB,gBAErCC,MAAO,CACLC,IAAKR,EAASQ,IACdC,KAAMT,EAASS,KACfC,MAAOV,EAASU,MAChBC,OAAQX,EAASW,OACjBC,cAAe,WAezB,qEA/EE,OAAAC,EAAAA,SAAAA,EAAAA,SAAA,CAAA,EAAYjD,KAA2BE,IACzC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=require("react/jsx-runtime"),r=require("react"),t=require("../checkbox/components.js"),o=require("../cell/ui/cell.js"),a=require("../range/provider.js"),n=require("../id/provider.js"),i=r.memo((function(r){var i=n.useTableIdGenerator(),l=a.useRangeActionContext().reset,c=JSON.parse(r.dataString),s=r.conditionalFormattingString.split(",");return e.jsxs("tr",{className:"relative border border-gray-200 after:absolute after:w-full after:h-full after:top-0 after:left-0 after:pointer-events-none after:
|
|
1
|
+
"use strict";var e=require("react/jsx-runtime"),r=require("react"),t=require("../checkbox/components.js"),o=require("../cell/ui/cell.js"),a=require("../range/provider.js"),n=require("../id/provider.js"),i=r.memo((function(r){var i=n.useTableIdGenerator(),l=a.useRangeActionContext().reset,c=JSON.parse(r.dataString),s=r.conditionalFormattingString.split(",");return e.jsxs("tr",{className:"relative border border-gray-200 after:absolute after:w-full after:h-full after:top-0 after:left-0 after:pointer-events-none hover:after:bg-gray-500/10 ".concat(r.onClickRow?"hover:cursor-pointer":""," ").concat(r.applyRowFormatting?r.applyRowFormatting(c):""),onClick:function(e){e.preventDefault(),r.onClickRow&&(r.onClickRow(c),l())},"data-testid":c.id,children:[r.existCheckbox&&e.jsx("td",{className:"w-8 h-full p-px",onClick:function(e){e.stopPropagation()},children:e.jsx(t.Checkbox,{row:c})}),r.cols.map((function(t,a){var n;return e.jsx(o.TableCell,{id:i.getTableCellId({rowIndex:r.rowIndex,columnIndex:a}),row:c,isExistOnClickRow:!!r.onClickRow,cellFormatClassName:s[a],editable:null!==(n=t.editable)&&void 0!==n&&n},t.key)}))]})}));exports.Row=i;
|
|
2
2
|
//# sourceMappingURL=components.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.js","sources":["../../../../../src/table/sheet/components.tsx"],"sourcesContent":["import { memo } from \"react\";\nimport { DataRecord, TTableColumn } from \"../table/type\";\nimport { Checkbox } from \"../checkbox/components\";\nimport { TableCell } from \"../cell/ui/cell\";\nimport { useRangeActionContext } from \"../range/provider\";\nimport { useTableIdGenerator } from \"../id\";\n\ninterface TPropsRow<T extends DataRecord> {\n dataString: string;\n cols: TTableColumn<T>[];\n existCheckbox?: boolean;\n rowIndex: number;\n conditionalFormattingString: string;\n onClickRow?: (row: any) => void;\n applyRowFormatting?: (row: any) => string;\n}\n\nexport const Row = memo(function R<T extends DataRecord>(props: TPropsRow<T>) {\n const IdGenerator = useTableIdGenerator();\n const { reset } = useRangeActionContext();\n const row = JSON.parse(props.dataString);\n const conditionalFormatting = props.conditionalFormattingString.split(\",\");\n\n return (\n <tr\n className={`relative border border-gray-200 after:absolute after:w-full after:h-full after:top-0 after:left-0 after:pointer-events-none after:
|
|
1
|
+
{"version":3,"file":"components.js","sources":["../../../../../src/table/sheet/components.tsx"],"sourcesContent":["import { memo } from \"react\";\nimport { DataRecord, TTableColumn } from \"../table/type\";\nimport { Checkbox } from \"../checkbox/components\";\nimport { TableCell } from \"../cell/ui/cell\";\nimport { useRangeActionContext } from \"../range/provider\";\nimport { useTableIdGenerator } from \"../id\";\n\ninterface TPropsRow<T extends DataRecord> {\n dataString: string;\n cols: TTableColumn<T>[];\n existCheckbox?: boolean;\n rowIndex: number;\n conditionalFormattingString: string;\n onClickRow?: (row: any) => void;\n applyRowFormatting?: (row: any) => string;\n}\n\nexport const Row = memo(function R<T extends DataRecord>(props: TPropsRow<T>) {\n const IdGenerator = useTableIdGenerator();\n const { reset } = useRangeActionContext();\n const row = JSON.parse(props.dataString);\n const conditionalFormatting = props.conditionalFormattingString.split(\",\");\n\n return (\n <tr\n className={`relative border border-gray-200 after:absolute after:w-full after:h-full after:top-0 after:left-0 after:pointer-events-none hover:after:bg-gray-500/10 ${\n !!props.onClickRow ? \"hover:cursor-pointer\" : \"\"\n } ${props.applyRowFormatting ? props.applyRowFormatting(row) : \"\"}`}\n onClick={(e) => {\n e.preventDefault();\n\n if (!!props.onClickRow) {\n props.onClickRow(row);\n reset();\n }\n }}\n data-testid={row.id}\n >\n {props.existCheckbox && (\n <td\n className=\"w-8 h-full p-px\"\n onClick={(e) => {\n e.stopPropagation();\n }}\n >\n <Checkbox row={row} />\n </td>\n )}\n {props.cols.map((col, j) => {\n return (\n <TableCell\n key={col.key as string}\n id={IdGenerator.getTableCellId({\n rowIndex: props.rowIndex,\n columnIndex: j,\n })}\n row={row}\n isExistOnClickRow={!!props.onClickRow}\n cellFormatClassName={conditionalFormatting[j]}\n editable={col.editable ?? false}\n />\n );\n })}\n </tr>\n );\n});\n"],"names":["Row","memo","props","IdGenerator","useTableIdGenerator","reset","useRangeActionContext","row","JSON","parse","dataString","conditionalFormatting","conditionalFormattingString","split","_jsxs","className","concat","onClickRow","applyRowFormatting","onClick","e","preventDefault","id","children","existCheckbox","_jsx","stopPropagation","Checkbox","cols","map","col","j","TableCell","getTableCellId","rowIndex","columnIndex","isExistOnClickRow","cellFormatClassName","editable","_a","key"],"mappings":"2MAiBaA,EAAMC,EAAAA,MAAK,SAAiCC,GACvD,IAAMC,EAAcC,EAAAA,sBACZC,EAAUC,EAAAA,8BACZC,EAAMC,KAAKC,MAAMP,EAAMQ,YACvBC,EAAwBT,EAAMU,4BAA4BC,MAAM,KAEtE,OACEC,OAAA,KAAA,CACEC,UAAW,0JAAAC,OACPd,EAAMe,WAAa,uBAAyB,GAAE,KAAAD,OAC9Cd,EAAMgB,mBAAqBhB,EAAMgB,mBAAmBX,GAAO,IAC/DY,QAAS,SAACC,GACRA,EAAEC,iBAEInB,EAAMe,aACVf,EAAMe,WAAWV,GACjBF,IAEJ,gBACaE,EAAIe,GAAEC,SAAA,CAElBrB,EAAMsB,eACLC,EAAAA,IAAA,KAAA,CACEV,UAAU,kBACVI,QAAS,SAACC,GACRA,EAAEM,iBACJ,EAACH,SAEDE,EAAAA,IAACE,EAAAA,SAAQ,CAACpB,IAAKA,MAGlBL,EAAM0B,KAAKC,KAAI,SAACC,EAAKC,SACpB,OACEN,EAAAA,IAACO,EAAAA,UAAS,CAERV,GAAInB,EAAY8B,eAAe,CAC7BC,SAAUhC,EAAMgC,SAChBC,YAAaJ,IAEfxB,IAAKA,EACL6B,oBAAqBlC,EAAMe,WAC3BoB,oBAAqB1B,EAAsBoB,GAC3CO,SAAsB,QAAZC,EAAAT,EAAIQ,gBAAQ,IAAAC,GAAAA,GARjBT,EAAIU,IAWf,MAGN"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";var e=require("../../../node_modules/tslib/tslib.es6.js"),r=require("react/jsx-runtime"),i=require("./hook.js"),o=require("../header/header.js"),s=require("../pagenation/providers.js"),t=require("../pagenation/components.js");require("../filter-v2/context.js");var n=require("../filter-v2/provider.js");require("../sort/icon.js");var d=require("../sort/provider.js"),a=require("../sheet/providers.js"),l=require("../checkbox/provider.js"),c=require("../edit/provider.js"),x=require("../table-property/provider.js"),j=require("../operation/components/keyboard-setting.js"),h=require("../sheet/components.js"),u=require("../paste/provider.js"),p=require("../libs/conditional-formatting.js"),v=require("../edit/ui/editor.js"),m=require("../range/provider.js"),g=require("../copy/provider.js"),b=require("../copy/components.js"),q=require("../id/provider.js"),w=require("../header/header-v2.js");require("../header/columns-width/context.js");var P=require("../header/columns-width/provider.js");require("../header/x-scroll-position/context.js");var C=require("../header/x-scroll-position/provider.js"),k=require("../frame/frame.js"),y=require("./component-provider/provider.js"),S=require("../../select-box/provider.js");function f(e){var s=i.useTable(e),n=s.cols,d=s.rowMaps,a=s.pageRowIds,l=q.useTableIdGenerator(),c=y.useGenerateSortButton();return r.jsxs("div",{className:"w-full max-w-full max-h-full",children:[r.jsxs("div",{children:[r.jsx(w.TableHeader,{cols:n,checkbox:!!e.checkbox,rows:e.rows,maxWidth:e.maxWidth,generateSortButton:c}),r.jsx(S.SelectBoxProvider,{children:r.jsxs(k.Frame,{id:l.getTableId(),maxHeight:e.maxHeight,maxWidth:e.maxWidth,displayScroll:!1,children:[r.jsxs("table",{className:"table",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[e.checkbox&&r.jsx("th",{}),n.map((function(e){return r.jsx(o.TableHeaderElement,{keyname:e.key.toString()},e.key.toString())}))]})}),r.jsxs("tbody",{children:[0===a.length&&r.jsx("tr",{children:r.jsx("td",{colSpan:n.length,className:"py-5",children:r.jsx("p",{className:"text-center font-bold text-lg",children:"NO DATA"})})}),a.map((function(i,o){return r.jsx(h.Row,{existCheckbox:!!e.checkbox,rowIndex:o,dataString:d[i].stringValue,cols:e.cols,onClickRow:e.onClickRow,applyRowFormatting:e.applyRowFormatting,conditionalFormattingString:p.generateFormattingString(d[i].data,n,e.conditionalFormattings)},i)}))]})]}),r.jsx(m.TestRange,{}),r.jsx(v.Editor,{rowMaps:d,pageRowIds:a})]})})]}),r.jsxs("div",{className:"mt-1",children:[r.jsx(t.DisplayRange,{}),r.jsx("div",{className:"mt-2",children:r.jsx(t.Pagenation,{})})]})]})}module.exports=function(i){var o,t,h,p;return r.jsx(y.ComponentProvider,{children:r.jsx(q.TableIdGeneratorProvider,{id:i.id,children:r.jsx(P.ColumnsWidthProvider,{initialState:i.cols,children:r.jsx(n.FilterProvider,{initialConditions:[],children:r.jsx(d.SortProvider,{initialCondition:null===(o=i.initialCondition)||void 0===o?void 0:o.sort,children:r.jsx(s.PagenationProvider,{rowCount:i.rows.length,perPage:null===(h=null===(t=i.initialCondition)||void 0===t?void 0:t.pagenation)||void 0===h?void 0:h.rowCountPerPage,children:r.jsx(l.CheckboxProvider,{checkbox:i.checkbox,children:r.jsx(l.CheckboxStatusProvider,{checkboxCount:i.rows.length,children:r.jsx(a.ColumnsProvider,{cols:i.cols,errorHandler:i.errorHandler,children:r.jsx(c.EditProvider,{children:r.jsx(x.TablePropertyProvider,{children:r.jsx(m.RangeProvider,{children:r.jsxs(g.CopyProvider,{rows:i.rows,cols:i.cols,children:[r.jsx(b.CopiedMessage,{}),r.jsxs(u.PasteProvider,{rows:i.rows,cols:i.cols,onUpdateRowFunction:i.onUpdateRow,children:[r.jsx(j.KeyboardSetting,{enableDeprecatedCopy:null===(p=i.deprecatedOptions)||void 0===p?void 0:p.enableDeprecatedCopy}),r.jsx(C.ScrollXPositionProvider,{children:r.jsx(f,e.__assign({},i))})]})]})})})})})})})})})})})})})};
|
|
2
|
+
"use strict";var e=require("../../../node_modules/tslib/tslib.es6.js"),r=require("react/jsx-runtime"),i=require("./hook.js"),o=require("../header/header.js"),s=require("../pagenation/providers.js"),t=require("../pagenation/components.js");require("../filter-v2/context.js");var n=require("../filter-v2/provider.js");require("../sort/icon.js");var d=require("../sort/provider.js"),a=require("../sheet/providers.js"),l=require("../checkbox/provider.js"),c=require("../edit/provider.js"),x=require("../table-property/provider.js"),j=require("../operation/components/keyboard-setting.js"),h=require("../sheet/components.js"),u=require("../paste/provider.js"),p=require("../libs/conditional-formatting.js"),v=require("../edit/ui/editor.js"),m=require("../range/provider.js"),g=require("../copy/provider.js"),b=require("../copy/components.js"),q=require("../id/provider.js"),w=require("../header/header-v2.js");require("../header/columns-width/context.js");var P=require("../header/columns-width/provider.js");require("../header/x-scroll-position/context.js");var C=require("../header/x-scroll-position/provider.js"),k=require("../frame/frame.js"),y=require("./component-provider/provider.js"),S=require("../../select-box/provider.js");function f(e){var s=i.useTable(e),n=s.cols,d=s.rowMaps,a=s.pageRowIds,l=q.useTableIdGenerator(),c=y.useGenerateSortButton();return r.jsxs("div",{className:"w-full max-w-full max-h-full",children:[r.jsxs("div",{children:[r.jsx(w.TableHeader,{cols:n,checkbox:!!e.checkbox,rows:e.rows,maxWidth:e.maxWidth,generateSortButton:c}),r.jsx(S.SelectBoxProvider,{children:r.jsxs(k.Frame,{id:l.getTableId(),maxHeight:e.maxHeight,maxWidth:e.maxWidth,displayScroll:!1,children:[r.jsxs("table",{className:"table",children:[r.jsx("thead",{children:r.jsxs("tr",{children:[e.checkbox&&r.jsx("th",{className:"p-px"}),n.map((function(e){return r.jsx(o.TableHeaderElement,{keyname:e.key.toString()},e.key.toString())}))]})}),r.jsxs("tbody",{children:[0===a.length&&r.jsx("tr",{children:r.jsx("td",{colSpan:n.length,className:"px-px py-5",children:r.jsx("p",{className:"text-center font-bold text-lg",children:"NO DATA"})})}),a.map((function(i,o){return r.jsx(h.Row,{existCheckbox:!!e.checkbox,rowIndex:o,dataString:d[i].stringValue,cols:e.cols,onClickRow:e.onClickRow,applyRowFormatting:e.applyRowFormatting,conditionalFormattingString:p.generateFormattingString(d[i].data,n,e.conditionalFormattings)},i)}))]})]}),r.jsx(m.TestRange,{}),r.jsx(v.Editor,{rowMaps:d,pageRowIds:a})]})})]}),r.jsxs("div",{className:"mt-1",children:[r.jsx(t.DisplayRange,{}),r.jsx("div",{className:"mt-2",children:r.jsx(t.Pagenation,{})})]})]})}module.exports=function(i){var o,t,h,p;return r.jsx(y.ComponentProvider,{children:r.jsx(q.TableIdGeneratorProvider,{id:i.id,children:r.jsx(P.ColumnsWidthProvider,{initialState:i.cols,children:r.jsx(n.FilterProvider,{initialConditions:[],children:r.jsx(d.SortProvider,{initialCondition:null===(o=i.initialCondition)||void 0===o?void 0:o.sort,children:r.jsx(s.PagenationProvider,{rowCount:i.rows.length,perPage:null===(h=null===(t=i.initialCondition)||void 0===t?void 0:t.pagenation)||void 0===h?void 0:h.rowCountPerPage,children:r.jsx(l.CheckboxProvider,{checkbox:i.checkbox,children:r.jsx(l.CheckboxStatusProvider,{checkboxCount:i.rows.length,children:r.jsx(a.ColumnsProvider,{cols:i.cols,errorHandler:i.errorHandler,children:r.jsx(c.EditProvider,{children:r.jsx(x.TablePropertyProvider,{children:r.jsx(m.RangeProvider,{children:r.jsxs(g.CopyProvider,{rows:i.rows,cols:i.cols,children:[r.jsx(b.CopiedMessage,{}),r.jsxs(u.PasteProvider,{rows:i.rows,cols:i.cols,onUpdateRowFunction:i.onUpdateRow,children:[r.jsx(j.KeyboardSetting,{enableDeprecatedCopy:null===(p=i.deprecatedOptions)||void 0===p?void 0:p.enableDeprecatedCopy}),r.jsx(C.ScrollXPositionProvider,{children:r.jsx(f,e.__assign({},i))})]})]})})})})})})})})})})})})})};
|
|
3
3
|
//# sourceMappingURL=base.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{jsx as e,jsxs as
|
|
2
|
+
import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{useState as i,useRef as o,useEffect as r}from"react";import{SelectBox as a}from"../../select-box/index.js";import{useConditionInputState as u,useConditionInputAction as l}from"./condition-input-management/context.js";import"../../../node_modules/tslib/tslib.es6.js";import{useIdGenerator as p}from"../id-generator/context.js";import{TiDeleteOutline as c}from"../../../node_modules/react-icons/ti/index.js";function s(t){switch(u().status){case"waiting for input":return e(d,{});case"inputted target":return e(g,{});case"inputted operator":return e(f,{size:t.size})}}function d(){var t=p().generateId,n=u().targets,i=l().inputTarget;return e(a,{id:t("TargetInput"),onSelect:function(e){i(e)},options:n.map((function(e){return{value:e.key,label:e.label}})),placeholder:"Select target",no_appearance:!0,no_icon:!0})}function g(){var i=p().generateId,o=u(),r=l(),c=r.inputOperator,s=r.removeInputedTarget;if("inputted target"!==o.status)return null;var d=o.inputtingCondition.target,g=o.useableOperators;return t(n,{children:[e(T,{label:d.label,onClickDelete:function(){s()}}),e("div",{className:"w-full min-w-64",children:e(a,{id:i("OperatorInput"),onSelect:function(e){c(e),setTimeout((function(){var e=document.getElementById(i("ValueInput"));e&&e.focus()}),10)},options:g.map((function(e){return{value:e.key,label:e.label}})),defaultIsOpen:!0,placeholder:"Select operator",no_appearance:!0,no_icon:!0})})]})}function f(i){var o=u(),r=l(),a=r.removeInputedOperator,p=r.removeInputedTarget;if("inputted operator"!==o.status)return null;var c=o.inputtingCondition.target,s=o.inputtingCondition.operator;return t(n,{children:[e(T,{label:c.label,onClickDelete:function(){p()}}),e(T,{label:s.label,onClickDelete:function(){a()}}),"single string"===o.inputtingCondition.operator.inputType?e(m,{inputType:o.inputtingCondition.operator.inputType,size:i.size}):"single number"===o.inputtingCondition.operator.inputType?e(y,{inputType:o.inputtingCondition.operator.inputType,size:i.size}):"select"===o.inputtingCondition.operator.inputType?e(v,{inputType:o.inputtingCondition.operator.inputType,options:"select"===o.inputtingCondition.target.type?o.inputtingCondition.target.options:[]}):"single datetime"===o.inputtingCondition.operator.inputType?e(b,{inputType:o.inputtingCondition.operator.inputType,size:i.size}):"single date"===o.inputtingCondition.operator.inputType?e(w,{inputType:o.inputtingCondition.operator.inputType,size:i.size}):console.error("Not implemented")]})}function m(t){var n=p().generateId,o=i(""),r=o[0],a=o[1],u=l().inputValue;return e("input",{id:n("ValueInput"),className:"appearance-none w-full min-w-64 border-none px-2 py-1 placeholder:text-gray-400 focus:outline-none focus-visible:outline-none bg-transparent ".concat("small"===t.size?"text-sm":"large"===t.size?"text-lg":""),type:"text",placeholder:"Search text",value:r,onChange:function(e){a(e.target.value)},onKeyDown:function(e){"Enter"===e.key&&(u({type:t.inputType,payload:{value:r}}),a(""))}})}function y(t){var n=p().generateId,o=i(""),r=o[0],a=o[1],u=l().inputValue;return e("input",{id:n("ValueInput"),className:"appearance-none w-full min-w-64 border-none px-2 py-1 placeholder:text-gray-400 focus:outline-none focus-visible:outline-none bg-transparent ".concat("small"===t.size?"text-sm":"large"===t.size?"text-lg":""),type:"text",placeholder:"Search text",value:r,onChange:function(e){a(e.target.value)},onKeyDown:function(e){"Enter"===e.key&&(u({type:t.inputType,payload:{value:Number(r)}}),a(""))}})}function v(t){var n=l().inputValue,i=p().generateId;return e("div",{className:"w-full min-w-64",children:e(a,{id:i("ValueInput"),onSelect:function(e){n({type:t.inputType,payload:{value:e}})},options:t.options,defaultIsOpen:!0,placeholder:"Select value",no_appearance:!0,no_icon:!0})})}function b(t){var n=p().generateId,i=l().inputValue,a=o(null);return r((function(){if(a.current){var e=a.current;e.focus(),e.scrollIntoView(),e.click()}}),[]),e("input",{ref:a,id:n("ValueInput"),className:"appearance-none w-fit min-w-64 border-none px-2 py-1 focus:outline-none focus-visible:outline-none bg-transparent ".concat("small"===t.size?"text-sm":"large"===t.size?"text-lg":""),type:"datetime-local",defaultValue:new Date((new Date).getTime()-6e4*(new Date).getTimezoneOffset()).toISOString().slice(0,16),onKeyDown:function(e){var n,o;if("Enter"===e.key){var r=new Date(null!==(o=null===(n=a.current)||void 0===n?void 0:n.value)&&void 0!==o?o:"");if(isNaN(r.getTime()))return;i({type:t.inputType,payload:{value:r}})}},onClick:function(e){e.currentTarget.showPicker()}})}function w(t){var n=p().generateId,i=l().inputValue,a=o(null),u=o(!1);return r((function(){if(a.current){var e=a.current;e.focus(),e.scrollIntoView(),e.click()}}),[]),e("input",{ref:a,id:n("ValueInput"),className:"appearance-none w-fit min-w-64 border-none px-2 py-1 focus:outline-none focus-visible:outline-none bg-transparent ".concat("small"===t.size?"text-sm":"large"===t.size?"text-lg":""),type:"date",defaultValue:new Date((new Date).getTime()-6e4*(new Date).getTimezoneOffset()).toISOString().slice(0,10),onKeyDown:function(e){var n;if("Enter"===e.key){if(!(null===(n=a.current)||void 0===n?void 0:n.value))return;var o=a.current.value.split("-"),r=o[0],u=o[1],l=o[2],p=new Date(Number(r),Number(u)-1,Number(l));if(isNaN(p.getTime()))return;i({type:t.inputType,payload:{value:p}})}},onClick:function(e){u.current||(e.currentTarget.showPicker(),u.current=!0)}})}function T(n){return t("div",{className:"flex items-center gap-2 w-fit px-2 border border-gray-200 rounded bg-slate-100",children:[e("p",{className:"whitespace-nowrap",children:n.label}),n.onClickDelete&&e("div",{children:e(c,{className:"bg-white hover:bg-slate-300 rounded-full cursor-pointer",onClick:n.onClickDelete})})]})}export{s as SearchBarInputForm};
|
|
3
3
|
//# sourceMappingURL=input-form.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{jsx as e}from"react/jsx-runtime";import{useMemo as t,useEffect as n}from"react";import{useIdContext as r}from"../id/provider.js";import{IdGenerator as o}from"../lib/id-generator.js";import{useOptionsWindow as a}from"../options-window/context.js";function i(i){var s,c,l,u=r(),p=a(),d=p.state,f=p.actions,v=t((function(){return d.isOpen?i.options.filter((function(e){return e.searchText?e.searchText.toLowerCase().includes(d.searchText.toLowerCase()):e.searchLabel?e.searchLabel.toLowerCase().includes(d.searchText.toLowerCase()):e.label.toLowerCase().includes(d.searchText.toLowerCase())})):[]}),[i.options,d]);n((function(){d.isOpen&&f.setSearchText(d.searchText)}),[d]),n((function(){if(!d.isOpen){var e=document.getElementById(o.generateIdSelectBoxInputArea(i.id));if(e){var t=function(e){"ArrowDown"===e.key&&(e.preventDefault(),i.open())};return e.addEventListener("keydown",t),function(){e.removeEventListener("keydown",t)}}}}),[d,v]);var x=null!==(c=null===(s=i.options.find((function(e){return e.value===i.value})))||void 0===s?void 0:s.label)&&void 0!==c?c:"";return e("input",{id:o.generateIdSelectBoxInputArea(u),ref:i.inputRef,className:"px-2 py-1 ".concat(i.no_appearance?"appearance-none border-none focus:outline-none focus-visible:outline-none bg-transparent w-full":"border border-gray-300 w-full"),type:"text",placeholder:""===x?null!==(l=i.placeholder)&&void 0!==l?l:"選択してください":x,value:d.isOpen?d.searchText:x,onChange:function(e){e.preventDefault(),f.setSearchText(e.target.value)}})}export{i as InputArea};
|
|
2
|
+
import{jsx as e}from"react/jsx-runtime";import{useMemo as t,useEffect as n}from"react";import{useIdContext as r}from"../id/provider.js";import{IdGenerator as o}from"../lib/id-generator.js";import{useOptionsWindow as a}from"../options-window/context.js";function i(i){var s,c,l,u=r(),p=a(),d=p.state,f=p.actions,v=t((function(){return d.isOpen?i.options.filter((function(e){return e.searchText?e.searchText.toLowerCase().includes(d.searchText.toLowerCase()):e.searchLabel?e.searchLabel.toLowerCase().includes(d.searchText.toLowerCase()):e.label.toLowerCase().includes(d.searchText.toLowerCase())})):[]}),[i.options,d]);n((function(){d.isOpen&&f.setSearchText(d.searchText)}),[d]),n((function(){if(!d.isOpen){var e=document.getElementById(o.generateIdSelectBoxInputArea(i.id));if(e){var t=function(e){"ArrowDown"===e.key&&(e.preventDefault(),i.open())};return e.addEventListener("keydown",t),function(){e.removeEventListener("keydown",t)}}}}),[d,v]);var x=null!==(c=null===(s=i.options.find((function(e){return e.value===i.value})))||void 0===s?void 0:s.label)&&void 0!==c?c:"";return e("input",{id:o.generateIdSelectBoxInputArea(u),ref:i.inputRef,className:"px-2 py-1 placeholder:text-gray-400 ".concat(i.no_appearance?"appearance-none border-none focus:outline-none focus-visible:outline-none bg-transparent w-full":"border border-gray-300 w-full"),type:"text",placeholder:""===x?null!==(l=i.placeholder)&&void 0!==l?l:"選択してください":x,value:d.isOpen?d.searchText:x,onChange:function(e){e.preventDefault(),f.setSearchText(e.target.value)}})}export{i as InputArea};
|
|
3
3
|
//# sourceMappingURL=input-area.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{jsx as o}from"react/jsx-runtime";import{useTableIdGenerator as e}from"../../id/provider.js";import{useCell as n}from"../hooks.js";function l(l){var t=e(),i=n(l.id,l.row),r=i.type,c=i.component,a=i.onDoubleClick,s=i.onMouseDown,m=i.onMouseEnter,d=t.extractCellIndexFromId(l.id);d[0];var p=d[1];return o("td",{id:l.id,className:"table-col-".concat(p," ").concat(l.cellFormatClassName),onDoubleClick:l.isExistOnClickRow?void 0:a,onMouseDown:s,onMouseEnter:m,children:o("div",{className:"flex items-center gap-3 min-h-10 w-fit max-w-full p-2 cursor-default",onClick:function(o){o.stopPropagation()},children:"component"===r?c:o("div",{onDoubleClick:a,className:"max-w-full",children:o("p",{className:"text-left max-w-full select-none overflow-hidden whitespace-nowrap text-ellipsis",children:c})})})})}export{l as TableCell};
|
|
2
|
+
import{jsx as o}from"react/jsx-runtime";import{useTableIdGenerator as e}from"../../id/provider.js";import{useCell as n}from"../hooks.js";function l(l){var t=e(),i=n(l.id,l.row),r=i.type,c=i.component,a=i.onDoubleClick,s=i.onMouseDown,m=i.onMouseEnter,d=t.extractCellIndexFromId(l.id);d[0];var p=d[1];return o("td",{id:l.id,className:"table-col-".concat(p," p-px ").concat(l.cellFormatClassName),onDoubleClick:l.isExistOnClickRow?void 0:a,onMouseDown:s,onMouseEnter:m,children:o("div",{className:"flex items-center gap-3 min-h-10 w-fit max-w-full p-2 cursor-default",onClick:function(o){o.stopPropagation()},children:"component"===r?c:o("div",{onDoubleClick:a,className:"max-w-full",children:o("p",{className:"text-left max-w-full select-none overflow-hidden whitespace-nowrap text-ellipsis",children:c})})})})}export{l as TableCell};
|
|
3
3
|
//# sourceMappingURL=cell.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useRef as n,useEffect as r}from"react";import{CancelIcon as o}from"../../../icon/cancel-icon.js";import{useTableIdGenerator as i}from"../../id/provider.js";function u(u){var a,
|
|
2
|
+
import{jsxs as e,jsx as t}from"react/jsx-runtime";import{useRef as n,useEffect as r}from"react";import{CancelIcon as o}from"../../../icon/cancel-icon.js";import{useTableIdGenerator as i}from"../../id/provider.js";function u(u){var a,c=i(),l=n(null);return r((function(){l.current&&l.current.focus()}),[l]),e("div",{className:"flex justify-between gap-1 w-full items-center",onClick:function(e){e.preventDefault(),e.stopPropagation()},children:[t("input",{id:c.getEditorId(),ref:l,className:"w-full py-1 px-2 bg-white text-gray-900",type:null!==(a=u.type)&&void 0!==a?a:"text",value:u.value,onChange:u.onChange,onBlur:u.onBlur,onKeyUp:function(e){e.preventDefault(),"Enter"===e.key?e.target.blur():"Escape"===e.key&&(u.reset(),u.endEditing())}}),t("button",{className:"cursor-pointer",onMouseDown:function(e){e.preventDefault(),e.stopPropagation(),setTimeout((function(){u.reset(),u.endEditing()}),300)},children:t(o,{size:16})})]})}export{u as CellInput};
|
|
3
3
|
//# sourceMappingURL=base-input.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{__spreadArray as e}from"../../../../node_modules/tslib/tslib.es6.js";import{jsx as o,Fragment as n,jsxs as t}from"react/jsx-runtime";import{useState as r,useRef as i,useEffect as u,useMemo as l}from"react";import{useEditActionContext as
|
|
2
|
+
import{__spreadArray as e}from"../../../../node_modules/tslib/tslib.es6.js";import{jsx as o,Fragment as n,jsxs as t}from"react/jsx-runtime";import{useState as r,useRef as i,useEffect as u,useMemo as l}from"react";import{useEditActionContext as s}from"../provider.js";import{CancelIcon as c}from"../../../icon/cancel-icon.js";import{SelectBox as a}from"../../../select-box/index.js";import{useTableIdGenerator as f}from"../../id/provider.js";function m(m){var d=f(),p=m.col,v=s().endEditing,w=m.row[p.key],b=r(w),j=b[0],E=b[1],g=i(null),x=i(null);u((function(){x.current&&x.current.focus()}),[x]);var y=function(e){p.editable&&p.onCellBlur(p.key,e,m.row,v)};if(!p.editable)return o(n,{});u((function(){var e=function(e){var o=g.current,n=e.target;n instanceof Node&&(null==o?void 0:o.contains(n))||(j!==w?y(j):v())};return document.addEventListener("mousedown",e),function(){document.removeEventListener("mousedown",e)}}),[j,y,v,w]);var N=l((function(){return p.allowEmpty?e([{value:"",label:""===w?"-- 未選択 --":"-- 選択解除 --"}],p.options,!0):p.options}),[p.options,p.allowEmpty,w]);return t("div",{ref:g,className:"flex justify-between gap-1 w-full items-center",children:[o(a,{id:d.getEditorId(),inputRef:x,value:j,defaultIsOpen:!0,options:N,onSelect:function(e){E(e),y(e)}}),o("button",{className:"cursor-pointer",onMouseDown:function(e){e.preventDefault(),e.stopPropagation(),setTimeout((function(){E(w),v()}),300)},children:o(c,{size:16})})]})}export{m as SelectCellInput};
|
|
3
3
|
//# sourceMappingURL=select-input.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{jsx as t}from"react/jsx-runtime";import{memo as
|
|
2
|
+
import{jsx as t}from"react/jsx-runtime";import{memo as m}from"react";import{useColumnsWidthState as r}from"./columns-width/context.js";import"../../../node_modules/tslib/tslib.es6.js";var e=m((function(m){var e=(0,r().getColumnWidth)(m.keyname);return t("th",{className:"p-px",style:{width:e,maxWidth:e,minWidth:e}})}));export{e as TableHeaderElement};
|
|
3
3
|
//# sourceMappingURL=header.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{jsx as
|
|
2
|
+
import{jsx as r,Fragment as t,jsxs as e}from"react/jsx-runtime";import{usePageContext as n}from"./providers.js";function o(){var o=n(),u=o.enable,c=o.current,i=o.pageCount,s=o.jump,a=o.prev,l=o.next;return u?e("div",{className:"flex justify-center gap-2",children:[r("button",{className:"text-sm cursor-pointer disabled:cursor-default",onClick:function(){return s(1)},disabled:1===c,children:"≪"}),r("button",{className:"text-sm cursor-pointer disabled:cursor-default",onClick:function(){return a()},disabled:1===c,children:"<"}),Array.from({length:i},(function(r,t){return t+1})).filter((function(r){return c-2<=r&&r<=c+2})).map((function(t){return r("button",{className:"text-sm cursor-pointer disabled:cursor-default ".concat(c===t?"text-blue-600":""),onClick:function(){return s(t)},children:t},t)})),r("button",{className:"text-sm cursor-pointer disabled:cursor-default",onClick:function(){return l()},disabled:c===i,children:">"}),r("button",{className:"text-sm cursor-pointer disabled:cursor-default",onClick:function(){return s(i)},disabled:c===i,children:"≫"})]}):r(t,{})}function u(){var o=n(),u=o.enable,c=o.from,i=o.to,s=o.rowCount;return u?e("p",{className:"text-center text-sm text-gray-600",children:[c+1," - ",i<s?i:s," of ",s]}):r(t,{})}export{u as DisplayRange,o as Pagenation};
|
|
3
3
|
//# sourceMappingURL=components.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__assign as e}from"../../../node_modules/tslib/tslib.es6.js";import{jsx as t,jsxs as n,Fragment as o}from"react/jsx-runtime";import{createContext as r,useContext as i,useEffect as d}from"react";import{NoImplementeFunction as a}from"../lib/errors.js";import{useRangeReducer as s}from"./hooks.js";import{useTablePropertyStateContext as l}from"../table-property/provider.js";import{useTableIdGenerator as m}from"../id/provider.js";var c=r({isSelecting:!1}),x=r({setMax:a,startSelectRange:a,moveSelectRange:a,endSelectRange:a,moveUp:a,moveDown:a,moveLeft:a,moveRight:a,moveTop:a,moveBottom:a,moveRightEnd:a,moveLeftEnd:a,extendUp:a,extendDown:a,extendLeft:a,extendRight:a,extendTop:a,extendBottom:a,extendRightEnd:a,extendLeftEnd:a,reset:a,setRange:a});function u(){return i(c)}function f(){return i(x)}function v(){return e(e({},u()),f())}function p(){var e=f().setMax,n=l(),r=n.maxDisplayRowCount,i=n.maxDisplayColCount;return d((function(){e({maxRowIndex:r-1,maxColIndex:i-1})}),[r,i]),t(o,{})}function g(e){var n=m(),r=u();if(d((function(){if(r.isSelecting){var e=document.getElementById(n.getTableCellId({rowIndex:r.end.rowIndex,columnIndex:r.end.colIndex}));e&&(e.scrollIntoView({behavior:"instant",block:"nearest",inline:"nearest"}),e.focus())}}),[r]),!r.isSelecting)return t(o,{});var i=r.rangeBox,a=r.start,s=r.end;return a.xEnd<s.xEnd?s.xEnd:a.xEnd,a.yEnd<s.yEnd?s.yEnd:a.yEnd,t(o,{children:t("div",{className:"absolute border border-gray-500 bg-gray-500
|
|
1
|
+
import{__assign as e}from"../../../node_modules/tslib/tslib.es6.js";import{jsx as t,jsxs as n,Fragment as o}from"react/jsx-runtime";import{createContext as r,useContext as i,useEffect as d}from"react";import{NoImplementeFunction as a}from"../lib/errors.js";import{useRangeReducer as s}from"./hooks.js";import{useTablePropertyStateContext as l}from"../table-property/provider.js";import{useTableIdGenerator as m}from"../id/provider.js";var c=r({isSelecting:!1}),x=r({setMax:a,startSelectRange:a,moveSelectRange:a,endSelectRange:a,moveUp:a,moveDown:a,moveLeft:a,moveRight:a,moveTop:a,moveBottom:a,moveRightEnd:a,moveLeftEnd:a,extendUp:a,extendDown:a,extendLeft:a,extendRight:a,extendTop:a,extendBottom:a,extendRightEnd:a,extendLeftEnd:a,reset:a,setRange:a});function u(){return i(c)}function f(){return i(x)}function v(){return e(e({},u()),f())}function p(){var e=f().setMax,n=l(),r=n.maxDisplayRowCount,i=n.maxDisplayColCount;return d((function(){e({maxRowIndex:r-1,maxColIndex:i-1})}),[r,i]),t(o,{})}function g(e){var n=m(),r=u();if(d((function(){if(r.isSelecting){var e=document.getElementById(n.getTableCellId({rowIndex:r.end.rowIndex,columnIndex:r.end.colIndex}));e&&(e.scrollIntoView({behavior:"instant",block:"nearest",inline:"nearest"}),e.focus())}}),[r]),!r.isSelecting)return t(o,{});var i=r.rangeBox,a=r.start,s=r.end;return a.xEnd<s.xEnd?s.xEnd:a.xEnd,a.yEnd<s.yEnd?s.yEnd:a.yEnd,t(o,{children:t("div",{className:"absolute border border-gray-500 bg-gray-500/10 ".concat(e.isCopied?"border-dashed":"border-solid"),style:{top:i.top,left:i.left,width:i.width,height:i.height,pointerEvents:"none"}})})}function h(e){var o=e.children,r=s(),i=r.state,d=r.actions;return t(c.Provider,{value:i,children:n(x.Provider,{value:d,children:[t(p,{}),o]})})}export{h as RangeProvider,g as TestRange,f as useRangeActionContext,v as useRangeContext,u as useRangeStateContext};
|
|
2
2
|
//# sourceMappingURL=provider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.js","sources":["../../../../../src/table/range/provider.tsx"],"sourcesContent":["import { createContext, useContext, useEffect } from \"react\";\nimport { TRangeActionContext, TRangeStateContext } from \"./type\";\nimport { NoImplementeFunction } from \"../lib/errors\";\nimport { useRangeReducer } from \"./hooks\";\nimport { useTablePropertyStateContext } from \"../table-property/provider\";\nimport { useTableIdGenerator } from \"../id\";\n\nconst RangeStateContext = createContext<TRangeStateContext>({\n isSelecting: false,\n});\n\nconst RangeActionContext = createContext<TRangeActionContext>({\n setMax: NoImplementeFunction,\n startSelectRange: NoImplementeFunction,\n moveSelectRange: NoImplementeFunction,\n endSelectRange: NoImplementeFunction,\n moveUp: NoImplementeFunction,\n moveDown: NoImplementeFunction,\n moveLeft: NoImplementeFunction,\n moveRight: NoImplementeFunction,\n moveTop: NoImplementeFunction,\n moveBottom: NoImplementeFunction,\n moveRightEnd: NoImplementeFunction,\n moveLeftEnd: NoImplementeFunction,\n extendUp: NoImplementeFunction,\n extendDown: NoImplementeFunction,\n extendLeft: NoImplementeFunction,\n extendRight: NoImplementeFunction,\n extendTop: NoImplementeFunction,\n extendBottom: NoImplementeFunction,\n extendRightEnd: NoImplementeFunction,\n extendLeftEnd: NoImplementeFunction,\n reset: NoImplementeFunction,\n setRange: NoImplementeFunction,\n});\n\nexport function useRangeStateContext() {\n return useContext(RangeStateContext);\n}\n\nexport function useRangeActionContext() {\n return useContext(RangeActionContext);\n}\n\nexport function useRangeContext() {\n return { ...useRangeStateContext(), ...useRangeActionContext() };\n}\n\nfunction EffectSetMax() {\n const { setMax } = useRangeActionContext();\n const { maxDisplayRowCount, maxDisplayColCount } =\n useTablePropertyStateContext();\n\n useEffect(() => {\n setMax({\n maxRowIndex: maxDisplayRowCount - 1,\n maxColIndex: maxDisplayColCount - 1,\n });\n }, [maxDisplayRowCount, maxDisplayColCount]);\n\n return <></>;\n}\n\nexport function TestRange(props: { isCopied?: boolean }) {\n const IdGenerator = useTableIdGenerator();\n const state = useRangeStateContext();\n\n useEffect(() => {\n if (state.isSelecting) {\n const endElement = document.getElementById(\n IdGenerator.getTableCellId({\n rowIndex: state.end.rowIndex,\n columnIndex: state.end.colIndex,\n })\n );\n\n if (endElement) {\n endElement.scrollIntoView({\n behavior: \"instant\",\n block: \"nearest\",\n inline: \"nearest\",\n });\n endElement.focus();\n }\n }\n }, [state]);\n\n if (!state.isSelecting) {\n return <></>;\n }\n\n const { rangeBox, start, end } = state;\n\n const clickboxPoint = {\n x: start.xEnd < end.xEnd ? end.xEnd : start.xEnd,\n y: start.yEnd < end.yEnd ? end.yEnd : start.yEnd,\n };\n\n return (\n <>\n <div\n className={`absolute border border-gray-500 bg-gray-500
|
|
1
|
+
{"version":3,"file":"provider.js","sources":["../../../../../src/table/range/provider.tsx"],"sourcesContent":["import { createContext, useContext, useEffect } from \"react\";\nimport { TRangeActionContext, TRangeStateContext } from \"./type\";\nimport { NoImplementeFunction } from \"../lib/errors\";\nimport { useRangeReducer } from \"./hooks\";\nimport { useTablePropertyStateContext } from \"../table-property/provider\";\nimport { useTableIdGenerator } from \"../id\";\n\nconst RangeStateContext = createContext<TRangeStateContext>({\n isSelecting: false,\n});\n\nconst RangeActionContext = createContext<TRangeActionContext>({\n setMax: NoImplementeFunction,\n startSelectRange: NoImplementeFunction,\n moveSelectRange: NoImplementeFunction,\n endSelectRange: NoImplementeFunction,\n moveUp: NoImplementeFunction,\n moveDown: NoImplementeFunction,\n moveLeft: NoImplementeFunction,\n moveRight: NoImplementeFunction,\n moveTop: NoImplementeFunction,\n moveBottom: NoImplementeFunction,\n moveRightEnd: NoImplementeFunction,\n moveLeftEnd: NoImplementeFunction,\n extendUp: NoImplementeFunction,\n extendDown: NoImplementeFunction,\n extendLeft: NoImplementeFunction,\n extendRight: NoImplementeFunction,\n extendTop: NoImplementeFunction,\n extendBottom: NoImplementeFunction,\n extendRightEnd: NoImplementeFunction,\n extendLeftEnd: NoImplementeFunction,\n reset: NoImplementeFunction,\n setRange: NoImplementeFunction,\n});\n\nexport function useRangeStateContext() {\n return useContext(RangeStateContext);\n}\n\nexport function useRangeActionContext() {\n return useContext(RangeActionContext);\n}\n\nexport function useRangeContext() {\n return { ...useRangeStateContext(), ...useRangeActionContext() };\n}\n\nfunction EffectSetMax() {\n const { setMax } = useRangeActionContext();\n const { maxDisplayRowCount, maxDisplayColCount } =\n useTablePropertyStateContext();\n\n useEffect(() => {\n setMax({\n maxRowIndex: maxDisplayRowCount - 1,\n maxColIndex: maxDisplayColCount - 1,\n });\n }, [maxDisplayRowCount, maxDisplayColCount]);\n\n return <></>;\n}\n\nexport function TestRange(props: { isCopied?: boolean }) {\n const IdGenerator = useTableIdGenerator();\n const state = useRangeStateContext();\n\n useEffect(() => {\n if (state.isSelecting) {\n const endElement = document.getElementById(\n IdGenerator.getTableCellId({\n rowIndex: state.end.rowIndex,\n columnIndex: state.end.colIndex,\n })\n );\n\n if (endElement) {\n endElement.scrollIntoView({\n behavior: \"instant\",\n block: \"nearest\",\n inline: \"nearest\",\n });\n endElement.focus();\n }\n }\n }, [state]);\n\n if (!state.isSelecting) {\n return <></>;\n }\n\n const { rangeBox, start, end } = state;\n\n const clickboxPoint = {\n x: start.xEnd < end.xEnd ? end.xEnd : start.xEnd,\n y: start.yEnd < end.yEnd ? end.yEnd : start.yEnd,\n };\n\n return (\n <>\n <div\n className={`absolute border border-gray-500 bg-gray-500/10 ${\n props.isCopied ? \"border-dashed\" : \"border-solid\"\n }`}\n style={{\n top: rangeBox.top,\n left: rangeBox.left,\n width: rangeBox.width,\n height: rangeBox.height,\n pointerEvents: \"none\",\n }}\n ></div>\n {/* <div\n className=\"absolute bg-gray-700\"\n style={{\n top: clickboxPoint.y - 5,\n left: clickboxPoint.x - 5,\n width: 10,\n height: 10,\n pointerEvents: \"none\",\n }}\n /> */}\n </>\n );\n}\n\nexport function RangeProvider({\n children,\n}: {\n children: React.JSX.Element | React.JSX.Element[];\n}) {\n const { state, actions } = useRangeReducer();\n\n return (\n <RangeStateContext.Provider value={state}>\n <RangeActionContext.Provider value={actions}>\n <EffectSetMax />\n {children}\n </RangeActionContext.Provider>\n </RangeStateContext.Provider>\n );\n}\n"],"names":["RangeStateContext","createContext","isSelecting","RangeActionContext","setMax","NoImplementeFunction","startSelectRange","moveSelectRange","endSelectRange","moveUp","moveDown","moveLeft","moveRight","moveTop","moveBottom","moveRightEnd","moveLeftEnd","extendUp","extendDown","extendLeft","extendRight","extendTop","extendBottom","extendRightEnd","extendLeftEnd","reset","setRange","useRangeStateContext","useContext","useRangeActionContext","useRangeContext","__assign","EffectSetMax","_a","useTablePropertyStateContext","maxDisplayRowCount","maxDisplayColCount","useEffect","maxRowIndex","maxColIndex","_jsx","TestRange","props","IdGenerator","useTableIdGenerator","state","endElement","document","getElementById","getTableCellId","rowIndex","end","columnIndex","colIndex","scrollIntoView","behavior","block","inline","focus","rangeBox","start","xEnd","yEnd","className","concat","isCopied","style","top","left","width","height","pointerEvents","RangeProvider","children","_b","useRangeReducer","actions","Provider","value","_jsxs"],"mappings":"mbAOA,IAAMA,EAAoBC,EAAkC,CAC1DC,aAAa,IAGTC,EAAqBF,EAAmC,CAC5DG,OAAQC,EACRC,iBAAkBD,EAClBE,gBAAiBF,EACjBG,eAAgBH,EAChBI,OAAQJ,EACRK,SAAUL,EACVM,SAAUN,EACVO,UAAWP,EACXQ,QAASR,EACTS,WAAYT,EACZU,aAAcV,EACdW,YAAaX,EACbY,SAAUZ,EACVa,WAAYb,EACZc,WAAYd,EACZe,YAAaf,EACbgB,UAAWhB,EACXiB,aAAcjB,EACdkB,eAAgBlB,EAChBmB,cAAenB,EACfoB,MAAOpB,EACPqB,SAAUrB,aAGIsB,IACd,OAAOC,EAAW5B,EACpB,UAEgB6B,IACd,OAAOD,EAAWzB,EACpB,UAEgB2B,IACd,OAAAC,EAAAA,EAAA,CAAA,EAAYJ,KAA2BE,IACzC,CAEA,SAASG,IACC,IAAA5B,EAAWyB,WACbI,EACJC,IADMC,EAAkBF,EAAAE,mBAAEC,EAAkBH,EAAAG,mBAU9C,OAPAC,GAAU,WACRjC,EAAO,CACLkC,YAAaH,EAAqB,EAClCI,YAAaH,EAAqB,GAEtC,GAAG,CAACD,EAAoBC,IAEjBI,OACT,CAEM,SAAUC,EAAUC,GACxB,IAAMC,EAAcC,IACdC,EAAQlB,IAsBd,GApBAU,GAAU,WACR,GAAIQ,EAAM3C,YAAa,CACrB,IAAM4C,EAAaC,SAASC,eAC1BL,EAAYM,eAAe,CACzBC,SAAUL,EAAMM,IAAID,SACpBE,YAAaP,EAAMM,IAAIE,YAIvBP,IACFA,EAAWQ,eAAe,CACxBC,SAAU,UACVC,MAAO,UACPC,OAAQ,YAEVX,EAAWY,QAEf,CACF,GAAG,CAACb,KAECA,EAAM3C,YACT,OAAOsC,QAGD,IAAAmB,EAAyBd,EAAKc,SAApBC,EAAef,EAAKe,MAAbT,EAAQN,MAOjC,OAJKe,EAAMC,KAAOV,EAAIU,KAAOV,EAAIU,KAAOD,EAAMC,KACzCD,EAAME,KAAOX,EAAIW,KAAOX,EAAIW,KAAOF,EAAME,KAI5CtB,cACEA,EAAA,MAAA,CACEuB,UAAW,kDAAAC,OACTtB,EAAMuB,SAAW,gBAAkB,gBAErCC,MAAO,CACLC,IAAKR,EAASQ,IACdC,KAAMT,EAASS,KACfC,MAAOV,EAASU,MAChBC,OAAQX,EAASW,OACjBC,cAAe,WAezB,CAEM,SAAUC,EAAcvC,GAC5B,IAAAwC,EAAQxC,EAAAwC,SAIFC,EAAqBC,IAAnB9B,EAAK6B,EAAA7B,MAAE+B,EAAOF,EAAAE,QAEtB,OACEpC,EAACxC,EAAkB6E,SAAQ,CAACC,MAAOjC,EAAK4B,SACtCM,EAAC5E,EAAmB0E,SAAQ,CAACC,MAAOF,EAAOH,SAAA,CACzCjC,EAACR,EAAY,CAAA,GACZyC,MAIT"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as r,jsx as o}from"react/jsx-runtime";import{memo as t}from"react";import{Checkbox as e}from"../checkbox/components.js";import{TableCell as i}from"../cell/ui/cell.js";import{useRangeActionContext as a}from"../range/provider.js";import{useTableIdGenerator as n}from"../id/provider.js";var l=t((function(t){var l=n(),c=a().reset,
|
|
1
|
+
import{jsxs as r,jsx as o}from"react/jsx-runtime";import{memo as t}from"react";import{Checkbox as e}from"../checkbox/components.js";import{TableCell as i}from"../cell/ui/cell.js";import{useRangeActionContext as a}from"../range/provider.js";import{useTableIdGenerator as n}from"../id/provider.js";var l=t((function(t){var l=n(),c=a().reset,p=JSON.parse(t.dataString),s=t.conditionalFormattingString.split(",");return r("tr",{className:"relative border border-gray-200 after:absolute after:w-full after:h-full after:top-0 after:left-0 after:pointer-events-none hover:after:bg-gray-500/10 ".concat(t.onClickRow?"hover:cursor-pointer":""," ").concat(t.applyRowFormatting?t.applyRowFormatting(p):""),onClick:function(r){r.preventDefault(),t.onClickRow&&(t.onClickRow(p),c())},"data-testid":p.id,children:[t.existCheckbox&&o("td",{className:"w-8 h-full p-px",onClick:function(r){r.stopPropagation()},children:o(e,{row:p})}),t.cols.map((function(r,e){var a;return o(i,{id:l.getTableCellId({rowIndex:t.rowIndex,columnIndex:e}),row:p,isExistOnClickRow:!!t.onClickRow,cellFormatClassName:s[e],editable:null!==(a=r.editable)&&void 0!==a&&a},r.key)}))]})}));export{l as Row};
|
|
2
2
|
//# sourceMappingURL=components.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"components.js","sources":["../../../../../src/table/sheet/components.tsx"],"sourcesContent":["import { memo } from \"react\";\nimport { DataRecord, TTableColumn } from \"../table/type\";\nimport { Checkbox } from \"../checkbox/components\";\nimport { TableCell } from \"../cell/ui/cell\";\nimport { useRangeActionContext } from \"../range/provider\";\nimport { useTableIdGenerator } from \"../id\";\n\ninterface TPropsRow<T extends DataRecord> {\n dataString: string;\n cols: TTableColumn<T>[];\n existCheckbox?: boolean;\n rowIndex: number;\n conditionalFormattingString: string;\n onClickRow?: (row: any) => void;\n applyRowFormatting?: (row: any) => string;\n}\n\nexport const Row = memo(function R<T extends DataRecord>(props: TPropsRow<T>) {\n const IdGenerator = useTableIdGenerator();\n const { reset } = useRangeActionContext();\n const row = JSON.parse(props.dataString);\n const conditionalFormatting = props.conditionalFormattingString.split(\",\");\n\n return (\n <tr\n className={`relative border border-gray-200 after:absolute after:w-full after:h-full after:top-0 after:left-0 after:pointer-events-none after:
|
|
1
|
+
{"version":3,"file":"components.js","sources":["../../../../../src/table/sheet/components.tsx"],"sourcesContent":["import { memo } from \"react\";\nimport { DataRecord, TTableColumn } from \"../table/type\";\nimport { Checkbox } from \"../checkbox/components\";\nimport { TableCell } from \"../cell/ui/cell\";\nimport { useRangeActionContext } from \"../range/provider\";\nimport { useTableIdGenerator } from \"../id\";\n\ninterface TPropsRow<T extends DataRecord> {\n dataString: string;\n cols: TTableColumn<T>[];\n existCheckbox?: boolean;\n rowIndex: number;\n conditionalFormattingString: string;\n onClickRow?: (row: any) => void;\n applyRowFormatting?: (row: any) => string;\n}\n\nexport const Row = memo(function R<T extends DataRecord>(props: TPropsRow<T>) {\n const IdGenerator = useTableIdGenerator();\n const { reset } = useRangeActionContext();\n const row = JSON.parse(props.dataString);\n const conditionalFormatting = props.conditionalFormattingString.split(\",\");\n\n return (\n <tr\n className={`relative border border-gray-200 after:absolute after:w-full after:h-full after:top-0 after:left-0 after:pointer-events-none hover:after:bg-gray-500/10 ${\n !!props.onClickRow ? \"hover:cursor-pointer\" : \"\"\n } ${props.applyRowFormatting ? props.applyRowFormatting(row) : \"\"}`}\n onClick={(e) => {\n e.preventDefault();\n\n if (!!props.onClickRow) {\n props.onClickRow(row);\n reset();\n }\n }}\n data-testid={row.id}\n >\n {props.existCheckbox && (\n <td\n className=\"w-8 h-full p-px\"\n onClick={(e) => {\n e.stopPropagation();\n }}\n >\n <Checkbox row={row} />\n </td>\n )}\n {props.cols.map((col, j) => {\n return (\n <TableCell\n key={col.key as string}\n id={IdGenerator.getTableCellId({\n rowIndex: props.rowIndex,\n columnIndex: j,\n })}\n row={row}\n isExistOnClickRow={!!props.onClickRow}\n cellFormatClassName={conditionalFormatting[j]}\n editable={col.editable ?? false}\n />\n );\n })}\n </tr>\n );\n});\n"],"names":["Row","memo","props","IdGenerator","useTableIdGenerator","reset","useRangeActionContext","row","JSON","parse","dataString","conditionalFormatting","conditionalFormattingString","split","_jsxs","className","concat","onClickRow","applyRowFormatting","onClick","e","preventDefault","id","children","existCheckbox","_jsx","stopPropagation","Checkbox","cols","map","col","j","TableCell","getTableCellId","rowIndex","columnIndex","isExistOnClickRow","cellFormatClassName","editable","_a","key"],"mappings":"4SAiBaA,EAAMC,GAAK,SAAiCC,GACvD,IAAMC,EAAcC,IACZC,EAAUC,UACZC,EAAMC,KAAKC,MAAMP,EAAMQ,YACvBC,EAAwBT,EAAMU,4BAA4BC,MAAM,KAEtE,OACEC,EAAA,KAAA,CACEC,UAAW,0JAAAC,OACPd,EAAMe,WAAa,uBAAyB,GAAE,KAAAD,OAC9Cd,EAAMgB,mBAAqBhB,EAAMgB,mBAAmBX,GAAO,IAC/DY,QAAS,SAACC,GACRA,EAAEC,iBAEInB,EAAMe,aACVf,EAAMe,WAAWV,GACjBF,IAEJ,gBACaE,EAAIe,GAAEC,SAAA,CAElBrB,EAAMsB,eACLC,EAAA,KAAA,CACEV,UAAU,kBACVI,QAAS,SAACC,GACRA,EAAEM,iBACJ,EAACH,SAEDE,EAACE,EAAQ,CAACpB,IAAKA,MAGlBL,EAAM0B,KAAKC,KAAI,SAACC,EAAKC,SACpB,OACEN,EAACO,EAAS,CAERV,GAAInB,EAAY8B,eAAe,CAC7BC,SAAUhC,EAAMgC,SAChBC,YAAaJ,IAEfxB,IAAKA,EACL6B,oBAAqBlC,EAAMe,WAC3BoB,oBAAqB1B,EAAsBoB,GAC3CO,SAAsB,QAAZC,EAAAT,EAAIQ,gBAAQ,IAAAC,GAAAA,GARjBT,EAAIU,IAWf,MAGN"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{__assign as o}from"../../../node_modules/tslib/tslib.es6.js";import{jsx as r,jsxs as e}from"react/jsx-runtime";import{useTable as i}from"./hook.js";import{TableHeaderElement as t}from"../header/header.js";import{PagenationProvider as n}from"../pagenation/providers.js";import{DisplayRange as d,Pagenation as l}from"../pagenation/components.js";import"../filter-v2/context.js";import{FilterProvider as s}from"../filter-v2/provider.js";import"../sort/icon.js";import{SortProvider as c}from"../sort/provider.js";import{ColumnsProvider as
|
|
2
|
+
import{__assign as o}from"../../../node_modules/tslib/tslib.es6.js";import{jsx as r,jsxs as e}from"react/jsx-runtime";import{useTable as i}from"./hook.js";import{TableHeaderElement as t}from"../header/header.js";import{PagenationProvider as n}from"../pagenation/providers.js";import{DisplayRange as d,Pagenation as l}from"../pagenation/components.js";import"../filter-v2/context.js";import{FilterProvider as s}from"../filter-v2/provider.js";import"../sort/icon.js";import{SortProvider as c}from"../sort/provider.js";import{ColumnsProvider as a}from"../sheet/providers.js";import{CheckboxProvider as m,CheckboxStatusProvider as p}from"../checkbox/provider.js";import{EditProvider as h}from"../edit/provider.js";import{TablePropertyProvider as f}from"../table-property/provider.js";import{KeyboardSetting as v}from"../operation/components/keyboard-setting.js";import{Row as x}from"../sheet/components.js";import{PasteProvider as j}from"../paste/provider.js";import{generateFormattingString as g}from"../libs/conditional-formatting.js";import{Editor as u}from"../edit/ui/editor.js";import{RangeProvider as w,TestRange as b}from"../range/provider.js";import{CopyProvider as k}from"../copy/provider.js";import{CopiedMessage as y}from"../copy/components.js";import{TableIdGeneratorProvider as C,useTableIdGenerator as N}from"../id/provider.js";import{TableHeader as R}from"../header/header-v2.js";import"../header/columns-width/context.js";import{ColumnsWidthProvider as S}from"../header/columns-width/provider.js";import"../header/x-scroll-position/context.js";import{ScrollXPositionProvider as F}from"../header/x-scroll-position/provider.js";import{Frame as H}from"../frame/frame.js";import{ComponentProvider as I,useGenerateSortButton as W}from"./component-provider/provider.js";import{SelectBoxProvider as D}from"../../select-box/provider.js";function P(i){var t,d,l,x;return r(I,{children:r(C,{id:i.id,children:r(S,{initialState:i.cols,children:r(s,{initialConditions:[],children:r(c,{initialCondition:null===(t=i.initialCondition)||void 0===t?void 0:t.sort,children:r(n,{rowCount:i.rows.length,perPage:null===(l=null===(d=i.initialCondition)||void 0===d?void 0:d.pagenation)||void 0===l?void 0:l.rowCountPerPage,children:r(m,{checkbox:i.checkbox,children:r(p,{checkboxCount:i.rows.length,children:r(a,{cols:i.cols,errorHandler:i.errorHandler,children:r(h,{children:r(f,{children:r(w,{children:e(k,{rows:i.rows,cols:i.cols,children:[r(y,{}),e(j,{rows:i.rows,cols:i.cols,onUpdateRowFunction:i.onUpdateRow,children:[r(v,{enableDeprecatedCopy:null===(x=i.deprecatedOptions)||void 0===x?void 0:x.enableDeprecatedCopy}),r(F,{children:r(A,o({},i))})]})]})})})})})})})})})})})})})}function A(o){var n=i(o),s=n.cols,c=n.rowMaps,a=n.pageRowIds,m=N(),p=W();return e("div",{className:"w-full max-w-full max-h-full",children:[e("div",{children:[r(R,{cols:s,checkbox:!!o.checkbox,rows:o.rows,maxWidth:o.maxWidth,generateSortButton:p}),r(D,{children:e(H,{id:m.getTableId(),maxHeight:o.maxHeight,maxWidth:o.maxWidth,displayScroll:!1,children:[e("table",{className:"table",children:[r("thead",{children:e("tr",{children:[o.checkbox&&r("th",{className:"p-px"}),s.map((function(o){return r(t,{keyname:o.key.toString()},o.key.toString())}))]})}),e("tbody",{children:[0===a.length&&r("tr",{children:r("td",{colSpan:s.length,className:"px-px py-5",children:r("p",{className:"text-center font-bold text-lg",children:"NO DATA"})})}),a.map((function(e,i){return r(x,{existCheckbox:!!o.checkbox,rowIndex:i,dataString:c[e].stringValue,cols:o.cols,onClickRow:o.onClickRow,applyRowFormatting:o.applyRowFormatting,conditionalFormattingString:g(c[e].data,s,o.conditionalFormattings)},e)}))]})]}),r(b,{}),r(u,{rowMaps:c,pageRowIds:a})]})})]}),e("div",{className:"mt-1",children:[r(d,{}),r("div",{className:"mt-2",children:r(l,{})})]})]})}export{P as default};
|
|
3
3
|
//# sourceMappingURL=base.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@teppen/react-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"description": "React UI Component",
|
|
5
5
|
"main": "dist/cjs/src/index.js",
|
|
6
6
|
"module": "dist/esm/src/index.js",
|
|
@@ -26,25 +26,21 @@
|
|
|
26
26
|
"@babel/preset-typescript": "^7.23.3",
|
|
27
27
|
"@rollup/plugin-commonjs": "^25.0.7",
|
|
28
28
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
29
|
-
"@rollup/plugin-terser": "^0.
|
|
29
|
+
"@rollup/plugin-terser": "^1.0.0",
|
|
30
30
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
31
|
-
"@storybook/addon-
|
|
32
|
-
"@storybook/addon-
|
|
33
|
-
"@storybook/
|
|
34
|
-
"@
|
|
35
|
-
"@storybook/react": "^8.6.14",
|
|
36
|
-
"@storybook/react-vite": "^8.6.14",
|
|
37
|
-
"@storybook/test": "^8.6.14",
|
|
31
|
+
"@storybook/addon-docs": "^10.6.2",
|
|
32
|
+
"@storybook/addon-links": "^10.6.2",
|
|
33
|
+
"@storybook/react-vite": "^10.6.2",
|
|
34
|
+
"@tailwindcss/postcss": "^4.3.3",
|
|
38
35
|
"@testing-library/dom": "^10.4.0",
|
|
39
36
|
"@testing-library/react": "^16.3.0",
|
|
40
|
-
"@types/jest": "^
|
|
37
|
+
"@types/jest": "^30.0.0",
|
|
41
38
|
"@types/react": "^19.0.0",
|
|
42
39
|
"@types/react-dom": "^19.0.0",
|
|
43
|
-
"
|
|
44
|
-
"babel-jest": "^29.7.0",
|
|
40
|
+
"babel-jest": "^30.5.2",
|
|
45
41
|
"identity-obj-proxy": "^3.0.0",
|
|
46
|
-
"jest": "^
|
|
47
|
-
"jest-environment-jsdom": "^
|
|
42
|
+
"jest": "^30.5.2",
|
|
43
|
+
"jest-environment-jsdom": "^30.5.2",
|
|
48
44
|
"postcss": "^8.4.35",
|
|
49
45
|
"react": "^19.0.0",
|
|
50
46
|
"react-dom": "^19.0.0",
|
|
@@ -53,13 +49,12 @@
|
|
|
53
49
|
"rollup": "^4.12.0",
|
|
54
50
|
"rollup-plugin-dts": "^6.1.0",
|
|
55
51
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
56
|
-
"rollup-plugin-postcss": "^4.0.2",
|
|
57
52
|
"rollup-plugin-preserve-directives": "^0.4.0",
|
|
58
|
-
"storybook": "^
|
|
59
|
-
"
|
|
60
|
-
"tailwindcss": "^3.4.1",
|
|
53
|
+
"storybook": "^10.6.2",
|
|
54
|
+
"tailwindcss": "^4.3.3",
|
|
61
55
|
"tslib": "^2.6.2",
|
|
62
|
-
"typescript": "^5.3.3"
|
|
56
|
+
"typescript": "^5.3.3",
|
|
57
|
+
"vite": "^7.3.7"
|
|
63
58
|
},
|
|
64
59
|
"peerDependencies": {
|
|
65
60
|
"react": "^18.2.0 || ^19.0.0",
|
|
@@ -81,5 +76,10 @@
|
|
|
81
76
|
"front-end",
|
|
82
77
|
"ui",
|
|
83
78
|
"table"
|
|
84
|
-
]
|
|
79
|
+
],
|
|
80
|
+
"overrides": {
|
|
81
|
+
"@istanbuljs/load-nyc-config": {
|
|
82
|
+
"js-yaml": "^4.1.1"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
85
|
}
|