@epam/ai-dial-ui-kit 0.14.0-dev.35 → 0.14.0-dev.37

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.
Files changed (53) hide show
  1. package/dist/CHANGELOG.md +1 -0
  2. package/dist/DateCellRenderer-DNPEX0I7.cjs +1 -0
  3. package/dist/{DateCellRenderer-B0o0BqbW.cjs → DateCellRenderer-p6k-mVZt.cjs} +26 -26
  4. package/dist/IconButton-DWqoaBWf.cjs +1 -0
  5. package/dist/JsonEditor-BZCyPc2D.cjs +1 -0
  6. package/dist/MarkdownEditor-CBH7ILah.cjs +1 -0
  7. package/dist/MarkdownEditor-CMRC_XsQ.cjs +1 -0
  8. package/dist/MarkdownEditorContainer-B_6-Gd-T.cjs +1 -0
  9. package/dist/{Switch-CtdhpYik.cjs → Switch-CUKClcEz.cjs} +1 -1
  10. package/dist/components/Grid/Grid.js +111 -111
  11. package/dist/components/JsonEditor/lazy.js +4 -0
  12. package/dist/components/MarkdownEditor/MarkdownEditorContainer.js +18 -16
  13. package/dist/components/MarkdownEditor/lazy.js +4 -0
  14. package/dist/components/New/Grid/Grid.js +129 -129
  15. package/dist/components/New/MarkdownEditor/lazy.js +4 -0
  16. package/dist/components/New/Tooltip/TooltipContent.js +16 -16
  17. package/dist/components/Tooltip/TooltipContent.js +11 -11
  18. package/dist/components-manifest.json +6 -6
  19. package/dist/dial-ui-kit.cjs +2 -2
  20. package/dist/dial-ui-kit.js +410 -408
  21. package/dist/editor-BKQqPhwX.cjs +1 -0
  22. package/dist/editors.cjs +1 -1
  23. package/dist/editors.js +10 -7
  24. package/dist/file-manager.cjs +1 -1
  25. package/dist/grid.cjs +1 -1
  26. package/dist/hooks/use-has-hover.js +17 -0
  27. package/dist/lazy-CJ-0Pjkj.cjs +1 -0
  28. package/dist/migration-guides/0.14.0/button-tooltip-2-0.md +1 -1
  29. package/dist/src/components/JsonEditor/lazy.d.ts +14 -0
  30. package/dist/src/components/MarkdownEditor/lazy.d.ts +7 -0
  31. package/dist/src/components/New/EllipsisTooltip/EllipsisTooltip.d.ts +1 -1
  32. package/dist/src/components/New/MarkdownEditor/lazy.d.ts +7 -0
  33. package/dist/src/components/New/Tooltip/Tooltip.d.ts +1 -1
  34. package/dist/src/components/New/Tooltip/TooltipContent.d.ts +4 -3
  35. package/dist/src/components/Tooltip/TooltipContent.d.ts +4 -0
  36. package/dist/src/hooks/use-has-hover.d.ts +20 -0
  37. package/dist/src/index.d.ts +3 -3
  38. package/dist/src/subpaths/editors.d.ts +13 -12
  39. package/dist/src/utils/__tests__/pointer.spec.d.ts +1 -0
  40. package/dist/src/utils/grid-registration.d.ts +16 -0
  41. package/dist/src/utils/grid-registration.spec.d.ts +1 -0
  42. package/dist/src/utils/pointer.d.ts +29 -0
  43. package/dist/{use-file-manager-tabs-CkYH0CvF.cjs → use-file-manager-tabs-CIQjiyK-.cjs} +2 -2
  44. package/dist/utils/grid-registration.js +8 -0
  45. package/dist/utils/pointer.js +5 -0
  46. package/package.json +1 -1
  47. package/dist/DateCellRenderer-B41xNX7a.cjs +0 -1
  48. package/dist/IconButton-BCbBgnzo.cjs +0 -1
  49. package/dist/JsonEditor-pdzI3xkJ.cjs +0 -1
  50. package/dist/MarkdownEditor-CNEY8i7O.cjs +0 -1
  51. package/dist/MarkdownEditor-Dea4eQpw.cjs +0 -1
  52. package/dist/MarkdownEditorContainer-BO6PafCS.cjs +0 -1
  53. package/dist/editor-Ba3vCFHk.cjs +0 -1
@@ -0,0 +1 @@
1
+ "use strict";const u=require("react/jsx-runtime"),s=require("@floating-ui/react"),c=require("react"),x=require("classnames"),F=require("./merge-classes-Dipy1Ih1.cjs");var l=(e=>(e.Primary="primary",e.Neutral="neutral",e.Danger="danger",e.Static="static",e.Success="success",e.Secondary="secondary",e.Tertiary="tertiary",e))(l||{}),r=(e=>(e.Solid="solid",e.Outlined="outlined",e.Ghost="ghost",e.Link="link",e))(r||{});const v={[l.Primary]:{[r.Solid]:"dial-primary-solid-button",[r.Ghost]:"dial-primary-ghost-button",[r.Link]:"dial-primary-link-button"},[l.Neutral]:{[r.Outlined]:"dial-neutral-outlined-button"},[l.Danger]:{[r.Solid]:"dial-danger-solid-button",[r.Ghost]:"dial-danger-ghost-button",[r.Outlined]:"dial-danger-outlined-button"},[l.Success]:{[r.Ghost]:"dial-success-ghost-button"},[l.Secondary]:{[r.Ghost]:"dial-secondary-ghost-button"},[l.Tertiary]:{[r.Ghost]:"dial-tertiary-ghost-button"},[l.Static]:{}},S=(e=l.Primary,n=r.Solid)=>{const t=v[e]?.[n];return t||(console.warn(`Could not find Button styles for variant: ${e} and appearance: ${n}. Using default primary solid button styles.`),v[l.Primary][r.Solid])};var h=(e=>(e.Small="small",e.Standard="standard",e.Large="large",e))(h||{});const I=7,A=2,C=c.createContext(null),N=()=>{const e=c.useContext(C);if(e==null)throw new Error("Tooltip components must be wrapped in <Tooltip />");return e},q=({initialOpen:e=!1,placement:n="bottom",isTriggerClickable:t=!1,open:o,onOpenChange:a}={})=>{const[i,g]=c.useState(e),p=c.useRef(null),m=o??i,d=a??g,f=s.useFloating({placement:n,open:m,onOpenChange:d,whileElementsMounted:s.autoUpdate,middleware:[s.offset(I+A),s.flip({crossAxis:n.includes("-"),fallbackAxisSideDirection:"start",padding:5}),s.shift({padding:5}),s.arrow({element:p})]}),M=s.useHover(f.context,{move:!1,enabled:o==null,mouseOnly:t,delay:{open:500,close:0}}),k=s.useFocus(f.context,{enabled:o==null}),P=s.useDismiss(f.context),G=s.useRole(f.context,{role:"tooltip"}),b=s.useInteractions([M,k,P,G]);return c.useEffect(()=>{if(!m)return;const y=f.refs.reference.current;if(!(y instanceof Element))return;const w=new IntersectionObserver(([L])=>{L.isIntersecting||d(!1)},{root:null,threshold:0});return w.observe(y),()=>w.disconnect()},[m,f.refs.reference,d]),c.useMemo(()=>({open:m,setOpen:d,arrowRef:p,...b,...f}),[m,d,b,f])},R=({children:e,...n})=>{const t=q(n);return u.jsx(C.Provider,{value:t,children:e})},T="(hover: none)",_=()=>typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia(T).matches,D=()=>{const[e,n]=c.useState(()=>!_());return c.useEffect(()=>{if(typeof window>"u"||typeof window.matchMedia!="function")return;const t=window.matchMedia(T);if(n(!t.matches),typeof t.addEventListener!="function")return;const o=a=>n(!a.matches);return t.addEventListener("change",o),()=>t.removeEventListener("change",o)},[]),e},E=({style:e,...n})=>{const t=N(),o=D(),a=c.useRef(null),i=s.useMergeRefs([t.refs.setFloating,a]);return!t.open||!o?null:u.jsx(s.FloatingPortal,{id:"tooltip-portal",children:u.jsxs("div",{ref:i,style:{...t.floatingStyles,...e},...t.getFloatingProps(n),className:x("z-[55] whitespace-pre-wrap break-words rounded border border-primary bg-layer-0 px-2 py-1 dial-tiny-text shadow max-w-[300px]",t.getFloatingProps(n).className),children:[n.children,u.jsx(s.FloatingArrow,{ref:t.arrowRef,context:t.context,fill:"currentColor",strokeWidth:1,className:"stroke-primary text-[var(--bg-layer-0,_#000000)]"})]})})},H=({children:e,asChild:n=!1,...t})=>{const o=N(),a=n&&c.isValidElement(e),i=a?e.props?.ref:null,g=s.useMergeRefs([o.refs.setReference,...i?[i]:[]]);return a?c.cloneElement(e,o.getReferenceProps({...e.props,...t,ref:g})):u.jsx("span",{ref:g,...o.getReferenceProps(t),className:t.className??"dial-tooltip-trigger text-start",children:e})},j=({hideTooltip:e,tooltip:n,children:t,triggerClassName:o,contentClassName:a,...i})=>u.jsxs(R,{...i,children:[u.jsx(H,{className:x(o,"truncate"),children:t}),u.jsx(E,{className:x("text-primary",a,"max-w-[300px]",(e||!n)&&"hidden"),children:n})]}),O=(...e)=>e.find(n=>typeof n=="string"&&n.length>0),U=({variant:e,appearance:n=r.Solid,size:t=h.Standard,className:o,icon:a,tooltipProps:i,type:g="button",...p})=>{const m=F.mergeClasses(e&&S(e,n),t===h.Small?"h-[24px] w-[24px]":"h-[40px] w-[40px] dial-kit-enhanced-target","dial-icon-button disabled:cursor-not-allowed focus-visible:outline focus-visible:outline-focus outline-offset-0 disabled:text-controls-secondary-disable",o),d=u.jsx("button",{...p,type:g,className:m,"aria-label":O(p["aria-label"],i?.tooltip),children:a});return i?u.jsx(j,{...i,children:d}):d};exports.ButtonAppearance=r;exports.ButtonVariant=l;exports.DialIconButton=U;exports.DialTooltip=j;exports.DialTooltipContainer=R;exports.DialTooltipContent=E;exports.DialTooltipTrigger=H;exports.ElementSize=h;exports.getButtonClassNames=S;exports.resolveAccessibleName=O;exports.useHasHover=D;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),u=require("./editor-BKQqPhwX.cjs"),c=require("@monaco-editor/react"),d=({value:o,onChange:a,onValidateJSON:i,options:r,currentTheme:e,themesConfig:s=u.EDITOR_THEMES_CONFIG})=>{function n(t){t?.editor?.defineTheme(e,s[e]),t.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0,enableSchemaRequest:!1,schemas:[{uri:"http://custom-schema/object-required.json",fileMatch:["*"],schema:{type:"object",description:"Top-level value must be an object",additionalProperties:!0}}]})}return l.jsx(c.Editor,{beforeMount:n,height:"100%",defaultLanguage:"json",value:o,onChange:a,theme:e,onValidate:i,options:{minimap:{enabled:!1},formatOnType:!0,formatOnPaste:!0,selectOnLineNumbers:!1,automaticLayout:!0,scrollBeyondLastLine:!1,wordWrap:"on",smoothScrolling:!0,overviewRulerLanes:0,scrollbar:{horizontal:"hidden",verticalScrollbarSize:4,verticalSliderSize:4},...r??{}}})};exports.DialJsonEditor=d;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("@uiw/react-md-editor"),m=require("./lazy-CJ-0Pjkj.cjs"),u=require("./merge-classes-Dipy1Ih1.cjs"),x=({value:t,onChange:s,height:o=300,preview:i="edit",theme:a=m.EditorThemes.dark,className:n,placeholder:r})=>{const d=r!==void 0&&!t;return e.jsxs("div",{"data-color-mode":a,className:u.mergeClasses("relative",n),children:[e.jsx(c,{value:t,onChange:l=>s?.(l||""),height:o,preview:i}),d&&e.jsx("div",{className:"pointer-events-none absolute left-0 top-8 px-2 dial-small-text text-secondary opacity-40",children:r})]})};exports.DialMarkdownEditor=x;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),c=require("react"),e=require("@uiw/react-md-editor"),C=require("./lazy-CJ-0Pjkj.cjs"),O=require("./merge-classes-Dipy1Ih1.cjs"),t=require("@tabler/icons-react"),k=require("./icon-DhjrDQ8I.cjs"),L=require("./icon-CrGVkVpG.cjs"),M=L.DIAL_ICON_SIZE.SM,i={size:M,stroke:k.DIAL_KIT_ICON_STROKE},n=(s,r)=>({...s,icon:r}),v=()=>[n(e.bold,o.jsx(t.IconBold,{...i})),n(e.italic,o.jsx(t.IconItalic,{...i})),n(e.strikethrough,o.jsx(t.IconStrikethrough,{...i})),e.divider,e.group([e.heading1,e.heading2,e.heading3],{name:"heading",groupName:"heading",icon:o.jsx(t.IconTextSize,{...i}),buttonProps:{"aria-label":"Text style",title:"Text style"}}),e.divider,n(e.unorderedListCommand,o.jsx(t.IconList,{...i})),n(e.orderedListCommand,o.jsx(t.IconListNumbers,{...i})),e.divider,n(e.quote,o.jsx(t.IconQuote,{...i})),n(e.link,o.jsx(t.IconLink,{...i})),n(e.code,o.jsx(t.IconCode,{...i})),e.divider,n(e.table,o.jsx(t.IconTable,{...i}))],E=()=>[n(e.codeEdit,o.jsx(t.IconPencil,{...i})),n(e.codeLive,o.jsx(t.IconLayoutColumns,{...i})),n(e.codePreview,o.jsx(t.IconEye,{...i})),e.divider,n(e.fullscreen,o.jsx(t.IconMaximize,{...i}))],T=({value:s,onChange:r,height:d=300,theme:a=C.EditorThemes.light,className:l,placeholder:m,defaultPreview:u="edit",id:I,ariaLabel:x})=>{const g=c.useMemo(()=>v(),[]),j=c.useMemo(()=>E(),[]);return o.jsx("div",{"data-color-mode":a,className:O.mergeClasses("dial-kit-markdown-editor",l),children:o.jsx(e,{value:s,onChange:h=>r?.(h||""),height:d,preview:u,commands:g,extraCommands:j,textareaProps:{placeholder:m,id:I,"aria-label":x}})})};exports.MarkdownEditor=T;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("react");require("./editor-BKQqPhwX.cjs");const E=require("./lazy-CJ-0Pjkj.cjs");require("@monaco-editor/react");const m=require("./Switch-CUKClcEz.cjs"),N=require("./MarkdownEditor-CBH7ILah.cjs"),b=({value:o,onChangeValue:l,label:i,headerContent:a,switcherLabel:d,height:c=300,theme:u=E.EditorThemes.dark,onValidateJSON:x,preview:j="edit"})=>{const w=n.useId(),[t,C]=n.useState(!1),[f,p]=n.useState(null);n.useEffect(()=>{t&&typeof window<"u"&&Promise.resolve().then(()=>require("./JsonEditor-BZCyPc2D.cjs")).then(s=>{p(()=>s.DialJsonEditor)})},[t]);const h=n.useCallback(s=>{l?.(s)},[l]),S=n.useCallback(s=>{x?.(s)},[x]),r=!!d;return e.jsx("div",{className:"size-full flex flex-col",children:e.jsx("div",{className:"flex flex-col gap-8",children:e.jsxs("div",{children:[(i||a||r)&&e.jsxs("div",{className:"flex justify-between items-center mb-2",children:[i&&e.jsx(m.DialLabel,{label:i}),e.jsxs("div",{className:"flex items-center gap-2 flex-1 justify-end",children:[a,r&&e.jsx("label",{className:"flex items-center gap-2 cursor-pointer",children:e.jsx(m.DialSwitch,{isOn:t,label:d,switchId:w,onChange:s=>C(s)})})]})]}),r&&t?e.jsx("div",{className:"border border-primary rounded",style:{height:`${c}px`},children:f&&e.jsx(f,{value:o,onChange:h,onValidateJSON:S,currentTheme:u})}):e.jsx(N.DialMarkdownEditor,{value:o,onChange:h,height:c,preview:j,theme:u})]})})})};exports.DialMarkdownEditorContainer=b;
@@ -1 +1 @@
1
- "use strict";const e=require("react/jsx-runtime"),p=require("./merge-classes-Dipy1Ih1.cjs"),d=require("@tabler/icons-react"),i=require("./IconButton-BCbBgnzo.cjs"),f=require("./icon-CrGVkVpG.cjs"),l=require("classnames"),h=require("react"),y="w-[24px] h-[24px] border border-solid rounded-[6px] border-transparent flex items-center justify-center text-secondary hover:text-controls-accent-primary-hover active:text-controls-accent-primary-active",o=({caption:t,onClick:a})=>{if(!t)return null;const s=e.jsx(i.DialIconButton,{"aria-label":t,className:y,icon:e.jsx(d.IconInfoCircle,{size:f.DIAL_ICON_SIZE.SM}),onClick:a});return t?e.jsx(i.DialTooltip,{tooltip:t,triggerClassName:"flex justify-center items-center",children:s}):s},j=({label:t,required:a,className:s,caption:r,...n})=>t?e.jsxs("label",{...n,className:p.mergeClasses("dial-tiny-text text-secondary flex items-center gap-1",s),children:[typeof t=="string"?e.jsx("span",{className:"min-h-4",children:t}):t,a&&e.jsx("span",{className:"text-accent-primary",children:"*"}),e.jsx(o,{caption:r})]}):null,N=({label:t,switchId:a,isOn:s=!1,disabled:r,onChange:n,caption:c})=>{const x=l("flex shrink-0 w-[36px] h-[18px] cursor-pointer items-center gap-1 rounded-full p-0.5 transition-all duration-200",s?"flex-row-reverse":"flex-row",r?"pointer-events-none":"",r?s?"bg-controls-disable":"bg-layer-4":s?"bg-accent-primary":"bg-layer-4"),m=h.useCallback(u=>{u.stopPropagation(),n?.(!s)},[n,s]);return e.jsxs("div",{className:"flex flex-row items-start",role:"switch",children:[e.jsx("input",{type:"checkbox",onChange:m,id:a,disabled:r,className:"invisible size-0",checked:s}),e.jsx("label",{htmlFor:a,className:x,"aria-describedby":c&&"caption",children:e.jsx("span",{className:l("size-3 rounded-full",r?"bg-controls-disable-accent":"bg-controls-enable-primary")})}),(t||c)&&e.jsxs("div",{className:"flex flex-col gap-1 ml-2",children:[t&&e.jsx("span",{className:l("dial-small-text py-[1px]",r?"text-secondary":"text-primary"),"aria-label":"switch-title",children:t}),c&&e.jsx("span",{id:"caption",className:"dial-tiny-text text-secondary",children:c})]})]})};exports.DialInfoButton=o;exports.DialLabel=j;exports.DialSwitch=N;
1
+ "use strict";const e=require("react/jsx-runtime"),p=require("./merge-classes-Dipy1Ih1.cjs"),d=require("@tabler/icons-react"),i=require("./IconButton-DWqoaBWf.cjs"),f=require("./icon-CrGVkVpG.cjs"),l=require("classnames"),h=require("react"),y="w-[24px] h-[24px] border border-solid rounded-[6px] border-transparent flex items-center justify-center text-secondary hover:text-controls-accent-primary-hover active:text-controls-accent-primary-active",o=({caption:t,onClick:a})=>{if(!t)return null;const s=e.jsx(i.DialIconButton,{"aria-label":t,className:y,icon:e.jsx(d.IconInfoCircle,{size:f.DIAL_ICON_SIZE.SM}),onClick:a});return t?e.jsx(i.DialTooltip,{tooltip:t,triggerClassName:"flex justify-center items-center",children:s}):s},j=({label:t,required:a,className:s,caption:r,...n})=>t?e.jsxs("label",{...n,className:p.mergeClasses("dial-tiny-text text-secondary flex items-center gap-1",s),children:[typeof t=="string"?e.jsx("span",{className:"min-h-4",children:t}):t,a&&e.jsx("span",{className:"text-accent-primary",children:"*"}),e.jsx(o,{caption:r})]}):null,N=({label:t,switchId:a,isOn:s=!1,disabled:r,onChange:n,caption:c})=>{const x=l("flex shrink-0 w-[36px] h-[18px] cursor-pointer items-center gap-1 rounded-full p-0.5 transition-all duration-200",s?"flex-row-reverse":"flex-row",r?"pointer-events-none":"",r?s?"bg-controls-disable":"bg-layer-4":s?"bg-accent-primary":"bg-layer-4"),m=h.useCallback(u=>{u.stopPropagation(),n?.(!s)},[n,s]);return e.jsxs("div",{className:"flex flex-row items-start",role:"switch",children:[e.jsx("input",{type:"checkbox",onChange:m,id:a,disabled:r,className:"invisible size-0",checked:s}),e.jsx("label",{htmlFor:a,className:x,"aria-describedby":c&&"caption",children:e.jsx("span",{className:l("size-3 rounded-full",r?"bg-controls-disable-accent":"bg-controls-enable-primary")})}),(t||c)&&e.jsxs("div",{className:"flex flex-col gap-1 ml-2",children:[t&&e.jsx("span",{className:l("dial-small-text py-[1px]",r?"text-secondary":"text-primary"),"aria-label":"switch-title",children:t}),c&&e.jsx("span",{id:"caption",className:"dial-tiny-text text-secondary",children:c})]})]})};exports.DialInfoButton=o;exports.DialLabel=j;exports.DialSwitch=N;
@@ -1,37 +1,36 @@
1
1
  import { jsx as s } from "react/jsx-runtime";
2
- import { themeBalham as Ne, colorSchemeLight as ge, setupAgTestIds as be, ModuleRegistry as ye, AllCommunityModule as Ae } from "../../node_modules/ag-grid-community/dist/package/main.esm.js";
3
- import { AgGridReact as Ee } from "../../node_modules/ag-grid-react/dist/package/index.esm.js";
4
- import Z from "classnames";
5
- import { useState as De, useId as Te, useRef as Y, useMemo as h, useCallback as l, useEffect as A } from "react";
2
+ import { themeBalham as Ne, colorSchemeLight as ge } from "../../node_modules/ag-grid-community/dist/package/main.esm.js";
3
+ import { AgGridReact as be } from "../../node_modules/ag-grid-react/dist/package/index.esm.js";
4
+ import Q from "classnames";
5
+ import { useState as ye, useId as Ee, useRef as Y, useMemo as h, useCallback as l, useEffect as E } from "react";
6
6
  import { DialDropdown as R } from "../Dropdown/Dropdown.js";
7
- import { DialEllipsisTooltip as ve } from "../EllipsisTooltip/EllipsisTooltip.js";
8
- import { RADIO_BUTTON_COL_DEF as Ge, CHECKBOX_COL_DEF as Oe } from "./renderers/constants.js";
9
- import { DialNoDataContent as xe } from "../NoDataContent/NoDataContent.js";
10
- import { DialRadioButton as ze } from "../RadioButton/RadioButton.js";
7
+ import { DialEllipsisTooltip as De } from "../EllipsisTooltip/EllipsisTooltip.js";
8
+ import { RADIO_BUTTON_COL_DEF as Ae, CHECKBOX_COL_DEF as Te } from "./renderers/constants.js";
9
+ import { DialNoDataContent as Ge } from "../NoDataContent/NoDataContent.js";
10
+ import { DialRadioButton as ve } from "../RadioButton/RadioButton.js";
11
11
  import { GridSelectionMode as x } from "../../models/selection-mode.js";
12
12
  import { DropdownTrigger as w } from "../../types/dropdown.js";
13
- import { IconZoomCancel as _e } from "@tabler/icons-react";
14
- import { GRID_THEME_COLORS as z, SelectionEventSourceType as p, checkboxClass as I, ROW_HEIGHT as ee, gridBaseClassName as ke } from "./constants.js";
15
- import { ariaDescription as te } from "../Checkbox/constants.js";
16
- import { useIsMobileScreen as He } from "../../hooks/use-is-mobile-screen.js";
17
- import { useIsTabletScreen as Le } from "../../hooks/use-is-tablet-screen.js";
18
- import { debounceFn as Fe } from "../../utils/debounce.js";
19
- import { baseColumnComparator as We, omitUndefined as Be } from "../../utils/grid-comparators.js";
20
- be({ testIdAttribute: "dataQA" });
21
- ye.registerModules([Ae]);
22
- const nt = ({
23
- columnDefs: E,
13
+ import { IconZoomCancel as Oe } from "@tabler/icons-react";
14
+ import { GRID_THEME_COLORS as z, SelectionEventSourceType as p, checkboxClass as I, ROW_HEIGHT as ee, gridBaseClassName as xe } from "./constants.js";
15
+ import { ariaDescription as re } from "../Checkbox/constants.js";
16
+ import { useIsMobileScreen as ze } from "../../hooks/use-is-mobile-screen.js";
17
+ import { useIsTabletScreen as _e } from "../../hooks/use-is-tablet-screen.js";
18
+ import { debounceFn as ke } from "../../utils/debounce.js";
19
+ import { registerAgGridModulesOnce as He } from "../../utils/grid-registration.js";
20
+ import { baseColumnComparator as Le, omitUndefined as Fe } from "../../utils/grid-comparators.js";
21
+ const or = ({
22
+ columnDefs: D,
24
23
  rowData: f,
25
24
  additionalGridOptions: _,
26
25
  getContextMenuItems: C,
27
- className: re,
26
+ className: te,
28
27
  ariaLabel: oe = "Data grid",
29
- wrapCustomCellRenderers: d = !0,
28
+ wrapCustomCellRenderers: m = !0,
30
29
  disabledRowIds: c,
31
30
  selectedRowIds: n,
32
31
  onSelectionChange: k,
33
32
  onGridApiChange: ne,
34
- getRowId: i = (r) => String(r.id ?? JSON.stringify(r)),
33
+ getRowId: i = (t) => String(t.id ?? JSON.stringify(t)),
35
34
  alternateOddRowColors: H = !1,
36
35
  filterPlaceholder: L = "Enter value",
37
36
  emptyStateIcon: F,
@@ -41,9 +40,10 @@ const nt = ({
41
40
  wrapperBorder: $ = !0,
42
41
  withoutHeaderBorders: ie = !1,
43
42
  allowDisabledContextMenu: N = !1,
44
- selectionMode: m
43
+ selectionMode: d
45
44
  }) => {
46
- const [r, se] = De(), ae = Te(), g = He(), b = Le(), D = Y(/* @__PURE__ */ new Set()), U = Y(
45
+ He();
46
+ const [t, se] = ye(), ae = Ee(), g = ze(), b = _e(), A = Y(/* @__PURE__ */ new Set()), U = Y(
47
47
  void 0
48
48
  ), le = h(
49
49
  () => ({
@@ -57,18 +57,18 @@ const nt = ({
57
57
  }, []), T = l(
58
58
  (e) => {
59
59
  if (e.data) {
60
- const t = i(e.data), o = c?.has(t) ?? !1, u = o && !N, a = e.value == null ? "" : String(e.value), G = C?.(e.data) ?? [];
60
+ const r = i(e.data), o = c?.has(r) ?? !1, u = o && !N, a = e.value == null ? "" : String(e.value), v = C?.(e.data) ?? [];
61
61
  return /* @__PURE__ */ s(
62
62
  R,
63
63
  {
64
64
  trigger: [w.ContextMenu],
65
- items: G,
65
+ items: v,
66
66
  anchorToMouse: !0,
67
67
  matchReferenceWidth: !0,
68
68
  className: "w-full",
69
69
  disabled: u,
70
70
  children: /* @__PURE__ */ s("span", { className: "block min-w-0 h-full max-w-full", children: /* @__PURE__ */ s(
71
- ve,
71
+ De,
72
72
  {
73
73
  text: a,
74
74
  className: "max-w-full h-full",
@@ -83,23 +83,23 @@ const nt = ({
83
83
  ), y = l(
84
84
  (e) => e === p.API || e === p.ROW_DATA_CHANGED,
85
85
  []
86
- ), M = l(
86
+ ), j = l(
87
87
  (e) => {
88
- if (!r)
88
+ if (!t)
89
89
  return;
90
90
  const o = (e.selectedNodes || []).map((a) => a.data), u = new Set(o.map(i));
91
- D.current = u, U.current = e.source, y(e.source) || k?.(u, o);
91
+ A.current = u, U.current = e.source, y(e.source) || k?.(u, o);
92
92
  },
93
- [r, i, y, k]
94
- ), ue = h(() => Fe(
95
- (e) => M?.(e),
93
+ [t, i, y, k]
94
+ ), ue = h(() => ke(
95
+ (e) => j?.(e),
96
96
  100
97
- ), [M]), j = l(
97
+ ), [j]), q = l(
98
98
  (e) => {
99
99
  if (!e.data) return null;
100
- const t = i(e.data), o = e.node.isSelected(), u = c?.has(t), a = `row-select-${t}`;
100
+ const r = i(e.data), o = e.node.isSelected(), u = c?.has(r), a = `row-select-${r}`;
101
101
  return /* @__PURE__ */ s("div", { className: "size-6 flex items-center justify-center", children: /* @__PURE__ */ s(
102
- ze,
102
+ ve,
103
103
  {
104
104
  className: "size-[18px]",
105
105
  inputId: a,
@@ -119,56 +119,56 @@ const nt = ({
119
119
  },
120
120
  [i, c]
121
121
  ), S = l(() => {
122
- const e = "dial-row-select", t = "dial-row-select-visible";
123
- return g || b || n && n.size > 0 ? `${e} ${t}` : !n || n.size === 0 ? e : `${e} ${t}`;
124
- }, [g, b, n]), q = l(() => g || b ? S() : !n || n.size === 0 ? "dial-row-not-select-header" : S(), [S, g, b, n]), fe = h(() => {
125
- if (m === x.SINGLE)
122
+ const e = "dial-row-select", r = "dial-row-select-visible";
123
+ return g || b || n && n.size > 0 ? `${e} ${r}` : !n || n.size === 0 ? e : `${e} ${r}`;
124
+ }, [g, b, n]), K = l(() => g || b ? S() : !n || n.size === 0 ? "dial-row-not-select-header" : S(), [S, g, b, n]), fe = h(() => {
125
+ if (d === x.SINGLE)
126
126
  return {
127
- ...Ge,
128
- cellRenderer: j
127
+ ...Ae,
128
+ cellRenderer: q
129
129
  };
130
- if (m === x.MULTIPLE)
130
+ if (d === x.MULTIPLE)
131
131
  return {
132
- ...Oe,
133
- headerClass: () => q(),
132
+ ...Te,
133
+ headerClass: () => K(),
134
134
  cellClass: (e) => {
135
- const t = e.data ? i(e.data) : null;
135
+ const r = e.data ? i(e.data) : null;
136
136
  let o = S();
137
- return t && c?.has(t) && (o += " opacity-50 pointer-events-none"), o;
137
+ return r && c?.has(r) && (o += " opacity-50 pointer-events-none"), o;
138
138
  }
139
139
  };
140
140
  }, [
141
- m,
142
- j,
141
+ d,
143
142
  q,
143
+ K,
144
144
  i,
145
145
  S,
146
146
  c
147
- ]), K = l(
147
+ ]), X = l(
148
148
  (e) => {
149
- const t = typeof d == "function" ? d(e) : !!d;
149
+ const r = typeof m == "function" ? m(e) : !!m;
150
150
  if (!e.cellRenderer)
151
151
  return { ...e, cellRenderer: T };
152
- if (!t)
152
+ if (!r)
153
153
  return e;
154
154
  const o = e.cellRenderer;
155
155
  return { ...e, cellRenderer: (a) => {
156
- const G = a.data ? C?.(a.data) ?? [] : [];
156
+ const v = a.data ? C?.(a.data) ?? [] : [];
157
157
  let O = null;
158
158
  typeof o == "function" ? O = /* @__PURE__ */ s(o, { ...a }) : O = T(a);
159
- const Q = a.data ? i(a.data) : null, V = Q ? c?.has(Q) : !1;
159
+ const V = a.data ? i(a.data) : null, Z = V ? c?.has(V) : !1;
160
160
  return /* @__PURE__ */ s(
161
161
  R,
162
162
  {
163
163
  trigger: [w.ContextMenu],
164
- items: G,
164
+ items: v,
165
165
  anchorToMouse: !0,
166
166
  matchReferenceWidth: !0,
167
- className: Z(
167
+ className: Q(
168
168
  "w-full h-full",
169
- V && "!cursor-not-allowed opacity-75"
169
+ Z && "!cursor-not-allowed opacity-75"
170
170
  ),
171
- disabled: V && !N,
171
+ disabled: Z && !N,
172
172
  children: /* @__PURE__ */ s("span", { className: "block min-w-0 max-w-full flex-1", children: O })
173
173
  }
174
174
  );
@@ -179,19 +179,19 @@ const nt = ({
179
179
  C,
180
180
  i,
181
181
  T,
182
- d,
182
+ m,
183
183
  N
184
184
  ]
185
- ), X = h(
186
- () => d ? (E ?? []).map(K) : E ?? [],
185
+ ), J = h(
186
+ () => m ? (D ?? []).map(X) : D ?? [],
187
187
  // eslint-disable-next-line react-hooks/exhaustive-deps
188
188
  [
189
- E,
190
- d,
189
+ D,
190
+ m,
191
191
  // eslint-disable-next-line react-hooks/exhaustive-deps
192
- d ? K : null
192
+ m ? X : null
193
193
  ]
194
- ), { defaultColDef: J, ...de } = _ ?? {}, me = h(
194
+ ), { defaultColDef: M, ...me } = _ ?? {}, de = h(
195
195
  () => ({
196
196
  minWidth: 150,
197
197
  resizable: !0,
@@ -202,32 +202,32 @@ const nt = ({
202
202
  filterPlaceholder: L,
203
203
  buttons: ["reset"]
204
204
  },
205
- comparator: We,
206
- ...Be(J)
205
+ comparator: Le,
206
+ ...Fe(M)
207
207
  }),
208
- [L, J]
208
+ [L, M]
209
209
  ), he = (e) => {
210
- const t = document.querySelector(I);
211
- t && t.setAttribute("aria-description", te);
212
- const o = X.map((u) => ({
210
+ const r = document.querySelector(I);
211
+ r && r.setAttribute("aria-description", re);
212
+ const o = J.map((u) => ({
213
213
  ...u,
214
214
  sort: void 0
215
215
  }));
216
216
  e.api.updateGridOptions({ columnDefs: o, rowData: f }), e.api.sizeColumnsToFit(), se(e.api), _?.onGridReady?.(e), ne?.(e.api);
217
217
  };
218
- A(() => {
219
- r && f && r.setGridOption("rowData", f);
220
- }, [r, f]);
218
+ E(() => {
219
+ t && f && t.setGridOption("rowData", f);
220
+ }, [t, f]);
221
221
  const pe = l(
222
222
  () => /* @__PURE__ */ s(
223
- xe,
223
+ Ge,
224
224
  {
225
225
  title: W,
226
226
  description: B,
227
227
  containerClassName: "gap-3",
228
228
  titleClassName: "mt-2 !text-lg",
229
229
  icon: F || /* @__PURE__ */ s(
230
- _e,
230
+ Oe,
231
231
  {
232
232
  size: 100,
233
233
  stroke: 0.5,
@@ -238,52 +238,52 @@ const nt = ({
238
238
  ),
239
239
  [W, B, F]
240
240
  ), Se = h(() => {
241
- if (m)
241
+ if (d)
242
242
  return {
243
- mode: m === x.SINGLE ? "singleRow" : "multiRow",
243
+ mode: d === x.SINGLE ? "singleRow" : "multiRow",
244
244
  isRowSelectable: (e) => {
245
- const t = e.data ? i(e.data) : null;
246
- return t ? !c?.has(t) : !0;
245
+ const r = e.data ? i(e.data) : null;
246
+ return r ? !c?.has(r) : !0;
247
247
  }
248
248
  };
249
- }, [c, i, m]);
250
- A(() => {
251
- r && f && D.current.size && D.current.forEach((e) => {
252
- const t = r.getRowNode(e);
253
- t && !t.isSelected() && t.setSelected(!0, !1, p.API);
249
+ }, [c, i, d]);
250
+ E(() => {
251
+ t && f && A.current.size && A.current.forEach((e) => {
252
+ const r = t.getRowNode(e);
253
+ r && !r.isSelected() && r.setSelected(!0, !1, p.API);
254
254
  });
255
- }, [r, f]), A(() => {
256
- r && n && (r.deselectAll("all", p.API), n.forEach((e) => {
257
- const t = r.getRowNode(e);
258
- t && !t.isSelected() && t.setSelected(!0, !1, p.API);
255
+ }, [t, f]), E(() => {
256
+ t && n && (t.deselectAll("all", p.API), n.forEach((e) => {
257
+ const r = t.getRowNode(e);
258
+ r && !r.isSelected() && r.setSelected(!0, !1, p.API);
259
259
  }));
260
- }, [r, n]);
260
+ }, [t, n]);
261
261
  const Ce = l(
262
262
  (e) => e.data ? i(e.data) : "",
263
263
  [i]
264
- ), v = l(() => {
264
+ ), G = l(() => {
265
265
  document.querySelectorAll(`.ag-row ${I}`).forEach((e) => {
266
- e.setAttribute("aria-description", te);
266
+ e.setAttribute("aria-description", re);
267
267
  });
268
268
  }, []);
269
- return A(() => {
269
+ return E(() => {
270
270
  const e = y(
271
271
  U.current
272
272
  );
273
- if (r && n?.size && e) {
274
- const t = Array.from(n)[0];
275
- if (t) {
276
- const o = r.getRowNode(t);
277
- o && r.ensureNodeVisible(o);
273
+ if (t && n?.size && e) {
274
+ const r = Array.from(n)[0];
275
+ if (r) {
276
+ const o = t.getRowNode(r);
277
+ o && t.ensureNodeVisible(o);
278
278
  }
279
279
  }
280
- }, [r, y, n]), /* @__PURE__ */ s(
280
+ }, [t, y, n]), /* @__PURE__ */ s(
281
281
  "div",
282
282
  {
283
- className: Z(
284
- ke,
285
- re,
286
- m && "with-selection-column",
283
+ className: Q(
284
+ xe,
285
+ te,
286
+ d && "with-selection-column",
287
287
  ie && "dial-without-header-borders"
288
288
  ),
289
289
  "aria-label": oe,
@@ -296,7 +296,7 @@ const nt = ({
296
296
  role: "table",
297
297
  "aria-describedby": ae,
298
298
  children: /* @__PURE__ */ s(
299
- Ee,
299
+ be,
300
300
  {
301
301
  rowModelType: "clientSide",
302
302
  headerHeight: ee,
@@ -304,8 +304,8 @@ const nt = ({
304
304
  cellSelection: !1,
305
305
  theme: Ne.withPart(ge).withParams({ ...le }),
306
306
  autoSizeStrategy: { type: "fitGridWidth" },
307
- columnDefs: X,
308
- defaultColDef: me,
307
+ columnDefs: J,
308
+ defaultColDef: de,
309
309
  selectionColumnDef: fe,
310
310
  onGridSizeChanged: ce,
311
311
  onGridReady: he,
@@ -317,10 +317,10 @@ const nt = ({
317
317
  rowSelection: Se,
318
318
  onSelectionChanged: ue,
319
319
  getRowId: Ce,
320
- onRowDataUpdated: v,
321
- onBodyScroll: v,
322
- onFirstDataRendered: v,
323
- ...de
320
+ onRowDataUpdated: G,
321
+ onBodyScroll: G,
322
+ onFirstDataRendered: G,
323
+ ...me
324
324
  }
325
325
  )
326
326
  }
@@ -329,5 +329,5 @@ const nt = ({
329
329
  );
330
330
  };
331
331
  export {
332
- nt as DialGrid
332
+ or as DialGrid
333
333
  };
@@ -0,0 +1,4 @@
1
+ const o = () => import("./JsonEditor.js");
2
+ export {
3
+ o as LazyDialJsonEditor
4
+ };
@@ -1,26 +1,28 @@
1
1
  import { jsx as e, jsxs as r } from "react/jsx-runtime";
2
2
  import { useId as g, useState as x, useEffect as J, useCallback as u } from "react";
3
- import { DialSwitch as S } from "../Switch/Switch.js";
4
- import { EditorThemes as b } from "../../types/editor.js";
3
+ import "../../constants/editor.js";
4
+ import { EditorThemes as S } from "../../types/editor.js";
5
+ import "@monaco-editor/react";
6
+ import { DialSwitch as b } from "../Switch/Switch.js";
5
7
  import { DialMarkdownEditor as v } from "./MarkdownEditor.js";
6
8
  import { DialLabel as y } from "../Label/Label.js";
7
- const z = ({
9
+ const $ = ({
8
10
  value: s,
9
11
  onChangeValue: l,
10
- label: i,
12
+ label: t,
11
13
  headerContent: d,
12
14
  switcherLabel: a,
13
15
  height: c = 300,
14
- theme: m = b.dark,
16
+ theme: m = S.dark,
15
17
  onValidateJSON: f,
16
18
  preview: C = "edit"
17
19
  }) => {
18
- const N = g(), [n, w] = x(!1), [p, D] = x(null);
20
+ const N = g(), [i, w] = x(!1), [p, D] = x(null);
19
21
  J(() => {
20
- n && typeof window < "u" && import("../JsonEditor/JsonEditor.js").then((o) => {
22
+ i && typeof window < "u" && import("../JsonEditor/JsonEditor.js").then((o) => {
21
23
  D(() => o.DialJsonEditor);
22
24
  });
23
- }, [n]);
25
+ }, [i]);
24
26
  const h = u(
25
27
  (o) => {
26
28
  l?.(o);
@@ -31,16 +33,16 @@ const z = ({
31
33
  f?.(o);
32
34
  },
33
35
  [f]
34
- ), t = !!a;
36
+ ), n = !!a;
35
37
  return /* @__PURE__ */ e("div", { className: "size-full flex flex-col", children: /* @__PURE__ */ e("div", { className: "flex flex-col gap-8", children: /* @__PURE__ */ r("div", { children: [
36
- (i || d || t) && /* @__PURE__ */ r("div", { className: "flex justify-between items-center mb-2", children: [
37
- i && /* @__PURE__ */ e(y, { label: i }),
38
+ (t || d || n) && /* @__PURE__ */ r("div", { className: "flex justify-between items-center mb-2", children: [
39
+ t && /* @__PURE__ */ e(y, { label: t }),
38
40
  /* @__PURE__ */ r("div", { className: "flex items-center gap-2 flex-1 justify-end", children: [
39
41
  d,
40
- t && /* @__PURE__ */ e("label", { className: "flex items-center gap-2 cursor-pointer", children: /* @__PURE__ */ e(
41
- S,
42
+ n && /* @__PURE__ */ e("label", { className: "flex items-center gap-2 cursor-pointer", children: /* @__PURE__ */ e(
43
+ b,
42
44
  {
43
- isOn: n,
45
+ isOn: i,
44
46
  label: a,
45
47
  switchId: N,
46
48
  onChange: (o) => w(o)
@@ -48,7 +50,7 @@ const z = ({
48
50
  ) })
49
51
  ] })
50
52
  ] }),
51
- t && n ? /* @__PURE__ */ e(
53
+ n && i ? /* @__PURE__ */ e(
52
54
  "div",
53
55
  {
54
56
  className: "border border-primary rounded",
@@ -76,5 +78,5 @@ const z = ({
76
78
  ] }) }) });
77
79
  };
78
80
  export {
79
- z as DialMarkdownEditorContainer
81
+ $ as DialMarkdownEditorContainer
80
82
  };
@@ -0,0 +1,4 @@
1
+ const o = () => import("./MarkdownEditor.js");
2
+ export {
3
+ o as LazyDialMarkdownEditor
4
+ };