@oracle/oraclejet-preact 18.1.4 → 18.1.5

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 (108) hide show
  1. package/amd/InputDatePicker-ecd4a7ce.js +2 -0
  2. package/amd/{InputDatePicker-cf7e7ea3.js.map → InputDatePicker-ecd4a7ce.js.map} +1 -1
  3. package/amd/Legend-6fa54628.js +2 -0
  4. package/amd/Legend-6fa54628.js.map +1 -0
  5. package/amd/LegendRendered-d8626509.js.map +1 -1
  6. package/amd/MaxLengthCounter-9a95922c.js +2 -0
  7. package/amd/MaxLengthCounter-9a95922c.js.map +1 -0
  8. package/amd/TextArea-f6b13c73.js +2 -0
  9. package/amd/TextArea-f6b13c73.js.map +1 -0
  10. package/amd/TextAreaAutosize-af350c32.js +2 -0
  11. package/amd/{TextAreaAutosize-b7e56051.js.map → TextAreaAutosize-af350c32.js.map} +1 -1
  12. package/amd/Theme-redwood/theme.css +130 -130
  13. package/amd/Theme-stable/theme.css +254 -254
  14. package/amd/UNSAFE_InputDatePicker.js +1 -1
  15. package/amd/UNSAFE_Legend.js +1 -1
  16. package/amd/UNSAFE_TextArea.js +1 -1
  17. package/amd/UNSAFE_TextAreaAutosize.js +1 -1
  18. package/cjs/CheckboxSetContext-c62db26d.js +12 -0
  19. package/{es/CheckboxSetContext-1be56556.js.map → cjs/CheckboxSetContext-c62db26d.js.map} +1 -1
  20. package/cjs/{InputDatePicker-6c8cbbf7.js → InputDatePicker-3dace90c.js} +2 -2
  21. package/cjs/{InputDatePicker-6c8cbbf7.js.map → InputDatePicker-3dace90c.js.map} +1 -1
  22. package/cjs/{Legend-743ebb76.js → Legend-7e72e911.js} +4 -4
  23. package/cjs/Legend-7e72e911.js.map +1 -0
  24. package/cjs/LegendRendered-c12152bc.js.map +1 -1
  25. package/cjs/MaxLengthCounter-9ab3f74b.js +27 -0
  26. package/cjs/MaxLengthCounter-9ab3f74b.js.map +1 -0
  27. package/cjs/{TextArea-f4a84aab.js → TextArea-a11875f3.js} +4 -22
  28. package/cjs/TextArea-a11875f3.js.map +1 -0
  29. package/cjs/{TextAreaAutosize-08ca17cf.js → TextAreaAutosize-5a8e8335.js} +3 -3
  30. package/cjs/{TextAreaAutosize-08ca17cf.js.map → TextAreaAutosize-5a8e8335.js.map} +1 -1
  31. package/cjs/Theme-redwood/theme.css +182 -182
  32. package/cjs/Theme-stable/theme.css +205 -205
  33. package/cjs/UNSAFE_CheckboxItem.js +30 -82
  34. package/cjs/UNSAFE_CheckboxItem.js.map +1 -1
  35. package/cjs/UNSAFE_CheckboxSet.js +44 -15
  36. package/cjs/UNSAFE_CheckboxSet.js.map +1 -1
  37. package/cjs/UNSAFE_InputDatePicker.js +90 -90
  38. package/cjs/UNSAFE_Legend.js +1 -1
  39. package/cjs/UNSAFE_RichCheckboxSet.js +26 -29
  40. package/cjs/UNSAFE_RichCheckboxSet.js.map +1 -1
  41. package/cjs/UNSAFE_RichSelectionItem.js +46 -184
  42. package/cjs/UNSAFE_RichSelectionItem.js.map +1 -1
  43. package/cjs/UNSAFE_TextArea.js +4 -3
  44. package/cjs/UNSAFE_TextArea.js.map +1 -1
  45. package/cjs/UNSAFE_TextAreaAutosize.js +3 -3
  46. package/es/CheckboxSet-28953b25.js +49 -0
  47. package/{cjs/CheckboxSet-abbf7a03.js.map → es/CheckboxSet-28953b25.js.map} +1 -1
  48. package/es/InputPassword-fa63ac17.js +1 -1
  49. package/es/{Legend-a60126aa.js → Legend-0e274097.js} +4 -4
  50. package/es/Legend-0e274097.js.map +1 -0
  51. package/es/LegendRendered-65a3684e.js.map +1 -1
  52. package/es/MaxLengthCounter-181b4fc9.js +25 -0
  53. package/es/MaxLengthCounter-181b4fc9.js.map +1 -0
  54. package/es/{NavigationListItem-07f041e6.js → NavigationListItem-37edc23b.js} +1 -14
  55. package/es/{NavigationListItem-07f041e6.js.map → NavigationListItem-37edc23b.js.map} +1 -1
  56. package/es/{OverflowTabBar-c920e944.js → OverflowTabBar-87b36877.js} +2 -2
  57. package/es/{OverflowTabBar-c920e944.js.map → OverflowTabBar-87b36877.js.map} +1 -1
  58. package/es/{OverflowTabBarItem-ccfa49a3.js → OverflowTabBarItem-a2684d2b.js} +2 -2
  59. package/es/{OverflowTabBarItem-ccfa49a3.js.map → OverflowTabBarItem-a2684d2b.js.map} +1 -1
  60. package/es/PRIVATE_RevealToggleIcon.js +2 -2
  61. package/es/{RevealToggleIcon-2f49fd19.js → RevealToggleIcon-35baaadf.js} +2 -2
  62. package/es/{RevealToggleIcon-2f49fd19.js.map → RevealToggleIcon-35baaadf.js.map} +1 -1
  63. package/es/SplitMenuButtonTheme.styles.css +4 -4
  64. package/es/SplitMenuButtonTheme.styles2.css +4 -4
  65. package/es/{TextArea-d7eb6b00.js → TextArea-2eb362ec.js} +8 -25
  66. package/es/TextArea-2eb362ec.js.map +1 -0
  67. package/es/{TextAreaAutosize-301eb2b7.js → TextAreaAutosize-35a923c3.js} +2 -2
  68. package/es/{TextAreaAutosize-301eb2b7.js.map → TextAreaAutosize-35a923c3.js.map} +1 -1
  69. package/es/Theme-redwood/theme.css +545 -545
  70. package/es/Theme-stable/theme.css +483 -483
  71. package/es/UNSAFE_ButtonLayout/tests/ButtonLayout.spec.js +1 -1
  72. package/es/UNSAFE_CheckboxItem.js +82 -30
  73. package/es/UNSAFE_CheckboxItem.js.map +1 -1
  74. package/es/UNSAFE_CheckboxSet.js +10 -44
  75. package/es/UNSAFE_CheckboxSet.js.map +1 -1
  76. package/es/UNSAFE_InputPassword.js +1 -1
  77. package/es/UNSAFE_InputSensitiveText.js +1 -1
  78. package/es/UNSAFE_Legend.js +1 -1
  79. package/es/UNSAFE_NavigationList.js +4 -4
  80. package/es/UNSAFE_OverflowTabBar.js +3 -3
  81. package/es/UNSAFE_RichCheckboxSet.js +28 -25
  82. package/es/UNSAFE_RichCheckboxSet.js.map +1 -1
  83. package/es/UNSAFE_RichSelectionItem.js +182 -44
  84. package/es/UNSAFE_RichSelectionItem.js.map +1 -1
  85. package/es/UNSAFE_SplitMenuButton/themes/redwood/SplitMenuButtonTheme.css.js +1 -1
  86. package/es/UNSAFE_SplitMenuButton/themes/stable/SplitMenuButtonTheme.css.js +1 -1
  87. package/es/UNSAFE_SplitMenuButton.js +1 -1
  88. package/es/UNSAFE_TabBar.js +2 -2
  89. package/es/UNSAFE_TabBarCommon.js +2 -2
  90. package/es/UNSAFE_TabBarMixed.js +2 -2
  91. package/es/UNSAFE_TextArea.js +3 -2
  92. package/es/UNSAFE_TextArea.js.map +1 -1
  93. package/es/UNSAFE_TextAreaAutosize.js +3 -3
  94. package/es/UNSAFE_Toolbar/tests/Toolbar.spec.js +1 -1
  95. package/package.json +2 -2
  96. package/types/hooks/UNSAFE_useLegendPreferredSize/LegendRendered.d.ts +1 -1
  97. package/amd/InputDatePicker-cf7e7ea3.js +0 -2
  98. package/amd/Legend-76df298c.js +0 -2
  99. package/amd/Legend-76df298c.js.map +0 -1
  100. package/amd/TextArea-d69acd23.js +0 -2
  101. package/amd/TextArea-d69acd23.js.map +0 -1
  102. package/amd/TextAreaAutosize-b7e56051.js +0 -2
  103. package/cjs/CheckboxSet-abbf7a03.js +0 -53
  104. package/cjs/Legend-743ebb76.js.map +0 -1
  105. package/cjs/TextArea-f4a84aab.js.map +0 -1
  106. package/es/CheckboxSetContext-1be56556.js +0 -9
  107. package/es/Legend-a60126aa.js.map +0 -1
  108. package/es/TextArea-d7eb6b00.js.map +0 -1
@@ -172,7 +172,7 @@ import '../../UNSAFE_Menu/themes/redwood/MenuSeparatorVariants.css.js';
172
172
  import '../../useMenuAction-1179e27b.js';
173
173
  import '../../UNSAFE_SplitMenuButton/themes/redwood/SplitMenuButtonTheme.css.js';
174
174
  import './../../SplitMenuButtonStyles.styles.css';
175
- import './../../SplitMenuButtonTheme.styles2.css';
175
+ import './../../SplitMenuButtonTheme.styles.css';
176
176
 
177
177
  describe('Test Toolbar component', () => {
178
178
  const sampleToolbar = (jsxs(Toolbar, { children: [jsx(BaseButton, {}), jsx(Button, { isDisabled: true }), jsx(ToolbarSeparator, {}), jsx(MenuButton, {}), jsx(SplitMenuButton, {})] }));
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "scripts": {},
6
6
  "devDependencies": {},
7
7
  "dependencies": {
8
- "@oracle/oraclejet-testing": "18.1.4",
8
+ "@oracle/oraclejet-testing": "18.1.5",
9
9
  "csstype": "3.1.1"
10
10
  },
11
11
  "peerDependencies": {
@@ -38,5 +38,5 @@
38
38
  ]
39
39
  }
40
40
  },
41
- "version": "18.1.4"
41
+ "version": "18.1.5"
42
42
  }
@@ -6,7 +6,7 @@
6
6
  * @ignore
7
7
  */
8
8
  type LegendRenderedContextType = {
9
- isLegendReady?: (isReady: boolean) => void;
9
+ isGetPreferredSizeReady?: (isReady: boolean) => void;
10
10
  width?: number;
11
11
  height?: number;
12
12
  };
@@ -1,2 +0,0 @@
1
- define(['exports', 'preact/jsx-runtime', 'preact/compat', 'preact/hooks', './Calendar-0e2eb66f', './InputDateMask-55fcbf50', './HiddenAccessible-037ef42d', './IconButton-05c6b793', './clientHints-fff66be9', './FormFieldContext-3c44aaaa', './logger-0f873e29', './TabbableModeContext-a9c97640', './useTranslationBundle-7c40cb58', 'css!./UserAssistanceStyles.styles.css', 'module', './UNSAFE_UserAssistance/themes/redwood/UserAssistanceVariants.css', './InlineUserAssistance-3d3e72a9', './Flex-590160eb', 'css!./MessageBannerStyles.styles.css', 'module', './UNSAFE_MessageBanner/themes/redwood/MessageBannerVariants.css', 'preact', './LayerHost-733ade2f', 'css!./TooltipContentStyles.styles.css', 'module', './hooks/UNSAFE_useTooltip/themes/redwood/TooltipContentVariants.css', './tooltipUtils-30886397', 'css!./IconStyle.styles.css', 'css!./MessageStyles.styles.css', './MessageFormattingUtils-2e19d8de', './TransitionGroup-3b9d81b6', './MessagesContext-602a69a2', 'css!./HiddenAccessibleStyles.styles.css', 'css!./ComponentMessageStyles.styles.css', 'module', './UNSAFE_ComponentMessage/themes/redwood/ComponentMessageVariants.css', './Popup-3e2566da', './UNSAFE_Separator/themes/SeparatorStyles.css', 'css!./LabelStyles.styles.css', 'module', './UNSAFE_Label/themes/redwood/LabelVariants.css', './InputGroupContext-372087af', 'module', './UNSAFE_Popup/themes/redwood/PopupVariants.css', './UNSAFE_InputDatePicker/themes/InputDatePickerDropdownStyles.css', './Sheet-404b38fa', './DatePicker-b907fb97', './SectionedContent-ef1f844c', './stringUtils-0ae982c2', './FormContext-5130e198', './useFormContext-30acdd33', './useId-c9578d26', './getFormatParse-3d7186b3', './maskUtils-9370948f', './calendarDateUtils-5e25297c'], (function(e,s,t,a,n,o,r,i,l,d,c,u,m,p,h,y,f,b,C,D,S,k,x,A,v,g,F,T,V,I,w,P,U,M,R,j,_,B,H,E,N,L,O,Y,Z,W,z,G,q,J,K,Q,X,$,ee){"use strict";const se=({anchorRef:e,assistiveText:t,dayFormatter:n,daysOutsideMonth:o,helpSourceLink:r,helpSourceText:i,isDisabled:l,isOpen:c,isReadonly:u,label:p,onClose:h,onCommit:y,max:b,messages:C,min:D,monthAndYearPicker:S,testId:k,todayButton:x,todayTimeZone:A,userAssistanceDensity:v,value:g,weekDisplay:F})=>{const[T,V]=a.useState(!1),[I,w]=a.useState(c),P=a.useCallback((e=>{V(e.placement.startsWith("top"))}),[]);I!==c&&(w(c),c||V(!1));const U=te(),{datePicker_label:M}=m.useTranslationBundle("@oracle/oraclejet-preact"),R=M(),j=s.jsx(z.DatePicker,{dayFormatter:n,daysOutsideMonth:o,height:U?void 0:"auto",onCommit:y,max:b,min:D,maxWidth:U?"100%":void 0,width:"100%",monthAndYearPicker:S,testId:k,todayTimeZone:A,todayButton:x,value:g,weekDisplay:F}),_=!c||T&&!U||l||u||!(t||r||C&&C.length>0)||"efficient"!==v&&"reflow"!==v?void 0:s.jsx(d.FormFieldContext.Provider,{value:{isFocused:!0},children:s.jsx("div",{class:Z.userAssistanceStyles,children:s.jsx(f.InlineUserAssistance,{assistiveText:t,fieldLabel:p,helpSourceLink:r,helpSourceText:i,messages:C,userAssistanceDensity:v})})}),B=k?k+(U?"_sheet":"_dropdown"):void 0,H=s.jsx("div",{class:Z.dropdownStyles,children:s.jsx(G.SectionedContent,{"aria-label":R,footer:_,hasFocusTrap:!0,main:j,role:"dialog",testId:B})});return U?s.jsx(W.Sheet,{initialFocus:"firstFocusable",isOpen:c,onClose:h,children:s.jsx(G.SectionedContent,{"aria-label":R,footer:_,hasFocusTrap:!0,main:j,role:"dialog",testId:B})}):s.jsx(G.StickyPositioningDropdown,{anchorRef:e,initialFocus:"firstFocusable",isOpen:c,onClose:h,onPosition:P,sizeOptions:{isMaxWidthAdjusted:!1,isMaxHeightAdjusted:!0},children:H})},te=()=>"phone"===l.getClientHints().deviceType,ae=e=>e&&ee.isCompleteCalendarDate(e)?e:void 0,ne=(e,s)=>{switch(s.type){case"dateChanged":return{...e,dateValue:s.data,completeDateValue:ae(s.data)};case"dateSelected":return{...e,dateValue:s.data,completeDateValue:s.data};case"reset":return{completeDateValue:ae(s.data),dateValue:s.data};default:return e}},oe=({onCommit:e,onInput:s,value:t})=>{const[n,o]=a.useState(!1),r=a.useRef(null),i=a.useRef(null),l=a.useRef(!1),d=a.useRef(),c=a.useRef(t),u=a.useRef(t),m=a.useRef(t),p=a.useRef(!1),{state:h,dispatch:y}=(({value:e})=>{const[s,t]=a.useReducer(ne,{completeDateValue:ae(e),dateValue:e});return{state:s,dispatch:t}})({value:t});$.calendarDatesAreDifferent(m.current,t)&&(m.current=t,$.calendarDatesAreDifferent(t,h.dateValue)&&(y({type:"reset",data:t}),u.current=t,c.current=t)),a.useEffect((()=>{$.calendarDatesAreDifferent(h.dateValue,u.current)&&(s({previousValue:u.current,value:h.dateValue}),u.current=h.dateValue),p.current&&$.calendarDatesAreDifferent(h.dateValue,c.current)&&(e?.({previousValue:c.current,value:h.dateValue}),c.current=h.dateValue,p.current=!1)}),[e,s,h.dateValue]);const f=a.useCallback((e=>{y({type:"dateChanged",data:e.value})}),[y]),b=a.useCallback((()=>{$.calendarDatesAreDifferent(c.current,h.dateValue)&&(e?.({value:h.dateValue,previousValue:c.current}),c.current=h.dateValue)}),[e,h.dateValue]),C=a.useCallback((()=>{l.current||o((e=>!e)),l.current=!1}),[]),D=a.useCallback((e=>{"outsideMousedown"===e.reason?(l.current=!0,clearTimeout(d.current),d.current=setTimeout((()=>{l.current=!1}),200)):"dismissed"!==e.reason&&"keyboardDismissed"!==e.reason||r.current?.focus(),o(!1)}),[]);return{calendarIconActionHandler:C,datePickerCommitHandler:a.useCallback((e=>{r.current?.focus(),p.current=!0,y({type:"dateSelected",data:e.value}),o(!1)}),[y]),dropdownCloseHandler:D,completeDateValue:h.completeDateValue,dateValue:h.dateValue,iconRef:r,isOpen:n,maskCommitHandler:b,maskInputHandler:f,maskRef:i}},re=t.forwardRef((({"aria-describedby":e,assistiveText:t,dayFormatter:l,daysOutsideMonth:d,helpSourceLink:c,helpSourceText:u,isDisabled:p,isReadonly:h,label:y,max:f,messages:b,min:C,monthAndYearPicker:D,todayTimeZone:S,todayButton:k,value:x,onCommit:A,onInput:v,testId:g,userAssistanceDensity:F,weekDisplay:T,...V},I)=>{const{calendarIconActionHandler:w,datePickerCommitHandler:P,completeDateValue:U,dateValue:M,dropdownCloseHandler:R,iconRef:j,isOpen:_,maskCommitHandler:B,maskInputHandler:H,maskRef:E}=oe({onCommit:A,onInput:v,value:x}),N=a.useRef(null),{inputDatePicker_selectDate:L,inputDatePicker_instruction:O}=m.useTranslationBundle("@oracle/oraclejet-preact"),Y=L(),{userAssistanceDensity:Z}=K.useFormContext(),W=F??Z;a.useImperativeHandle(I,(()=>({focus:()=>{E.current?.focus()},blur:()=>{E.current?.blur()}})));const z=Q.useId(),G=O(),J=p||h?void 0:s.jsx(r.HiddenAccessible,{id:z,isHidden:!0,children:G}),X=p||h?e:q.merge([e,z]),$=s.jsx(i.IconButton,{"aria-haspopup":"dialog","aria-label":Y,isDisabled:p,ref:j,size:"sm",testId:g?g+"_calendarIcon":void 0,variant:"ghost",onAction:w,children:s.jsx(n.SvgCalendar,{})}),ee=_;return s.jsxs(s.Fragment,{children:[s.jsx(o.InputDateMaskContext.Provider,{value:{isDropdownOpen:_,isInputDatePickerParent:!0},children:s.jsx(o.InputDateMask,{"aria-describedby":X,assistiveText:t,endContent:$,helpSourceLink:c,helpSourceText:u,isDisabled:p,isReadonly:h,label:y,onCommit:B,onInput:H,mainFieldRef:N,messages:b,testId:g,ref:E,userAssistanceDensity:F,value:M,...V})}),J,ee&&s.jsx(se,{anchorRef:N,assistiveText:t,dayFormatter:l,daysOutsideMonth:d,helpSourceLink:c,helpSourceText:u,isDisabled:p,isReadonly:h,isOpen:_,label:y,onClose:R,onCommit:P,max:f,messages:b,min:C,monthAndYearPicker:D,testId:g?g+"_datePicker":void 0,todayTimeZone:S,todayButton:k,userAssistanceDensity:W,value:U,weekDisplay:T})]})}));e.InputDatePicker=re}));
2
- //# sourceMappingURL=InputDatePicker-cf7e7ea3.js.map
@@ -1,2 +0,0 @@
1
- define(['exports', 'preact/jsx-runtime', 'preact/hooks', './useLegendContextMenu-c4a44c23', './useVisEvents-a8ea4ced', './useLegendDnd-126b0174', './mergeProps-bcfa6a92', './useItemFocus-75d6510d', './PRIVATE_BaseLegend/themes/LegendStyles.css', './useCssVars-cc825c54', './classNames-08d99695', './useTestId-c286f212', './useVisTouchResponse-88a7bb09', './stringUtils-0ae982c2', 'preact/compat', './TrackResizeContainer-c6b5de04', './useTextDimensions-030c6dbd', './hooks/PRIVATE_useVisDnd/themes/VisDndStyles.css', './LegendRendered-d8626509'], (function(e,t,n,s,i,o,a,d,r,l,m,g,h,c,u,I,x,f,y){"use strict";function v(e,t){const{itemIdx:n}=e;return-1==n?t[t.length-1]:t[n]}function b(e,t){let n=e.itemIdx;return-1==n&&(n=t.length-1),n=Math.min(t.length-1,n+1),"off"!==t[n].actionable?{sectionIdx:0,itemIdx:n}:n===t.length-1?(n-=1,{sectionIdx:0,itemIdx:n}):b({sectionIdx:0,itemIdx:n},t)}function p(e,t){let n=e.itemIdx;return-1==n&&(n=t.length-1),n=Math.max(0,n-1),"off"!==t[n].actionable?{sectionIdx:0,itemIdx:n}:p({sectionIdx:0,itemIdx:n},t)}function D(e){return{getItem:t=>v(t,e),getDetailFromInfo:t=>{if(!t||0===e.length)return{itemId:void 0,data:void 0};const n=v(t,e);return{itemId:n.id,data:n}},getPrevItemInfo:t=>p(t,e),getNextItemInfo:t=>b(t,e)}}const S=({width:e,getTextDimensions:t,resolvedVars:n,orientation:s,legendFontStylesObj:i={},symbolWidth:o,items:a})=>{let d=0,r=0,l=0,m=!1;const g=e;if(!Object.keys(n).length||!t)return;const h=parseFloat(n.unit),{maxItemWidth:c,maxItemHeight:u,horizontalSectionWidth:I}=R(a,h,t,i,o);l=I,d=c,r=u,m=I>g;return{totalWidth:l,maxItemWidth:Math.min(d,g),maxItemHeight:r,itemsPerRow:"vertical"===s?1:Math.max(1,Math.floor(g/d)),isWrapped:m}},R=(e,t,n,s,i,o)=>{let a=0,d=0,r=0,l=0,m=0;return l=i?1.5*t+i:4*t,m=o?o+1.7*t:2.5*t+1.7*t,e?.forEach((e=>{const i=e,{width:o,height:g}=n(i.text,s),h=2.5*t+o;r+=l+h,a=Math.max(a,l+h),d=Math.max(d,g,m)})),{maxItemWidth:a,maxItemHeight:d,horizontalSectionWidth:r}};const M=u.forwardRef((({orientation:e="horizontal",items:v,isReadOnly:b=!0,onItemAction:p,onItemHover:R,onItemFocus:M,testId:W,contextMenuConfig:C,hideAndShowBehavior:P="off",hoverBehavior:F="none",halign:L="start",valign:T="top",...V},H=null)=>{const{isLegendReady:w,width:j,height:E}=n.useContext(y.LegendRenderedContext),{textMeasureContent:O,getTextDimensions:z}=x.useTextDimensions(),{resolvedVars:A,cssContent:N}=l.useCssVars(o.legendVars),B=o.getLegendTextStyle({fontStyle:V.textFontStyle,fontSize:V.textFontSize?.toString(),fontWeight:V.textFontWeight?.toString(),fontFamily:V.textFontFamily},A),k=n.useRef(null);u.useImperativeHandle(H,(()=>({_getPreferredSize:(t,n)=>function(e,t,n,s,i,a,d,r,l){if(!l)return;const m=S({width:e,getTextDimensions:l,resolvedVars:s,orientation:i,legendFontStylesObj:a,symbolWidth:d,symbolHeight:r,items:n}),{itemsPerCol:g,itemsPerRow:h}=o.getGridNums(n.length,m,i),c=parseFloat(s.unit),u=Math.min(e,1===g?m.totalWidth:h?m.maxItemWidth*h:m.totalWidth),I=.8*c,x=1.5*c,f=g?m.maxItemHeight*g+(g-1)*I+x:m.maxItemHeight+x,y=Math.min(t,f);return{width:Math.ceil(u),height:Math.ceil(y)}}(t,n,v,A,e,B,V.symbolWidth,V.symbolHeight,z)})),[z,A,e,B,V.symbolWidth,V.symbolHeight,v]),z&&null!=A.unit&&null!=A.fontSize&&w?.(!0);const $=g.useTestId(W),_=void 0!==$["data-testid"],G=n.useRef(),{getItem:U,getDetailFromInfo:q,getPrevItemInfo:K,getNextItemInfo:J}=D(v),Q=o.getIsLegendItemActionable(v,b),X=v.length>0,{touchResponse:Y,touchResponseStyle:Z}=h.useVisTouchResponse({type:"touchStart"}),{focusedItemInfo:ee,hoveredItemInfo:te,onContextMenuDismissed:ne,activeId:se,eventsProps:ie}=i.useVisEvent(Y,!b,Q,((e,t,n)=>o.getKeyUpHandler(e,t,n,null!=V.hiddenIds)),q,K,J,p,R,M,o.isEqualItem,o.getItemInfo,{itemIdx:0,sectionIdx:0},null!=V.hiddenIds),{focusedItemRef:oe}=d.useItemFocus(ee),ae=o.getDatatipText(v,U,ee,te),[de,re]=n.useState(!1),{datatipContent:le,datatipProps:{"aria-describedby":me,...ge}}=s.useLegendDatatip({text:ae,rootDimsRef:G,focusedItemInfo:ee,focusedItemRef:oe,touchResponse:Y,isDisabled:de}),he=o.getAriaProps(b,V["aria-label"],V.hiddenIds,c.merge([V["aria-describedby"],me]),V["aria-labelledby"]),{contextMenuContent:ce,contextMenuProps:ue}=s.useLegendContextMenu({rootRef:k,contextMenuConfig:X?C:void 0,focusedItemInfo:ee,items:v,isReadOnly:b,onContextMenuDismissed:ne}),[Ie,xe]=n.useState(),{draggable:fe,dndProps:ye,dndContent:ve}=o.useLegendDnd({onDrag:V.onDrag,onDragStart:V.onDragStart,onDragEnd:V.onDragEnd,onDragEnter:V.onDragEnter,onDragLeave:V.onDragLeave,onDragOver:V.onDragOver,onDrop:V.onDrop,items:v,setDragOver:xe,setDatatipDisabled:re,itemDraggable:V.itemDraggable}),be=a.mergeProps(ie,ge,ue,ye),{legendStyle:pe,renderedLegendStyle:De}=r.styles;return t.jsxs(t.Fragment,{children:[!w&&t.jsx(I.TrackResizeContainer,{width:j?`${j}px`:"100%",height:E?`${E}px`:"100%",class:m.classNames([r.styles.flexStyle,r.styles[`${L}HAlign`],r.styles[`${T}VAlign`]]),children:function(i){const a=n.useMemo((()=>S({width:i,getTextDimensions:z,resolvedVars:A,orientation:e,legendFontStylesObj:B,symbolWidth:V.symbolWidth,symbolHeight:V.symbolHeight,items:v})),[i]),{itemsPerCol:d,itemsPerRow:r}=o.getGridNums(v.length,a);return t.jsxs(t.Fragment,{children:[t.jsx("div",{ref:k,tabIndex:b?void 0:0,role:"application",draggable:fe,class:m.classNames([pe,De,Ie?f.styles.dndDragOverHTMLStyle:!1===Ie?f.styles.dndRejectedStyle:void 0]),style:Z,...$,...he,...be,"aria-activedescendant":se,children:t.jsx(s.BaseLegend,{...V,focusedItemRef:oe,items:v,isReadOnly:b,orientation:e,sectionIdx:0,itemsPerRow:r,itemsPerCol:d,itemWidth:a?.isWrapped?a?.maxItemWidth:void 0,focusedItemInfo:ee,hoveredItemInfo:te,activeId:se,hideAndShowBehavior:P,hoverBehavior:F,isTestEnv:_})}),le,ce,ve]})}}),O,N]})}));e.Legend=M}));
2
- //# sourceMappingURL=Legend-76df298c.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Legend-76df298c.js","sources":["../../src/UNSAFE_Legend/legendNavUtils.ts","../../src/UNSAFE_Legend/getLegendLayout.ts","../../src/UNSAFE_Legend/Legend.tsx"],"sourcesContent":["/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport {\n ItemActionDetail,\n ItemFocusDetail,\n ItemHoverDetail,\n ItemInfo,\n LegendItemData\n} from '#utils/UNSAFE_visTypes/legend';\n\nfunction getItem<K, D extends LegendItemData<K>>(itemInfo: ItemInfo, items: D[]) {\n const { itemIdx } = itemInfo;\n\n if (itemIdx == -1) {\n return items[items.length - 1];\n }\n return items[itemIdx];\n}\n\nfunction getNextItemInfo<K>(itemInfo: ItemInfo, items: LegendItemData<K>[]) {\n let itemIdx = itemInfo.itemIdx;\n\n if (itemIdx == -1) {\n itemIdx = items.length - 1;\n }\n\n itemIdx = Math.min(items.length - 1, itemIdx + 1);\n if (items[itemIdx].actionable !== 'off') {\n return { sectionIdx: 0, itemIdx };\n } else if (itemIdx === items.length - 1) {\n itemIdx = itemIdx - 1;\n return { sectionIdx: 0, itemIdx };\n }\n\n return getNextItemInfo({ sectionIdx: 0, itemIdx }, items);\n}\n\nfunction getPrevItemInfo<K>(itemInfo: ItemInfo, items: LegendItemData<K>[]) {\n let itemIdx = itemInfo.itemIdx;\n\n if (itemIdx == -1) {\n itemIdx = items.length - 1;\n }\n\n itemIdx = Math.max(0, itemIdx - 1);\n if (items[itemIdx].actionable !== 'off') {\n return { sectionIdx: 0, itemIdx };\n }\n\n return getPrevItemInfo({ sectionIdx: 0, itemIdx }, items);\n}\n\n/**\n * Returns utils functions for navigation in simple legend.\n * @param items\n * @returns\n */\nexport function getLegendNavUtils<K extends string | number, D extends LegendItemData<K>>(\n items: D[]\n) {\n return {\n getItem: (itemInfo: ItemInfo) => {\n return getItem(itemInfo, items);\n },\n getDetailFromInfo: (\n itemInfo?: ItemInfo\n ): ItemFocusDetail<K, D> | ItemHoverDetail<K, D> | ItemActionDetail<K, D> => {\n if (!itemInfo || items.length === 0) {\n return { itemId: undefined, data: undefined };\n }\n const item = getItem(itemInfo, items);\n return { itemId: item.id, data: item };\n },\n getPrevItemInfo: (itemInfo: ItemInfo) => {\n return getPrevItemInfo(itemInfo, items);\n },\n getNextItemInfo: (itemInfo: ItemInfo) => {\n return getNextItemInfo(itemInfo, items);\n }\n };\n}\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport { LegendItemData } from '#utils/UNSAFE_visTypes/legend';\nimport { Font, TextDimensions, useTextDimensions } from '#hooks/PRIVATE_useTextDimensions';\nimport { getGridNums } from '#utils/PRIVATE_legendUtils/legendUtils';\n\ntype Props<K> = {\n width: number;\n getTextDimensions?: ((textString: string, font?: Font | undefined) => TextDimensions) | undefined;\n resolvedVars: Record<string, any>;\n orientation?: 'vertical' | 'horizontal';\n legendFontStylesObj?: Font;\n symbolWidth?: number;\n symbolHeight?: number;\n items: LegendItemData<K>[];\n};\nexport type LayoutInfo = {\n totalWidth: number;\n maxItemWidth: number;\n maxItemHeight: number;\n itemsPerRow: number;\n isWrapped?: boolean;\n};\ntype getTextDimensionsType = NonNullable<\n NonNullable<ReturnType<typeof useTextDimensions>>['getTextDimensions']\n>;\n\nexport const getLinearLegendLayoutInfo = <K>({\n width,\n getTextDimensions,\n resolvedVars,\n orientation,\n legendFontStylesObj = {},\n symbolWidth,\n items\n}: Props<K>) => {\n let maxWidth = 0;\n let maxHeight = 0;\n let totalWidth = 0;\n let isWrapped = false;\n\n const containerWidth = width;\n\n if (!Object.keys(resolvedVars).length || !getTextDimensions) {\n return;\n }\n\n const unitLength = parseFloat(resolvedVars['unit']);\n\n const { maxItemWidth, maxItemHeight, horizontalSectionWidth } = getMaxWidth(\n items,\n unitLength,\n getTextDimensions,\n legendFontStylesObj,\n symbolWidth\n );\n totalWidth = horizontalSectionWidth;\n maxWidth = maxItemWidth;\n maxHeight = maxItemHeight;\n isWrapped = horizontalSectionWidth > containerWidth!;\n\n const legendLayoutInfo = {\n totalWidth,\n maxItemWidth: Math.min(maxWidth, containerWidth!),\n maxItemHeight: maxHeight,\n itemsPerRow:\n orientation === 'vertical' ? 1 : Math.max(1, Math.floor(containerWidth / maxWidth)),\n isWrapped\n };\n\n return legendLayoutInfo;\n};\n\n/**\n * Returns maximum of the width among the items in a section of legend also return the width of the entire section.\n * @param items Legend items array\n * @param unitLength Base element\n * @param getTextDimensions Text width measurement function\n * @param legendFontStylesObj Legend text font style properties object\n * @param symbolWidth Width of legend symbol\n *\n * @returns\n */\nconst getMaxWidth = <K>(\n items: LegendItemData<K>[],\n unitLength: number,\n getTextDimensions: getTextDimensionsType,\n legendFontStylesObj?: Font,\n symbolWidth?: number,\n symbolHeight?: number\n) => {\n let maxItemWidth = 0;\n let maxItemHeight = 0;\n let horizontalSectionWidth = 0;\n let itemSymbolWidth = 0;\n let itemSymbolHeight = 0;\n if (symbolWidth) {\n itemSymbolWidth = unitLength * 1.5 + symbolWidth;\n } else {\n //itemSymbolWidth = marginLeft + marginRight + width below expression is simplified\n itemSymbolWidth = 4 * unitLength;\n }\n\n if (symbolHeight) {\n // symbolHeight/defaultSymbolHeight + symbolPaddingTopBottom\n itemSymbolHeight = symbolHeight + unitLength * 1.7;\n } else {\n // symbolHeight/defaultSymbolHeight + symbolPaddingTopBottom\n itemSymbolHeight = 2.5 * unitLength + unitLength * 1.7;\n }\n\n items?.forEach((item) => {\n const legendItem = item as LegendItemData<K>;\n const { width, height } = getTextDimensions(legendItem.text, legendFontStylesObj);\n //itemTextWidth = paddingLeft + paddingRight + width\n const itemTextWidth = unitLength * 2.5 + width;\n //horizontalSectionWidth = total width of the section\n horizontalSectionWidth += itemSymbolWidth + itemTextWidth;\n maxItemWidth = Math.max(maxItemWidth, itemSymbolWidth + itemTextWidth);\n maxItemHeight = Math.max(maxItemHeight, height, itemSymbolHeight);\n });\n\n return { maxItemWidth, maxItemHeight, horizontalSectionWidth };\n};\n\nexport function _getPreferredSize<K>(\n _width: number,\n _height: number,\n items: LegendItemData<K>[],\n resolvedVars: Record<string, any>,\n orientation: 'vertical' | 'horizontal',\n legendFontStylesObj: Record<string, any>,\n symbolWidth?: number,\n symbolHeight?: number,\n getTextDimensions?: (textString: string, font?: Font | undefined) => TextDimensions\n) {\n if (!getTextDimensions) {\n return undefined;\n }\n const layoutInfo = getLinearLegendLayoutInfo({\n width: _width,\n getTextDimensions,\n resolvedVars,\n orientation,\n legendFontStylesObj,\n symbolWidth: symbolWidth,\n symbolHeight: symbolHeight,\n items\n });\n const { itemsPerCol, itemsPerRow } = getGridNums(items.length, layoutInfo, orientation);\n const unitLength = parseFloat(resolvedVars['unit']);\n const preferredWidth = Math.min(\n _width,\n itemsPerCol === 1\n ? layoutInfo!.totalWidth\n : itemsPerRow\n ? layoutInfo!.maxItemWidth * itemsPerRow!\n : layoutInfo!.totalWidth\n );\n const paddingLegendItems = 0.8 * unitLength;\n const paddingLegendTopBottom = 1.5 * unitLength;\n\n const legendHeight = itemsPerCol\n ? layoutInfo!.maxItemHeight * itemsPerCol! +\n (itemsPerCol! - 1) * paddingLegendItems +\n paddingLegendTopBottom\n : layoutInfo!.maxItemHeight + paddingLegendTopBottom;\n const preferredHeight = Math.min(_height, legendHeight);\n\n return { width: Math.ceil(preferredWidth), height: Math.ceil(preferredHeight) };\n}\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\nimport { Ref, VNode } from 'preact';\nimport { useContext, useMemo, useRef, useState } from 'preact/hooks';\nimport { BaseLegend } from '#PRIVATE_BaseLegend/BaseLegend';\nimport { useVisEvent } from '#hooks/PRIVATE_useVisEvents/useVisEvents';\nimport { LegendProps, LegendDragStartDetail } from './legend.type';\nimport { getLegendNavUtils } from './legendNavUtils';\nimport {\n getAriaProps,\n getDatatipText,\n getGridNums,\n getIsLegendItemActionable,\n getItemInfo,\n getLegendTextStyle,\n isEqualItem\n} from '#utils/PRIVATE_legendUtils/legendUtils';\nimport { mergeProps } from '#utils/UNSAFE_mergeProps';\nimport { useLegendDatatip } from './useLegendDatatip';\nimport { useItemFocus } from '#hooks/PRIVATE_useVisEvents';\nimport { styles } from '#PRIVATE_BaseLegend/themes/LegendStyles.css';\nimport { useCssVars } from '#hooks/PRIVATE_useCssVars';\nimport { legendVars, getKeyUpHandler } from '#utils/PRIVATE_legendUtils/legendUtils';\nimport { classNames } from '#utils/UNSAFE_classNames';\nimport { useTestId } from '#hooks/UNSAFE_useTestId';\nimport { useLegendContextMenu } from '#PRIVATE_BaseLegend/useLegendContextMenu';\nimport {\n ItemFocusDetail,\n ItemActionDetail,\n ItemInfo,\n LegendItemData\n} from '#utils/UNSAFE_visTypes/legend';\nimport { useVisTouchResponse } from '#hooks/PRIVATE_useVisTouchResponse';\nimport { merge } from '#utils/UNSAFE_stringUtils';\nimport { forwardRef, useImperativeHandle } from 'preact/compat';\nimport { TrackResizeContainer } from '#UNSAFE_TrackResizeContainer';\nimport { useTextDimensions } from '#hooks/PRIVATE_useTextDimensions';\nimport { _getPreferredSize, getLinearLegendLayoutInfo } from './getLegendLayout';\nimport { useLegendDnd } from '#hooks/PRIVATE_useLegendDnD/useLegendDnd';\nimport { styles as VisDndStyles } from '#hooks/PRIVATE_useVisDnd/themes/VisDndStyles.css';\nimport { LegendRenderedContext } from '#hooks/UNSAFE_useLegendPreferredSize';\n\nexport type SizeHandle = {\n _getPreferredSize: (\n _width: number,\n _height: number\n ) => { width: number; height: number } | undefined;\n};\n\ntype ForwardRefLegend = <K extends string | number, D extends LegendItemData<K>>(\n props: LegendProps<K, D> & { ref?: Ref<SizeHandle> }\n) => VNode | null;\n\n/**\n * A legend displays an interactive description of symbols, colors, etc., used in graphical information representations.\n */\nexport const Legend = forwardRef(\n <K extends string | number, D extends LegendItemData<K>>(\n {\n orientation = 'horizontal',\n items,\n isReadOnly = true,\n onItemAction,\n onItemHover,\n onItemFocus,\n testId,\n contextMenuConfig,\n hideAndShowBehavior = 'off',\n hoverBehavior = 'none',\n halign = 'start',\n valign = 'top',\n ...props\n }: LegendProps<K, D>,\n ref: Ref<SizeHandle> = null\n ) => {\n // Use the context\n const { isLegendReady, width, height } = useContext(LegendRenderedContext);\n const { textMeasureContent, getTextDimensions } = useTextDimensions();\n const { resolvedVars, cssContent } = useCssVars(legendVars);\n\n const legendFontStylesObj = getLegendTextStyle(\n {\n fontStyle: props.textFontStyle,\n fontSize: props.textFontSize?.toString(),\n fontWeight: props.textFontWeight?.toString(),\n fontFamily: props.textFontFamily\n },\n resolvedVars\n );\n const rootRef = useRef<HTMLDivElement>(null);\n\n useImperativeHandle(\n ref!,\n () => ({\n _getPreferredSize: (_width: number, _height: number) => {\n return _getPreferredSize(\n _width,\n _height,\n items,\n resolvedVars,\n orientation,\n legendFontStylesObj,\n props.symbolWidth,\n props.symbolHeight,\n getTextDimensions\n );\n }\n }),\n [\n getTextDimensions,\n resolvedVars,\n orientation,\n legendFontStylesObj,\n props.symbolWidth,\n props.symbolHeight,\n items\n ]\n );\n\n if (\n getTextDimensions &&\n resolvedVars['unit'] != undefined &&\n resolvedVars['fontSize'] != undefined\n ) {\n isLegendReady?.(true);\n }\n\n const testIdProps = useTestId(testId);\n const isTestEnv = testIdProps['data-testid'] !== undefined;\n const rootDimsRef = useRef<DOMRect>();\n const { getItem, getDetailFromInfo, getPrevItemInfo, getNextItemInfo } = getLegendNavUtils<\n K,\n D\n >(items);\n\n const isLegendItemActionable = getIsLegendItemActionable(items, isReadOnly);\n const hasData = items.length > 0;\n\n const legendKeyUpHandler = (\n triggerOnAction: () => void,\n updatefocusedItemInfo: (itemInfo: ItemInfo) => void,\n focusedItemInfo: ItemInfo\n ) =>\n getKeyUpHandler(\n triggerOnAction,\n updatefocusedItemInfo,\n focusedItemInfo,\n props.hiddenIds != null\n );\n\n const { touchResponse, touchResponseStyle } = useVisTouchResponse({\n type: 'touchStart'\n });\n const { focusedItemInfo, hoveredItemInfo, onContextMenuDismissed, activeId, eventsProps } =\n useVisEvent<ItemInfo, ItemActionDetail<K, D>, ItemFocusDetail<K, D>, D>(\n touchResponse,\n !isReadOnly,\n isLegendItemActionable,\n legendKeyUpHandler,\n getDetailFromInfo,\n getPrevItemInfo,\n getNextItemInfo,\n onItemAction,\n onItemHover,\n onItemFocus,\n isEqualItem,\n getItemInfo,\n { itemIdx: 0, sectionIdx: 0 },\n props.hiddenIds != null\n );\n\n const { focusedItemRef } = useItemFocus(focusedItemInfo);\n const datatipText = getDatatipText(items, getItem, focusedItemInfo, hoveredItemInfo);\n const [datatipDisabled, setDatatipDisabled] = useState(false);\n const {\n datatipContent,\n datatipProps: { 'aria-describedby': datatipAriaDescribedby, ...datatipProps }\n } = useLegendDatatip({\n text: datatipText,\n rootDimsRef,\n focusedItemInfo,\n focusedItemRef,\n touchResponse,\n isDisabled: datatipDisabled\n });\n\n const ariaProps = getAriaProps<K>(\n isReadOnly,\n props['aria-label'],\n props.hiddenIds,\n merge([props['aria-describedby'], datatipAriaDescribedby]),\n props['aria-labelledby']\n );\n\n const { contextMenuContent, contextMenuProps } = useLegendContextMenu<D>({\n rootRef,\n contextMenuConfig: hasData ? contextMenuConfig : undefined,\n focusedItemInfo,\n items,\n isReadOnly,\n onContextMenuDismissed\n });\n\n const [dragOver, setDragOver] = useState<boolean>();\n\n const { draggable, dndProps, dndContent } = useLegendDnd<K, D, LegendDragStartDetail<D>>({\n onDrag: props.onDrag,\n onDragStart: props.onDragStart,\n onDragEnd: props.onDragEnd,\n onDragEnter: props.onDragEnter,\n onDragLeave: props.onDragLeave,\n onDragOver: props.onDragOver,\n onDrop: props.onDrop,\n items,\n setDragOver,\n setDatatipDisabled,\n itemDraggable: props.itemDraggable\n });\n\n const mergedProps = mergeProps(eventsProps, datatipProps, contextMenuProps, dndProps);\n const { legendStyle, renderedLegendStyle } = styles;\n\n return (\n <>\n {!isLegendReady && (\n <TrackResizeContainer\n width={width ? `${width}px` : '100%'}\n height={height ? `${height}px` : '100%'}\n class={classNames([\n styles.flexStyle,\n styles[`${halign}HAlign`],\n styles[`${valign}VAlign`]\n ])}>\n {function _(width) {\n const layoutInfo = useMemo(\n () =>\n getLinearLegendLayoutInfo<K>({\n width,\n getTextDimensions,\n resolvedVars,\n orientation,\n legendFontStylesObj,\n symbolWidth: props.symbolWidth,\n symbolHeight: props.symbolHeight,\n items\n }),\n [width]\n );\n const { itemsPerCol, itemsPerRow } = getGridNums(items.length, layoutInfo);\n return (\n <>\n <div\n ref={rootRef}\n tabIndex={isReadOnly ? undefined : 0}\n role=\"application\"\n draggable={draggable}\n class={classNames([\n legendStyle,\n renderedLegendStyle,\n dragOver\n ? VisDndStyles.dndDragOverHTMLStyle\n : dragOver === false\n ? VisDndStyles.dndRejectedStyle\n : undefined\n ])}\n style={touchResponseStyle}\n {...testIdProps}\n {...ariaProps}\n {...mergedProps}\n aria-activedescendant={activeId}>\n <BaseLegend\n {...props}\n focusedItemRef={focusedItemRef}\n items={items}\n isReadOnly={isReadOnly}\n orientation={orientation}\n sectionIdx={0}\n itemsPerRow={itemsPerRow}\n itemsPerCol={itemsPerCol}\n itemWidth={layoutInfo?.isWrapped ? layoutInfo?.maxItemWidth : undefined}\n focusedItemInfo={focusedItemInfo}\n hoveredItemInfo={hoveredItemInfo}\n activeId={activeId}\n hideAndShowBehavior={hideAndShowBehavior}\n hoverBehavior={hoverBehavior}\n isTestEnv={isTestEnv}\n />\n </div>\n {datatipContent}\n {contextMenuContent}\n {dndContent}\n </>\n );\n }}\n </TrackResizeContainer>\n )}\n {textMeasureContent}\n {cssContent}\n </>\n );\n }\n) as ForwardRefLegend;\n"],"names":["getItem","itemInfo","items","itemIdx","length","getNextItemInfo","Math","min","actionable","sectionIdx","getPrevItemInfo","max","getLegendNavUtils","getDetailFromInfo","itemId","undefined","data","item","id","getLinearLegendLayoutInfo","width","getTextDimensions","resolvedVars","orientation","legendFontStylesObj","symbolWidth","maxWidth","maxHeight","totalWidth","isWrapped","containerWidth","Object","keys","unitLength","parseFloat","maxItemWidth","maxItemHeight","horizontalSectionWidth","getMaxWidth","itemsPerRow","floor","symbolHeight","itemSymbolWidth","itemSymbolHeight","forEach","legendItem","height","text","itemTextWidth","Legend","forwardRef","isReadOnly","onItemAction","onItemHover","onItemFocus","testId","contextMenuConfig","hideAndShowBehavior","hoverBehavior","halign","valign","props","ref","isLegendReady","useContext","LegendRenderedContext","textMeasureContent","useTextDimensions","cssContent","useCssVars","legendVars","getLegendTextStyle","fontStyle","textFontStyle","fontSize","textFontSize","toString","fontWeight","textFontWeight","fontFamily","textFontFamily","rootRef","useRef","useImperativeHandle","_getPreferredSize","_width","_height","layoutInfo","itemsPerCol","getGridNums","preferredWidth","paddingLegendItems","paddingLegendTopBottom","legendHeight","preferredHeight","ceil","testIdProps","useTestId","isTestEnv","rootDimsRef","isLegendItemActionable","getIsLegendItemActionable","hasData","touchResponse","touchResponseStyle","useVisTouchResponse","type","focusedItemInfo","hoveredItemInfo","onContextMenuDismissed","activeId","eventsProps","useVisEvent","triggerOnAction","updatefocusedItemInfo","getKeyUpHandler","hiddenIds","isEqualItem","getItemInfo","focusedItemRef","useItemFocus","datatipText","getDatatipText","datatipDisabled","setDatatipDisabled","useState","datatipContent","datatipProps","datatipAriaDescribedby","useLegendDatatip","isDisabled","ariaProps","getAriaProps","merge","contextMenuContent","contextMenuProps","useLegendContextMenu","dragOver","setDragOver","draggable","dndProps","dndContent","useLegendDnd","onDrag","onDragStart","onDragEnd","onDragEnter","onDragLeave","onDragOver","onDrop","itemDraggable","mergedProps","mergeProps","legendStyle","renderedLegendStyle","styles","_jsxs","_Fragment","children","_jsx","TrackResizeContainer","class","classNames","flexStyle","useMemo","jsxs","Fragment","tabIndex","role","VisDndStyles","dndDragOverHTMLStyle","dndRejectedStyle","style","BaseLegend","itemWidth"],"mappings":"8kBAgBA,SAASA,EAAwCC,E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sF,UAAWvF,GAAY1D,UAAY0D,GAAYpD,kBAAepB,EAC9D4F,gBAAiBA,GACjBC,gBAAiBA,GACjBE,SAAUA,GACVrD,oBAAqBA,EACrBC,cAAeA,EACfwC,UAAWA,MAGd4B,GACAQ,GACAO,KAGN,IAGJ3E,EACAE,IAEH"}
@@ -1,2 +0,0 @@
1
- define(['exports', 'preact/jsx-runtime', 'preact/compat', './FormContext-5130e198', './useFormContext-30acdd33', './FormFieldContext-3c44aaaa', 'preact/hooks', './useFocusableTextField-8b755b15', './Label-7cbbe3b7', './keyboardUtils-71bc5d84', './TextFieldInput-e86a1d08', 'css!./ObfuscatedTextFieldInputStyles.styles.css', './ReadonlyTextFieldInput-d6c6dbc4', './StyledTextField-5dcd2ff4', './TextField-c16917d8', './MaxLengthLiveRegion-46bb45da', './useTextField-e6877c79', './logger-0f873e29', './TabbableModeContext-a9c97640', './useId-c9578d26', './useTranslationBundle-7c40cb58', 'css!./UserAssistanceStyles.styles.css', 'module', './UNSAFE_UserAssistance/themes/redwood/UserAssistanceVariants.css', './InlineUserAssistance-3d3e72a9', './CompactUserAssistance-f962b357', './mergeProps-bcfa6a92', './LayerHost-733ade2f', 'css!./TooltipContentStyles.styles.css', 'module', './hooks/UNSAFE_useTooltip/themes/redwood/TooltipContentVariants.css', './tooltipUtils-30886397', 'preact', 'css!./IconStyle.styles.css', './Popup-3e2566da', 'css!./LabelStyles.styles.css', 'module', './UNSAFE_Label/themes/redwood/LabelVariants.css', './InputGroupContext-372087af', './HiddenAccessible-037ef42d', 'module', './UNSAFE_Popup/themes/redwood/PopupVariants.css', './useLengthFilter-ed8959a4', './classNames-08d99695', './usePress-949a0d03', './useFormFieldContext-8196183c', 'css!./MaxLengthCounterStyles.styles.css', './useCurrentValueReducer-faded381', './useSelectableTextField-900d2860'], (function(e,s,t,a,n,l,i,o,r,d,c,u,x,m,p,h,b,F,y,g,C,L,f,v,A,S,T,R,I,U,j,_,E,w,P,k,D,M,N,V,B,H,q,z,W,$,G,O,X){"use strict";var J="MaxLengthCounterStyles_spanStyles__7dy9j72";const K=()=>{};function Q({maxLength:e,valueLength:t=0,onClick:a}){const{isFocused:n}=$.useFormFieldContext(),l=i.useCallback((e=>e.preventDefault()),[]),o=z.classNames([!n&&"MaxLengthCounterStyles_hide__7dy9j71"]),{pressProps:r}=W.usePress(a??K);return s.jsx("div",{class:"MaxLengthCounterStyles_maxLengthCounterBase__7dy9j70",onMouseDown:l,...r,children:s.jsxs("span",{class:o,children:[s.jsx("span",{class:J,children:t}),s.jsx("span",{class:J,children:"/"}),s.jsx("span",{class:J,children:e})]})})}const Y=t.forwardRef((({"aria-describedby":e,assistiveText:a,autoComplete:i="off",autoFocus:d=!1,columnSpan:u,helpSourceLink:F,helpSourceText:y,isDisabled:L,isReadonly:f,isRequired:v=!1,isRequiredShown:R,label:I,labelEdge:U,labelStartWidth:j,maxLength:_,maxLengthCounter:E="remaining",maxLengthUnit:w,messages:P,placeholder:k,resize:D,role:M,rows:N,textAlign:B,userAssistanceDensity:H,value:z,variant:W="default",onInput:$,onCommit:G,testId:J},K)=>{const Y=C.useTranslationBundle("@oracle/oraclejet-preact"),Z=_?Y.formControl_limitReached({CHARACTER_LIMIT:_}):"",{currentCommitValue:ee,dispatch:se}=O.useCurrentValueReducer({value:z}),te=t.useCallback((e=>{se({type:"input",payload:e.value}),$?.(e)}),[$,se]),ae=t.useCallback((e=>{se({type:"commit",payload:e.value}),G?.(e)}),[G,se]),{isDisabled:ne,isReadonly:le,labelEdge:ie,labelStartWidth:oe,textAlign:re,userAssistanceDensity:de}=n.useFormContext(),ce=L??ne,ue=f??le,xe=U??ie,me=j??oe,pe=B??re,he=H??de,be=t.useRef(g.useId()),Fe=e?`${e} ${be.current}`:be.current,ye=t.useRef(null),ge=t.useRef(null),{focusProps:Ce,isFocused:Le,methods:fe}=o.useFocusableTextField({isDisabled:ce,isReadonly:ue,enabledElementRef:ye,readonlyElementRef:ge}),{methods:ve}=X.useSelectableTextField(ye);t.useImperativeHandle(K,(()=>T.mergeProps(fe,ve)),[fe,ve]);const{isMaxLengthReached:Ae,valueLength:Se,onFilteredInput:Te}=q.useLengthFilter({maxLength:_,maxLengthUnit:w,value:z,onInput:te,onCommit:ae}),Re=[...P??[],...Ae?[{detail:Z,severity:"info"}]:[]],{formFieldContext:Ie,inputProps:Ue,labelProps:je,textFieldProps:_e,userAssistanceProps:Ee}=b.useTextField({ariaDescribedBy:ue||ce?e:Fe,contentVariant:"textarea",helpSourceLink:F,helpSourceText:y,isDisabled:ce,isFocused:Le,isReadonly:ue,isRequiredShown:R,labelEdge:xe,messages:Re,styleVariant:W,userAssistanceDensity:he,value:z}),we=t.useCallback((()=>{const e=ye.current,s=e?e.value.length:null;ye.current?.setSelectionRange(s,s),ye.current?.focus()}),[ye]),Pe="none"!==xe?s.jsx(r.Label,{...je,children:I}):void 0,ke={label:"none"!==xe?Pe:void 0,labelEdge:"none"!==xe?xe:void 0,labelStartWidth:"none"!==xe?me:void 0},De="none"===xe?I:void 0,Me="efficient"===he||"reflow"===he?ce||ue?"efficient"!==he?void 0:s.jsx(A.InlineUserAssistance,{userAssistanceDensity:he,...Ee}):s.jsx(A.InlineUserAssistance,{assistiveText:a,fieldLabel:I,helpSourceLink:F,helpSourceText:y,messages:Re,isRequiredShown:R,userAssistanceDensity:he,...Ee}):void 0,Ne=t.useRef(null),Ve="compact"===he?s.jsx(S.CompactUserAssistance,{anchorRef:Ne,messages:Re,assistiveText:a,...Ee}):void 0;if(ue){const e=s.jsx(x.ReadonlyTextFieldInput,{"aria-describedby":Ue["aria-describedby"],"aria-label":De,"aria-labelledby":je.id,as:"textarea",elementRef:ge,rows:N,autoFocus:d,textAlign:pe,value:z,variant:"textarea",hasEmptyLabel:""===I&&"none"===xe,hasInsideLabel:void 0!==I&&"inside"===xe});return s.jsx(l.FormFieldContext.Provider,{value:Ie,children:s.jsx(m.ReadonlyTextField,{role:"presentation",columnSpan:u,compactUserAssistance:Ve,inlineUserAssistance:Me,ref:Ne,testId:J,variant:"textarea",mainContent:e,resize:D,...ke})})}const Be=void 0!==_,He=s.jsxs(s.Fragment,{children:[s.jsx(c.TextFieldInput,{as:"textarea","aria-label":De,autoComplete:i,autoFocus:d,currentCommitValue:ee,hasEmptyLabel:""===I&&"none"===xe,hasInsideLabel:void 0!==Pe&&"inside"===xe,isRequired:v,inputRef:ye,onCommit:ae,onInput:Te,placeholder:k,role:M,rows:N,textAlign:pe,value:z,...Ue}),"remaining"===E&&Be&&s.jsx(Q,{maxLength:_,valueLength:Se,onClick:we}),Be&&s.jsx(V.HiddenAccessible,{id:be.current,isHidden:!0,children:Y.formControl_maxLength({MAX_LENGTH:`${_}`})}),Be&&Le&&s.jsx(h.MaxLengthLiveRegion,{maxLength:_,valueLength:Se,testId:J+"_remainingChars"})]});return s.jsx(l.FormFieldContext.Provider,{value:Ie,children:s.jsx(p.TextField,{mainContent:He,columnSpan:u,compactUserAssistance:Ve,inlineUserAssistance:Me,onBlur:Ce?.onFocusOut,onFocus:Ce?.onFocusIn,mainFieldRef:Ne,resize:D,testId:J,..._e,...ke})})}));e.MaxLengthCounter=Q,e.TextArea=Y}));
2
- //# sourceMappingURL=TextArea-d69acd23.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TextArea-d69acd23.js","sources":["../../src/UNSAFE_TextArea/MaxLengthCounter.tsx","../../src/UNSAFE_TextArea/TextArea.tsx"],"sourcesContent":["import { useCallback } from 'preact/hooks';\n\nimport { classNames } from '../utils/UNSAFE_classNames';\nimport { usePress } from '../hooks/UNSAFE_usePress';\nimport { useFormFieldContext } from '../hooks/UNSAFE_useFormFieldContext';\nimport { hide, maxLengthCounterBase, spanStyles } from './MaxLengthCounterStyles.css';\n\ntype Props = {\n maxLength: number;\n valueLength?: number;\n onClick?: () => void; // the calling component should focus on the appropriate element when clicked.\n};\n\nconst noop = () => {};\n\nexport function MaxLengthCounter({ maxLength, valueLength = 0, onClick }: Props) {\n const { isFocused } = useFormFieldContext();\n // We don't want mousedown on this component to do anything, so prevent the default behavior.\n const killEvent = useCallback((event: Event) => event.preventDefault(), []);\n const textClasses = classNames([!isFocused && hide]);\n const { pressProps } = usePress(onClick ?? noop);\n return (\n <div class={maxLengthCounterBase} onMouseDown={killEvent} {...pressProps}>\n <span class={textClasses}>\n <span class={spanStyles}>{valueLength}</span>\n <span class={spanStyles}>/</span>\n <span class={spanStyles}>{maxLength}</span>\n </span>\n </div>\n );\n}\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport { ComponentProps, Ref } from 'preact';\nimport { forwardRef, useCallback, useImperativeHandle, useRef } from 'preact/compat';\nimport { useFormContext } from '../hooks/UNSAFE_useFormContext';\nimport { FormFieldContext } from '../hooks/UNSAFE_useFormFieldContext';\nimport { FocusableHandle, useFocusableTextField } from '../hooks/UNSAFE_useFocusableTextField';\nimport { Label } from '../UNSAFE_Label';\nimport {\n ReadonlyTextField,\n ReadonlyTextFieldInput,\n TextField,\n TextFieldInput\n} from '../UNSAFE_TextField';\nimport { useTextField } from '../hooks/UNSAFE_useTextField';\nimport {\n CompactUserAssistance,\n InlineUserAssistance,\n UserAssistanceDensityType\n} from '../UNSAFE_UserAssistance';\nimport { CountUnit, useLengthFilter } from '../hooks/UNSAFE_useLengthFilter';\nimport { MaxLengthLiveRegion } from '../UNSAFE_TextField';\nimport { MaxLengthCounter } from './MaxLengthCounter';\nimport { Size } from '../utils/UNSAFE_size';\nimport { useCurrentValueReducer } from '../hooks/UNSAFE_useCurrentValueReducer';\nimport { ValueUpdateDetail } from '../utils/UNSAFE_valueUpdateDetail';\nimport { ComponentMessageItem } from '../UNSAFE_ComponentMessage';\nimport { useTranslationBundle } from '../hooks/UNSAFE_useTranslationBundle';\nimport { BundleType } from '../resources/nls/bundle';\nimport { LayoutColumnSpan } from '../utils/UNSAFE_styles/Layout';\nimport type { TestIdProps } from '#hooks/UNSAFE_useTestId';\nimport { HiddenAccessible } from '../UNSAFE_HiddenAccessible';\nimport { useId } from '../hooks/UNSAFE_useId';\nimport { SelectableHandle, useSelectableTextField } from '#hooks/UNSAFE_useSelectableTextField';\nimport { mergeProps } from '#utils/UNSAFE_mergeProps';\n\ntype TextFieldProps = ComponentProps<typeof TextField>;\ntype TextFieldInputProps = ComponentProps<typeof TextFieldInput>;\ntype InlineUserAssistanceProps = ComponentProps<typeof InlineUserAssistance>;\n\ntype Props = TestIdProps & {\n /**\n * The ID of an element (or space separated IDs of multiple elements) that\n * describes the input.\n */\n 'aria-describedby'?: TextFieldInputProps['aria-describedby'];\n\n /**\n * Text to provide guidance to help the user understand what to enter.\n */\n assistiveText?: InlineUserAssistanceProps['assistiveText'];\n /**\n * Dictates component's autocomplete state.\n * This attribute indicates whether the value of the control can be automatically completed by the browser.\n * The common values are \"on\" and \"off\".\n */\n autoComplete?: TextFieldInputProps['autoComplete'];\n /**\n * Autofocus specifies whether the component will get focus when the page is loaded.\n * If it is set to true then the associated component will get input focus when the page is loaded.\n * Setting this property doesn't set the focus to the component; it tells the browser to focus\n * to it when the element is inserted in the document.\n */\n autoFocus?: TextFieldInputProps['autoFocus'];\n /**\n * Specifies how many columns to span in a FormLayout with direction === 'row'\n */\n columnSpan?: LayoutColumnSpan;\n /**\n * Help source URL associated with the component.\n */\n helpSourceLink?: InlineUserAssistanceProps['helpSourceLink'];\n /**\n * Custom text to be rendered for the <code>helpSourceLink</code>.\n */\n helpSourceText?: InlineUserAssistanceProps['helpSourceText'];\n /**\n * Specifies whether the component is disabled.\n */\n isDisabled?: boolean;\n /**\n * Specifies whether the component is readonly.\n */\n isReadonly?: boolean;\n /**\n * Specifies for accessibility purposes whether a value is required.\n *\n * Setting this property to <code>false</code> means that a value is not required to be\n * committed by the user. Setting this property to <code>true</code> means that a value\n * is required to be committed by the user.\n */\n isRequired?: TextFieldInputProps['isRequired'];\n /**\n * Specifies whether to show an indicator on screen that a value is required, for example\n * before the user has committed a value.\n */\n isRequiredShown?: InlineUserAssistanceProps['isRequiredShown'];\n /**\n * Specifies the label associated with the field.\n */\n label: string;\n /**\n * Specifies where the label is positioned relative to the field.\n */\n labelEdge?: 'inside' | 'start' | 'top' | 'none';\n /**\n * Specifies the width of the label when <code>labelEdge</code> is <code>\"start\"</code>\n */\n labelStartWidth?: Size;\n /**\n * Specifies the maximum number of characters that can be entered in the input field.\n */\n maxLength?: number;\n /**\n * Determines whether the remaining number of characters that can be entered is shown or not.\n */\n maxLengthCounter?: 'none' | 'remaining';\n /**\n * Specifies how the input text characters are to be counted when maxLength is specified.\n */\n maxLengthUnit?: CountUnit;\n /**\n * Messages to show on screen that are associated with the component.\n */\n messages?: InlineUserAssistanceProps['messages'];\n /**\n * A short hint to display before the user enters a value.\n */\n placeholder?: TextFieldInputProps['placeholder'];\n /**\n * Specifies how the user is allowed to manually resize the TextArea component.\n */\n resize?: TextFieldProps['resize'];\n /**\n * Specifies the ARIA role type.\n */\n role?: TextFieldInputProps['role'];\n /**\n * Specifies the number of rows to display\n */\n rows?: TextFieldInputProps['rows'];\n /**\n * Specifies how to align text within the field.\n */\n textAlign?: TextFieldInputProps['textAlign'];\n /**\n * Specifies the density of the user assistance presentation. It can be set to:\n * <ul>\n * <li><code>'efficient'</code>: Show inline and reserve space to prevent layout reflow when user\n * assistance text is displayed.</li>\n * <li><code>'reflow'</code>: Show inline. Layout will reflow when text is displayed.</li>\n * <li><code>'compact'</code>: Messages, help, hints, and required will not be shown inline; they will show in a mode that keeps the screen more compact, like a popup for the messages, and a required icon to indicate Required. </li>\n * </ul>\n */\n userAssistanceDensity?: UserAssistanceDensityType;\n /**\n * The current display value of the component.\n */\n value?: TextFieldInputProps['value'];\n /**\n * The style variant of the component.\n */\n variant?: TextFieldInputProps['variant'];\n /**\n * Callback invoked when the user commits the entered value by blurring out of the field.\n */\n onCommit?: TextFieldInputProps['onCommit'];\n /**\n * Callback invoked each time the user changes the value of the field. For example, if the user\n * types 'abcd', this callback will be called four times with the value as 'a', 'ab', 'abc' and 'abcd'\n * respectively.\n */\n onInput: TextFieldInputProps['onInput'];\n};\n\ntype FocusSelectHandle = FocusableHandle & SelectableHandle;\n\n/**\n * A text area displays a field that allows a user to enter a multi-line text value.\n */\nexport const TextArea = forwardRef(\n (\n {\n 'aria-describedby': ariaDescribedBy,\n assistiveText,\n autoComplete = 'off',\n autoFocus = false,\n columnSpan,\n helpSourceLink,\n helpSourceText,\n isDisabled: propIsDisabled,\n isReadonly: propIsReadonly,\n isRequired = false,\n isRequiredShown,\n label,\n labelEdge: propLabelEdge,\n labelStartWidth: propLabelStartWidth,\n maxLength,\n maxLengthCounter = 'remaining',\n maxLengthUnit,\n messages,\n placeholder,\n resize,\n role,\n rows,\n textAlign: propTextAlign,\n userAssistanceDensity: propUserAssistanceDensity,\n value,\n variant = 'default',\n onInput,\n onCommit,\n testId\n }: Props,\n ref?: Ref<FocusSelectHandle>\n ) => {\n const translations = useTranslationBundle<BundleType>('@oracle/oraclejet-preact');\n const formControl_limitReached = maxLength\n ? translations.formControl_limitReached({\n CHARACTER_LIMIT: maxLength\n })\n : '';\n\n const { currentCommitValue, dispatch } = useCurrentValueReducer({ value });\n const onInputAndDispatch = useCallback(\n (detail: ValueUpdateDetail<string>) => {\n // Should dispatch happen first? This will queue up a re-render, ordering should not cause issues (this is async)\n dispatch({ type: 'input', payload: detail.value });\n onInput?.(detail);\n },\n [onInput, dispatch]\n );\n const onCommitAndDispatch = useCallback(\n (detail: ValueUpdateDetail<string>) => {\n // Should dispatch happen first? This will queue up a re-render, ordering should not cause issues (this is async)\n dispatch({ type: 'commit', payload: detail.value });\n onCommit?.(detail);\n },\n [onCommit, dispatch]\n );\n const {\n isDisabled: isFormDisabled,\n isReadonly: isFormReadonly,\n labelEdge: formLabelEdge,\n labelStartWidth: formLabelStartWidth,\n textAlign: formTextAlign,\n userAssistanceDensity: formUserAssistanceDensity\n } = useFormContext();\n\n // default to FormContext values if component properties are not specified\n const isDisabled = propIsDisabled ?? isFormDisabled;\n const isReadonly = propIsReadonly ?? isFormReadonly;\n const labelEdge = propLabelEdge ?? formLabelEdge;\n const labelStartWidth = propLabelStartWidth ?? formLabelStartWidth;\n const textAlign = propTextAlign ?? formTextAlign;\n const userAssistanceDensity = propUserAssistanceDensity ?? formUserAssistanceDensity;\n const maxLengthDescribedByIdRef = useRef<string>(useId());\n // The enabledAriaDescribedBy includes the maxLengthDescribedById in addition to what was passed in to aria-describedby.\n // We don't need to announce the max length message for readonly, as it only applies when editing the value.\n const enabledAriaDescribedBy = ariaDescribedBy\n ? `${ariaDescribedBy} ${maxLengthDescribedByIdRef.current}`\n : maxLengthDescribedByIdRef.current;\n\n const enabledElementRef = useRef<HTMLTextAreaElement>(null);\n const readonlyElementRef = useRef<HTMLTextAreaElement>(null);\n\n const {\n focusProps,\n isFocused,\n methods: focusMethods\n } = useFocusableTextField<HTMLTextAreaElement, HTMLTextAreaElement>({\n isDisabled,\n isReadonly,\n enabledElementRef,\n readonlyElementRef\n });\n\n const { methods: selectMethods } =\n useSelectableTextField<HTMLTextAreaElement>(enabledElementRef);\n\n useImperativeHandle(ref!, () => mergeProps(focusMethods, selectMethods), [\n focusMethods,\n selectMethods\n ]);\n\n // Handle length filter for user-typed inputs and controlled inputs\n const { isMaxLengthReached, valueLength, onFilteredInput } = useLengthFilter({\n maxLength,\n maxLengthUnit,\n value,\n onInput: onInputAndDispatch,\n onCommit: onCommitAndDispatch\n });\n\n const limitMessage = [{ detail: formControl_limitReached, severity: 'info' }];\n const allMessages = [\n ...(messages ?? []),\n ...(isMaxLengthReached ? limitMessage : [])\n ] as ComponentMessageItem[];\n\n const { formFieldContext, inputProps, labelProps, textFieldProps, userAssistanceProps } =\n useTextField({\n ariaDescribedBy: isReadonly || isDisabled ? ariaDescribedBy : enabledAriaDescribedBy,\n contentVariant: 'textarea',\n helpSourceLink,\n helpSourceText,\n isDisabled,\n isFocused,\n isReadonly,\n isRequiredShown,\n labelEdge,\n messages: allMessages,\n styleVariant: variant,\n userAssistanceDensity,\n value\n });\n\n const onClickCounter = useCallback(() => {\n const elm = enabledElementRef.current;\n // for setSelectionRange(), len needs to be a number or null.\n const len = elm ? elm.value.length : null;\n // Since the counter element is after the text, clicking in this\n // should put the selection at the end of the text\n enabledElementRef.current?.setSelectionRange(len, len);\n // Clicking the counter should put the focus on the input field\n enabledElementRef.current?.focus();\n }, [enabledElementRef]);\n\n const labelComp = labelEdge !== 'none' ? <Label {...labelProps}>{label}</Label> : undefined;\n\n const fieldLabelProps = {\n label: labelEdge !== 'none' ? labelComp : undefined,\n labelEdge: labelEdge !== 'none' ? labelEdge : undefined,\n labelStartWidth: labelEdge !== 'none' ? labelStartWidth : undefined\n };\n\n const ariaLabel = labelEdge === 'none' ? label : undefined;\n const isInlineDensity =\n userAssistanceDensity === 'efficient' || userAssistanceDensity === 'reflow';\n\n const inlineUserAssistance = isInlineDensity ? (\n isDisabled || isReadonly ? (\n // save space for user assistance if density is 'efficient', even though we don't\n // render user assistance for disabled or readonly fields\n userAssistanceDensity !== 'efficient' ? undefined : (\n <InlineUserAssistance\n userAssistanceDensity={userAssistanceDensity}\n {...userAssistanceProps}\n />\n )\n ) : (\n <InlineUserAssistance\n assistiveText={assistiveText}\n fieldLabel={label}\n helpSourceLink={helpSourceLink}\n helpSourceText={helpSourceText}\n messages={allMessages}\n isRequiredShown={isRequiredShown}\n userAssistanceDensity={userAssistanceDensity}\n {...userAssistanceProps}\n />\n )\n ) : undefined;\n\n const anchorRef = useRef<HTMLDivElement>(null);\n\n const compactUserAssistance =\n userAssistanceDensity === 'compact' ? (\n <CompactUserAssistance\n anchorRef={anchorRef}\n messages={allMessages}\n assistiveText={assistiveText}\n {...userAssistanceProps}\n />\n ) : undefined;\n\n if (isReadonly) {\n const mainContent = (\n <ReadonlyTextFieldInput\n aria-describedby={inputProps['aria-describedby']}\n aria-label={ariaLabel}\n aria-labelledby={labelProps.id}\n as=\"textarea\"\n elementRef={readonlyElementRef}\n rows={rows}\n autoFocus={autoFocus}\n textAlign={textAlign}\n value={value}\n variant=\"textarea\"\n hasEmptyLabel={label === '' && labelEdge === 'none'}\n hasInsideLabel={label !== undefined && labelEdge === 'inside'}\n />\n );\n return (\n <FormFieldContext.Provider value={formFieldContext}>\n <ReadonlyTextField\n role=\"presentation\"\n columnSpan={columnSpan}\n compactUserAssistance={compactUserAssistance}\n inlineUserAssistance={inlineUserAssistance}\n ref={anchorRef}\n testId={testId}\n variant=\"textarea\"\n mainContent={mainContent}\n resize={resize}\n {...fieldLabelProps}\n />\n </FormFieldContext.Provider>\n );\n }\n const hasMaxLength = maxLength !== undefined;\n const mainContent = (\n <>\n <TextFieldInput\n as=\"textarea\"\n aria-label={ariaLabel}\n autoComplete={autoComplete}\n autoFocus={autoFocus}\n currentCommitValue={currentCommitValue}\n hasEmptyLabel={label === '' && labelEdge === 'none'}\n hasInsideLabel={labelComp !== undefined && labelEdge === 'inside'}\n isRequired={isRequired}\n inputRef={enabledElementRef}\n onCommit={onCommitAndDispatch}\n onInput={onFilteredInput}\n placeholder={placeholder}\n role={role}\n rows={rows}\n textAlign={textAlign}\n value={value}\n {...inputProps}\n />\n {maxLengthCounter === 'remaining' && hasMaxLength && (\n <MaxLengthCounter\n maxLength={maxLength}\n valueLength={valueLength}\n onClick={onClickCounter}\n />\n )}\n {hasMaxLength && (\n <HiddenAccessible id={maxLengthDescribedByIdRef.current} isHidden={true}>\n {translations.formControl_maxLength({\n MAX_LENGTH: `${maxLength}`\n })}\n </HiddenAccessible>\n )}\n {hasMaxLength && isFocused && (\n <MaxLengthLiveRegion\n maxLength={maxLength}\n valueLength={valueLength}\n testId={testId + '_remainingChars'}\n />\n )}\n </>\n );\n\n return (\n <FormFieldContext.Provider value={formFieldContext}>\n <TextField\n mainContent={mainContent}\n columnSpan={columnSpan}\n compactUserAssistance={compactUserAssistance}\n inlineUserAssistance={inlineUserAssistance}\n onBlur={focusProps?.onFocusOut}\n onFocus={focusProps?.onFocusIn}\n mainFieldRef={anchorRef}\n resize={resize}\n testId={testId}\n {...textFieldProps}\n {...fieldLabelProps}></TextField>\n </FormFieldContext.Provider>\n );\n }\n);\n"],"names":["noop","MaxLengthCounter","maxLength","valueLength","onClick","isFocused","useFormFieldContext","killEvent","useCallback","event","preventDefault","textClasses","classNames","pressProps","usePress","_jsx","jsx","class","onMouseDown","_jsxs","jsxs","children","spanStyles","TextArea","forwardRef","ariaDescribedBy","assistiveText","autoComplete","autoFocus","columnSpan","helpSourceLink","helpSourceText","isDisabled","propIsDisabled","isReadonly","propIsReadonly","isRequired","isRequiredShown","label","labelEdge","propLabelEdge","labelStartWidth","propLabelStartWidth","maxLengthCounter","maxLengthUnit","messages","placeholder","resize","role","rows","textAlign","propTextAlign","userAssistanceDensity","propUserAssistanceDensity","value","variant","onInput","onCommit","testId","ref","translations","useTranslationBundle","formControl_limitReached","CHARACTER_LIMIT","currentCommitValue","dispatch","useCurrentValueReducer","onInputAndDispatch","detail","type","payload","onCommitAndDispatch","isFormDisabled","isFormReadonly","formLabelEdge","formLabelStartWidth","formTextAlign","formUserAssistanceDensity","useFormContext","maxLengthDescribedByIdRef","useRef","useId","enabledAriaDescribedBy","current","enabledElementRef","readonlyElementRef","focusProps","methods","focusMethods","useFocusableTextField","selectMethods","useSelectableTextField","useImperativeHandle","mergeProps","isMaxLengthReached","onFilteredInput","useLengthFilter","allMessages","severity","formFieldContext","inputProps","labelProps","textFieldProps","userAssistanceProps","useTextField","contentVariant","styleVariant","onClickCounter","elm","len","length","setSelectionRange","focus","labelComp","Label","undefined","fieldLabelProps","ariaLabel","inlineUserAssistance","InlineUserAssistance","fieldLabel","anchorRef","compactUserAssistance","CompactUserAssistance","mainContent","ReadonlyTextFieldInput","id","as","elementRef","hasEmptyLabel","hasInsideLabel","FormFieldContext","Provider","ReadonlyTextField","hasMaxLength","_Fragment","Fragment","TextFieldInput","inputRef","HiddenAccessible","isHidden","formControl_maxLength","MAX_LENGTH","MaxLengthLiveRegion","TextField","onBlur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uBA,GACvBJ,qBAAsBA,GACtB3D,IAAK8D,GACL/D,OAAQA,EACRH,QAAQ,WACRqE,YAAaA,EACb7E,OAAQA,KACJqE,MAIX,CACD,MAAMkB,QAA6BnB,IAAdjH,EACf0H,GACJzG,EAAAA,KAAAoH,EAAAC,SAAA,CAAAnH,SAAA,CACEN,EAACC,IAAAyH,iBACC,CAAAV,GAAG,WACS,aAAAV,GACZ1F,aAAcA,EACdC,UAAWA,EACXoC,mBAAoBA,GACpBiE,cAAyB,KAAV3F,GAA8B,SAAdC,GAC/B2F,oBAA8Bf,IAAdF,IAAyC,WAAd1E,GAC3CH,WAAYA,EACZsG,SAAUtD,GACV3B,SAAUc,GACVf,QAASuC,GACTjD,YAAaA,EACbE,KAAMA,EACNC,KAAMA,EACNC,UAAWA,GACXI,MAAOA,KACH8C,KAEgB,cAArBzD,GAAoC2F,IACnCvH,EAAAA,IAACd,GACCC,UAAWA,EACXC,YAAaA,GACbC,QAASuG,KAGZ2B,IACCvH,MAAC4H,EAAAA,iBAAgB,CAACb,GAAI/C,GAA0BI,QAASyD,UAAU,EAAIvH,SACpEuC,EAAaiF,sBAAsB,CAClCC,WAAY,GAAG5I,QAIpBoI,IAAgBjI,IACfU,MAACgI,EAAAA,oBACC,CAAA7I,UAAWA,EACXC,YAAaA,GACbuD,OAAQA,EAAS,uBAMzB,OACE3C,EAAAA,IAACoH,EAAAA,iBAAiBC,SAAS,CAAA9E,MAAO6C,GAChC9E,SAAAN,EAAAC,IAACgI,EAASA,UAAA,CACRpB,YAAaA,GACb/F,WAAYA,EACZ6F,sBAAuBA,GACvBJ,qBAAsBA,GACtB2B,OAAQ3D,IAAY4D,WACpBC,QAAS7D,IAAY8D,UACrBC,aAAc5B,GACd1E,OAAQA,EACRW,OAAQA,KACJ4C,MACAc,MAER"}
@@ -1,2 +0,0 @@
1
- define(['exports', 'preact/jsx-runtime', 'preact/compat', './FormContext-5130e198', './useFormContext-30acdd33', './FormFieldContext-3c44aaaa', 'preact/hooks', './useFocusableTextField-8b755b15', './Label-7cbbe3b7', './keyboardUtils-71bc5d84', './TextFieldInput-e86a1d08', 'css!./ObfuscatedTextFieldInputStyles.styles.css', './ReadonlyTextFieldInput-d6c6dbc4', './StyledTextField-5dcd2ff4', './TextField-c16917d8', './MaxLengthLiveRegion-46bb45da', './useTextField-e6877c79', './logger-0f873e29', './TabbableModeContext-a9c97640', './useId-c9578d26', './useTranslationBundle-7c40cb58', 'css!./UserAssistanceStyles.styles.css', 'module', './UNSAFE_UserAssistance/themes/redwood/UserAssistanceVariants.css', './InlineUserAssistance-3d3e72a9', './CompactUserAssistance-f962b357', './mergeProps-bcfa6a92', './LayerHost-733ade2f', 'css!./TooltipContentStyles.styles.css', 'module', './hooks/UNSAFE_useTooltip/themes/redwood/TooltipContentVariants.css', './tooltipUtils-30886397', 'preact', 'css!./IconStyle.styles.css', './Popup-3e2566da', 'css!./LabelStyles.styles.css', 'module', './UNSAFE_Label/themes/redwood/LabelVariants.css', './InputGroupContext-372087af', './HiddenAccessible-037ef42d', 'module', './UNSAFE_Popup/themes/redwood/PopupVariants.css', './useLengthFilter-ed8959a4', './useCurrentValueReducer-faded381', './TextArea-d69acd23', './useSelectableTextField-900d2860'], (function(e,s,t,a,n,o,i,l,r,d,c,u,m,p,x,h,b,g,F,f,y,R,v,T,A,L,C,S,I,U,w,E,j,P,H,_,k,D,B,V,N,M,q,W,$,z){"use strict";const G=({isReadonly:e,enabledElementRef:s,readonlyElementRef:t,minRows:a=2,maxRows:n,value:o})=>{i.useLayoutEffect((()=>{const o=e?t:s;if(null===o.current)return;if(o.current instanceof HTMLDivElement)return;const i=o.current,l=(e=>{const s=window.getComputedStyle(e),t=s.lineHeight;if("normal"===t)return 1.2*parseFloat(s.fontSize);return parseFloat(t)})(i);i.style.height="0";const{paddingHeight:r,borderHeight:d}=(e=>{const s=window.getComputedStyle(e);return{paddingHeight:parseFloat(s.paddingTop)+parseFloat(s.paddingBottom),borderHeight:parseFloat(s.borderTop)+parseFloat(s.borderBottom)}})(i),c=l*a+r+d,u=i.scrollHeight+d;let m=0;if(void 0===n)m=u<c?c:u;else if(n>a){const e=l*n+r+d;m=u>e?e:u<c?c:u}else m=c;i.style.height=m+.5+"px"}),[o,a,n,e,s,t])},O=t.forwardRef((({"aria-describedby":e,assistiveText:a,autoComplete:i="off",autoFocus:d=!1,columnSpan:u,helpSourceLink:g,helpSourceText:F,isDisabled:R,isReadonly:v,isRequired:T=!1,isRequiredShown:S,label:I,labelEdge:U,labelStartWidth:w,maxLength:E,maxLengthCounter:j="remaining",maxLengthUnit:P,maxRows:H,messages:_,minRows:k=2,placeholder:D,role:B,textAlign:N,userAssistanceDensity:M,value:O,variant:X="default",onInput:J,onCommit:K,testId:Q},Y)=>{const Z=y.useTranslationBundle("@oracle/oraclejet-preact"),ee=E?Z.formControl_limitReached({CHARACTER_LIMIT:E}):"",{currentCommitValue:se,dispatch:te}=W.useCurrentValueReducer({value:O}),ae=t.useCallback((e=>{te({type:"input",payload:e.value}),J?.(e)}),[J,te]),ne=t.useCallback((e=>{te({type:"commit",payload:e.value}),K?.(e)}),[K,te]),{isDisabled:oe,isReadonly:ie,labelEdge:le,labelStartWidth:re,textAlign:de,userAssistanceDensity:ce}=n.useFormContext(),ue=R??oe,me=v??ie,pe=U??le,xe=w??re,he=N??de,be=M??ce,ge=t.useRef(f.useId()),Fe=e?`${e} ${ge.current}`:ge.current,fe=t.useRef(null),ye=t.useRef(null),{focusProps:Re,isFocused:ve,methods:Te}=l.useFocusableTextField({isDisabled:ue,isReadonly:me,enabledElementRef:fe,readonlyElementRef:ye}),{methods:Ae}=z.useSelectableTextField(fe);t.useImperativeHandle(Y,(()=>C.mergeProps(Te,Ae)),[Te,Ae]);const{isMaxLengthReached:Le,valueLength:Ce,onFilteredInput:Se}=q.useLengthFilter({maxLength:E,maxLengthUnit:P,value:O,onInput:ae,onCommit:ne}),Ie=[..._??[],...Le?[{detail:ee,severity:"info"}]:[]],{formFieldContext:Ue,inputProps:we,labelProps:Ee,textFieldProps:je,userAssistanceProps:Pe}=b.useTextField({ariaDescribedBy:me||ue?e:Fe,contentVariant:"textarea",helpSourceLink:g,helpSourceText:F,isDisabled:ue,isFocused:ve,isReadonly:me,isRequiredShown:S,labelEdge:pe,messages:Ie,styleVariant:X,userAssistanceDensity:be,value:O}),He=t.useCallback((()=>{const e=fe.current,s=e?e.value.length:null;fe.current?.setSelectionRange(s,s),fe.current?.focus()}),[fe]),_e="none"!==pe?s.jsx(r.Label,{...Ee,children:I}):void 0,ke={label:"none"!==pe?_e:void 0,labelEdge:"none"!==pe?pe:void 0,labelStartWidth:"none"!==pe?xe:void 0},De="none"===pe?I:void 0,Be="efficient"===be||"reflow"===be?ue||me?"efficient"!==be?void 0:s.jsx(A.InlineUserAssistance,{userAssistanceDensity:be,...Pe}):s.jsx(A.InlineUserAssistance,{assistiveText:a,fieldLabel:I,helpSourceLink:g,helpSourceText:F,messages:Ie,isRequiredShown:S,userAssistanceDensity:be,...Pe}):void 0,Ve=t.useRef(null),Ne="compact"===be?s.jsx(L.CompactUserAssistance,{anchorRef:Ve,messages:Ie,assistiveText:a,...Pe}):void 0;if(G({isReadonly:me,enabledElementRef:fe,readonlyElementRef:ye,minRows:k,maxRows:H,value:O}),me){const e=s.jsx(m.ReadonlyTextFieldInput,{"aria-describedby":we["aria-describedby"],"aria-label":De,"aria-labelledby":Ee.id,elementRef:ye,...H?{as:"textarea",rows:k}:{as:"div"},autoFocus:d,textAlign:he,value:O,variant:"textarea",hasEmptyLabel:""===I&&"none"===pe,hasInsideLabel:void 0!==I&&"inside"===pe});return s.jsx(o.FormFieldContext.Provider,{value:Ue,children:s.jsx(p.ReadonlyTextField,{role:"presentation",columnSpan:u,compactUserAssistance:Ne,inlineUserAssistance:Be,variant:"textarea",mainContent:e,ref:Ve,testId:Q,...ke})})}const Me=void 0!==E,qe=s.jsxs(s.Fragment,{children:[s.jsx(c.TextFieldInput,{as:"textarea","aria-label":De,autoComplete:i,autoFocus:d,currentCommitValue:se,hasEmptyLabel:""===I&&"none"===pe,hasInsideLabel:void 0!==_e&&"inside"===pe,isRequired:T,inputRef:fe,onCommit:ne,onInput:Se,placeholder:D,role:B,rows:k,textAlign:he,value:O,...we}),"remaining"===j&&Me&&s.jsx($.MaxLengthCounter,{maxLength:E,valueLength:Ce,onClick:He}),Me&&s.jsx(V.HiddenAccessible,{id:ge.current,children:Z.formControl_maxLength({MAX_LENGTH:`${E}`})}),Me&&ve&&s.jsx(h.MaxLengthLiveRegion,{maxLength:E,valueLength:Ce,testId:Q+"_remainingChars"})]});return s.jsx(o.FormFieldContext.Provider,{value:Ue,children:s.jsx(x.TextField,{mainContent:qe,columnSpan:u,compactUserAssistance:Ne,inlineUserAssistance:Be,onBlur:Re?.onFocusOut,onFocus:Re?.onFocusIn,mainFieldRef:Ve,testId:Q,...je,...ke})})}));e.TextAreaAutosize=O}));
2
- //# sourceMappingURL=TextAreaAutosize-b7e56051.js.map
@@ -1,53 +0,0 @@
1
- /* @oracle/oraclejet-preact: undefined */
2
- 'use strict';
3
-
4
- var jsxRuntime = require('preact/jsx-runtime');
5
- var preact = require('preact');
6
- var hooks = require('preact/hooks');
7
- var compat = require('preact/compat');
8
- require('./FormContext-9452bd30.js');
9
- var useFormContext = require('./useFormContext-4c3091dc.js');
10
- var FormFieldContext = require('./FormFieldContext-8418dc68.js');
11
- var useFormFieldContextProps = require('./useFormFieldContextProps-8c04ed0f.js');
12
-
13
- var useId = require('./useId-6c0eeb27.js');
14
- var CheckboxRadioField = require('./CheckboxRadioField-037cddb9.js');
15
-
16
- const CheckboxSetContext = preact.createContext({});
17
- const useCheckboxSetContext = () => hooks.useContext(CheckboxSetContext);
18
-
19
- var styles = {ul:'CheckboxSetStyles_styles_ul__68p6630'};
20
-
21
- /**
22
- * A CheckboxSet allows the user to select one or more options from a set.
23
- */
24
- const CheckboxSet = compat.forwardRef(({ 'aria-describedby': ariaDescribedBy, assistiveText, columnSpan, direction = 'column', helpSourceLink, helpSourceText, isDisabled: propIsDisabled, isReadonly: propIsReadonly, isRequired = false, label, labelEdge: propLabelEdge, labelStartWidth: propLabelStartWidth, messages, onCommit, userAssistanceDensity: propUserAssistanceDensity, value, children, testId }, ref) => {
25
- const hasValue = value !== undefined ? value.size > 0 : false;
26
- const baseId = useId.useId();
27
- const { isDisabled: isFormDisabled, isReadonly: isFormReadonly, labelEdge: formLabelEdge, labelStartWidth: formLabelStartWidth, userAssistanceDensity: formUserAssistanceDensity } = useFormContext.useFormContext();
28
- // default to FormContext values if component properties are not specified
29
- const isDisabled = propIsDisabled ?? isFormDisabled;
30
- const isReadonly = propIsReadonly ?? isFormReadonly;
31
- const labelEdge = propLabelEdge ?? formLabelEdge;
32
- const labelStartWidth = propLabelStartWidth ?? formLabelStartWidth;
33
- const userAssistanceDensity = propUserAssistanceDensity ?? formUserAssistanceDensity;
34
- const formFieldContext = useFormFieldContextProps.useFormFieldContextProps({
35
- hasValue,
36
- isDisabled,
37
- isReadonly
38
- });
39
- const checkboxSetContext = hooks.useMemo(() => ({
40
- name: baseId,
41
- value,
42
- onCommit
43
- }), [baseId, onCommit, value]);
44
- // wrap each CheckboxItem in an <li> tag and the entire set with <ul>
45
- const childrenArray = preact.toChildArray(children).filter(Boolean);
46
- const wrappedChildren = childrenArray.map((item) => jsxRuntime.jsx("li", { children: item }));
47
- return (jsxRuntime.jsx(FormFieldContext.FormFieldContext.Provider, { value: formFieldContext, children: jsxRuntime.jsx(CheckboxRadioField.CheckboxRadioField, { "aria-describedby": ariaDescribedBy, assistiveText: assistiveText, baseId: baseId, columnSpan: columnSpan, direction: direction, helpSourceLink: helpSourceLink, helpSourceText: helpSourceText, isDisabled: isDisabled, isReadonly: isReadonly, isRequired: isRequired, label: label, labelEdge: labelEdge, labelStartWidth: labelStartWidth, parentComponentVariant: "checkboxSet", messages: messages, userAssistanceDensity: userAssistanceDensity, hasValue: hasValue, role: "group", testId: testId, ref: ref, children: jsxRuntime.jsx(CheckboxSetContext.Provider, { value: checkboxSetContext, children: jsxRuntime.jsx("ul", { className: styles.ul, children: wrappedChildren }) }) }) }));
48
- });
49
-
50
- exports.CheckboxSet = CheckboxSet;
51
- exports.CheckboxSetContext = CheckboxSetContext;
52
- exports.useCheckboxSetContext = useCheckboxSetContext;
53
- //# sourceMappingURL=CheckboxSet-abbf7a03.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Legend-743ebb76.js","sources":["../../src/UNSAFE_Legend/legendNavUtils.ts","../../src/UNSAFE_Legend/getLegendLayout.ts","../../src/UNSAFE_Legend/Legend.tsx"],"sourcesContent":["/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport {\n ItemActionDetail,\n ItemFocusDetail,\n ItemHoverDetail,\n ItemInfo,\n LegendItemData\n} from '#utils/UNSAFE_visTypes/legend';\n\nfunction getItem<K, D extends LegendItemData<K>>(itemInfo: ItemInfo, items: D[]) {\n const { itemIdx } = itemInfo;\n\n if (itemIdx == -1) {\n return items[items.length - 1];\n }\n return items[itemIdx];\n}\n\nfunction getNextItemInfo<K>(itemInfo: ItemInfo, items: LegendItemData<K>[]) {\n let itemIdx = itemInfo.itemIdx;\n\n if (itemIdx == -1) {\n itemIdx = items.length - 1;\n }\n\n itemIdx = Math.min(items.length - 1, itemIdx + 1);\n if (items[itemIdx].actionable !== 'off') {\n return { sectionIdx: 0, itemIdx };\n } else if (itemIdx === items.length - 1) {\n itemIdx = itemIdx - 1;\n return { sectionIdx: 0, itemIdx };\n }\n\n return getNextItemInfo({ sectionIdx: 0, itemIdx }, items);\n}\n\nfunction getPrevItemInfo<K>(itemInfo: ItemInfo, items: LegendItemData<K>[]) {\n let itemIdx = itemInfo.itemIdx;\n\n if (itemIdx == -1) {\n itemIdx = items.length - 1;\n }\n\n itemIdx = Math.max(0, itemIdx - 1);\n if (items[itemIdx].actionable !== 'off') {\n return { sectionIdx: 0, itemIdx };\n }\n\n return getPrevItemInfo({ sectionIdx: 0, itemIdx }, items);\n}\n\n/**\n * Returns utils functions for navigation in simple legend.\n * @param items\n * @returns\n */\nexport function getLegendNavUtils<K extends string | number, D extends LegendItemData<K>>(\n items: D[]\n) {\n return {\n getItem: (itemInfo: ItemInfo) => {\n return getItem(itemInfo, items);\n },\n getDetailFromInfo: (\n itemInfo?: ItemInfo\n ): ItemFocusDetail<K, D> | ItemHoverDetail<K, D> | ItemActionDetail<K, D> => {\n if (!itemInfo || items.length === 0) {\n return { itemId: undefined, data: undefined };\n }\n const item = getItem(itemInfo, items);\n return { itemId: item.id, data: item };\n },\n getPrevItemInfo: (itemInfo: ItemInfo) => {\n return getPrevItemInfo(itemInfo, items);\n },\n getNextItemInfo: (itemInfo: ItemInfo) => {\n return getNextItemInfo(itemInfo, items);\n }\n };\n}\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport { LegendItemData } from '#utils/UNSAFE_visTypes/legend';\nimport { Font, TextDimensions, useTextDimensions } from '#hooks/PRIVATE_useTextDimensions';\nimport { getGridNums } from '#utils/PRIVATE_legendUtils/legendUtils';\n\ntype Props<K> = {\n width: number;\n getTextDimensions?: ((textString: string, font?: Font | undefined) => TextDimensions) | undefined;\n resolvedVars: Record<string, any>;\n orientation?: 'vertical' | 'horizontal';\n legendFontStylesObj?: Font;\n symbolWidth?: number;\n symbolHeight?: number;\n items: LegendItemData<K>[];\n};\nexport type LayoutInfo = {\n totalWidth: number;\n maxItemWidth: number;\n maxItemHeight: number;\n itemsPerRow: number;\n isWrapped?: boolean;\n};\ntype getTextDimensionsType = NonNullable<\n NonNullable<ReturnType<typeof useTextDimensions>>['getTextDimensions']\n>;\n\nexport const getLinearLegendLayoutInfo = <K>({\n width,\n getTextDimensions,\n resolvedVars,\n orientation,\n legendFontStylesObj = {},\n symbolWidth,\n items\n}: Props<K>) => {\n let maxWidth = 0;\n let maxHeight = 0;\n let totalWidth = 0;\n let isWrapped = false;\n\n const containerWidth = width;\n\n if (!Object.keys(resolvedVars).length || !getTextDimensions) {\n return;\n }\n\n const unitLength = parseFloat(resolvedVars['unit']);\n\n const { maxItemWidth, maxItemHeight, horizontalSectionWidth } = getMaxWidth(\n items,\n unitLength,\n getTextDimensions,\n legendFontStylesObj,\n symbolWidth\n );\n totalWidth = horizontalSectionWidth;\n maxWidth = maxItemWidth;\n maxHeight = maxItemHeight;\n isWrapped = horizontalSectionWidth > containerWidth!;\n\n const legendLayoutInfo = {\n totalWidth,\n maxItemWidth: Math.min(maxWidth, containerWidth!),\n maxItemHeight: maxHeight,\n itemsPerRow:\n orientation === 'vertical' ? 1 : Math.max(1, Math.floor(containerWidth / maxWidth)),\n isWrapped\n };\n\n return legendLayoutInfo;\n};\n\n/**\n * Returns maximum of the width among the items in a section of legend also return the width of the entire section.\n * @param items Legend items array\n * @param unitLength Base element\n * @param getTextDimensions Text width measurement function\n * @param legendFontStylesObj Legend text font style properties object\n * @param symbolWidth Width of legend symbol\n *\n * @returns\n */\nconst getMaxWidth = <K>(\n items: LegendItemData<K>[],\n unitLength: number,\n getTextDimensions: getTextDimensionsType,\n legendFontStylesObj?: Font,\n symbolWidth?: number,\n symbolHeight?: number\n) => {\n let maxItemWidth = 0;\n let maxItemHeight = 0;\n let horizontalSectionWidth = 0;\n let itemSymbolWidth = 0;\n let itemSymbolHeight = 0;\n if (symbolWidth) {\n itemSymbolWidth = unitLength * 1.5 + symbolWidth;\n } else {\n //itemSymbolWidth = marginLeft + marginRight + width below expression is simplified\n itemSymbolWidth = 4 * unitLength;\n }\n\n if (symbolHeight) {\n // symbolHeight/defaultSymbolHeight + symbolPaddingTopBottom\n itemSymbolHeight = symbolHeight + unitLength * 1.7;\n } else {\n // symbolHeight/defaultSymbolHeight + symbolPaddingTopBottom\n itemSymbolHeight = 2.5 * unitLength + unitLength * 1.7;\n }\n\n items?.forEach((item) => {\n const legendItem = item as LegendItemData<K>;\n const { width, height } = getTextDimensions(legendItem.text, legendFontStylesObj);\n //itemTextWidth = paddingLeft + paddingRight + width\n const itemTextWidth = unitLength * 2.5 + width;\n //horizontalSectionWidth = total width of the section\n horizontalSectionWidth += itemSymbolWidth + itemTextWidth;\n maxItemWidth = Math.max(maxItemWidth, itemSymbolWidth + itemTextWidth);\n maxItemHeight = Math.max(maxItemHeight, height, itemSymbolHeight);\n });\n\n return { maxItemWidth, maxItemHeight, horizontalSectionWidth };\n};\n\nexport function _getPreferredSize<K>(\n _width: number,\n _height: number,\n items: LegendItemData<K>[],\n resolvedVars: Record<string, any>,\n orientation: 'vertical' | 'horizontal',\n legendFontStylesObj: Record<string, any>,\n symbolWidth?: number,\n symbolHeight?: number,\n getTextDimensions?: (textString: string, font?: Font | undefined) => TextDimensions\n) {\n if (!getTextDimensions) {\n return undefined;\n }\n const layoutInfo = getLinearLegendLayoutInfo({\n width: _width,\n getTextDimensions,\n resolvedVars,\n orientation,\n legendFontStylesObj,\n symbolWidth: symbolWidth,\n symbolHeight: symbolHeight,\n items\n });\n const { itemsPerCol, itemsPerRow } = getGridNums(items.length, layoutInfo, orientation);\n const unitLength = parseFloat(resolvedVars['unit']);\n const preferredWidth = Math.min(\n _width,\n itemsPerCol === 1\n ? layoutInfo!.totalWidth\n : itemsPerRow\n ? layoutInfo!.maxItemWidth * itemsPerRow!\n : layoutInfo!.totalWidth\n );\n const paddingLegendItems = 0.8 * unitLength;\n const paddingLegendTopBottom = 1.5 * unitLength;\n\n const legendHeight = itemsPerCol\n ? layoutInfo!.maxItemHeight * itemsPerCol! +\n (itemsPerCol! - 1) * paddingLegendItems +\n paddingLegendTopBottom\n : layoutInfo!.maxItemHeight + paddingLegendTopBottom;\n const preferredHeight = Math.min(_height, legendHeight);\n\n return { width: Math.ceil(preferredWidth), height: Math.ceil(preferredHeight) };\n}\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\nimport { Ref, VNode } from 'preact';\nimport { useContext, useMemo, useRef, useState } from 'preact/hooks';\nimport { BaseLegend } from '#PRIVATE_BaseLegend/BaseLegend';\nimport { useVisEvent } from '#hooks/PRIVATE_useVisEvents/useVisEvents';\nimport { LegendProps, LegendDragStartDetail } from './legend.type';\nimport { getLegendNavUtils } from './legendNavUtils';\nimport {\n getAriaProps,\n getDatatipText,\n getGridNums,\n getIsLegendItemActionable,\n getItemInfo,\n getLegendTextStyle,\n isEqualItem\n} from '#utils/PRIVATE_legendUtils/legendUtils';\nimport { mergeProps } from '#utils/UNSAFE_mergeProps';\nimport { useLegendDatatip } from './useLegendDatatip';\nimport { useItemFocus } from '#hooks/PRIVATE_useVisEvents';\nimport { styles } from '#PRIVATE_BaseLegend/themes/LegendStyles.css';\nimport { useCssVars } from '#hooks/PRIVATE_useCssVars';\nimport { legendVars, getKeyUpHandler } from '#utils/PRIVATE_legendUtils/legendUtils';\nimport { classNames } from '#utils/UNSAFE_classNames';\nimport { useTestId } from '#hooks/UNSAFE_useTestId';\nimport { useLegendContextMenu } from '#PRIVATE_BaseLegend/useLegendContextMenu';\nimport {\n ItemFocusDetail,\n ItemActionDetail,\n ItemInfo,\n LegendItemData\n} from '#utils/UNSAFE_visTypes/legend';\nimport { useVisTouchResponse } from '#hooks/PRIVATE_useVisTouchResponse';\nimport { merge } from '#utils/UNSAFE_stringUtils';\nimport { forwardRef, useImperativeHandle } from 'preact/compat';\nimport { TrackResizeContainer } from '#UNSAFE_TrackResizeContainer';\nimport { useTextDimensions } from '#hooks/PRIVATE_useTextDimensions';\nimport { _getPreferredSize, getLinearLegendLayoutInfo } from './getLegendLayout';\nimport { useLegendDnd } from '#hooks/PRIVATE_useLegendDnD/useLegendDnd';\nimport { styles as VisDndStyles } from '#hooks/PRIVATE_useVisDnd/themes/VisDndStyles.css';\nimport { LegendRenderedContext } from '#hooks/UNSAFE_useLegendPreferredSize';\n\nexport type SizeHandle = {\n _getPreferredSize: (\n _width: number,\n _height: number\n ) => { width: number; height: number } | undefined;\n};\n\ntype ForwardRefLegend = <K extends string | number, D extends LegendItemData<K>>(\n props: LegendProps<K, D> & { ref?: Ref<SizeHandle> }\n) => VNode | null;\n\n/**\n * A legend displays an interactive description of symbols, colors, etc., used in graphical information representations.\n */\nexport const Legend = forwardRef(\n <K extends string | number, D extends LegendItemData<K>>(\n {\n orientation = 'horizontal',\n items,\n isReadOnly = true,\n onItemAction,\n onItemHover,\n onItemFocus,\n testId,\n contextMenuConfig,\n hideAndShowBehavior = 'off',\n hoverBehavior = 'none',\n halign = 'start',\n valign = 'top',\n ...props\n }: LegendProps<K, D>,\n ref: Ref<SizeHandle> = null\n ) => {\n // Use the context\n const { isLegendReady, width, height } = useContext(LegendRenderedContext);\n const { textMeasureContent, getTextDimensions } = useTextDimensions();\n const { resolvedVars, cssContent } = useCssVars(legendVars);\n\n const legendFontStylesObj = getLegendTextStyle(\n {\n fontStyle: props.textFontStyle,\n fontSize: props.textFontSize?.toString(),\n fontWeight: props.textFontWeight?.toString(),\n fontFamily: props.textFontFamily\n },\n resolvedVars\n );\n const rootRef = useRef<HTMLDivElement>(null);\n\n useImperativeHandle(\n ref!,\n () => ({\n _getPreferredSize: (_width: number, _height: number) => {\n return _getPreferredSize(\n _width,\n _height,\n items,\n resolvedVars,\n orientation,\n legendFontStylesObj,\n props.symbolWidth,\n props.symbolHeight,\n getTextDimensions\n );\n }\n }),\n [\n getTextDimensions,\n resolvedVars,\n orientation,\n legendFontStylesObj,\n props.symbolWidth,\n props.symbolHeight,\n items\n ]\n );\n\n if (\n getTextDimensions &&\n resolvedVars['unit'] != undefined &&\n resolvedVars['fontSize'] != undefined\n ) {\n isLegendReady?.(true);\n }\n\n const testIdProps = useTestId(testId);\n const isTestEnv = testIdProps['data-testid'] !== undefined;\n const rootDimsRef = useRef<DOMRect>();\n const { getItem, getDetailFromInfo, getPrevItemInfo, getNextItemInfo } = getLegendNavUtils<\n K,\n D\n >(items);\n\n const isLegendItemActionable = getIsLegendItemActionable(items, isReadOnly);\n const hasData = items.length > 0;\n\n const legendKeyUpHandler = (\n triggerOnAction: () => void,\n updatefocusedItemInfo: (itemInfo: ItemInfo) => void,\n focusedItemInfo: ItemInfo\n ) =>\n getKeyUpHandler(\n triggerOnAction,\n updatefocusedItemInfo,\n focusedItemInfo,\n props.hiddenIds != null\n );\n\n const { touchResponse, touchResponseStyle } = useVisTouchResponse({\n type: 'touchStart'\n });\n const { focusedItemInfo, hoveredItemInfo, onContextMenuDismissed, activeId, eventsProps } =\n useVisEvent<ItemInfo, ItemActionDetail<K, D>, ItemFocusDetail<K, D>, D>(\n touchResponse,\n !isReadOnly,\n isLegendItemActionable,\n legendKeyUpHandler,\n getDetailFromInfo,\n getPrevItemInfo,\n getNextItemInfo,\n onItemAction,\n onItemHover,\n onItemFocus,\n isEqualItem,\n getItemInfo,\n { itemIdx: 0, sectionIdx: 0 },\n props.hiddenIds != null\n );\n\n const { focusedItemRef } = useItemFocus(focusedItemInfo);\n const datatipText = getDatatipText(items, getItem, focusedItemInfo, hoveredItemInfo);\n const [datatipDisabled, setDatatipDisabled] = useState(false);\n const {\n datatipContent,\n datatipProps: { 'aria-describedby': datatipAriaDescribedby, ...datatipProps }\n } = useLegendDatatip({\n text: datatipText,\n rootDimsRef,\n focusedItemInfo,\n focusedItemRef,\n touchResponse,\n isDisabled: datatipDisabled\n });\n\n const ariaProps = getAriaProps<K>(\n isReadOnly,\n props['aria-label'],\n props.hiddenIds,\n merge([props['aria-describedby'], datatipAriaDescribedby]),\n props['aria-labelledby']\n );\n\n const { contextMenuContent, contextMenuProps } = useLegendContextMenu<D>({\n rootRef,\n contextMenuConfig: hasData ? contextMenuConfig : undefined,\n focusedItemInfo,\n items,\n isReadOnly,\n onContextMenuDismissed\n });\n\n const [dragOver, setDragOver] = useState<boolean>();\n\n const { draggable, dndProps, dndContent } = useLegendDnd<K, D, LegendDragStartDetail<D>>({\n onDrag: props.onDrag,\n onDragStart: props.onDragStart,\n onDragEnd: props.onDragEnd,\n onDragEnter: props.onDragEnter,\n onDragLeave: props.onDragLeave,\n onDragOver: props.onDragOver,\n onDrop: props.onDrop,\n items,\n setDragOver,\n setDatatipDisabled,\n itemDraggable: props.itemDraggable\n });\n\n const mergedProps = mergeProps(eventsProps, datatipProps, contextMenuProps, dndProps);\n const { legendStyle, renderedLegendStyle } = styles;\n\n return (\n <>\n {!isLegendReady && (\n <TrackResizeContainer\n width={width ? `${width}px` : '100%'}\n height={height ? `${height}px` : '100%'}\n class={classNames([\n styles.flexStyle,\n styles[`${halign}HAlign`],\n styles[`${valign}VAlign`]\n ])}>\n {function _(width) {\n const layoutInfo = useMemo(\n () =>\n getLinearLegendLayoutInfo<K>({\n width,\n getTextDimensions,\n resolvedVars,\n orientation,\n legendFontStylesObj,\n symbolWidth: props.symbolWidth,\n symbolHeight: props.symbolHeight,\n items\n }),\n [width]\n );\n const { itemsPerCol, itemsPerRow } = getGridNums(items.length, layoutInfo);\n return (\n <>\n <div\n ref={rootRef}\n tabIndex={isReadOnly ? undefined : 0}\n role=\"application\"\n draggable={draggable}\n class={classNames([\n legendStyle,\n renderedLegendStyle,\n dragOver\n ? VisDndStyles.dndDragOverHTMLStyle\n : dragOver === false\n ? VisDndStyles.dndRejectedStyle\n : undefined\n ])}\n style={touchResponseStyle}\n {...testIdProps}\n {...ariaProps}\n {...mergedProps}\n aria-activedescendant={activeId}>\n <BaseLegend\n {...props}\n focusedItemRef={focusedItemRef}\n items={items}\n isReadOnly={isReadOnly}\n orientation={orientation}\n sectionIdx={0}\n itemsPerRow={itemsPerRow}\n itemsPerCol={itemsPerCol}\n itemWidth={layoutInfo?.isWrapped ? layoutInfo?.maxItemWidth : undefined}\n focusedItemInfo={focusedItemInfo}\n hoveredItemInfo={hoveredItemInfo}\n activeId={activeId}\n hideAndShowBehavior={hideAndShowBehavior}\n hoverBehavior={hoverBehavior}\n isTestEnv={isTestEnv}\n />\n </div>\n {datatipContent}\n {contextMenuContent}\n {dndContent}\n </>\n );\n }}\n </TrackResizeContainer>\n )}\n {textMeasureContent}\n {cssContent}\n </>\n );\n }\n) as ForwardRefLegend;\n"],"names":["getGridNums","forwardRef","useContext","LegendRenderedContext","useTextDimensions","useCssVars","legendVars","getLegendTextStyle","useRef","useImperativeHandle","useTestId","getIsLegendItemActionable","getKeyUpHandler","useVisTouchResponse","useVisEvent","isEqualItem","getItemInfo","useItemFocus","getDatatipText","useState","useLegendDatatip","getAriaProps","merge","useLegendContextMenu","useLegendDnd","mergeProps","styles","_jsxs","_Fragment","_jsx","TrackResizeContainer","classNames","useMemo","VisDndStyles","BaseLegend"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;AAMG;AAUH,SAAS,OAAO,CAAiC,QAAkB,EAAE,KAAU,EAAA;AAC7E,IAAA,MAAM,EAAE,OAAO,EAAE,GAAG,QAAQ,CAAC;AAE7B,IAAA,IAAI,OAAO,IAAI,CAAC,CAAC,EAAE;QACjB,OAAO,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;KAChC;AACD,IAAA,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC;AACxB,CAAC;AAED,SAAS,eAAe,CAAI,QAAkB,EAAE,KAA0B,EAAA;AACxE,IAAA,IAAI,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC;AAE/B,IAAA,IAAI,OAAO,IAAI,CAAC,CAAC,EAAE;AACjB,QAAA,OAAO,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;KAC5B;AAED,IAAA,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,CAAC;IAClD,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,UAAU,KAAK,KAAK,EAAE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QAAQ,EAAA,QAAA,EAC/BJ,eAACK,+BAAU,EAAA,EAAA,GACL,KAAK,EACT,cAAc,EAAE,cAAc,EAC9B,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,CAAC,EACb,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,UAAU,EAAE,SAAS,GAAG,UAAU,EAAE,YAAY,GAAG,SAAS,EACvE,eAAe,EAAE,eAAe,EAChC,eAAe,EAAE,eAAe,EAChC,QAAQ,EAAE,QAAQ,EAClB,mBAAmB,EAAE,mBAAmB,EACxC,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,SAAS,EACpB,CAAA,EAAA,CACE,EACL,cAAc,EACd,kBAAkB,EAClB,UAAU,CACV,EAAA,CAAA,EACH;iBACH,EAAA,CACoB,CACxB,EACA,kBAAkB,EAClB,UAAU,CAAA,EAAA,CACV,EACH;AACJ,CAAC;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"TextArea-f4a84aab.js","sources":["../../src/UNSAFE_TextArea/MaxLengthCounter.tsx","../../src/UNSAFE_TextArea/TextArea.tsx"],"sourcesContent":["import { useCallback } from 'preact/hooks';\n\nimport { classNames } from '../utils/UNSAFE_classNames';\nimport { usePress } from '../hooks/UNSAFE_usePress';\nimport { useFormFieldContext } from '../hooks/UNSAFE_useFormFieldContext';\nimport { hide, maxLengthCounterBase, spanStyles } from './MaxLengthCounterStyles.css';\n\ntype Props = {\n maxLength: number;\n valueLength?: number;\n onClick?: () => void; // the calling component should focus on the appropriate element when clicked.\n};\n\nconst noop = () => {};\n\nexport function MaxLengthCounter({ maxLength, valueLength = 0, onClick }: Props) {\n const { isFocused } = useFormFieldContext();\n // We don't want mousedown on this component to do anything, so prevent the default behavior.\n const killEvent = useCallback((event: Event) => event.preventDefault(), []);\n const textClasses = classNames([!isFocused && hide]);\n const { pressProps } = usePress(onClick ?? noop);\n return (\n <div class={maxLengthCounterBase} onMouseDown={killEvent} {...pressProps}>\n <span class={textClasses}>\n <span class={spanStyles}>{valueLength}</span>\n <span class={spanStyles}>/</span>\n <span class={spanStyles}>{maxLength}</span>\n </span>\n </div>\n );\n}\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport { ComponentProps, Ref } from 'preact';\nimport { forwardRef, useCallback, useImperativeHandle, useRef } from 'preact/compat';\nimport { useFormContext } from '../hooks/UNSAFE_useFormContext';\nimport { FormFieldContext } from '../hooks/UNSAFE_useFormFieldContext';\nimport { FocusableHandle, useFocusableTextField } from '../hooks/UNSAFE_useFocusableTextField';\nimport { Label } from '../UNSAFE_Label';\nimport {\n ReadonlyTextField,\n ReadonlyTextFieldInput,\n TextField,\n TextFieldInput\n} from '../UNSAFE_TextField';\nimport { useTextField } from '../hooks/UNSAFE_useTextField';\nimport {\n CompactUserAssistance,\n InlineUserAssistance,\n UserAssistanceDensityType\n} from '../UNSAFE_UserAssistance';\nimport { CountUnit, useLengthFilter } from '../hooks/UNSAFE_useLengthFilter';\nimport { MaxLengthLiveRegion } from '../UNSAFE_TextField';\nimport { MaxLengthCounter } from './MaxLengthCounter';\nimport { Size } from '../utils/UNSAFE_size';\nimport { useCurrentValueReducer } from '../hooks/UNSAFE_useCurrentValueReducer';\nimport { ValueUpdateDetail } from '../utils/UNSAFE_valueUpdateDetail';\nimport { ComponentMessageItem } from '../UNSAFE_ComponentMessage';\nimport { useTranslationBundle } from '../hooks/UNSAFE_useTranslationBundle';\nimport { BundleType } from '../resources/nls/bundle';\nimport { LayoutColumnSpan } from '../utils/UNSAFE_styles/Layout';\nimport type { TestIdProps } from '#hooks/UNSAFE_useTestId';\nimport { HiddenAccessible } from '../UNSAFE_HiddenAccessible';\nimport { useId } from '../hooks/UNSAFE_useId';\nimport { SelectableHandle, useSelectableTextField } from '#hooks/UNSAFE_useSelectableTextField';\nimport { mergeProps } from '#utils/UNSAFE_mergeProps';\n\ntype TextFieldProps = ComponentProps<typeof TextField>;\ntype TextFieldInputProps = ComponentProps<typeof TextFieldInput>;\ntype InlineUserAssistanceProps = ComponentProps<typeof InlineUserAssistance>;\n\ntype Props = TestIdProps & {\n /**\n * The ID of an element (or space separated IDs of multiple elements) that\n * describes the input.\n */\n 'aria-describedby'?: TextFieldInputProps['aria-describedby'];\n\n /**\n * Text to provide guidance to help the user understand what to enter.\n */\n assistiveText?: InlineUserAssistanceProps['assistiveText'];\n /**\n * Dictates component's autocomplete state.\n * This attribute indicates whether the value of the control can be automatically completed by the browser.\n * The common values are \"on\" and \"off\".\n */\n autoComplete?: TextFieldInputProps['autoComplete'];\n /**\n * Autofocus specifies whether the component will get focus when the page is loaded.\n * If it is set to true then the associated component will get input focus when the page is loaded.\n * Setting this property doesn't set the focus to the component; it tells the browser to focus\n * to it when the element is inserted in the document.\n */\n autoFocus?: TextFieldInputProps['autoFocus'];\n /**\n * Specifies how many columns to span in a FormLayout with direction === 'row'\n */\n columnSpan?: LayoutColumnSpan;\n /**\n * Help source URL associated with the component.\n */\n helpSourceLink?: InlineUserAssistanceProps['helpSourceLink'];\n /**\n * Custom text to be rendered for the <code>helpSourceLink</code>.\n */\n helpSourceText?: InlineUserAssistanceProps['helpSourceText'];\n /**\n * Specifies whether the component is disabled.\n */\n isDisabled?: boolean;\n /**\n * Specifies whether the component is readonly.\n */\n isReadonly?: boolean;\n /**\n * Specifies for accessibility purposes whether a value is required.\n *\n * Setting this property to <code>false</code> means that a value is not required to be\n * committed by the user. Setting this property to <code>true</code> means that a value\n * is required to be committed by the user.\n */\n isRequired?: TextFieldInputProps['isRequired'];\n /**\n * Specifies whether to show an indicator on screen that a value is required, for example\n * before the user has committed a value.\n */\n isRequiredShown?: InlineUserAssistanceProps['isRequiredShown'];\n /**\n * Specifies the label associated with the field.\n */\n label: string;\n /**\n * Specifies where the label is positioned relative to the field.\n */\n labelEdge?: 'inside' | 'start' | 'top' | 'none';\n /**\n * Specifies the width of the label when <code>labelEdge</code> is <code>\"start\"</code>\n */\n labelStartWidth?: Size;\n /**\n * Specifies the maximum number of characters that can be entered in the input field.\n */\n maxLength?: number;\n /**\n * Determines whether the remaining number of characters that can be entered is shown or not.\n */\n maxLengthCounter?: 'none' | 'remaining';\n /**\n * Specifies how the input text characters are to be counted when maxLength is specified.\n */\n maxLengthUnit?: CountUnit;\n /**\n * Messages to show on screen that are associated with the component.\n */\n messages?: InlineUserAssistanceProps['messages'];\n /**\n * A short hint to display before the user enters a value.\n */\n placeholder?: TextFieldInputProps['placeholder'];\n /**\n * Specifies how the user is allowed to manually resize the TextArea component.\n */\n resize?: TextFieldProps['resize'];\n /**\n * Specifies the ARIA role type.\n */\n role?: TextFieldInputProps['role'];\n /**\n * Specifies the number of rows to display\n */\n rows?: TextFieldInputProps['rows'];\n /**\n * Specifies how to align text within the field.\n */\n textAlign?: TextFieldInputProps['textAlign'];\n /**\n * Specifies the density of the user assistance presentation. It can be set to:\n * <ul>\n * <li><code>'efficient'</code>: Show inline and reserve space to prevent layout reflow when user\n * assistance text is displayed.</li>\n * <li><code>'reflow'</code>: Show inline. Layout will reflow when text is displayed.</li>\n * <li><code>'compact'</code>: Messages, help, hints, and required will not be shown inline; they will show in a mode that keeps the screen more compact, like a popup for the messages, and a required icon to indicate Required. </li>\n * </ul>\n */\n userAssistanceDensity?: UserAssistanceDensityType;\n /**\n * The current display value of the component.\n */\n value?: TextFieldInputProps['value'];\n /**\n * The style variant of the component.\n */\n variant?: TextFieldInputProps['variant'];\n /**\n * Callback invoked when the user commits the entered value by blurring out of the field.\n */\n onCommit?: TextFieldInputProps['onCommit'];\n /**\n * Callback invoked each time the user changes the value of the field. For example, if the user\n * types 'abcd', this callback will be called four times with the value as 'a', 'ab', 'abc' and 'abcd'\n * respectively.\n */\n onInput: TextFieldInputProps['onInput'];\n};\n\ntype FocusSelectHandle = FocusableHandle & SelectableHandle;\n\n/**\n * A text area displays a field that allows a user to enter a multi-line text value.\n */\nexport const TextArea = forwardRef(\n (\n {\n 'aria-describedby': ariaDescribedBy,\n assistiveText,\n autoComplete = 'off',\n autoFocus = false,\n columnSpan,\n helpSourceLink,\n helpSourceText,\n isDisabled: propIsDisabled,\n isReadonly: propIsReadonly,\n isRequired = false,\n isRequiredShown,\n label,\n labelEdge: propLabelEdge,\n labelStartWidth: propLabelStartWidth,\n maxLength,\n maxLengthCounter = 'remaining',\n maxLengthUnit,\n messages,\n placeholder,\n resize,\n role,\n rows,\n textAlign: propTextAlign,\n userAssistanceDensity: propUserAssistanceDensity,\n value,\n variant = 'default',\n onInput,\n onCommit,\n testId\n }: Props,\n ref?: Ref<FocusSelectHandle>\n ) => {\n const translations = useTranslationBundle<BundleType>('@oracle/oraclejet-preact');\n const formControl_limitReached = maxLength\n ? translations.formControl_limitReached({\n CHARACTER_LIMIT: maxLength\n })\n : '';\n\n const { currentCommitValue, dispatch } = useCurrentValueReducer({ value });\n const onInputAndDispatch = useCallback(\n (detail: ValueUpdateDetail<string>) => {\n // Should dispatch happen first? This will queue up a re-render, ordering should not cause issues (this is async)\n dispatch({ type: 'input', payload: detail.value });\n onInput?.(detail);\n },\n [onInput, dispatch]\n );\n const onCommitAndDispatch = useCallback(\n (detail: ValueUpdateDetail<string>) => {\n // Should dispatch happen first? This will queue up a re-render, ordering should not cause issues (this is async)\n dispatch({ type: 'commit', payload: detail.value });\n onCommit?.(detail);\n },\n [onCommit, dispatch]\n );\n const {\n isDisabled: isFormDisabled,\n isReadonly: isFormReadonly,\n labelEdge: formLabelEdge,\n labelStartWidth: formLabelStartWidth,\n textAlign: formTextAlign,\n userAssistanceDensity: formUserAssistanceDensity\n } = useFormContext();\n\n // default to FormContext values if component properties are not specified\n const isDisabled = propIsDisabled ?? isFormDisabled;\n const isReadonly = propIsReadonly ?? isFormReadonly;\n const labelEdge = propLabelEdge ?? formLabelEdge;\n const labelStartWidth = propLabelStartWidth ?? formLabelStartWidth;\n const textAlign = propTextAlign ?? formTextAlign;\n const userAssistanceDensity = propUserAssistanceDensity ?? formUserAssistanceDensity;\n const maxLengthDescribedByIdRef = useRef<string>(useId());\n // The enabledAriaDescribedBy includes the maxLengthDescribedById in addition to what was passed in to aria-describedby.\n // We don't need to announce the max length message for readonly, as it only applies when editing the value.\n const enabledAriaDescribedBy = ariaDescribedBy\n ? `${ariaDescribedBy} ${maxLengthDescribedByIdRef.current}`\n : maxLengthDescribedByIdRef.current;\n\n const enabledElementRef = useRef<HTMLTextAreaElement>(null);\n const readonlyElementRef = useRef<HTMLTextAreaElement>(null);\n\n const {\n focusProps,\n isFocused,\n methods: focusMethods\n } = useFocusableTextField<HTMLTextAreaElement, HTMLTextAreaElement>({\n isDisabled,\n isReadonly,\n enabledElementRef,\n readonlyElementRef\n });\n\n const { methods: selectMethods } =\n useSelectableTextField<HTMLTextAreaElement>(enabledElementRef);\n\n useImperativeHandle(ref!, () => mergeProps(focusMethods, selectMethods), [\n focusMethods,\n selectMethods\n ]);\n\n // Handle length filter for user-typed inputs and controlled inputs\n const { isMaxLengthReached, valueLength, onFilteredInput } = useLengthFilter({\n maxLength,\n maxLengthUnit,\n value,\n onInput: onInputAndDispatch,\n onCommit: onCommitAndDispatch\n });\n\n const limitMessage = [{ detail: formControl_limitReached, severity: 'info' }];\n const allMessages = [\n ...(messages ?? []),\n ...(isMaxLengthReached ? limitMessage : [])\n ] as ComponentMessageItem[];\n\n const { formFieldContext, inputProps, labelProps, textFieldProps, userAssistanceProps } =\n useTextField({\n ariaDescribedBy: isReadonly || isDisabled ? ariaDescribedBy : enabledAriaDescribedBy,\n contentVariant: 'textarea',\n helpSourceLink,\n helpSourceText,\n isDisabled,\n isFocused,\n isReadonly,\n isRequiredShown,\n labelEdge,\n messages: allMessages,\n styleVariant: variant,\n userAssistanceDensity,\n value\n });\n\n const onClickCounter = useCallback(() => {\n const elm = enabledElementRef.current;\n // for setSelectionRange(), len needs to be a number or null.\n const len = elm ? elm.value.length : null;\n // Since the counter element is after the text, clicking in this\n // should put the selection at the end of the text\n enabledElementRef.current?.setSelectionRange(len, len);\n // Clicking the counter should put the focus on the input field\n enabledElementRef.current?.focus();\n }, [enabledElementRef]);\n\n const labelComp = labelEdge !== 'none' ? <Label {...labelProps}>{label}</Label> : undefined;\n\n const fieldLabelProps = {\n label: labelEdge !== 'none' ? labelComp : undefined,\n labelEdge: labelEdge !== 'none' ? labelEdge : undefined,\n labelStartWidth: labelEdge !== 'none' ? labelStartWidth : undefined\n };\n\n const ariaLabel = labelEdge === 'none' ? label : undefined;\n const isInlineDensity =\n userAssistanceDensity === 'efficient' || userAssistanceDensity === 'reflow';\n\n const inlineUserAssistance = isInlineDensity ? (\n isDisabled || isReadonly ? (\n // save space for user assistance if density is 'efficient', even though we don't\n // render user assistance for disabled or readonly fields\n userAssistanceDensity !== 'efficient' ? undefined : (\n <InlineUserAssistance\n userAssistanceDensity={userAssistanceDensity}\n {...userAssistanceProps}\n />\n )\n ) : (\n <InlineUserAssistance\n assistiveText={assistiveText}\n fieldLabel={label}\n helpSourceLink={helpSourceLink}\n helpSourceText={helpSourceText}\n messages={allMessages}\n isRequiredShown={isRequiredShown}\n userAssistanceDensity={userAssistanceDensity}\n {...userAssistanceProps}\n />\n )\n ) : undefined;\n\n const anchorRef = useRef<HTMLDivElement>(null);\n\n const compactUserAssistance =\n userAssistanceDensity === 'compact' ? (\n <CompactUserAssistance\n anchorRef={anchorRef}\n messages={allMessages}\n assistiveText={assistiveText}\n {...userAssistanceProps}\n />\n ) : undefined;\n\n if (isReadonly) {\n const mainContent = (\n <ReadonlyTextFieldInput\n aria-describedby={inputProps['aria-describedby']}\n aria-label={ariaLabel}\n aria-labelledby={labelProps.id}\n as=\"textarea\"\n elementRef={readonlyElementRef}\n rows={rows}\n autoFocus={autoFocus}\n textAlign={textAlign}\n value={value}\n variant=\"textarea\"\n hasEmptyLabel={label === '' && labelEdge === 'none'}\n hasInsideLabel={label !== undefined && labelEdge === 'inside'}\n />\n );\n return (\n <FormFieldContext.Provider value={formFieldContext}>\n <ReadonlyTextField\n role=\"presentation\"\n columnSpan={columnSpan}\n compactUserAssistance={compactUserAssistance}\n inlineUserAssistance={inlineUserAssistance}\n ref={anchorRef}\n testId={testId}\n variant=\"textarea\"\n mainContent={mainContent}\n resize={resize}\n {...fieldLabelProps}\n />\n </FormFieldContext.Provider>\n );\n }\n const hasMaxLength = maxLength !== undefined;\n const mainContent = (\n <>\n <TextFieldInput\n as=\"textarea\"\n aria-label={ariaLabel}\n autoComplete={autoComplete}\n autoFocus={autoFocus}\n currentCommitValue={currentCommitValue}\n hasEmptyLabel={label === '' && labelEdge === 'none'}\n hasInsideLabel={labelComp !== undefined && labelEdge === 'inside'}\n isRequired={isRequired}\n inputRef={enabledElementRef}\n onCommit={onCommitAndDispatch}\n onInput={onFilteredInput}\n placeholder={placeholder}\n role={role}\n rows={rows}\n textAlign={textAlign}\n value={value}\n {...inputProps}\n />\n {maxLengthCounter === 'remaining' && hasMaxLength && (\n <MaxLengthCounter\n maxLength={maxLength}\n valueLength={valueLength}\n onClick={onClickCounter}\n />\n )}\n {hasMaxLength && (\n <HiddenAccessible id={maxLengthDescribedByIdRef.current} isHidden={true}>\n {translations.formControl_maxLength({\n MAX_LENGTH: `${maxLength}`\n })}\n </HiddenAccessible>\n )}\n {hasMaxLength && isFocused && (\n <MaxLengthLiveRegion\n maxLength={maxLength}\n valueLength={valueLength}\n testId={testId + '_remainingChars'}\n />\n )}\n </>\n );\n\n return (\n <FormFieldContext.Provider value={formFieldContext}>\n <TextField\n mainContent={mainContent}\n columnSpan={columnSpan}\n compactUserAssistance={compactUserAssistance}\n inlineUserAssistance={inlineUserAssistance}\n onBlur={focusProps?.onFocusOut}\n onFocus={focusProps?.onFocusIn}\n mainFieldRef={anchorRef}\n resize={resize}\n testId={testId}\n {...textFieldProps}\n {...fieldLabelProps}></TextField>\n </FormFieldContext.Provider>\n );\n }\n);\n"],"names":["useFormFieldContext","useCallback","classNames","usePress","_jsx","_jsxs","forwardRef","useTranslationBundle","useCurrentValueReducer","useFormContext","useRef","useId","useFocusableTextField","useSelectableTextField","useImperativeHandle","mergeProps","useLengthFilter","useTextField","Label","InlineUserAssistance","CompactUserAssistance","ReadonlyTextFieldInput","FormFieldContext","ReadonlyTextField","_Fragment","TextFieldInput","HiddenAccessible","MaxLengthLiveRegion","TextField"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA,MAAM,IAAI,GAAG,MAAK,GAAG,CAAC;AAEhB,SAAU,gBAAgB,CAAC,EAAE,SAAS,EAAE,WAAW,GAAG,CAAC,EAAE,OAAO,EAAS,EAAA;AAC7E,IAAA,MAAM,EAAE,SAAS,EAAE,GAAGA,uCAAmB,EAAE,CAAC;;AAE5C,IAAA,MAAM,SAAS,GAAGC,iBAAW,CAAC,CAAC,KAAY,KAAK,KAAK,CAAC,cAAc,EAAE,EAAE,EAAE,CAAC,CAAC;IAC5E,MAAM,WAAW,GAAGC,qBAAU,CAAC,CAAC,CAAC,SAAS,IAAI,IAAI,CAAC,CAAC,CAAC;IACrD,MAAM,EAAE,UAAU,EAAE,GAAGC,iBAAQ,CAAC,OAAO,IAAI,IAAI,CAAC,CAAC;AACjD,IAAA,QACEC,cAAK,CAAA,KAAA,EAAA,EAAA,KAAK,EAAE,oBAAoB,EAAE,WAAW,EAAE,SAAS,EAAM,GAAA,UAAU,YACtEC,eAAM,CAAA,MAAA,EAAA,EAAA,KAAK,EAAE,WAAW,EAAA,QAAA,EAAA,CACtBD,yBAAM,KAAK,EAAE,UAAU,EAAA,QAAA,EAAG,WAAW,EAAQ,CAAA,EAC7CA,yBAAM,KAAK,EAAE,UAAU,EAAU,QAAA,EAAA,GAAA,EAAA,CAAA,EACjCA,yBAAM,KAAK,EAAE,UAAU,EAAG,QAAA,EAAA,SAAS,GAAQ,CACtC,EAAA,CAAA,EAAA,CACH,EACN;AAC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,EAAC,EAAA,KAAK,EAAE,gBAAgB,EAChD,QAAA,EAAAlB,cAAA,CAACwB,mBAAS,EAAA,EACR,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,qBAAqB,EAAE,qBAAqB,EAC5C,oBAAoB,EAAE,oBAAoB,EAC1C,MAAM,EAAE,UAAU,EAAE,UAAU,EAC9B,OAAO,EAAE,UAAU,EAAE,SAAS,EAC9B,YAAY,EAAE,SAAS,EACvB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EAAA,GACV,cAAc,EAAA,GACd,eAAe,EAAA,CAAc,EACT,CAAA,EAC5B;AACJ,CAAC;;;;;"}
@@ -1,9 +0,0 @@
1
- /* @oracle/oraclejet-preact: undefined */
2
- import { createContext } from 'preact';
3
- import { useContext } from 'preact/hooks';
4
-
5
- const CheckboxSetContext = createContext({});
6
- const useCheckboxSetContext = () => useContext(CheckboxSetContext);
7
-
8
- export { CheckboxSetContext as C, useCheckboxSetContext as u };
9
- //# sourceMappingURL=CheckboxSetContext-1be56556.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Legend-a60126aa.js","sources":["../../src/UNSAFE_Legend/legendNavUtils.ts","../../src/UNSAFE_Legend/getLegendLayout.ts","../../src/UNSAFE_Legend/Legend.tsx"],"sourcesContent":["/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport {\n ItemActionDetail,\n ItemFocusDetail,\n ItemHoverDetail,\n ItemInfo,\n LegendItemData\n} from '#utils/UNSAFE_visTypes/legend';\n\nfunction getItem<K, D extends LegendItemData<K>>(itemInfo: ItemInfo, items: D[]) {\n const { itemIdx } = itemInfo;\n\n if (itemIdx == -1) {\n return items[items.length - 1];\n }\n return items[itemIdx];\n}\n\nfunction getNextItemInfo<K>(itemInfo: ItemInfo, items: LegendItemData<K>[]) {\n let itemIdx = itemInfo.itemIdx;\n\n if (itemIdx == -1) {\n itemIdx = items.length - 1;\n }\n\n itemIdx = Math.min(items.length - 1, itemIdx + 1);\n if (items[itemIdx].actionable !== 'off') {\n return { sectionIdx: 0, itemIdx };\n } else if (itemIdx === items.length - 1) {\n itemIdx = itemIdx - 1;\n return { sectionIdx: 0, itemIdx };\n }\n\n return getNextItemInfo({ sectionIdx: 0, itemIdx }, items);\n}\n\nfunction getPrevItemInfo<K>(itemInfo: ItemInfo, items: LegendItemData<K>[]) {\n let itemIdx = itemInfo.itemIdx;\n\n if (itemIdx == -1) {\n itemIdx = items.length - 1;\n }\n\n itemIdx = Math.max(0, itemIdx - 1);\n if (items[itemIdx].actionable !== 'off') {\n return { sectionIdx: 0, itemIdx };\n }\n\n return getPrevItemInfo({ sectionIdx: 0, itemIdx }, items);\n}\n\n/**\n * Returns utils functions for navigation in simple legend.\n * @param items\n * @returns\n */\nexport function getLegendNavUtils<K extends string | number, D extends LegendItemData<K>>(\n items: D[]\n) {\n return {\n getItem: (itemInfo: ItemInfo) => {\n return getItem(itemInfo, items);\n },\n getDetailFromInfo: (\n itemInfo?: ItemInfo\n ): ItemFocusDetail<K, D> | ItemHoverDetail<K, D> | ItemActionDetail<K, D> => {\n if (!itemInfo || items.length === 0) {\n return { itemId: undefined, data: undefined };\n }\n const item = getItem(itemInfo, items);\n return { itemId: item.id, data: item };\n },\n getPrevItemInfo: (itemInfo: ItemInfo) => {\n return getPrevItemInfo(itemInfo, items);\n },\n getNextItemInfo: (itemInfo: ItemInfo) => {\n return getNextItemInfo(itemInfo, items);\n }\n };\n}\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\n\nimport { LegendItemData } from '#utils/UNSAFE_visTypes/legend';\nimport { Font, TextDimensions, useTextDimensions } from '#hooks/PRIVATE_useTextDimensions';\nimport { getGridNums } from '#utils/PRIVATE_legendUtils/legendUtils';\n\ntype Props<K> = {\n width: number;\n getTextDimensions?: ((textString: string, font?: Font | undefined) => TextDimensions) | undefined;\n resolvedVars: Record<string, any>;\n orientation?: 'vertical' | 'horizontal';\n legendFontStylesObj?: Font;\n symbolWidth?: number;\n symbolHeight?: number;\n items: LegendItemData<K>[];\n};\nexport type LayoutInfo = {\n totalWidth: number;\n maxItemWidth: number;\n maxItemHeight: number;\n itemsPerRow: number;\n isWrapped?: boolean;\n};\ntype getTextDimensionsType = NonNullable<\n NonNullable<ReturnType<typeof useTextDimensions>>['getTextDimensions']\n>;\n\nexport const getLinearLegendLayoutInfo = <K>({\n width,\n getTextDimensions,\n resolvedVars,\n orientation,\n legendFontStylesObj = {},\n symbolWidth,\n items\n}: Props<K>) => {\n let maxWidth = 0;\n let maxHeight = 0;\n let totalWidth = 0;\n let isWrapped = false;\n\n const containerWidth = width;\n\n if (!Object.keys(resolvedVars).length || !getTextDimensions) {\n return;\n }\n\n const unitLength = parseFloat(resolvedVars['unit']);\n\n const { maxItemWidth, maxItemHeight, horizontalSectionWidth } = getMaxWidth(\n items,\n unitLength,\n getTextDimensions,\n legendFontStylesObj,\n symbolWidth\n );\n totalWidth = horizontalSectionWidth;\n maxWidth = maxItemWidth;\n maxHeight = maxItemHeight;\n isWrapped = horizontalSectionWidth > containerWidth!;\n\n const legendLayoutInfo = {\n totalWidth,\n maxItemWidth: Math.min(maxWidth, containerWidth!),\n maxItemHeight: maxHeight,\n itemsPerRow:\n orientation === 'vertical' ? 1 : Math.max(1, Math.floor(containerWidth / maxWidth)),\n isWrapped\n };\n\n return legendLayoutInfo;\n};\n\n/**\n * Returns maximum of the width among the items in a section of legend also return the width of the entire section.\n * @param items Legend items array\n * @param unitLength Base element\n * @param getTextDimensions Text width measurement function\n * @param legendFontStylesObj Legend text font style properties object\n * @param symbolWidth Width of legend symbol\n *\n * @returns\n */\nconst getMaxWidth = <K>(\n items: LegendItemData<K>[],\n unitLength: number,\n getTextDimensions: getTextDimensionsType,\n legendFontStylesObj?: Font,\n symbolWidth?: number,\n symbolHeight?: number\n) => {\n let maxItemWidth = 0;\n let maxItemHeight = 0;\n let horizontalSectionWidth = 0;\n let itemSymbolWidth = 0;\n let itemSymbolHeight = 0;\n if (symbolWidth) {\n itemSymbolWidth = unitLength * 1.5 + symbolWidth;\n } else {\n //itemSymbolWidth = marginLeft + marginRight + width below expression is simplified\n itemSymbolWidth = 4 * unitLength;\n }\n\n if (symbolHeight) {\n // symbolHeight/defaultSymbolHeight + symbolPaddingTopBottom\n itemSymbolHeight = symbolHeight + unitLength * 1.7;\n } else {\n // symbolHeight/defaultSymbolHeight + symbolPaddingTopBottom\n itemSymbolHeight = 2.5 * unitLength + unitLength * 1.7;\n }\n\n items?.forEach((item) => {\n const legendItem = item as LegendItemData<K>;\n const { width, height } = getTextDimensions(legendItem.text, legendFontStylesObj);\n //itemTextWidth = paddingLeft + paddingRight + width\n const itemTextWidth = unitLength * 2.5 + width;\n //horizontalSectionWidth = total width of the section\n horizontalSectionWidth += itemSymbolWidth + itemTextWidth;\n maxItemWidth = Math.max(maxItemWidth, itemSymbolWidth + itemTextWidth);\n maxItemHeight = Math.max(maxItemHeight, height, itemSymbolHeight);\n });\n\n return { maxItemWidth, maxItemHeight, horizontalSectionWidth };\n};\n\nexport function _getPreferredSize<K>(\n _width: number,\n _height: number,\n items: LegendItemData<K>[],\n resolvedVars: Record<string, any>,\n orientation: 'vertical' | 'horizontal',\n legendFontStylesObj: Record<string, any>,\n symbolWidth?: number,\n symbolHeight?: number,\n getTextDimensions?: (textString: string, font?: Font | undefined) => TextDimensions\n) {\n if (!getTextDimensions) {\n return undefined;\n }\n const layoutInfo = getLinearLegendLayoutInfo({\n width: _width,\n getTextDimensions,\n resolvedVars,\n orientation,\n legendFontStylesObj,\n symbolWidth: symbolWidth,\n symbolHeight: symbolHeight,\n items\n });\n const { itemsPerCol, itemsPerRow } = getGridNums(items.length, layoutInfo, orientation);\n const unitLength = parseFloat(resolvedVars['unit']);\n const preferredWidth = Math.min(\n _width,\n itemsPerCol === 1\n ? layoutInfo!.totalWidth\n : itemsPerRow\n ? layoutInfo!.maxItemWidth * itemsPerRow!\n : layoutInfo!.totalWidth\n );\n const paddingLegendItems = 0.8 * unitLength;\n const paddingLegendTopBottom = 1.5 * unitLength;\n\n const legendHeight = itemsPerCol\n ? layoutInfo!.maxItemHeight * itemsPerCol! +\n (itemsPerCol! - 1) * paddingLegendItems +\n paddingLegendTopBottom\n : layoutInfo!.maxItemHeight + paddingLegendTopBottom;\n const preferredHeight = Math.min(_height, legendHeight);\n\n return { width: Math.ceil(preferredWidth), height: Math.ceil(preferredHeight) };\n}\n","/**\n * @license\n * Copyright (c) %FIRST_YEAR% %CURRENT_YEAR%, Oracle and/or its affiliates.\n * The Universal Permissive License (UPL), Version 1.0\n * as shown at https://oss.oracle.com/licenses/upl/\n * @ignore\n */\nimport { Ref, VNode } from 'preact';\nimport { useContext, useMemo, useRef, useState } from 'preact/hooks';\nimport { BaseLegend } from '#PRIVATE_BaseLegend/BaseLegend';\nimport { useVisEvent } from '#hooks/PRIVATE_useVisEvents/useVisEvents';\nimport { LegendProps, LegendDragStartDetail } from './legend.type';\nimport { getLegendNavUtils } from './legendNavUtils';\nimport {\n getAriaProps,\n getDatatipText,\n getGridNums,\n getIsLegendItemActionable,\n getItemInfo,\n getLegendTextStyle,\n isEqualItem\n} from '#utils/PRIVATE_legendUtils/legendUtils';\nimport { mergeProps } from '#utils/UNSAFE_mergeProps';\nimport { useLegendDatatip } from './useLegendDatatip';\nimport { useItemFocus } from '#hooks/PRIVATE_useVisEvents';\nimport { styles } from '#PRIVATE_BaseLegend/themes/LegendStyles.css';\nimport { useCssVars } from '#hooks/PRIVATE_useCssVars';\nimport { legendVars, getKeyUpHandler } from '#utils/PRIVATE_legendUtils/legendUtils';\nimport { classNames } from '#utils/UNSAFE_classNames';\nimport { useTestId } from '#hooks/UNSAFE_useTestId';\nimport { useLegendContextMenu } from '#PRIVATE_BaseLegend/useLegendContextMenu';\nimport {\n ItemFocusDetail,\n ItemActionDetail,\n ItemInfo,\n LegendItemData\n} from '#utils/UNSAFE_visTypes/legend';\nimport { useVisTouchResponse } from '#hooks/PRIVATE_useVisTouchResponse';\nimport { merge } from '#utils/UNSAFE_stringUtils';\nimport { forwardRef, useImperativeHandle } from 'preact/compat';\nimport { TrackResizeContainer } from '#UNSAFE_TrackResizeContainer';\nimport { useTextDimensions } from '#hooks/PRIVATE_useTextDimensions';\nimport { _getPreferredSize, getLinearLegendLayoutInfo } from './getLegendLayout';\nimport { useLegendDnd } from '#hooks/PRIVATE_useLegendDnD/useLegendDnd';\nimport { styles as VisDndStyles } from '#hooks/PRIVATE_useVisDnd/themes/VisDndStyles.css';\nimport { LegendRenderedContext } from '#hooks/UNSAFE_useLegendPreferredSize';\n\nexport type SizeHandle = {\n _getPreferredSize: (\n _width: number,\n _height: number\n ) => { width: number; height: number } | undefined;\n};\n\ntype ForwardRefLegend = <K extends string | number, D extends LegendItemData<K>>(\n props: LegendProps<K, D> & { ref?: Ref<SizeHandle> }\n) => VNode | null;\n\n/**\n * A legend displays an interactive description of symbols, colors, etc., used in graphical information representations.\n */\nexport const Legend = forwardRef(\n <K extends string | number, D extends LegendItemData<K>>(\n {\n orientation = 'horizontal',\n items,\n isReadOnly = true,\n onItemAction,\n onItemHover,\n onItemFocus,\n testId,\n contextMenuConfig,\n hideAndShowBehavior = 'off',\n hoverBehavior = 'none',\n halign = 'start',\n valign = 'top',\n ...props\n }: LegendProps<K, D>,\n ref: Ref<SizeHandle> = null\n ) => {\n // Use the context\n const { isLegendReady, width, height } = useContext(LegendRenderedContext);\n const { textMeasureContent, getTextDimensions } = useTextDimensions();\n const { resolvedVars, cssContent } = useCssVars(legendVars);\n\n const legendFontStylesObj = getLegendTextStyle(\n {\n fontStyle: props.textFontStyle,\n fontSize: props.textFontSize?.toString(),\n fontWeight: props.textFontWeight?.toString(),\n fontFamily: props.textFontFamily\n },\n resolvedVars\n );\n const rootRef = useRef<HTMLDivElement>(null);\n\n useImperativeHandle(\n ref!,\n () => ({\n _getPreferredSize: (_width: number, _height: number) => {\n return _getPreferredSize(\n _width,\n _height,\n items,\n resolvedVars,\n orientation,\n legendFontStylesObj,\n props.symbolWidth,\n props.symbolHeight,\n getTextDimensions\n );\n }\n }),\n [\n getTextDimensions,\n resolvedVars,\n orientation,\n legendFontStylesObj,\n props.symbolWidth,\n props.symbolHeight,\n items\n ]\n );\n\n if (\n getTextDimensions &&\n resolvedVars['unit'] != undefined &&\n resolvedVars['fontSize'] != undefined\n ) {\n isLegendReady?.(true);\n }\n\n const testIdProps = useTestId(testId);\n const isTestEnv = testIdProps['data-testid'] !== undefined;\n const rootDimsRef = useRef<DOMRect>();\n const { getItem, getDetailFromInfo, getPrevItemInfo, getNextItemInfo } = getLegendNavUtils<\n K,\n D\n >(items);\n\n const isLegendItemActionable = getIsLegendItemActionable(items, isReadOnly);\n const hasData = items.length > 0;\n\n const legendKeyUpHandler = (\n triggerOnAction: () => void,\n updatefocusedItemInfo: (itemInfo: ItemInfo) => void,\n focusedItemInfo: ItemInfo\n ) =>\n getKeyUpHandler(\n triggerOnAction,\n updatefocusedItemInfo,\n focusedItemInfo,\n props.hiddenIds != null\n );\n\n const { touchResponse, touchResponseStyle } = useVisTouchResponse({\n type: 'touchStart'\n });\n const { focusedItemInfo, hoveredItemInfo, onContextMenuDismissed, activeId, eventsProps } =\n useVisEvent<ItemInfo, ItemActionDetail<K, D>, ItemFocusDetail<K, D>, D>(\n touchResponse,\n !isReadOnly,\n isLegendItemActionable,\n legendKeyUpHandler,\n getDetailFromInfo,\n getPrevItemInfo,\n getNextItemInfo,\n onItemAction,\n onItemHover,\n onItemFocus,\n isEqualItem,\n getItemInfo,\n { itemIdx: 0, sectionIdx: 0 },\n props.hiddenIds != null\n );\n\n const { focusedItemRef } = useItemFocus(focusedItemInfo);\n const datatipText = getDatatipText(items, getItem, focusedItemInfo, hoveredItemInfo);\n const [datatipDisabled, setDatatipDisabled] = useState(false);\n const {\n datatipContent,\n datatipProps: { 'aria-describedby': datatipAriaDescribedby, ...datatipProps }\n } = useLegendDatatip({\n text: datatipText,\n rootDimsRef,\n focusedItemInfo,\n focusedItemRef,\n touchResponse,\n isDisabled: datatipDisabled\n });\n\n const ariaProps = getAriaProps<K>(\n isReadOnly,\n props['aria-label'],\n props.hiddenIds,\n merge([props['aria-describedby'], datatipAriaDescribedby]),\n props['aria-labelledby']\n );\n\n const { contextMenuContent, contextMenuProps } = useLegendContextMenu<D>({\n rootRef,\n contextMenuConfig: hasData ? contextMenuConfig : undefined,\n focusedItemInfo,\n items,\n isReadOnly,\n onContextMenuDismissed\n });\n\n const [dragOver, setDragOver] = useState<boolean>();\n\n const { draggable, dndProps, dndContent } = useLegendDnd<K, D, LegendDragStartDetail<D>>({\n onDrag: props.onDrag,\n onDragStart: props.onDragStart,\n onDragEnd: props.onDragEnd,\n onDragEnter: props.onDragEnter,\n onDragLeave: props.onDragLeave,\n onDragOver: props.onDragOver,\n onDrop: props.onDrop,\n items,\n setDragOver,\n setDatatipDisabled,\n itemDraggable: props.itemDraggable\n });\n\n const mergedProps = mergeProps(eventsProps, datatipProps, contextMenuProps, dndProps);\n const { legendStyle, renderedLegendStyle } = styles;\n\n return (\n <>\n {!isLegendReady && (\n <TrackResizeContainer\n width={width ? `${width}px` : '100%'}\n height={height ? `${height}px` : '100%'}\n class={classNames([\n styles.flexStyle,\n styles[`${halign}HAlign`],\n styles[`${valign}VAlign`]\n ])}>\n {function _(width) {\n const layoutInfo = useMemo(\n () =>\n getLinearLegendLayoutInfo<K>({\n width,\n getTextDimensions,\n resolvedVars,\n orientation,\n legendFontStylesObj,\n symbolWidth: props.symbolWidth,\n symbolHeight: props.symbolHeight,\n items\n }),\n [width]\n );\n const { itemsPerCol, itemsPerRow } = getGridNums(items.length, layoutInfo);\n return (\n <>\n <div\n ref={rootRef}\n tabIndex={isReadOnly ? undefined : 0}\n role=\"application\"\n draggable={draggable}\n class={classNames([\n legendStyle,\n renderedLegendStyle,\n dragOver\n ? VisDndStyles.dndDragOverHTMLStyle\n : dragOver === false\n ? VisDndStyles.dndRejectedStyle\n : undefined\n ])}\n style={touchResponseStyle}\n {...testIdProps}\n {...ariaProps}\n {...mergedProps}\n aria-activedescendant={activeId}>\n <BaseLegend\n {...props}\n focusedItemRef={focusedItemRef}\n items={items}\n isReadOnly={isReadOnly}\n orientation={orientation}\n sectionIdx={0}\n itemsPerRow={itemsPerRow}\n itemsPerCol={itemsPerCol}\n itemWidth={layoutInfo?.isWrapped ? layoutInfo?.maxItemWidth : undefined}\n focusedItemInfo={focusedItemInfo}\n hoveredItemInfo={hoveredItemInfo}\n activeId={activeId}\n hideAndShowBehavior={hideAndShowBehavior}\n hoverBehavior={hoverBehavior}\n isTestEnv={isTestEnv}\n />\n </div>\n {datatipContent}\n {contextMenuContent}\n {dndContent}\n </>\n );\n }}\n </TrackResizeContainer>\n )}\n {textMeasureContent}\n {cssContent}\n </>\n );\n }\n) as ForwardRefLegend;\n"],"names":["_jsxs","_Fragment","_jsx","VisDndStyles"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;AAMG;AAUH,SAAS,OAAO,CAAiC,QAAkB,EAAE,KAAU,EAAA;AAC7E,IAAA,MAAM,EAAE,OAAO,EAAE,GAAG,QAAQ,CAAC;AAE7B,IAAA,IAAI,OAAO,IAAI,CAAC,CAAC,EAAE;QACjB,OAAO,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;KAChC;AACD,IAAA,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC;AACxB,CAAC;AAED,SAAS,eAAe,CAAI,QAAkB,EAAE,KAA0B,EAAA;AACxE,IAAA,IAAI,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC;AAE/B,IAAA,IAAI,OAAO,IAAI,CAAC,CAAC,EAAE;AACjB,QAAA,OAAO,GAAG,KAAK,CAAC,MAAM,GAA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