@widergy/energy-ui 3.192.3 → 3.194.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/CHANGELOG.md +16 -3
  2. package/dist/components/UTCheckbox/versions/V1/components/CheckboxControl/index.js +1 -0
  3. package/dist/components/UTCheckbox/versions/V1/components/CheckboxIcon/index.js +1 -0
  4. package/dist/components/UTCheckbox/versions/V1/components/TitleAndDescription/index.js +1 -0
  5. package/dist/components/UTCheckbox/versions/V1/components/TitleRow/index.js +1 -0
  6. package/dist/components/UTCheckbox/versions/V1/constants.js +1 -1
  7. package/dist/components/UTCheckbox/versions/V1/index.js +1 -1
  8. package/dist/components/UTCheckbox/versions/V1/theme.js +1 -1
  9. package/dist/components/UTDatePicker/versions/V1/components/Calendar/index.js +1 -1
  10. package/dist/components/UTDatePicker/versions/V1/index.js +1 -1
  11. package/dist/components/UTDatePicker/versions/V1/utils.js +1 -1
  12. package/dist/components/UTModal/index.js +1 -1
  13. package/dist/components/UTRadioGroup/versions/V1/components/Radio/constants.js +1 -1
  14. package/dist/components/UTRadioGroup/versions/V1/components/Radio/index.js +1 -1
  15. package/dist/components/UTRadioGroup/versions/V1/components/Radio/theme.js +1 -1
  16. package/dist/components/UTRichText/index.js +1 -1
  17. package/dist/components/UTRichText/modules/table/TableHandles.js +1 -0
  18. package/dist/components/UTRichText/modules/table/TableMenu/index.js +1 -0
  19. package/dist/components/UTRichText/modules/table/TableMenu/styles.module.scss +75 -0
  20. package/dist/components/UTRichText/modules/table/TableMenuOverlay.js +1 -0
  21. package/dist/components/UTRichText/modules/table/ToolbarButton.js +1 -1
  22. package/dist/components/UTRichText/modules/table/actions.js +1 -0
  23. package/dist/components/UTRichText/modules/table/autoScroll.js +1 -0
  24. package/dist/components/UTRichText/modules/table/columnWidths.js +1 -0
  25. package/dist/components/UTRichText/modules/table/dragGhost.js +1 -0
  26. package/dist/components/UTRichText/modules/table/dragHandle.js +1 -0
  27. package/dist/components/UTRichText/modules/table/emailStyles.js +1 -0
  28. package/dist/components/UTRichText/modules/table/extensions.js +1 -1
  29. package/dist/components/UTRichText/modules/table/guideLine.js +1 -0
  30. package/dist/components/UTRichText/modules/table/index.js +1 -1
  31. package/dist/components/UTRichText/modules/table/menu.js +1 -0
  32. package/dist/components/UTRichText/modules/table/pm.js +1 -0
  33. package/dist/components/UTRichText/modules/table/rowResizing.js +1 -0
  34. package/dist/components/UTRichText/modules/table/selection.js +1 -0
  35. package/dist/components/UTRichText/styles.module.scss +156 -10
  36. package/dist/components/UTRichText/utils/contentBuilders.js +1 -1
  37. package/dist/constants/testIds.js +1 -1
  38. package/dist/esm/components/UTCheckbox/versions/V1/components/CheckboxControl/index.js +1 -0
  39. package/dist/esm/components/UTCheckbox/versions/V1/components/CheckboxIcon/index.js +1 -0
  40. package/dist/esm/components/UTCheckbox/versions/V1/components/TitleAndDescription/index.js +1 -0
  41. package/dist/esm/components/UTCheckbox/versions/V1/components/TitleRow/index.js +1 -0
  42. package/dist/esm/components/UTCheckbox/versions/V1/constants.js +1 -1
  43. package/dist/esm/components/UTCheckbox/versions/V1/index.js +1 -1
  44. package/dist/esm/components/UTCheckbox/versions/V1/theme.js +1 -1
  45. package/dist/esm/components/UTDatePicker/versions/V1/components/Calendar/index.js +1 -1
  46. package/dist/esm/components/UTDatePicker/versions/V1/index.js +1 -1
  47. package/dist/esm/components/UTDatePicker/versions/V1/utils.js +1 -1
  48. package/dist/esm/components/UTModal/index.js +1 -1
  49. package/dist/esm/components/UTRadioGroup/versions/V1/components/Radio/constants.js +1 -1
  50. package/dist/esm/components/UTRadioGroup/versions/V1/components/Radio/index.js +1 -1
  51. package/dist/esm/components/UTRadioGroup/versions/V1/components/Radio/theme.js +1 -1
  52. package/dist/esm/components/UTRichText/index.js +1 -1
  53. package/dist/esm/components/UTRichText/modules/table/TableHandles.js +1 -0
  54. package/dist/esm/components/UTRichText/modules/table/TableMenu/index.js +1 -0
  55. package/dist/esm/components/UTRichText/modules/table/TableMenu/styles.module.scss +75 -0
  56. package/dist/esm/components/UTRichText/modules/table/TableMenuOverlay.js +1 -0
  57. package/dist/esm/components/UTRichText/modules/table/ToolbarButton.js +1 -1
  58. package/dist/esm/components/UTRichText/modules/table/actions.js +1 -0
  59. package/dist/esm/components/UTRichText/modules/table/autoScroll.js +1 -0
  60. package/dist/esm/components/UTRichText/modules/table/columnWidths.js +1 -0
  61. package/dist/esm/components/UTRichText/modules/table/dragGhost.js +1 -0
  62. package/dist/esm/components/UTRichText/modules/table/dragHandle.js +1 -0
  63. package/dist/esm/components/UTRichText/modules/table/emailStyles.js +1 -0
  64. package/dist/esm/components/UTRichText/modules/table/extensions.js +1 -1
  65. package/dist/esm/components/UTRichText/modules/table/guideLine.js +1 -0
  66. package/dist/esm/components/UTRichText/modules/table/index.js +1 -1
  67. package/dist/esm/components/UTRichText/modules/table/menu.js +1 -0
  68. package/dist/esm/components/UTRichText/modules/table/pm.js +1 -0
  69. package/dist/esm/components/UTRichText/modules/table/rowResizing.js +1 -0
  70. package/dist/esm/components/UTRichText/modules/table/selection.js +1 -0
  71. package/dist/esm/components/UTRichText/styles.module.scss +156 -10
  72. package/dist/esm/components/UTRichText/utils/contentBuilders.js +1 -1
  73. package/dist/esm/constants/testIds.js +1 -1
  74. package/dist/esm/index.js +1 -1
  75. package/dist/esm/utils/hooks/useCSSVariables/dimensionTokens.js +1 -1
  76. package/dist/index.js +1 -1
  77. package/dist/utils/hooks/useCSSVariables/dimensionTokens.js +1 -1
  78. package/package.json +5 -1
  79. package/dist/components/UTRichText/modules/table/TableToolbar/index.js +0 -1
  80. package/dist/components/UTRichText/modules/table/TableToolbar/styles.module.scss +0 -13
  81. package/dist/esm/components/UTRichText/modules/table/TableToolbar/index.js +0 -1
  82. package/dist/esm/components/UTRichText/modules/table/TableToolbar/styles.module.scss +0 -13
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.buildTableMenu=exports.TABLE_ACTION_REGISTRY=exports.MENU_GROUPS=void 0;var _constants=require("../../constants.js"),_actions=require("./actions"),_extensions=require("./extensions"),_pm=require("./pm"),_selection=require("./selection");const firstMovableRow=(e,o)=>(0,_extensions.hasHeaderRow)(e,o.tablePos)?1:0,firstMovableColumn=(e,o)=>(0,_extensions.hasHeaderColumn)(e,o.tablePos)?1:0,CLEAR_ONE="Borrar contenido de la celda",clearCellsLabel=(e,o)=>(0,_selection.getHandleCellPositions)(e.doc,o).length>1?"Borrar contenido de las celdas":CLEAR_ONE,clearTableLabel=(e,o)=>(0,_selection.getHandleCellPositions)(e.doc,o).length>1?"Borrar contenido de la tabla":CLEAR_ONE,tableSize=(e,o)=>{const a=e.doc.nodeAt(o.tablePos);if(!a||"table"!==a.type.name)return{height:0,width:0};const{height:n,width:l}=_pm.TableMap.get(a);return{height:n,width:l}},TABLE_ACTION_REGISTRY=exports.TABLE_ACTION_REGISTRY={[_actions.TABLE_ACTIONS.clearCell]:{icon:"IconCircleX",label:CLEAR_ONE,run:e=>e.commands.clearCell()},[_actions.TABLE_ACTIONS.clearColumn]:{icon:"IconCircleX",label:clearCellsLabel,run:e=>e.commands.clearColumn()},[_actions.TABLE_ACTIONS.clearRow]:{icon:"IconCircleX",label:clearCellsLabel,run:e=>e.commands.clearRow()},[_actions.TABLE_ACTIONS.clearTable]:{icon:"IconCircleX",label:clearTableLabel,run:e=>e.commands.clearTable()},[_actions.TABLE_ACTIONS.copyTable]:{icon:"IconCopy",label:"Copiar tabla",run:e=>e.commands.copyTable()},[_actions.TABLE_ACTIONS.toggleHeaderColumn]:{checked:(e,o)=>(0,_extensions.hasHeaderColumn)(e,o.tablePos),icon:"IconTableColumn",label:"Columna de encabezado",run:e=>e.commands.toggleHeaderColumn(),visible:e=>e.type===_selection.HANDLE_TYPES.table||e.type===_selection.HANDLE_TYPES.column&&0===e.index},[_actions.TABLE_ACTIONS.toggleHeaderRow]:{checked:(e,o)=>(0,_extensions.hasHeaderRow)(e,o.tablePos),icon:"IconTableRow",label:"Fila de encabezado",run:e=>e.commands.toggleHeaderRow(),visible:e=>e.type===_selection.HANDLE_TYPES.table||e.type===_selection.HANDLE_TYPES.row&&0===e.index},[_actions.TABLE_ACTIONS.addColumnAfter]:{icon:"IconColumnInsertRight",label:"Añadir columna a la derecha",run:e=>e.commands.addColumnAfter()},[_actions.TABLE_ACTIONS.addColumnBefore]:{icon:"IconColumnInsertLeft",label:"Añadir columna a la izquierda",run:e=>e.commands.addColumnBefore()},[_actions.TABLE_ACTIONS.addRowAfter]:{icon:"IconRowInsertBottom",label:"Añadir fila abajo",run:e=>e.commands.addRowAfter()},[_actions.TABLE_ACTIONS.addRowBefore]:{icon:"IconRowInsertTop",label:"Añadir fila arriba",run:e=>e.commands.addRowBefore()},[_actions.TABLE_ACTIONS.deleteColumn]:{enabled:(e,o)=>tableSize(e,o).width>1,icon:"IconTrash",label:"Borrar columna",run:e=>e.commands.deleteColumn()},[_actions.TABLE_ACTIONS.deleteRow]:{enabled:(e,o)=>tableSize(e,o).height>1,icon:"IconTrash",label:"Borrar fila",run:e=>e.commands.deleteRow()},[_actions.TABLE_ACTIONS.deleteTable]:{icon:"IconTrash",label:"Borrar tabla",run:e=>e.commands.deleteTable()},[_actions.TABLE_ACTIONS.moveColumnLeft]:{enabled:(e,o)=>o.index>firstMovableColumn(e,o),icon:"IconArrowLeft",label:"Mover columna a la izquierda",run:e=>e.commands.moveColumn(-1)},[_actions.TABLE_ACTIONS.moveColumnRight]:{enabled:(e,o)=>o.index>=firstMovableColumn(e,o)&&o.index<tableSize(e,o).width-1,icon:"IconArrowRight",label:"Mover columna a la derecha",run:e=>e.commands.moveColumn(1)},[_actions.TABLE_ACTIONS.moveRowDown]:{enabled:(e,o)=>o.index>=firstMovableRow(e,o)&&o.index<tableSize(e,o).height-1,icon:"IconArrowDown",label:"Mover fila abajo",run:e=>e.commands.moveRow(1)},[_actions.TABLE_ACTIONS.moveRowUp]:{enabled:(e,o)=>o.index>firstMovableRow(e,o),icon:"IconArrowUp",label:"Mover fila arriba",run:e=>e.commands.moveRow(-1)}},MENU_GROUPS=exports.MENU_GROUPS={[_selection.HANDLE_TYPES.cell]:[[_actions.TABLE_ACTIONS.addColumnAfter,_actions.TABLE_ACTIONS.addRowAfter],[_actions.TABLE_ACTIONS.clearCell,_actions.TABLE_ACTIONS.deleteColumn,_actions.TABLE_ACTIONS.deleteRow]],[_selection.HANDLE_TYPES.column]:[[_actions.TABLE_ACTIONS.toggleHeaderColumn],[_actions.TABLE_ACTIONS.addColumnBefore,_actions.TABLE_ACTIONS.addColumnAfter,_actions.TABLE_ACTIONS.moveColumnLeft,_actions.TABLE_ACTIONS.moveColumnRight],[_actions.TABLE_ACTIONS.clearColumn,_actions.TABLE_ACTIONS.deleteColumn]],[_selection.HANDLE_TYPES.row]:[[_actions.TABLE_ACTIONS.toggleHeaderRow],[_actions.TABLE_ACTIONS.addRowBefore,_actions.TABLE_ACTIONS.addRowAfter,_actions.TABLE_ACTIONS.moveRowUp,_actions.TABLE_ACTIONS.moveRowDown],[_actions.TABLE_ACTIONS.clearRow,_actions.TABLE_ACTIONS.deleteRow]],[_selection.HANDLE_TYPES.table]:[[_actions.TABLE_ACTIONS.toggleHeaderColumn,_actions.TABLE_ACTIONS.toggleHeaderRow],[_actions.TABLE_ACTIONS.copyTable],[_actions.TABLE_ACTIONS.clearTable,_actions.TABLE_ACTIONS.deleteTable]]},buildTableMenu=(e,o,a)=>{const n=new Set(a),l={};return{groups:MENU_GROUPS[o.type].map(a=>a.filter(a=>{const t=TABLE_ACTION_REGISTRY[a];return!(!n.has(a)||!t)&&(!(t.visible&&!t.visible(o))&&(l[a]={checked:t.checked?t.checked(e.state,o):void 0,dataTestId:_constants.TEST_IDS_RICH_TEXT.tableMenu[o.type][a],disabled:!!t.enabled&&!t.enabled(e.state,o),icon:t.icon,label:"function"==typeof t.label?t.label(e.state,o):t.label,onSelect:()=>(0,_selection.runWithStoredSelection)(e,o,t.run)},!0))})).filter(e=>e.length>0),items:l}};exports.buildTableMenu=buildTableMenu;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),Object.defineProperty(exports,"CellSelection",{enumerable:!0,get:function(){return _prosemirrorTables.CellSelection}}),Object.defineProperty(exports,"DOMSerializer",{enumerable:!0,get:function(){return _prosemirrorModel.DOMSerializer}}),Object.defineProperty(exports,"Decoration",{enumerable:!0,get:function(){return _prosemirrorView.Decoration}}),Object.defineProperty(exports,"DecorationSet",{enumerable:!0,get:function(){return _prosemirrorView.DecorationSet}}),Object.defineProperty(exports,"Plugin",{enumerable:!0,get:function(){return _prosemirrorState.Plugin}}),Object.defineProperty(exports,"PluginKey",{enumerable:!0,get:function(){return _prosemirrorState.PluginKey}}),Object.defineProperty(exports,"Selection",{enumerable:!0,get:function(){return _prosemirrorState.Selection}}),Object.defineProperty(exports,"TableMap",{enumerable:!0,get:function(){return _prosemirrorTables.TableMap}}),Object.defineProperty(exports,"columnResizingPluginKey",{enumerable:!0,get:function(){return _prosemirrorTables.columnResizingPluginKey}}),Object.defineProperty(exports,"deleteCellSelection",{enumerable:!0,get:function(){return _prosemirrorTables.deleteCellSelection}}),Object.defineProperty(exports,"moveTableColumn",{enumerable:!0,get:function(){return _prosemirrorTables.moveTableColumn}}),Object.defineProperty(exports,"moveTableRow",{enumerable:!0,get:function(){return _prosemirrorTables.moveTableRow}}),Object.defineProperty(exports,"selectedRect",{enumerable:!0,get:function(){return _prosemirrorTables.selectedRect}}),Object.defineProperty(exports,"toggleHeader",{enumerable:!0,get:function(){return _prosemirrorTables.toggleHeader}});var _prosemirrorState=require("prosemirror-state"),_prosemirrorModel=require("prosemirror-model"),_prosemirrorView=require("prosemirror-view"),_prosemirrorTables=require("prosemirror-tables");
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.withHeight=exports.rowResizingKey=exports.RowResizing=void 0;var _core=require("@tiptap/core"),_autoScroll=require("./autoScroll"),_guideLine=require("./guideLine"),_pm=require("./pm");const rowResizingKey=exports.rowResizingKey=new _pm.PluginKey("rowResizing"),EDGE=5,CURSOR_CLASS="row-resize-cursor",COLUMN_CURSOR_CLASS="resize-cursor",rowEdgeAt=(e,t)=>{var o,n;const r=null===(o=t.target)||void 0===o||null===(n=o.closest)||void 0===n?void 0:n.call(o,"td, th");if(!r||!e.dom.contains(r))return null;const i=r.parentElement,{bottom:l,top:s}=i.getBoundingClientRect();return Math.abs(t.clientY-l)<=5?i:Math.abs(t.clientY-s)<=5?i.previousElementSibling:null},rowPosOf=(e,t)=>{try{var o;const n=e.posAtDOM(t,0)-1;return"tableRow"===(null===(o=e.state.doc.nodeAt(n))||void 0===o?void 0:o.type.name)?n:null}catch{return null}},verticalExtras=e=>{const t=getComputedStyle(e);return["paddingTop","paddingBottom","borderTopWidth","borderBottomWidth"].reduce((e,o)=>e+(parseFloat(t[o])||0),0)},contentHeight=e=>Math.max(...Array.from(e.cells,e=>Array.from(e.children).filter(e=>"absolute"!==getComputedStyle(e).position).reduce((e,t)=>e+t.getBoundingClientRect().height,0)+verticalExtras(e))),withHeight=(e,t)=>[...(e||"").split(";").map(e=>e.trim()).filter(e=>e&&!/^height\s*:/i.test(e)),"height: ".concat(t,"px")].join("; ");exports.withHeight=withHeight;const setPreview=(e,t)=>e.dispatch(e.state.tr.setMeta(rowResizingKey,{preview:t})),startResize=(e,t,o)=>{const n=rowPosOf(e,t);if(null===n)return!1;const r=o.clientY,i=t.getBoundingClientRect().height,l=contentHeight(t),s=(0,_guideLine.createGuideLine)(e),c=(0,_autoScroll.scrollParentOf)(t,"y"),u=c?c.scrollTop:0;let a=r,d=i;const g=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;const t=c?(0,_autoScroll.clampToContainer)(c,"y",a):a,o=c?c.scrollTop-u+e:0;return Math.round(Math.max(l,i+t-r+o))},p=()=>{const t=e.nodeDOM(n);t&&s.horizontal(t.closest("table"),t.getBoundingClientRect().bottom)},m=t=>t!==d&&(d=t,setPreview(e,{height:d,pos:n}),p(),!0),h=c&&(0,_autoScroll.createAutoScroller)(c,"y",{grow:e=>m(g(e)),onScroll:()=>{m(g()),p()}}),v=e=>{a=e.clientY,m(g()),null==h||h.update(a)},w=()=>{document.removeEventListener("mousemove",v),document.removeEventListener("mouseup",w),null==h||h.stop(),s.remove();const t=e.state.doc.nodeAt(n),o=e.state.tr.setMeta(rowResizingKey,{preview:null});t&&Math.abs(d-i)>=1&&o.setNodeMarkup(n,null,{...t.attrs,style:withHeight(t.attrs.style,d)}),e.dispatch(o)};return p(),document.addEventListener("mousemove",v),document.addEventListener("mouseup",w),!0},previewDecorations=(e,t)=>{const o=t&&e.nodeAt(t.pos);return o&&"tableRow"===o.type.name?_pm.DecorationSet.create(e,[_pm.Decoration.node(t.pos,t.pos+o.nodeSize,{style:"height: ".concat(t.height,"px")})]):_pm.DecorationSet.empty},RowResizing=exports.RowResizing=_core.Extension.create({name:"rowResizing",addProseMirrorPlugins(){let e=null,t=null,o=null;const n=(o,n)=>{var r;(e=n,o.dom.classList.toggle(CURSOR_CLASS,!!n),n)?(t=t||(0,_guideLine.createGuideLine)(o),t.horizontal(n.closest("table"),n.getBoundingClientRect().bottom)):null===(r=t)||void 0===r||r.hide()};return[new _pm.Plugin({key:rowResizingKey,state:{init:()=>null,apply:(e,t)=>{const o=e.getMeta(rowResizingKey);return o?o.preview:t}},view:r=>{const i=()=>{if(!e||!o)return;const t=document.elementFromPoint(o.clientX,o.clientY);n(r,rowEdgeAt(r,{clientY:o.clientY,target:t}))};return document.addEventListener("scroll",i,!0),{destroy:()=>{var e;document.removeEventListener("scroll",i,!0),null===(e=t)||void 0===e||e.remove(),t=null}}},props:{decorations:e=>previewDecorations(e.doc,rowResizingKey.getState(e)),handleDOMEvents:{mouseleave:e=>(o=null,n(e,null),!1),mousedown:(t,o)=>!(!e||0!==o.button||!t.editable)&&(!!startResize(t,e,o)&&(o.preventDefault(),n(t,null),!0)),mousemove:(t,r)=>{if(o={clientX:r.clientX,clientY:r.clientY},!t.editable||r.buttons||t.dom.classList.contains("resize-cursor"))return e&&n(t,null),!1;const i=rowEdgeAt(t,r);return(i||i!==e)&&n(t,i),!1}}}})]}});
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.runWithStoredSelection=exports.rebuildSelection=exports.getHandleCellPositions=exports.buildHandleRef=exports.HANDLE_TYPES=void 0;var _pm=require("./pm");const HANDLE_TYPES=exports.HANDLE_TYPES={cell:"cell",column:"column",row:"row",table:"table"},buildHandleRef=(e,t)=>{var l;return{index:null!==(l=t.index)&&void 0!==l?l:0,tablePos:t.tablePos,type:t.type}};exports.buildHandleRef=buildHandleRef;const getHandleCellPositions=(e,t)=>{const{index:l,tablePos:o,type:n}=t,r=e.nodeAt(o);if(!r||"table"!==r.type.name)return[];const i=_pm.TableMap.get(r);if(n===HANDLE_TYPES.row&&l>=i.height)return[];if(n===HANDLE_TYPES.column&&l>=i.width)return[];if(n===HANDLE_TYPES.cell&&!i.map.includes(l))return[];const s=o+1;if(n===HANDLE_TYPES.cell)return[s+l];let c;return c=n===HANDLE_TYPES.row?{bottom:l+1,left:0,right:i.width,top:l}:n===HANDLE_TYPES.column?{bottom:i.height,left:l,right:l+1,top:0}:{bottom:i.height,left:0,right:i.width,top:0},i.cellsInRect(c).map(e=>s+e)};exports.getHandleCellPositions=getHandleCellPositions;const rebuildSelection=(e,t)=>{const l=getHandleCellPositions(e,t);if(!l.length)return null;try{return _pm.CellSelection.create(e,l[0],l[l.length-1])}catch{return null}};exports.rebuildSelection=rebuildSelection;const runWithStoredSelection=(e,t,l)=>{const{view:o}=e,n=rebuildSelection(o.state.doc,t);n&&o.dispatch(o.state.tr.setSelection(n)),l(e),o.focus()};exports.runWithStoredSelection=runWithStoredSelection;
@@ -119,6 +119,8 @@
119
119
  th {
120
120
  border: 1px solid var(--light05);
121
121
  min-width: var(--UT-textEditor-table-cell-min-width, 40px);
122
+ // sass-lint:disable-block no-important
123
+ overflow: visible !important;
122
124
  padding: var(--UT-textEditor-table-cell-padding-y, 6px) var(--UT-textEditor-table-cell-padding-x, 8px);
123
125
  position: relative;
124
126
  vertical-align: top;
@@ -126,10 +128,6 @@
126
128
  > * {
127
129
  margin: 0;
128
130
  }
129
-
130
- &:hover :global(.column-resize-handle) {
131
- opacity: 1;
132
- }
133
131
  }
134
132
 
135
133
  th {
@@ -182,26 +180,174 @@
182
180
 
183
181
  :global(.column-resize-handle) {
184
182
  background-color: var(--actionAccent04);
185
- bottom: -9999px;
183
+ bottom: -1px;
186
184
  opacity: 0;
187
185
  pointer-events: none;
188
186
  position: absolute;
189
187
  right: -1px;
190
- top: -9999px;
188
+ top: -1px;
191
189
  transition: opacity 0.15s ease;
192
190
  width: 2px;
193
191
  z-index: 10;
194
192
  }
195
193
 
196
- :global(.resize-cursor) {
194
+ &:global(.resize-cursor) {
197
195
  cursor: col-resize;
196
+
197
+ :global(.column-resize-handle) {
198
+ opacity: 1;
199
+ }
200
+ }
201
+
202
+ &:global(.row-resize-cursor) {
203
+ cursor: row-resize;
204
+ }
205
+
206
+ &:global(.has-table-handles) :global(.tableWrapper) {
207
+ padding-left: calc(var(--UT-richText-table-grip-height-active) + var(--gap-sm));
208
+ padding-top: calc(var(--UT-richText-table-grip-height-active) / 2);
209
+ }
210
+
211
+ &[contenteditable='false'] :global(.table-handle) {
212
+ display: none;
213
+ }
214
+
215
+ :global(.table-handle) {
216
+ align-items: center;
217
+ background-color: var(--light05);
218
+ border-radius: var(--UT-richText-table-grip-radius);
219
+ box-sizing: border-box;
220
+ color: var(--light01);
221
+ cursor: pointer;
222
+ display: flex;
223
+ justify-content: center;
224
+ opacity: 0;
225
+ position: absolute;
226
+ transform: translate(-50%, -50%);
227
+ transition: opacity 0.15s ease;
228
+ user-select: none;
229
+ z-index: 4;
230
+
231
+ &:hover {
232
+ background-color: var(--gray04);
233
+ }
234
+
235
+ &:global(.table-handle--visible) {
236
+ opacity: 1;
237
+ }
238
+
239
+ &:focus {
240
+ opacity: 1;
241
+ outline: 2px solid var(--actionAccent04);
242
+ outline-offset: 1px;
243
+ }
244
+
245
+ svg {
246
+ height: var(--UT-richText-table-grip-icon-size);
247
+ width: var(--UT-richText-table-grip-icon-size);
248
+ }
249
+ }
250
+
251
+ :global(.table-handle--column),
252
+ :global(.table-handle--row) {
253
+ svg {
254
+ display: none;
255
+ }
256
+
257
+ &:hover,
258
+ &:global(.table-handle--active) {
259
+ background-color: var(--actionAccent04);
260
+
261
+ svg {
262
+ display: block;
263
+ }
264
+ }
265
+ }
266
+
267
+ :global(.table-handle--column) {
268
+ height: var(--UT-richText-table-grip-height);
269
+ left: 50%;
270
+ top: 0;
271
+ width: var(--UT-richText-table-grip-width);
272
+
273
+ &:hover {
274
+ height: var(--UT-richText-table-grip-height-active);
275
+ }
276
+ }
277
+
278
+ :global(.table-handle--row) {
279
+ height: var(--UT-richText-table-grip-width);
280
+ left: 0;
281
+ top: 50%;
282
+ width: var(--UT-richText-table-grip-height);
283
+
284
+ &:hover {
285
+ width: var(--UT-richText-table-grip-height-active);
286
+ }
287
+ }
288
+
289
+ :global(.table-handle--cell) {
290
+ height: var(--UT-richText-table-cell-handle-size);
291
+ right: 2px;
292
+ top: 2px;
293
+ transform: none;
294
+ width: var(--UT-richText-table-cell-handle-size);
295
+ z-index: 5;
296
+
297
+ svg {
298
+ height: var(--UT-richText-table-cell-handle-icon-size);
299
+ width: var(--UT-richText-table-cell-handle-icon-size);
300
+ }
301
+ }
302
+
303
+ :global(.table-handle--table) {
304
+ background-color: var(--light01);
305
+ border: 1px solid var(--light05);
306
+ color: var(--gray04);
307
+ height: var(--UT-richText-table-grip-width);
308
+ left: calc(-1 * (var(--UT-richText-table-grip-height-active) + var(--gap-sm)));
309
+ top: 0;
310
+ transform: none;
311
+ width: var(--UT-richText-table-grip-height-active);
312
+
313
+ &:hover {
314
+ background-color: var(--light03);
315
+ }
316
+ }
317
+
318
+ :global(.table-handle--active) {
319
+ background-color: var(--actionAccent04);
320
+ opacity: 1;
321
+
322
+ &:hover {
323
+ background-color: var(--actionAccent04);
324
+ }
325
+
326
+ &:global(.table-handle--column) {
327
+ height: var(--UT-richText-table-grip-height-active);
328
+ }
329
+
330
+ &:global(.table-handle--row) {
331
+ width: var(--UT-richText-table-grip-height-active);
332
+ }
333
+
334
+ &:global(.table-handle--table) {
335
+ border-color: var(--actionAccent04);
336
+ color: var(--light01);
337
+ }
338
+ }
339
+
340
+ :global(.table-drag-source) {
341
+ opacity: 0.4;
198
342
  }
199
343
 
200
- .selectedCell {
344
+ :global(.selectedCell) {
201
345
  &::after {
202
- background: var(--actionAccent01);
346
+ background-color: var(--actionAccent01);
347
+ box-shadow: inset 0 0 0 1px var(--actionAccent04);
203
348
  content: '';
204
- inset: 0;
349
+ inset: -1px;
350
+ mix-blend-mode: multiply;
205
351
  pointer-events: none;
206
352
  position: absolute;
207
353
  z-index: 2;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.serializeToHTML=exports.readTableNode=exports.buildTableNode=exports.buildSerializationExtensions=exports.buildParagraphNodes=exports.buildNodesFromHTML=void 0;var _core=require("@tiptap/core"),_html=require("@tiptap/html"),_isEmpty=_interopRequireDefault(require("lodash/isEmpty")),_constants=require("../constants.js"),_utils=require("../utils.js"),_moduleResolution=require("./moduleResolution.js");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const buildSerializationExtensions=function(){let{moduleConfig:e,modules:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,_utils.dedupeExtensions)([...(0,_constants.buildBaseExtensions)({}),...(0,_moduleResolution.buildModuleGroups)(t,e).flat().flatMap(e=>e.resolvedExtensions)])};exports.buildSerializationExtensions=buildSerializationExtensions;const buildEmptyParagraph=()=>({type:"paragraph"}),buildPlainInlineContent=e=>e?[{type:"text",text:e}]:[],buildInlineNodes=(e,t)=>(e||[]).reduce((e,n)=>{var l;if("text"===n.type||null!==(l=t.nodes[n.type])&&void 0!==l&&l.isInline)return[...e,n];const o=buildInlineNodes(n.content,t);return(0,_isEmpty.default)(o)?e:(0,_isEmpty.default)(e)?o:[...e,{type:"hardBreak"},...o]},[]),buildInlineHTMLContent=(e,t)=>{let{extensions:n,schema:l}=t;if(!e)return[];const{content:o}=(0,_html.generateJSON)("<p>".concat(e,"</p>"),n);return buildInlineNodes(o,l)},buildInlineContentResolver=function(){let{inlineHTML:e,moduleConfig:t,modules:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e)return buildPlainInlineContent;const l=buildSerializationExtensions({moduleConfig:t,modules:n}),o=(0,_core.getSchema)(l);return e=>buildInlineHTMLContent(e,{extensions:l,schema:o})},PARAGRAPH_SEPARATOR=/(?:\r?\n){2,}/,LINE_SEPARATOR=/\r?\n/,buildParagraphContent=(e,t)=>e.split(LINE_SEPARATOR).map(t).reduce((e,t)=>(0,_isEmpty.default)(t)?e:(0,_isEmpty.default)(e)?t:[...e,{type:"hardBreak"},...t],[]),buildParagraphNodes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return[buildEmptyParagraph()];const n=buildInlineContentResolver(t);return e.split(PARAGRAPH_SEPARATOR).map(e=>{const t=buildParagraphContent(e,n);return(0,_isEmpty.default)(t)?buildEmptyParagraph():{type:"paragraph",content:t}})};exports.buildParagraphNodes=buildParagraphNodes;const buildNodesFromHTML=function(e){let{moduleConfig:t,modules:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return[buildEmptyParagraph()];const{content:l}=(0,_html.generateJSON)(e,buildSerializationExtensions({moduleConfig:t,modules:n}));return(0,_isEmpty.default)(l)?[buildEmptyParagraph()]:l};exports.buildNodesFromHTML=buildNodesFromHTML;const TABLE_HEADER_TYPE="tableHeader",TABLE_EMAIL_STYLE="border-collapse: collapse; width: 100%; border-spacing: 0;",HEADER_CELL_EMAIL_STYLE="border: 1px solid #CCCCCC; padding: 8px 12px; text-align: left; font-family: inherit; font-weight: 600; background-color: #F5F5F5;",DATA_CELL_EMAIL_STYLE="border: 1px solid #CCCCCC; padding: 8px 12px; text-align: left; font-family: inherit;",buildParagraph=(e,t)=>({type:"paragraph",content:e?t(String(e)):[]}),buildTableNode=e=>{let{cellColwidth:t,headers:n,inlineHTML:l,moduleConfig:o,modules:i,rows:r}=e;const a=buildInlineContentResolver({inlineHTML:l,moduleConfig:o,modules:i});return{type:"table",attrs:{style:TABLE_EMAIL_STYLE},content:[{type:"tableRow",content:n.map(e=>({type:"tableHeader",attrs:{colspan:1,colwidth:t?[t]:null,rowspan:1,style:HEADER_CELL_EMAIL_STYLE},content:[buildParagraph(e,a)]}))},...r.map(e=>({type:"tableRow",content:e.map(e=>({type:"tableCell",attrs:{colspan:1,colwidth:t?[t]:null,rowspan:1,style:DATA_CELL_EMAIL_STYLE},content:[buildParagraph(e,a)]}))}))]}};exports.buildTableNode=buildTableNode;const serializeInlineContent=(e,t)=>(e||[]).map(e=>(0,_html.generateHTML)({type:"doc",content:[e]},t).replace(/^<p>|<\/p>$/g,"")).filter(Boolean).join("<br>"),readTableNode=function(e){var t;let{moduleConfig:n,modules:l}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const o=buildSerializationExtensions({moduleConfig:n,modules:l}),i=e=>serializeInlineContent(e.content,o),r=(null==e?void 0:e.content)||[],a="tableHeader"===(null===(t=r[0])||void 0===t||null===(t=t.content)||void 0===t||null===(t=t[0])||void 0===t?void 0:t.type),[d,s]=a?[r[0],r.slice(1)]:[null,r],u=((null==d?void 0:d.content)||[]).map(e=>{var t;return null===(t=e.attrs)||void 0===t||null===(t=t.colwidth)||void 0===t?void 0:t[0]}),[p]=u;return{cellColwidth:u.every(e=>e===p)&&null!=p?p:void 0,headers:((null==d?void 0:d.content)||[]).map(i),inlineHTML:!0,rows:s.map(e=>(e.content||[]).map(i))}};exports.readTableNode=readTableNode;const serializeToHTML=function(e){let{moduleConfig:t,modules:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,_html.generateHTML)(e,buildSerializationExtensions({moduleConfig:t,modules:n}))};exports.serializeToHTML=serializeToHTML;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.serializeToHTML=exports.readTableNode=exports.buildTableNode=exports.buildSerializationExtensions=exports.buildParagraphNodes=exports.buildNodesFromHTML=void 0;var _core=require("@tiptap/core"),_html=require("@tiptap/html"),_isEmpty=_interopRequireDefault(require("lodash/isEmpty")),_constants=require("../constants.js"),_utils=require("../utils.js"),_emailStyles=require("../modules/table/emailStyles.js"),_moduleResolution=require("./moduleResolution.js");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const buildSerializationExtensions=function(){let{moduleConfig:e,modules:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,_utils.dedupeExtensions)([...(0,_constants.buildBaseExtensions)({}),...(0,_moduleResolution.buildModuleGroups)(t,e).flat().flatMap(e=>e.resolvedExtensions)])};exports.buildSerializationExtensions=buildSerializationExtensions;const buildEmptyParagraph=()=>({type:"paragraph"}),buildPlainInlineContent=e=>e?[{type:"text",text:e}]:[],buildInlineNodes=(e,t)=>(e||[]).reduce((e,n)=>{var l;if("text"===n.type||null!==(l=t.nodes[n.type])&&void 0!==l&&l.isInline)return[...e,n];const o=buildInlineNodes(n.content,t);return(0,_isEmpty.default)(o)?e:(0,_isEmpty.default)(e)?o:[...e,{type:"hardBreak"},...o]},[]),buildInlineHTMLContent=(e,t)=>{let{extensions:n,schema:l}=t;if(!e)return[];const{content:o}=(0,_html.generateJSON)("<p>".concat(e,"</p>"),n);return buildInlineNodes(o,l)},buildInlineContentResolver=function(){let{inlineHTML:e,moduleConfig:t,modules:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!e)return buildPlainInlineContent;const l=buildSerializationExtensions({moduleConfig:t,modules:n}),o=(0,_core.getSchema)(l);return e=>buildInlineHTMLContent(e,{extensions:l,schema:o})},PARAGRAPH_SEPARATOR=/(?:\r?\n){2,}/,LINE_SEPARATOR=/\r?\n/,buildParagraphContent=(e,t)=>e.split(LINE_SEPARATOR).map(t).reduce((e,t)=>(0,_isEmpty.default)(t)?e:(0,_isEmpty.default)(e)?t:[...e,{type:"hardBreak"},...t],[]),buildParagraphNodes=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return[buildEmptyParagraph()];const n=buildInlineContentResolver(t);return e.split(PARAGRAPH_SEPARATOR).map(e=>{const t=buildParagraphContent(e,n);return(0,_isEmpty.default)(t)?buildEmptyParagraph():{type:"paragraph",content:t}})};exports.buildParagraphNodes=buildParagraphNodes;const buildNodesFromHTML=function(e){let{moduleConfig:t,modules:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return[buildEmptyParagraph()];const{content:l}=(0,_html.generateJSON)(e,buildSerializationExtensions({moduleConfig:t,modules:n}));return(0,_isEmpty.default)(l)?[buildEmptyParagraph()]:l};exports.buildNodesFromHTML=buildNodesFromHTML;const TABLE_HEADER_TYPE="tableHeader",TABLE_EMAIL_STYLE="border-collapse: collapse; width: 100%; border-spacing: 0;",buildParagraph=(e,t)=>({type:"paragraph",content:e?t(String(e)):[]}),buildTableNode=e=>{let{cellColwidth:t,headers:n,inlineHTML:l,moduleConfig:o,modules:i,rows:r}=e;const a=buildInlineContentResolver({inlineHTML:l,moduleConfig:o,modules:i});return{type:"table",attrs:{style:TABLE_EMAIL_STYLE},content:[{type:"tableRow",content:n.map(e=>({type:"tableHeader",attrs:{colspan:1,colwidth:t?[t]:null,rowspan:1,style:_emailStyles.HEADER_CELL_EMAIL_STYLE},content:[buildParagraph(e,a)]}))},...r.map(e=>({type:"tableRow",content:e.map(e=>({type:"tableCell",attrs:{colspan:1,colwidth:t?[t]:null,rowspan:1,style:_emailStyles.DATA_CELL_EMAIL_STYLE},content:[buildParagraph(e,a)]}))}))]}};exports.buildTableNode=buildTableNode;const serializeInlineContent=(e,t)=>(e||[]).map(e=>(0,_html.generateHTML)({type:"doc",content:[e]},t).replace(/^<p>|<\/p>$/g,"")).filter(Boolean).join("<br>"),readTableNode=function(e){var t;let{moduleConfig:n,modules:l}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const o=buildSerializationExtensions({moduleConfig:n,modules:l}),i=e=>serializeInlineContent(e.content,o),r=(null==e?void 0:e.content)||[],a="tableHeader"===(null===(t=r[0])||void 0===t||null===(t=t.content)||void 0===t||null===(t=t[0])||void 0===t?void 0:t.type),[s,d]=a?[r[0],r.slice(1)]:[null,r],u=((null==s?void 0:s.content)||[]).map(e=>{var t;return null===(t=e.attrs)||void 0===t||null===(t=t.colwidth)||void 0===t?void 0:t[0]}),[p]=u;return{cellColwidth:u.every(e=>e===p)&&null!=p?p:void 0,headers:((null==s?void 0:s.content)||[]).map(i),inlineHTML:!0,rows:d.map(e=>(e.content||[]).map(i))}};exports.readTableNode=readTableNode;const serializeToHTML=function(e){let{moduleConfig:t,modules:n}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,_html.generateHTML)(e,buildSerializationExtensions({moduleConfig:t,modules:n}))};exports.serializeToHTML=serializeToHTML;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.TEST_IDS=exports.ID_CONSTANTS=void 0;const ID_CONSTANTS=exports.ID_CONSTANTS={ACTIONS:"actions",ADD_FILTER_BUTTON:"addFilterButton",AVATAR:"avatar",BOTTOM_NAV:"bottomNav",CANVAS:"canvas",CELL:"cell",CLEAR_BUTTON:"clearButton",CLIENT_FILTER:"clientFilter",COLLAPSED_PANEL_CONTENT:"collapsedPanelContent",COLLAPSE_BUTTON:"collapseButton",COLLAPSE_BUTTON_TOOLTIP:"collapseButtonTooltip",CREDIT_CARD:"creditCard",CUSTOM_SEARCH_ACTION:"customSearchAction",DATA_CATEGORY:"dataCategory",DATA_ELEMENT:"dataElement",DELETE_BUTTON:"deleteButton",DELETE_BUTTON_TOOLTIP:"deleteButtonTooltip",ADDITIONAL_CONTENT:"additionalContent",ADDITIONAL_CONTENT_BODY:"additionalContentBody",DESCRIPTION:"description",DIALOG:"dialog",EDIT_BUTTON:"editButton",EDIT_BUTTON_TOOLTIP:"editButtonTooltip",EXPANDED_PANEL_CONTENT:"expandedPanelContent",EXPANDED_PANEL_CONTENT_CATEGORY:"expandedPanelContentCategory",EXPANDED_PANEL_CONTENT_CATEGORY_EMPTY:"expandedPanelContentCategoryEmpty",EXPANDED_PANEL_CONTENT_CATEGORY_HEADER:"expandedPanelContentCategoryHeader",EXPANDED_PANEL_CONTENT_CATEGORY_ITEM:"expandedPanelContentCategoryItem",EXPANDED_PANEL_CONTENT_HEADER:"expandedPanelContentHeader",EXPAND_BUTTON:"expandButton",FILTER_GROUPING:"filterGrouping",GROUPING_PANEL:"groupingPanel",HEADER:"header",HELP_TEXT:"helpText",ICON:"icon",INVALID_PARAMS:"invalidParams",LABEL:"label",MAIN_BUTTON:"mainButton",NAME:"name",NAME_CONTAINER:"nameContainer",ONBOARDING:"onboarding",PAGINATION_NEXT:"paginationNext",PAGINATION_PREV:"paginationPrev",PANEL:"panel",PERSISTENT_FILTER:"persistentFilter",PINNED:"pinned",POPPER:"popper",SEARCH_BUTTON:"searchButton",SECONDARY_ACTION:"secondaryAction",SEARCH_BUTTON_TOOLTIP:"searchButtonTooltip",SEARCH_FIELD:"searchField",SELECTION_COMPONENT:"selectionComponent",SIDEBAR:"sidebar",SIDEBAR_BUTTON:"sidebarButton",STATUS_MESSAGE:"statusMessage",TABLE:"table",TERTIARY_ACTION:"tertiaryAction",TABLE_ROW:"tableRow",TITLE:"title",USER_FILTER:"userFilter",UT_RICH_TEXT:"UTRichText",UT_SNACKBAR:"UTSnackbar",VALIDATION_DATA:"validationData",WORKFLOW_CONTAINER:"workflowContainer"},TEST_IDS=exports.TEST_IDS={barChart:{bar:{tooltip:"barChart.bar.tooltip."},xAxis:{secondaryLabel:"barChart.xAxis.secondaryLabel.",mainLabel:"barChart.xAxis.mainLabel."}},breadcrumbs:{item:"breadcrumbs.item"},creditCard:{cardField:"".concat(ID_CONSTANTS.CREDIT_CARD,".cardField"),cvcField:"".concat(ID_CONSTANTS.CREDIT_CARD,".cvcField"),expires:"".concat(ID_CONSTANTS.CREDIT_CARD,".expires"),nameField:"".concat(ID_CONSTANTS.CREDIT_CARD,".nameField")},dataCategory:{container:"".concat(ID_CONSTANTS.DATA_CATEGORY,".container"),collapseButton:"".concat(ID_CONSTANTS.DATA_CATEGORY,".collapseButton"),item:"".concat(ID_CONSTANTS.DATA_CATEGORY,".item")},dataElement:{container:"".concat(ID_CONSTANTS.DATA_ELEMENT,".container"),collapseButton:"".concat(ID_CONSTANTS.DATA_ELEMENT,".collapseButton"),switchAction:"".concat(ID_CONSTANTS.DATA_ELEMENT,".actionSwitch"),buttonAction:"".concat(ID_CONSTANTS.DATA_ELEMENT,".actionButton")},dialog:{acceptButton:"".concat(ID_CONSTANTS.DIALOG,".acceptButton"),cancelButton:"".concat(ID_CONSTANTS.DIALOG,".cancelButton"),closeButton:"".concat(ID_CONSTANTS.DIALOG,".closeButton"),title:"".concat(ID_CONSTANTS.DIALOG,".title")},filterGrouping:{groupingPanel:{collapsedPanelContent:{expandButton:"".concat(ID_CONSTANTS.FILTER_GROUPING,".").concat(ID_CONSTANTS.GROUPING_PANEL,".").concat(ID_CONSTANTS.COLLAPSED_PANEL_CONTENT,".").concat(ID_CONSTANTS.EXPAND_BUTTON)},expandedPanelContent:{expandedPanelContentCategory:"".concat(ID_CONSTANTS.FILTER_GROUPING,".").concat(ID_CONSTANTS.GROUPING_PANEL,".").concat(ID_CONSTANTS.EXPANDED_PANEL_CONTENT,".").concat(ID_CONSTANTS.EXPANDED_PANEL_CONTENT_CATEGORY),expandedPanelContentHeader:{addFilterButton:"".concat(ID_CONSTANTS.FILTER_GROUPING,".").concat(ID_CONSTANTS.GROUPING_PANEL,".").concat(ID_CONSTANTS.EXPANDED_PANEL_CONTENT,".").concat(ID_CONSTANTS.EXPANDED_PANEL_CONTENT_HEADER,".").concat(ID_CONSTANTS.ADD_FILTER_BUTTON),collapseButton:"".concat(ID_CONSTANTS.FILTER_GROUPING,".").concat(ID_CONSTANTS.GROUPING_PANEL,".").concat(ID_CONSTANTS.EXPANDED_PANEL_CONTENT,".").concat(ID_CONSTANTS.EXPANDED_PANEL_CONTENT_HEADER,".").concat(ID_CONSTANTS.COLLAPSE_BUTTON),collapseButtonTooltip:"".concat(ID_CONSTANTS.FILTER_GROUPING,".").concat(ID_CONSTANTS.GROUPING_PANEL,".").concat(ID_CONSTANTS.EXPANDED_PANEL_CONTENT,".").concat(ID_CONSTANTS.EXPANDED_PANEL_CONTENT_HEADER,".").concat(ID_CONSTANTS.COLLAPSE_BUTTON_TOOLTIP),customSearchAction:"".concat(ID_CONSTANTS.FILTER_GROUPING,".").concat(ID_CONSTANTS.GROUPING_PANEL,".").concat(ID_CONSTANTS.EXPANDED_PANEL_CONTENT,".").concat(ID_CONSTANTS.EXPANDED_PANEL_CONTENT_HEADER,".").concat(ID_CONSTANTS.CUSTOM_SEARCH_ACTION),searchButton:"".concat(ID_CONSTANTS.FILTER_GROUPING,".").concat(ID_CONSTANTS.GROUPING_PANEL,".").concat(ID_CONSTANTS.EXPANDED_PANEL_CONTENT,".").concat(ID_CONSTANTS.EXPANDED_PANEL_CONTENT_HEADER,".").concat(ID_CONSTANTS.SEARCH_BUTTON),searchButtonTooltip:"".concat(ID_CONSTANTS.FILTER_GROUPING,".").concat(ID_CONSTANTS.GROUPING_PANEL,".").concat(ID_CONSTANTS.EXPANDED_PANEL_CONTENT,".").concat(ID_CONSTANTS.EXPANDED_PANEL_CONTENT_HEADER,".").concat(ID_CONSTANTS.SEARCH_BUTTON_TOOLTIP),searchField:"".concat(ID_CONSTANTS.FILTER_GROUPING,".").concat(ID_CONSTANTS.GROUPING_PANEL,".").concat(ID_CONSTANTS.EXPANDED_PANEL_CONTENT,".").concat(ID_CONSTANTS.EXPANDED_PANEL_CONTENT_HEADER,".").concat(ID_CONSTANTS.SEARCH_FIELD),title:"".concat(ID_CONSTANTS.FILTER_GROUPING,".").concat(ID_CONSTANTS.GROUPING_PANEL,".").concat(ID_CONSTANTS.EXPANDED_PANEL_CONTENT,".").concat(ID_CONSTANTS.EXPANDED_PANEL_CONTENT_HEADER,".").concat(ID_CONSTANTS.TITLE)}}}},onboarding:{close:"".concat(ID_CONSTANTS.ONBOARDING,".close"),description:"".concat(ID_CONSTANTS.ONBOARDING,".description"),nextButton:"".concat(ID_CONSTANTS.ONBOARDING,".nextButton"),prevButton:"".concat(ID_CONSTANTS.ONBOARDING,".prevButton"),title:"".concat(ID_CONSTANTS.ONBOARDING,".title")},panel:{additionalContent:{body:"".concat(ID_CONSTANTS.PANEL,".").concat(ID_CONSTANTS.ADDITIONAL_CONTENT,".").concat(ID_CONSTANTS.ADDITIONAL_CONTENT_BODY),sidebar:"".concat(ID_CONSTANTS.PANEL,".").concat(ID_CONSTANTS.ADDITIONAL_CONTENT,".").concat(ID_CONSTANTS.SIDEBAR),sidebarButton:"".concat(ID_CONSTANTS.PANEL,".").concat(ID_CONSTANTS.ADDITIONAL_CONTENT,".").concat(ID_CONSTANTS.SIDEBAR_BUTTON,".")},backButton:"".concat(ID_CONSTANTS.PANEL,".backButton"),closeButton:"".concat(ID_CONSTANTS.PANEL,".closeButton"),mainAction:"".concat(ID_CONSTANTS.PANEL,".mainAction"),mainButton:"".concat(ID_CONSTANTS.PANEL,".").concat(ID_CONSTANTS.MAIN_BUTTON),paginationNext:"".concat(ID_CONSTANTS.PANEL,".").concat(ID_CONSTANTS.PAGINATION_NEXT),paginationPrev:"".concat(ID_CONSTANTS.PANEL,".").concat(ID_CONSTANTS.PAGINATION_PREV),secondaryAction:"".concat(ID_CONSTANTS.PANEL,".secondaryAction"),title:"".concat(ID_CONSTANTS.PANEL,".title")},signature:"signature",snackBar:{closeButton:"snackbar.closeButton",label:"snackbar.label"},statusMessage:{chip:"".concat(ID_CONSTANTS.STATUS_MESSAGE,".chip"),description:"".concat(ID_CONSTANTS.STATUS_MESSAGE,".description"),flag:"".concat(ID_CONSTANTS.STATUS_MESSAGE,".flag"),helperText:"".concat(ID_CONSTANTS.STATUS_MESSAGE,".helperText"),icon:"".concat(ID_CONSTANTS.STATUS_MESSAGE,".icon"),title:"".concat(ID_CONSTANTS.STATUS_MESSAGE,".title")},table:{tableHeader:{title:"".concat(ID_CONSTANTS.TABLE,".tableHeader.title")}},tabs:{tab:"tabs.tab."},wrapperObservation:{actionIcon:"wrapperObservation.actionIcon."},UTLoading:{logoLoader:"UTLoading.logoLoader",spinner:"UTLoading.spinner"},UTRichText:{content:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".content"),field:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".field"),helpText:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".").concat(ID_CONSTANTS.HELP_TEXT),label:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".").concat(ID_CONSTANTS.LABEL),root:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".root"),submitButton:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".submitButton"),tableToolbar:{addColumnAfter:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".tableToolbar.addColumnAfter"),addColumnBefore:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".tableToolbar.addColumnBefore"),addRowAfter:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".tableToolbar.addRowAfter"),deleteColumn:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".tableToolbar.deleteColumn"),deleteRow:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".tableToolbar.deleteRow"),deleteTable:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".tableToolbar.deleteTable"),root:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".tableToolbar.root")},toolbar:{bold:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".toolbar.bold"),italic:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".toolbar.italic"),list:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".toolbar.list"),listNumbers:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".toolbar.listNumbers"),root:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".toolbar.root"),table:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".toolbar.table")},validation:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".").concat(ID_CONSTANTS.VALIDATION_DATA)},UTSnackbar:{closeButton:"".concat(ID_CONSTANTS.UT_SNACKBAR,".closeButton"),description:"".concat(ID_CONSTANTS.UT_SNACKBAR,".description"),label:"".concat(ID_CONSTANTS.UT_SNACKBAR,".label"),primaryActionButton:"".concat(ID_CONSTANTS.UT_SNACKBAR,".primaryActionButton"),root:"".concat(ID_CONSTANTS.UT_SNACKBAR,".root"),secondaryActionButton:"".concat(ID_CONSTANTS.UT_SNACKBAR,".secondaryActionButton")},UTDatePickerV1TestID:{calendar:"UTDatePickerV1.calendar",calendarPrevBtn:"UTDatePickerV1.calendarPrevBtn",calendarNextBtn:"UTDatePickerV1.calendarNextBtn",calendarMonthYear:"UTDatePickerV1.calendarMonthYear"},workflowContainer:{bottomNav:{backButton:"".concat(ID_CONSTANTS.WORKFLOW_CONTAINER,".").concat(ID_CONSTANTS.BOTTOM_NAV,".backButton"),nextButton:"".concat(ID_CONSTANTS.WORKFLOW_CONTAINER,".").concat(ID_CONSTANTS.BOTTOM_NAV,".nextButton"),primaryAction:"".concat(ID_CONSTANTS.WORKFLOW_CONTAINER,".").concat(ID_CONSTANTS.BOTTOM_NAV,".primaryAction"),secondaryAction:"".concat(ID_CONSTANTS.WORKFLOW_CONTAINER,".").concat(ID_CONSTANTS.BOTTOM_NAV,".secondaryAction")},header:{helpText:"".concat(ID_CONSTANTS.WORKFLOW_CONTAINER,".").concat(ID_CONSTANTS.HEADER,".helpText"),requiredFieldInfo:"".concat(ID_CONSTANTS.WORKFLOW_CONTAINER,".").concat(ID_CONSTANTS.HEADER,".requiredFieldInfo"),subtitle:"".concat(ID_CONSTANTS.WORKFLOW_CONTAINER,".").concat(ID_CONSTANTS.HEADER,".subtitle"),tagline:"".concat(ID_CONSTANTS.WORKFLOW_CONTAINER,".").concat(ID_CONSTANTS.HEADER,".tagline"),title:"".concat(ID_CONSTANTS.WORKFLOW_CONTAINER,".").concat(ID_CONSTANTS.HEADER,".title")}}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.TEST_IDS=exports.ID_CONSTANTS=void 0;const ID_CONSTANTS=exports.ID_CONSTANTS={ACTIONS:"actions",ADD_FILTER_BUTTON:"addFilterButton",AVATAR:"avatar",BOTTOM_NAV:"bottomNav",CANVAS:"canvas",CELL:"cell",CLEAR_BUTTON:"clearButton",CLIENT_FILTER:"clientFilter",COLLAPSED_PANEL_CONTENT:"collapsedPanelContent",COLLAPSE_BUTTON:"collapseButton",COLLAPSE_BUTTON_TOOLTIP:"collapseButtonTooltip",CREDIT_CARD:"creditCard",CUSTOM_SEARCH_ACTION:"customSearchAction",DATA_CATEGORY:"dataCategory",DATA_ELEMENT:"dataElement",DELETE_BUTTON:"deleteButton",DELETE_BUTTON_TOOLTIP:"deleteButtonTooltip",ADDITIONAL_CONTENT:"additionalContent",ADDITIONAL_CONTENT_BODY:"additionalContentBody",DESCRIPTION:"description",DIALOG:"dialog",EDIT_BUTTON:"editButton",EDIT_BUTTON_TOOLTIP:"editButtonTooltip",EXPANDED_PANEL_CONTENT:"expandedPanelContent",EXPANDED_PANEL_CONTENT_CATEGORY:"expandedPanelContentCategory",EXPANDED_PANEL_CONTENT_CATEGORY_EMPTY:"expandedPanelContentCategoryEmpty",EXPANDED_PANEL_CONTENT_CATEGORY_HEADER:"expandedPanelContentCategoryHeader",EXPANDED_PANEL_CONTENT_CATEGORY_ITEM:"expandedPanelContentCategoryItem",EXPANDED_PANEL_CONTENT_HEADER:"expandedPanelContentHeader",EXPAND_BUTTON:"expandButton",FILTER_GROUPING:"filterGrouping",GROUPING_PANEL:"groupingPanel",HEADER:"header",HELP_TEXT:"helpText",ICON:"icon",INVALID_PARAMS:"invalidParams",LABEL:"label",MAIN_BUTTON:"mainButton",NAME:"name",NAME_CONTAINER:"nameContainer",ONBOARDING:"onboarding",PAGINATION_NEXT:"paginationNext",PAGINATION_PREV:"paginationPrev",PANEL:"panel",PERSISTENT_FILTER:"persistentFilter",PINNED:"pinned",POPPER:"popper",SEARCH_BUTTON:"searchButton",SECONDARY_ACTION:"secondaryAction",SEARCH_BUTTON_TOOLTIP:"searchButtonTooltip",SEARCH_FIELD:"searchField",SELECTION_COMPONENT:"selectionComponent",SIDEBAR:"sidebar",SIDEBAR_BUTTON:"sidebarButton",STATUS_MESSAGE:"statusMessage",TABLE:"table",TERTIARY_ACTION:"tertiaryAction",TABLE_ROW:"tableRow",TITLE:"title",USER_FILTER:"userFilter",UT_RICH_TEXT:"UTRichText",UT_SNACKBAR:"UTSnackbar",VALIDATION_DATA:"validationData",WORKFLOW_CONTAINER:"workflowContainer"},TEST_IDS=exports.TEST_IDS={barChart:{bar:{tooltip:"barChart.bar.tooltip."},xAxis:{secondaryLabel:"barChart.xAxis.secondaryLabel.",mainLabel:"barChart.xAxis.mainLabel."}},breadcrumbs:{item:"breadcrumbs.item"},creditCard:{cardField:"".concat(ID_CONSTANTS.CREDIT_CARD,".cardField"),cvcField:"".concat(ID_CONSTANTS.CREDIT_CARD,".cvcField"),expires:"".concat(ID_CONSTANTS.CREDIT_CARD,".expires"),nameField:"".concat(ID_CONSTANTS.CREDIT_CARD,".nameField")},dataCategory:{container:"".concat(ID_CONSTANTS.DATA_CATEGORY,".container"),collapseButton:"".concat(ID_CONSTANTS.DATA_CATEGORY,".collapseButton"),item:"".concat(ID_CONSTANTS.DATA_CATEGORY,".item")},dataElement:{container:"".concat(ID_CONSTANTS.DATA_ELEMENT,".container"),collapseButton:"".concat(ID_CONSTANTS.DATA_ELEMENT,".collapseButton"),switchAction:"".concat(ID_CONSTANTS.DATA_ELEMENT,".actionSwitch"),buttonAction:"".concat(ID_CONSTANTS.DATA_ELEMENT,".actionButton")},dialog:{acceptButton:"".concat(ID_CONSTANTS.DIALOG,".acceptButton"),cancelButton:"".concat(ID_CONSTANTS.DIALOG,".cancelButton"),closeButton:"".concat(ID_CONSTANTS.DIALOG,".closeButton"),title:"".concat(ID_CONSTANTS.DIALOG,".title")},filterGrouping:{groupingPanel:{collapsedPanelContent:{expandButton:"".concat(ID_CONSTANTS.FILTER_GROUPING,".").concat(ID_CONSTANTS.GROUPING_PANEL,".").concat(ID_CONSTANTS.COLLAPSED_PANEL_CONTENT,".").concat(ID_CONSTANTS.EXPAND_BUTTON)},expandedPanelContent:{expandedPanelContentCategory:"".concat(ID_CONSTANTS.FILTER_GROUPING,".").concat(ID_CONSTANTS.GROUPING_PANEL,".").concat(ID_CONSTANTS.EXPANDED_PANEL_CONTENT,".").concat(ID_CONSTANTS.EXPANDED_PANEL_CONTENT_CATEGORY),expandedPanelContentHeader:{addFilterButton:"".concat(ID_CONSTANTS.FILTER_GROUPING,".").concat(ID_CONSTANTS.GROUPING_PANEL,".").concat(ID_CONSTANTS.EXPANDED_PANEL_CONTENT,".").concat(ID_CONSTANTS.EXPANDED_PANEL_CONTENT_HEADER,".").concat(ID_CONSTANTS.ADD_FILTER_BUTTON),collapseButton:"".concat(ID_CONSTANTS.FILTER_GROUPING,".").concat(ID_CONSTANTS.GROUPING_PANEL,".").concat(ID_CONSTANTS.EXPANDED_PANEL_CONTENT,".").concat(ID_CONSTANTS.EXPANDED_PANEL_CONTENT_HEADER,".").concat(ID_CONSTANTS.COLLAPSE_BUTTON),collapseButtonTooltip:"".concat(ID_CONSTANTS.FILTER_GROUPING,".").concat(ID_CONSTANTS.GROUPING_PANEL,".").concat(ID_CONSTANTS.EXPANDED_PANEL_CONTENT,".").concat(ID_CONSTANTS.EXPANDED_PANEL_CONTENT_HEADER,".").concat(ID_CONSTANTS.COLLAPSE_BUTTON_TOOLTIP),customSearchAction:"".concat(ID_CONSTANTS.FILTER_GROUPING,".").concat(ID_CONSTANTS.GROUPING_PANEL,".").concat(ID_CONSTANTS.EXPANDED_PANEL_CONTENT,".").concat(ID_CONSTANTS.EXPANDED_PANEL_CONTENT_HEADER,".").concat(ID_CONSTANTS.CUSTOM_SEARCH_ACTION),searchButton:"".concat(ID_CONSTANTS.FILTER_GROUPING,".").concat(ID_CONSTANTS.GROUPING_PANEL,".").concat(ID_CONSTANTS.EXPANDED_PANEL_CONTENT,".").concat(ID_CONSTANTS.EXPANDED_PANEL_CONTENT_HEADER,".").concat(ID_CONSTANTS.SEARCH_BUTTON),searchButtonTooltip:"".concat(ID_CONSTANTS.FILTER_GROUPING,".").concat(ID_CONSTANTS.GROUPING_PANEL,".").concat(ID_CONSTANTS.EXPANDED_PANEL_CONTENT,".").concat(ID_CONSTANTS.EXPANDED_PANEL_CONTENT_HEADER,".").concat(ID_CONSTANTS.SEARCH_BUTTON_TOOLTIP),searchField:"".concat(ID_CONSTANTS.FILTER_GROUPING,".").concat(ID_CONSTANTS.GROUPING_PANEL,".").concat(ID_CONSTANTS.EXPANDED_PANEL_CONTENT,".").concat(ID_CONSTANTS.EXPANDED_PANEL_CONTENT_HEADER,".").concat(ID_CONSTANTS.SEARCH_FIELD),title:"".concat(ID_CONSTANTS.FILTER_GROUPING,".").concat(ID_CONSTANTS.GROUPING_PANEL,".").concat(ID_CONSTANTS.EXPANDED_PANEL_CONTENT,".").concat(ID_CONSTANTS.EXPANDED_PANEL_CONTENT_HEADER,".").concat(ID_CONSTANTS.TITLE)}}}},onboarding:{close:"".concat(ID_CONSTANTS.ONBOARDING,".close"),description:"".concat(ID_CONSTANTS.ONBOARDING,".description"),nextButton:"".concat(ID_CONSTANTS.ONBOARDING,".nextButton"),prevButton:"".concat(ID_CONSTANTS.ONBOARDING,".prevButton"),title:"".concat(ID_CONSTANTS.ONBOARDING,".title")},panel:{additionalContent:{body:"".concat(ID_CONSTANTS.PANEL,".").concat(ID_CONSTANTS.ADDITIONAL_CONTENT,".").concat(ID_CONSTANTS.ADDITIONAL_CONTENT_BODY),sidebar:"".concat(ID_CONSTANTS.PANEL,".").concat(ID_CONSTANTS.ADDITIONAL_CONTENT,".").concat(ID_CONSTANTS.SIDEBAR),sidebarButton:"".concat(ID_CONSTANTS.PANEL,".").concat(ID_CONSTANTS.ADDITIONAL_CONTENT,".").concat(ID_CONSTANTS.SIDEBAR_BUTTON,".")},backButton:"".concat(ID_CONSTANTS.PANEL,".backButton"),closeButton:"".concat(ID_CONSTANTS.PANEL,".closeButton"),mainAction:"".concat(ID_CONSTANTS.PANEL,".mainAction"),mainButton:"".concat(ID_CONSTANTS.PANEL,".").concat(ID_CONSTANTS.MAIN_BUTTON),paginationNext:"".concat(ID_CONSTANTS.PANEL,".").concat(ID_CONSTANTS.PAGINATION_NEXT),paginationPrev:"".concat(ID_CONSTANTS.PANEL,".").concat(ID_CONSTANTS.PAGINATION_PREV),secondaryAction:"".concat(ID_CONSTANTS.PANEL,".secondaryAction"),title:"".concat(ID_CONSTANTS.PANEL,".title")},signature:"signature",snackBar:{closeButton:"snackbar.closeButton",label:"snackbar.label"},statusMessage:{chip:"".concat(ID_CONSTANTS.STATUS_MESSAGE,".chip"),description:"".concat(ID_CONSTANTS.STATUS_MESSAGE,".description"),flag:"".concat(ID_CONSTANTS.STATUS_MESSAGE,".flag"),helperText:"".concat(ID_CONSTANTS.STATUS_MESSAGE,".helperText"),icon:"".concat(ID_CONSTANTS.STATUS_MESSAGE,".icon"),title:"".concat(ID_CONSTANTS.STATUS_MESSAGE,".title")},table:{tableHeader:{title:"".concat(ID_CONSTANTS.TABLE,".tableHeader.title")}},tabs:{tab:"tabs.tab."},wrapperObservation:{actionIcon:"wrapperObservation.actionIcon."},UTLoading:{logoLoader:"UTLoading.logoLoader",spinner:"UTLoading.spinner"},UTRichText:{content:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".content"),field:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".field"),helpText:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".").concat(ID_CONSTANTS.HELP_TEXT),label:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".").concat(ID_CONSTANTS.LABEL),root:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".root"),submitButton:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".submitButton"),tableHandle:{cell:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".tableHandle.cell"),column:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".tableHandle.column"),row:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".tableHandle.row"),table:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".tableHandle.table")},tableMenu:{cell:{addColumnAfter:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".tableMenu.cell.addColumnAfter"),addRowAfter:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".tableMenu.cell.addRowAfter"),clearCell:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".tableMenu.cell.clearCell"),deleteColumn:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".tableMenu.cell.deleteColumn"),deleteRow:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".tableMenu.cell.deleteRow"),root:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".tableMenu.cell.root")},column:{addColumnAfter:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".tableMenu.column.addColumnAfter"),addColumnBefore:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".tableMenu.column.addColumnBefore"),clearColumn:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".tableMenu.column.clearColumn"),deleteColumn:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".tableMenu.column.deleteColumn"),moveColumnLeft:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".tableMenu.column.moveColumnLeft"),moveColumnRight:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".tableMenu.column.moveColumnRight"),root:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".tableMenu.column.root"),toggleHeaderColumn:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".tableMenu.column.toggleHeaderColumn")},root:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".tableMenu.root"),row:{addRowAfter:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".tableMenu.row.addRowAfter"),addRowBefore:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".tableMenu.row.addRowBefore"),clearRow:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".tableMenu.row.clearRow"),deleteRow:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".tableMenu.row.deleteRow"),moveRowDown:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".tableMenu.row.moveRowDown"),moveRowUp:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".tableMenu.row.moveRowUp"),root:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".tableMenu.row.root"),toggleHeaderRow:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".tableMenu.row.toggleHeaderRow")},table:{clearTable:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".tableMenu.table.clearTable"),copyTable:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".tableMenu.table.copyTable"),deleteTable:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".tableMenu.table.deleteTable"),root:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".tableMenu.table.root"),toggleHeaderColumn:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".tableMenu.table.toggleHeaderColumn"),toggleHeaderRow:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".tableMenu.table.toggleHeaderRow")}},toolbar:{bold:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".toolbar.bold"),italic:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".toolbar.italic"),list:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".toolbar.list"),listNumbers:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".toolbar.listNumbers"),root:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".toolbar.root"),table:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".toolbar.table")},validation:"".concat(ID_CONSTANTS.UT_RICH_TEXT,".").concat(ID_CONSTANTS.VALIDATION_DATA)},UTSnackbar:{closeButton:"".concat(ID_CONSTANTS.UT_SNACKBAR,".closeButton"),description:"".concat(ID_CONSTANTS.UT_SNACKBAR,".description"),label:"".concat(ID_CONSTANTS.UT_SNACKBAR,".label"),primaryActionButton:"".concat(ID_CONSTANTS.UT_SNACKBAR,".primaryActionButton"),root:"".concat(ID_CONSTANTS.UT_SNACKBAR,".root"),secondaryActionButton:"".concat(ID_CONSTANTS.UT_SNACKBAR,".secondaryActionButton")},UTDatePickerV1TestID:{calendar:"UTDatePickerV1.calendar",calendarPrevBtn:"UTDatePickerV1.calendarPrevBtn",calendarNextBtn:"UTDatePickerV1.calendarNextBtn",calendarMonthYear:"UTDatePickerV1.calendarMonthYear"},workflowContainer:{bottomNav:{backButton:"".concat(ID_CONSTANTS.WORKFLOW_CONTAINER,".").concat(ID_CONSTANTS.BOTTOM_NAV,".backButton"),nextButton:"".concat(ID_CONSTANTS.WORKFLOW_CONTAINER,".").concat(ID_CONSTANTS.BOTTOM_NAV,".nextButton"),primaryAction:"".concat(ID_CONSTANTS.WORKFLOW_CONTAINER,".").concat(ID_CONSTANTS.BOTTOM_NAV,".primaryAction"),secondaryAction:"".concat(ID_CONSTANTS.WORKFLOW_CONTAINER,".").concat(ID_CONSTANTS.BOTTOM_NAV,".secondaryAction")},header:{helpText:"".concat(ID_CONSTANTS.WORKFLOW_CONTAINER,".").concat(ID_CONSTANTS.HEADER,".helpText"),requiredFieldInfo:"".concat(ID_CONSTANTS.WORKFLOW_CONTAINER,".").concat(ID_CONSTANTS.HEADER,".requiredFieldInfo"),subtitle:"".concat(ID_CONSTANTS.WORKFLOW_CONTAINER,".").concat(ID_CONSTANTS.HEADER,".subtitle"),tagline:"".concat(ID_CONSTANTS.WORKFLOW_CONTAINER,".").concat(ID_CONSTANTS.HEADER,".tagline"),title:"".concat(ID_CONSTANTS.WORKFLOW_CONTAINER,".").concat(ID_CONSTANTS.HEADER,".title")}}};
@@ -0,0 +1 @@
1
+ import React from"react";import{bool,objectOf,string}from"prop-types";import UTIcon from"../../../../../UTIcon";import{CHECKED_ICON,INDETERMINATE_ICON}from"../../constants";import styles from"../../styles.module.scss";const CheckboxControl=e=>{let{classes:t,dataTestId:o,indeterminate:a,isSimple:s=!1,value:c=!1}=e;const n=a?INDETERMINATE_ICON:!0===c?CHECKED_ICON:"";return React.createElement("div",{className:t.boxContainer,"data-testid":o},s?React.createElement(UTIcon,{className:c?void 0:styles.hidden,colorTheme:"accent",name:CHECKED_ICON,shade:"04"}):React.createElement("div",{className:t.box},React.createElement("div",{className:t.iconContainer},n&&React.createElement(UTIcon,{colorTheme:"light",name:n,size:10}))))};CheckboxControl.propTypes={classes:objectOf(string),dataTestId:string,indeterminate:bool,isSimple:bool,value:bool};export default CheckboxControl;
@@ -0,0 +1 @@
1
+ function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var o=1;o<arguments.length;o++){var t=arguments[o];for(var r in t)({}).hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},_extends.apply(null,arguments)}import React from"react";import{bool,elementType,object,objectOf,oneOfType,shape,string}from"prop-types";import UTIcon from"../../../../../UTIcon";import{CARD_ICON_AREA_RADIUS,CARD_ICON_AREA_SIZE,CARD_ICON_SIZE,ICON_CONTENT_TYPES}from"../../constants";import{getIconContentType}from"../../utils";const CheckboxIcon=e=>{let{classes:o,icon:t,iconProps:r={},iconSelectedProps:n={},isCard:c=!1,value:a=!1}=e;if(!t)return null;const s=getIconContentType(t);if(s===ICON_CONTENT_TYPES.IMAGE)return React.createElement("img",{alt:t.alt||"",className:o.iconImage,src:t.src});if(s===ICON_CONTENT_TYPES.COMPONENT){const e=t;return React.createElement(e,{className:o.icon})}return React.createElement(UTIcon,_extends({colorTheme:"dark",name:t,size:c?CARD_ICON_SIZE:void 0},c&&{area:!0,areaBackground:"var(--light01)",areaBorderColor:"var(--light04)",areaRadius:CARD_ICON_AREA_RADIUS,areaSize:CARD_ICON_AREA_SIZE},r,a?n:{}))};CheckboxIcon.propTypes={classes:objectOf(string),icon:oneOfType([string,elementType,shape({alt:string,src:string})]),iconProps:object,iconSelectedProps:object,isCard:bool,value:bool};export default CheckboxIcon;
@@ -0,0 +1 @@
1
+ import React from"react";import{bool,node,objectOf,string}from"prop-types";import UTLabel from"../../../../../UTLabel";const TitleAndDescription=e=>{let{children:t,classes:o,description:r,withContainer:i=!1}=e;return r||i?React.createElement("div",{className:o.contentContainer},t,r&&React.createElement(UTLabel,{className:o.description,colorTheme:"gray",variant:"body"},r)):t};TitleAndDescription.propTypes={children:node,classes:objectOf(string),description:string,withContainer:bool};export default TitleAndDescription;
@@ -0,0 +1 @@
1
+ import React from"react";import{node,objectOf,string}from"prop-types";import UTIcon from"../../../../../UTIcon";import UTLabel from"../../../../../UTLabel";import UTTooltip from"../../../../../UTTooltip";import{TOOLTIP_ICON_SIZE}from"../../constants";const TitleRow=e=>{let{children:t,classes:o,prefix:r,suffix:a,tooltip:c}=e;return r||a||c?React.createElement("div",{className:o.titleRow},r&&React.createElement(UTLabel,{colorTheme:"gray"},r),t,c&&React.createElement(UTTooltip,{content:c},React.createElement("span",{className:o.tooltip},React.createElement(UTIcon,{className:o.infoIcon,colorTheme:"gray",name:"IconHelp",shade:"04",size:TOOLTIP_ICON_SIZE}))),a&&React.createElement(UTLabel,{colorTheme:"gray"},a)):t};TitleRow.propTypes={children:node,classes:objectOf(string),prefix:string,suffix:string,tooltip:string};export default TitleRow;
@@ -1 +1 @@
1
- export const CHECKED_ICON="IconCheck";export const INDETERMINATE_ICON="IconMinus";export const SPACING={SMALL:"small",MEDIUM:"medium"};export const BUTTON_VARIANT="button";export const CARD_VARIANT="card";export const CARD_ICON_SIZE=16;export const CARD_ICON_AREA_SIZE=32;export const CARD_ICON_AREA_RADIUS="var(--UT-checkbox-card-icon-area-radius, 8px)";export const ICON_CONTENT_TYPES={UT_ICON:"utIcon",IMAGE:"image",COMPONENT:"component"};
1
+ export const CHECKED_ICON="IconCheck";export const INDETERMINATE_ICON="IconMinus";export const SPACING={SMALL:"small",MEDIUM:"medium"};export const BUTTON_VARIANT="button";export const CARD_VARIANT="card";export const CARD_ICON_SIZE=16;export const CARD_ICON_AREA_SIZE=32;export const CARD_ICON_AREA_RADIUS="var(--UT-checkbox-card-icon-area-radius, 8px)";export const TOOLTIP_ICON_SIZE=16;export const ICON_CONTENT_TYPES={UT_ICON:"utIcon",IMAGE:"image",COMPONENT:"component"};
@@ -1 +1 @@
1
- import React,{useMemo}from"react";import{arrayOf,bool,elementType,func,objectOf,oneOfType,shape,string}from"prop-types";import{shouldShowErrors}from"@widergy/web-utils/lib/form";import{mergeMultipleClassNames}from"../../../../utils/classesUtils";import UTFieldLabel from"../../../UTFieldLabel";import UTIcon from"../../../UTIcon";import UTLabel from"../../../UTLabel";import UTTooltip from"../../../UTTooltip";import WithTheme from"../../../WithTheme";import UTTouchableWithoutFeedback from"../../../UTTouchableWithoutFeedback";import{buttonTypes}from"../../../../types/buttonTypes";import{metaPropTypes}from"../../../../types/formTypes";import{formatErrorToValidation}from"../../../UTValidation/utils";import UTValidation from"../../../UTValidation";import{BUTTON_VARIANT,CARD_ICON_AREA_RADIUS,CARD_ICON_AREA_SIZE,CARD_ICON_SIZE,CARD_VARIANT,CHECKED_ICON,ICON_CONTENT_TYPES,INDETERMINATE_ICON}from"./constants";import{retrieveStyle}from"./theme";import{getIconContentType}from"./utils";import styles from"./styles.module.scss";const UTCheckbox=e=>{let{actions:t,checkboxDataTestId:a,classes:o,classNames:r,CustomComponent:c,dataTestId:n,description:i,disabled:l,icon:s,indeterminate:m,isSimple:T=!1,meta:d,onChange:p=()=>{},required:E,title:N,tooltip:R,value:u=!1,variant:C="default",withUpperTitle:I}=e;const h=useMemo(()=>mergeMultipleClassNames(o,r),[r,o]),b=C===CARD_VARIANT,U=useMemo(()=>m?INDETERMINATE_ICON:!0===u?CHECKED_ICON:"",[m,u]),f=()=>{!l&&p&&p(!u)},g=!0===u&&C===BUTTON_VARIANT,A=d&&shouldShowErrors(d)&&d.error||"",_=formatErrorToValidation(A);return b?React.createElement(React.Fragment,null,I&&React.createElement(UTFieldLabel,{actions:t,required:E},N),React.createElement(UTTouchableWithoutFeedback,{className:h.container,dataTestId:n,disabled:l,onMouseDown:f},React.createElement("div",{className:h.content},(()=>{if(!s)return null;const e=getIconContentType(s);if(e===ICON_CONTENT_TYPES.IMAGE)return React.createElement("img",{alt:s.alt||"",className:h.iconImage,src:s.src});if(e===ICON_CONTENT_TYPES.COMPONENT){const e=s;return React.createElement(e,{className:h.icon})}return React.createElement(UTIcon,{area:!0,areaBackground:"var(--light01)",areaBorderColor:"var(--light04)",areaRadius:CARD_ICON_AREA_RADIUS,areaSize:CARD_ICON_AREA_SIZE,colorTheme:"dark",name:s,size:CARD_ICON_SIZE})})(),React.createElement("div",{className:h.contentContainer},R?React.createElement("div",{className:h.titleAndTooltip},React.createElement(UTLabel,{className:h.name,colorTheme:"dark"},N),React.createElement(UTTooltip,{content:R},React.createElement("span",{className:h.tooltip},React.createElement(UTIcon,{className:h.infoIcon,colorTheme:u?"accent":l?"gray":"dark",name:"IconHelp",size:20})))):React.createElement(UTLabel,{className:h.name,colorTheme:"dark"},N),i&&React.createElement(UTLabel,{className:h.description,colorTheme:"gray",variant:"body"},i))),React.createElement("div",{className:h.boxContainer,"data-testid":a},React.createElement("div",{className:h.box},React.createElement("div",{className:h.iconContainer},U&&React.createElement(UTIcon,{colorTheme:"light",name:m?"IconMinus":"IconCheck",size:10})))),A&&React.createElement(UTValidation,{className:h.validation,validationData:_}))):React.createElement(React.Fragment,null,I&&React.createElement(UTFieldLabel,{actions:t,required:E},N),React.createElement(UTTouchableWithoutFeedback,{className:h.container,dataTestId:n,disabled:l,onMouseDown:f},React.createElement("div",{className:h.content},React.createElement("div",{className:h.boxContainer,"data-testid":a},T?React.createElement(UTIcon,{name:"IconCheck",shade:"04",colorTheme:"accent",className:u?void 0:styles.hidden}):React.createElement("div",{className:h.box},React.createElement("div",{className:h.iconContainer},U&&React.createElement(UTIcon,{colorTheme:"light",name:m?"IconMinus":"IconCheck",size:10})))),c||React.createElement(UTFieldLabel,{className:h.title,highlighted:g,icon:s,required:E},N)),A&&React.createElement(UTValidation,{className:h.validation,validationData:_})))};UTCheckbox.propTypes={actions:arrayOf(buttonTypes),checkboxDataTestId:string,classes:objectOf(string),classNames:objectOf(string),CustomComponent:elementType,dataTestId:string,description:string,disabled:bool,icon:oneOfType([string,elementType,shape({alt:string,src:string})]),indeterminate:bool,isSimple:bool,meta:metaPropTypes.isRequired,onChange:func,required:bool,title:string,tooltip:string,value:bool,variant:string,withUpperTitle:bool};export default WithTheme(retrieveStyle)(UTCheckbox);
1
+ function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)({}).hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},_extends.apply(null,arguments)}import React,{useMemo}from"react";import{arrayOf,bool,elementType,func,object,objectOf,oneOfType,shape,string}from"prop-types";import{shouldShowErrors}from"@widergy/web-utils/lib/form";import{mergeMultipleClassNames}from"../../../../utils/classesUtils";import UTFieldLabel from"../../../UTFieldLabel";import UTLabel from"../../../UTLabel";import WithTheme from"../../../WithTheme";import UTTouchableWithoutFeedback from"../../../UTTouchableWithoutFeedback";import{buttonTypes}from"../../../../types/buttonTypes";import{metaPropTypes}from"../../../../types/formTypes";import{formatErrorToValidation}from"../../../UTValidation/utils";import UTValidation from"../../../UTValidation";import CheckboxControl from"./components/CheckboxControl";import CheckboxIcon from"./components/CheckboxIcon";import TitleAndDescription from"./components/TitleAndDescription";import TitleRow from"./components/TitleRow";import{BUTTON_VARIANT,CARD_VARIANT}from"./constants";import{retrieveStyle}from"./theme";const UTCheckbox=e=>{let{actions:t,checkboxDataTestId:o,classes:r,classNames:a,CustomComponent:i,dataTestId:n,description:s,disabled:l,icon:c,iconProps:m={},iconSelectedProps:p={},indeterminate:d,isSimple:T=!1,meta:b,nameProps:f={},nameSelectedProps:u={},onChange:h=()=>{},prefix:R,required:g,suffix:C,title:x,tooltip:y,value:U=!1,variant:E="default",withUpperTitle:N}=e;const k=useMemo(()=>mergeMultipleClassNames(r,a),[a,r]),v=E===CARD_VARIANT,A=!0===U&&E===BUTTON_VARIANT,I=b&&shouldShowErrors(b)&&b.error||"",P=formatErrorToValidation(I),w=React.createElement(CheckboxControl,{classes:k,dataTestId:o,indeterminate:d,isSimple:!v&&T,value:U}),O=v?React.createElement(UTLabel,_extends({className:k.name,colorTheme:"dark"},f,U?u:{}),x):React.createElement(UTFieldLabel,{className:k.title,highlighted:A,required:g},x),S=React.createElement(React.Fragment,null,React.createElement(CheckboxIcon,{classes:k,icon:c,iconProps:m,iconSelectedProps:p,isCard:v,value:U}),React.createElement(TitleAndDescription,{classes:k,description:s,withContainer:v},React.createElement(TitleRow,{classes:k,prefix:R,suffix:C,tooltip:y},i||O)));return React.createElement(React.Fragment,null,N&&React.createElement(UTFieldLabel,{actions:t,required:g},x),React.createElement(UTTouchableWithoutFeedback,{className:k.container,dataTestId:n,disabled:l,onMouseDown:()=>{!l&&h&&h(!U)}},React.createElement("div",{className:k.content},v?S:React.createElement(React.Fragment,null,w,React.createElement("div",{className:k.labelContainer},S))),v&&w,I&&React.createElement(UTValidation,{className:k.validation,validationData:P})))};UTCheckbox.propTypes={actions:arrayOf(buttonTypes),checkboxDataTestId:string,classes:objectOf(string),classNames:objectOf(string),CustomComponent:elementType,dataTestId:string,description:string,disabled:bool,icon:oneOfType([string,elementType,shape({alt:string,src:string})]),iconProps:object,iconSelectedProps:object,indeterminate:bool,isSimple:bool,meta:metaPropTypes.isRequired,nameProps:object,nameSelectedProps:object,onChange:func,prefix:string,required:bool,suffix:string,title:string,tooltip:string,value:bool,variant:string,withUpperTitle:bool};export default WithTheme(retrieveStyle)(UTCheckbox);
@@ -1 +1 @@
1
- import{shouldShowErrors}from"@widergy/web-utils/lib/form";import{BUTTON_VARIANT,CARD_VARIANT,SPACING}from"./constants";const MEDIUM_SPACING="var(--UT-checkbox-gap-md, 8px)",SMALL_SPACING="var(--UT-checkbox-gap-sm, 4px)",baseCheckBoxTheme=e=>({container:{alignItems:"center !important",display:"flex",flexWrap:"wrap",gap:"0px"},content:{display:"flex",flexDirection:"row",alignItems:"center"},iconContainer:{border:"1px solid ".concat(e.Palette.light["05"]),borderRadius:"var(--UT-checkbox-radius, 4px)",display:"flex",height:"var(--UT-checkbox-size, 16px)",placeContent:"center",placeItems:"center",width:"var(--UT-checkbox-size, 16px)"},box:{borderRadius:25,overflow:"hidden",padding:3},validation:{flexBasis:"100%"},contentContainer:{display:"flex",flexDirection:"column",gap:"var(--UT-checkbox-content-gap, 4px)"},titleAndTooltip:{alignItems:"center",display:"flex",gap:"var(--gap-xs, 4px)"},tooltip:{display:"flex"},icon:{flexShrink:0,height:"36px",width:"36px"},iconImage:{borderRadius:"50%",flexShrink:0,height:"36px",objectFit:"cover",width:"36px"},infoIcon:{flexShrink:0},name:{},description:{}}),getCardTheme=e=>{var t,o,a,n;let{theme:r,error:i}=e;const l=(null===(t=r.Palette.actions)||void 0===t?void 0:t.accent["01"])||r.Palette.accent["01"],c=(null===(o=r.Palette.actions)||void 0===o?void 0:o.accent["02"])||r.Palette.accent["02"],d=(null===(a=r.Palette.actions)||void 0===a?void 0:a.accent["03"])||r.Palette.accent["03"],s=(null===(n=r.Palette.actions)||void 0===n?void 0:n.accent["05"])||r.Palette.accent["05"];return{base:{backgroundColor:r.Palette.light["01"],boxShadow:"none",outline:"1px solid ".concat(i?r.Palette.error["04"]:r.Palette.light["04"]," !important"),"&:hover":{backgroundColor:i?r.Palette.error["01"]:r.Palette.light["03"]},"&:active":{backgroundColor:i?r.Palette.error["02"]:r.Palette.light["04"],"& $description":{color:r.Palette.gray["03"]}}},selected:{boxShadow:"none",outline:"2px solid ".concat(d," !important"),"& $icon path":{fill:s},"&:hover":{backgroundColor:l,outline:"2px solid ".concat(d," !important")},"&:active":{backgroundColor:c,outline:"2px solid ".concat(d," !important")}},disabled:{backgroundColor:r.Palette.light["03"],boxShadow:"none",outline:"2px solid transparent !important",pointerEvents:"none","& $name, & $description":{color:r.Palette.gray["04"]},"& $icon path":{fill:r.Palette.gray["04"]}}}},getCardCheckboxColors=e=>{var t;let{isMarked:o,disabled:a,theme:n}=e;const r=(null===(t=n.Palette.actions)||void 0===t?void 0:t.accent["04"])||n.Palette.accent["04"],i=n.Palette.gray["04"];return{backgroundColor:o?a?i:r:"transparent",borderColor:o?a?i:r:n.Palette.light["05"]}},conditionalStyles=e=>{var t,o,a,n,r;let{value:i,indeterminate:l,reversed:c,spacing:d,variant:s,theme:p,disabled:h,error:x}=e;const g=d===SPACING.SMALL?SMALL_SPACING:MEDIUM_SPACING,b=s===CARD_VARIANT,v=b&&getCardTheme({theme:p,error:x}),u=!0===i||l;return{container:{...c&&{flexDirection:"row-reverse",justifyContent:"space-between"},...h&&!b&&{opacity:.5},...s===BUTTON_VARIANT&&{borderRadius:"8px",padding:"small"===d?"8px 12px":"12px 16px",backgroundColor:x?p.Palette.error["01"]:"transparent","&:active, &:hover":{transition:"background-color 0.1s ease-in-out"},"&:active":{backgroundColor:x?p.Palette.error["02"]:p.Palette.light["04"]},"&:hover":{backgroundColor:x?p.Palette.error["02"]:p.Palette.light["03"]}},...b&&{borderRadius:"var(--UT-checkbox-card-radius, 12px)",gap:g,minHeight:"var(--UT-checkbox-card-min-height, 24px)",overflow:"visible",padding:"var(--UT-checkbox-card-padding-y, 12px) var(--UT-checkbox-card-padding-x, 16px)",...h?v.disabled:i?v.selected:v.base}},content:{...c&&{flexDirection:"row-reverse",justifyContent:"space-between",...s===BUTTON_VARIANT&&{width:"100%"}},...b&&{gap:g,marginRight:"auto"}},iconContainer:{...x&&{borderColor:p.Palette.error["04"]},...u&&{backgroundColor:(null===(t=p.Palette.actions)||void 0===t?void 0:t.accent["04"])||p.Palette.accent["04"],borderColor:(null===(o=p.Palette.actions)||void 0===o?void 0:o.accent["04"])||p.Palette.accent["04"]},...b&&getCardCheckboxColors({isMarked:u,disabled:h,theme:p})},boxContainer:{...b?{}:c?{marginLeft:g,marginRight:0}:{marginRight:g},...s!==BUTTON_VARIANT&&!b&&{"&:active, &:hover":{"& $box":{borderColor:x?p.Palette.error["03"]:(null===(a=p.Palette.actions)||void 0===a?void 0:a.accent["03"])||p.Palette.accent["03"],borderWidth:1,overflow:"hidden",transition:"background-color 0.1s ease-in-out"}},"&:active":{"& $box":{backgroundColor:x?p.Palette.error["02"]:(null===(n=p.Palette.actions)||void 0===n?void 0:n.accent["02"])||p.Palette.accent["02"]}},"&:hover":{"& $box":{backgroundColor:x?p.Palette.error["01"]:(null===(r=p.Palette.actions)||void 0===r?void 0:r.accent["01"])||p.Palette.accent["01"]}}}},title:s===BUTTON_VARIANT&&{userSelect:"none"}}};export const retrieveStyle=e=>{let{value:t,disabled:o,indeterminate:a,reversed:n,spacing:r,theme:i,variant:l,meta:c}=e;const d=baseCheckBoxTheme(i),s=c&&shouldShowErrors(c),{container:p,content:h,iconContainer:x,boxContainer:g,title:b}=conditionalStyles({value:t,disabled:o,indeterminate:a,reversed:n,spacing:r,variant:l,theme:i,error:s});return{box:d.box,content:{...d.content,...h},container:{...d.container,...p},iconContainer:{...d.iconContainer,...x},boxContainer:g,title:b,validation:d.validation,contentContainer:d.contentContainer,titleAndTooltip:d.titleAndTooltip,tooltip:d.tooltip,icon:d.icon,iconImage:d.iconImage,infoIcon:d.infoIcon,name:d.name,description:d.description}};
1
+ import{shouldShowErrors}from"@widergy/web-utils/lib/form";import{BUTTON_VARIANT,CARD_VARIANT,SPACING}from"./constants";const MEDIUM_SPACING="var(--UT-checkbox-gap-md, 8px)",SMALL_SPACING="var(--UT-checkbox-gap-sm, 4px)",baseCheckBoxTheme=e=>({container:{alignItems:"center !important",display:"flex",flexWrap:"wrap",gap:"0px"},content:{display:"flex",flexDirection:"row",alignItems:"center"},labelContainer:{alignItems:"center",display:"flex"},iconContainer:{border:"1px solid ".concat(e.Palette.light["05"]),borderRadius:"var(--UT-checkbox-radius, 4px)",display:"flex",height:"var(--UT-checkbox-size, 16px)",placeContent:"center",placeItems:"center",width:"var(--UT-checkbox-size, 16px)"},box:{borderRadius:25,overflow:"hidden",padding:3},validation:{flexBasis:"100%"},contentContainer:{display:"flex",flexDirection:"column",gap:"var(--UT-checkbox-content-gap, 4px)"},titleRow:{alignItems:"center",display:"flex",gap:"var(--gap-xs, 4px)"},tooltip:{display:"flex"},icon:{flexShrink:0,height:"36px",width:"36px"},iconImage:{borderRadius:"50%",flexShrink:0,height:"36px",objectFit:"cover",width:"36px"},infoIcon:{flexShrink:0},name:{},description:{}}),getCardTheme=e=>{var t,o,a,n;let{theme:r,error:i}=e;const l=(null===(t=r.Palette.actions)||void 0===t?void 0:t.accent["01"])||r.Palette.accent["01"],c=(null===(o=r.Palette.actions)||void 0===o?void 0:o.accent["02"])||r.Palette.accent["02"],d=(null===(a=r.Palette.actions)||void 0===a?void 0:a.accent["03"])||r.Palette.accent["03"],s=(null===(n=r.Palette.actions)||void 0===n?void 0:n.accent["05"])||r.Palette.accent["05"];return{base:{backgroundColor:r.Palette.light["01"],boxShadow:"none",outline:"1px solid ".concat(i?r.Palette.error["04"]:r.Palette.light["04"]," !important"),"&:hover":{backgroundColor:i?r.Palette.error["01"]:r.Palette.light["03"]},"&:active":{backgroundColor:i?r.Palette.error["02"]:r.Palette.light["04"],"& $description":{color:r.Palette.gray["03"]}}},selected:{boxShadow:"none",outline:"2px solid ".concat(d," !important"),"& $icon path":{fill:s},"&:hover":{backgroundColor:l,outline:"2px solid ".concat(d," !important")},"&:active":{backgroundColor:c,outline:"2px solid ".concat(d," !important")}},disabled:{backgroundColor:r.Palette.light["03"],boxShadow:"none",outline:"2px solid transparent !important",pointerEvents:"none","& $name, & $description":{color:r.Palette.gray["04"]},"& $icon path":{fill:r.Palette.gray["04"]}}}},getCardCheckboxColors=e=>{var t;let{isMarked:o,disabled:a,theme:n}=e;const r=(null===(t=n.Palette.actions)||void 0===t?void 0:t.accent["04"])||n.Palette.accent["04"],i=n.Palette.gray["04"];return{backgroundColor:o?a?i:r:"transparent",borderColor:o?a?i:r:n.Palette.light["05"]}},conditionalStyles=e=>{var t,o,a,n,r;let{value:i,indeterminate:l,reversed:c,spacing:d,variant:s,theme:p,disabled:b,error:x}=e;const h=d===SPACING.SMALL?SMALL_SPACING:MEDIUM_SPACING,v=s===CARD_VARIANT,g=v&&getCardTheme({theme:p,error:x}),u=!0===i||l;return{container:{...c&&{flexDirection:"row-reverse",justifyContent:"space-between"},...b&&!v&&{opacity:.5},...s===BUTTON_VARIANT&&{borderRadius:"8px",padding:"small"===d?"8px 12px":"12px 16px",backgroundColor:x?p.Palette.error["01"]:"transparent","&:active, &:hover":{transition:"background-color 0.1s ease-in-out"},"&:active":{backgroundColor:x?p.Palette.error["02"]:p.Palette.light["04"]},"&:hover":{backgroundColor:x?p.Palette.error["02"]:p.Palette.light["03"]}},...v&&{borderRadius:"var(--UT-checkbox-card-radius, 12px)",gap:h,minHeight:"var(--UT-checkbox-card-min-height, 24px)",overflow:"visible",padding:"var(--UT-checkbox-card-padding-y, 12px) var(--UT-checkbox-card-padding-x, 16px)",...b?g.disabled:i?g.selected:g.base}},content:{...c&&{flexDirection:"row-reverse",justifyContent:"space-between",...s===BUTTON_VARIANT&&{width:"100%"}},gap:h,...v&&{marginRight:"auto"}},labelContainer:{gap:h},iconContainer:{...x&&{borderColor:p.Palette.error["04"]},...u&&{backgroundColor:(null===(t=p.Palette.actions)||void 0===t?void 0:t.accent["04"])||p.Palette.accent["04"],borderColor:(null===(o=p.Palette.actions)||void 0===o?void 0:o.accent["04"])||p.Palette.accent["04"]},...v&&getCardCheckboxColors({isMarked:u,disabled:b,theme:p})},boxContainer:{...s!==BUTTON_VARIANT&&!v&&{"&:active, &:hover":{"& $box":{borderColor:x?p.Palette.error["03"]:(null===(a=p.Palette.actions)||void 0===a?void 0:a.accent["03"])||p.Palette.accent["03"],borderWidth:1,overflow:"hidden",transition:"background-color 0.1s ease-in-out"}},"&:active":{"& $box":{backgroundColor:x?p.Palette.error["02"]:(null===(n=p.Palette.actions)||void 0===n?void 0:n.accent["02"])||p.Palette.accent["02"]}},"&:hover":{"& $box":{backgroundColor:x?p.Palette.error["01"]:(null===(r=p.Palette.actions)||void 0===r?void 0:r.accent["01"])||p.Palette.accent["01"]}}}},title:s===BUTTON_VARIANT&&{userSelect:"none"}}};export const retrieveStyle=e=>{let{value:t,disabled:o,indeterminate:a,reversed:n,spacing:r,theme:i,variant:l,meta:c}=e;const d=baseCheckBoxTheme(i),s=c&&shouldShowErrors(c),{container:p,content:b,iconContainer:x,boxContainer:h,labelContainer:v,title:g}=conditionalStyles({value:t,disabled:o,indeterminate:a,reversed:n,spacing:r,variant:l,theme:i,error:s});return{box:d.box,content:{...d.content,...b},container:{...d.container,...p},iconContainer:{...d.iconContainer,...x},boxContainer:h,labelContainer:{...d.labelContainer,...v},title:g,validation:d.validation,contentContainer:d.contentContainer,titleRow:d.titleRow,tooltip:d.tooltip,icon:d.icon,iconImage:d.iconImage,infoIcon:d.infoIcon,name:d.name,description:d.description}};
@@ -1 +1 @@
1
- import React,{useState,useEffect}from"react";import dayjs from"dayjs";import"dayjs/locale/es";import{func,object}from"prop-types";import{TEST_IDS}from"../../../../../../constants/testIds";import UTButton from"../../../../../UTButton";import UTLabel from"../../../../../UTLabel";import Day from"../Day";import{WEEKDAYS_LABELS,MONTH_YEAR_FORMAT,OUTPUT_LABEL_MASK}from"../../constants";import styles from"../../styles.module.scss";import{getWeeks}from"../../utils";const{UTDatePickerV1TestID:UTDatePickerV1TestID}=TEST_IDS,Calendar=e=>{let{maxDate:t,minDate:a,onDaySelect:s,pickedDate:c}=e;const[r,o]=useState(c||dayjs());useEffect(()=>{null!=c&&c.isValid()&&o(c)},[c]);const n=getWeeks(r),l=e=>!(!a||!e.isBefore(dayjs(a,OUTPUT_LABEL_MASK),"day"))||!(!t||!e.isAfter(dayjs(t,OUTPUT_LABEL_MASK),"day"));return React.createElement("div",{className:styles.calendarContainer,"data-testid":UTDatePickerV1TestID.calendar},React.createElement("div",{className:styles.nav},React.createElement(UTButton,{colorTheme:"secondary",dataTestId:UTDatePickerV1TestID.calendarPrevBtn,Icon:"IconChevronLeft",onClick:()=>o(e=>e.subtract(1,"month")),size:"small",variant:"text"}),React.createElement(UTLabel,{align:"center",className:styles.navLabel,dataTestId:UTDatePickerV1TestID.calendarMonthYear,variant:"body",weight:"medium"},r.locale("es").format(MONTH_YEAR_FORMAT)),React.createElement(UTButton,{colorTheme:"secondary",dataTestId:UTDatePickerV1TestID.calendarNextBtn,Icon:"IconChevronRight",onClick:()=>o(e=>e.add(1,"month")),size:"small",variant:"text"})),React.createElement("div",{className:styles.month},React.createElement("div",{className:styles.week},WEEKDAYS_LABELS.map(e=>React.createElement(UTLabel,{className:"".concat(styles.dayCell," ").concat(styles.dayHeader),key:e,variant:"body",weight:"medium"},e))),n.map(e=>React.createElement("div",{className:styles.week,key:e[0].format("YYYY-MM-DD")},e.map(e=>{const t=e.month()===r.month();return React.createElement(Day,{date:e,dayInCurrentMonth:t,isDisabled:l(e),key:e.format("YYYY-MM-DD"),onClick:s,pickedDate:c})})))))};Calendar.propTypes={maxDate:object,minDate:object,onDaySelect:func,pickedDate:object};export default Calendar;
1
+ import React,{useState,useEffect}from"react";import dayjs from"dayjs";import"dayjs/locale/es";import{func,object,string}from"prop-types";import UTButton from"../../../../../UTButton";import UTLabel from"../../../../../UTLabel";import Day from"../Day";import{WEEKDAYS_LABELS,MONTH_YEAR_FORMAT,OUTPUT_LABEL_MASK}from"../../constants";import styles from"../../styles.module.scss";import{getCalendarTestIds,getWeeks}from"../../utils";const Calendar=e=>{let{dataTestId:t,maxDate:a,minDate:s,onDaySelect:n,pickedDate:c}=e;const[r,o]=useState(c||dayjs()),l=getCalendarTestIds(t);useEffect(()=>{null!=c&&c.isValid()&&o(c)},[c]);const m=getWeeks(r),d=e=>!(!s||!e.isBefore(dayjs(s,OUTPUT_LABEL_MASK),"day"))||!(!a||!e.isAfter(dayjs(a,OUTPUT_LABEL_MASK),"day"));return React.createElement("div",{className:styles.calendarContainer,"data-testid":l.calendar},React.createElement("div",{className:styles.nav},React.createElement(UTButton,{colorTheme:"secondary",dataTestId:l.calendarPrevBtn,Icon:"IconChevronLeft",onClick:()=>o(e=>e.subtract(1,"month")),size:"small",variant:"text"}),React.createElement(UTLabel,{align:"center",className:styles.navLabel,dataTestId:l.calendarMonthYear,variant:"body",weight:"medium"},r.locale("es").format(MONTH_YEAR_FORMAT)),React.createElement(UTButton,{colorTheme:"secondary",dataTestId:l.calendarNextBtn,Icon:"IconChevronRight",onClick:()=>o(e=>e.add(1,"month")),size:"small",variant:"text"})),React.createElement("div",{className:styles.month},React.createElement("div",{className:styles.week},WEEKDAYS_LABELS.map(e=>React.createElement(UTLabel,{className:"".concat(styles.dayCell," ").concat(styles.dayHeader),key:e,variant:"body",weight:"medium"},e))),m.map(e=>React.createElement("div",{className:styles.week,key:e[0].format("YYYY-MM-DD")},e.map(e=>{const t=e.month()===r.month();return React.createElement(Day,{date:e,dayInCurrentMonth:t,isDisabled:d(e),key:e.format("YYYY-MM-DD"),onClick:n,pickedDate:c})})))))};Calendar.propTypes={dataTestId:string,maxDate:object,minDate:object,onDaySelect:func,pickedDate:object};export default Calendar;
@@ -1 +1 @@
1
- function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},_extends.apply(null,arguments)}import React,{useRef,useState,useEffect}from"react";import Popover from"@material-ui/core/Popover";import dayjs from"dayjs";import customParseFormat from"dayjs/plugin/customParseFormat";import{bool,elementType,func,object,shape,string,oneOf}from"prop-types";import UTBaseInputField from"../../../UTBaseInputField";import UTButton from"../../../UTButton";import UTFieldLabel from"../../../UTFieldLabel";import UTLabel from"../../../UTLabel";import UTValidation from"../../../UTValidation";import{COMPONENT_KEYS}from"../../../UTBaseInputField/constants";import Calendar from"./components/Calendar";import styles from"./styles.module.scss";import{DEFAULT_PROPS,DEFAULT_PLACEHOLDER,OUTPUT_LABEL_MASK,TYPING_ERROR_MESSAGE}from"./constants";import{dateMatchesFormat,getFinalDate}from"./utils";dayjs.extend(customParseFormat);const CALENDAR_PAPER_PROPS={className:styles.calendarPaper,onMouseDown:e=>e.preventDefault()},UTDatePicker=e=>{let{classNames:t={},CustomIcon:a,dataTestId:r,disabled:o,error:n="",helpText:l,onChange:s=()=>{},placeholder:i,popoverProps:c,range:d,readOnly:m=!1,required:u,size:p=DEFAULT_PROPS.size,title:T,value:E="",variant:P=DEFAULT_PROPS.variant}=e;const{maxDate:U,minDate:f}=d||{},[_,A]=useState(null),[v,L]=useState(!1),[O,g]=useState(""),[R,h]=useState(!1),[S,D]=useState(!1),y=useRef(null),F=useRef(null);useEffect(()=>{L(!1),g(""),D(!1),!E&&null!=_&&_.isValid()?A(null):dateMatchesFormat(E,OUTPUT_LABEL_MASK)?A(dayjs(E,OUTPUT_LABEL_MASK)):A(null)},[E]);const M=()=>{var e;o||m||(h(!0),null===(e=F.current)||void 0===e||e.focus())},b=v?O:null!=_&&_.isValid()?_.format(OUTPUT_LABEL_MASK):"",B=!!n||S,C=null==_?void 0:_.isValid(),I=i||DEFAULT_PLACEHOLDER,x=(C||v)&&!o&&!m,N=n||(S?TYPING_ERROR_MESSAGE:""),K="picker"===P,j=B&&!o?[{name:COMPONENT_KEYS.ICON,props:{showOnlyOnError:!0}}]:[],k={colorTheme:B?"error":R?"primary":"gray",Icon:a||"IconCalendarEvent"},w=m?void 0:React.createElement("div",{className:styles.endAdornments},React.createElement(UTButton,_extends({},x?{colorTheme:"dark",Icon:"IconX"}:k,{classNames:{root:styles.calendarButton},disabled:o,onClick:x?e=>{e.stopPropagation(),A(null),L(!1),g(""),D(!1),s("")}:M,size:"small",variant:"text"})));return React.createElement(React.Fragment,null,React.createElement("div",{className:styles.root},T&&React.createElement(UTFieldLabel,{className:null==t?void 0:t.upperTitle,required:u,withMarkdown:!0},T),React.createElement("div",{ref:y},React.createElement(UTBaseInputField,{alwaysShowPlaceholder:!0,classNames:t,dataTestId:r,inputRef:F,disabled:o,error:B,readOnly:m,inputSize:"sm"===p?"small":void 0,variant:K?"transparent":void 0,leftAdornments:j,maxLength:10,muiProps:{InputProps:{endAdornment:w},onChange:e=>{var t,a;const r=(e=>{const t=e.replace(/\D/g,"").slice(0,8);return t.length<=2?t:t.length<=4?"".concat(t.slice(0,2),"/").concat(t.slice(2)):"".concat(t.slice(0,2),"/").concat(t.slice(2,4),"/").concat(t.slice(4))})(v?e.target.value:null!==(t=null===(a=e.nativeEvent)||void 0===a?void 0:a.data)&&void 0!==t?t:"");g(r),L(!0);if(8===r.replace(/\D/g,"").length){const e=dateMatchesFormat(r,OUTPUT_LABEL_MASK)&&dayjs(r,OUTPUT_LABEL_MASK).isValid();D(!e),e&&A(dayjs(r,OUTPUT_LABEL_MASK))}else D(!1)},fullWidth:!0},onBlur:e=>{var t;if((null===(t=y.current)||void 0===t||!t.contains(e.relatedTarget))&&(h(!1),D(!1),v)){if(L(!1),g(""),!O)return A(null),void s("");if(dateMatchesFormat(O,OUTPUT_LABEL_MASK)){const e=dayjs(O,OUTPUT_LABEL_MASK);if(e.isValid()){const t=getFinalDate({date:e,maxDate:U,minDate:f});return A(t),void s(t.format(OUTPUT_LABEL_MASK))}}A(null),s("")}},onFocus:M,placeholder:I,value:b})),l&&React.createElement(UTLabel,{colorTheme:"gray",variant:"small",withMarkdown:!0},l),"select"===P&&N&&React.createElement(UTValidation,{dataTestId:r?"".concat(r,".errorMessage"):void 0,validationData:[{items:[{status:"error",text:N}]}]})),React.createElement(Popover,_extends({anchorEl:y.current,anchorOrigin:{horizontal:"left",vertical:"bottom"},disableAutoFocus:!0,disableEnforceFocus:!0,disableRestoreFocus:!0,onClose:()=>{h(!1),D(!1),v&&(L(!1),g(""),E&&dateMatchesFormat(E,OUTPUT_LABEL_MASK)?A(dayjs(E,OUTPUT_LABEL_MASK)):A(null))},open:R,PaperProps:CALENDAR_PAPER_PROPS,transformOrigin:{horizontal:"left",vertical:"top"}},c),React.createElement(Calendar,{maxDate:U,minDate:f,onDaySelect:e=>{const t=getFinalDate({date:e,maxDate:U,minDate:f});A(t),L(!1),g(""),D(!1),t.isValid()?s(t.format(OUTPUT_LABEL_MASK)):s(""),h(!1)},pickedDate:_})))};UTDatePicker.propTypes={classNames:object,CustomIcon:elementType,dataTestId:string,disabled:bool,error:string,helpText:string,onChange:func,placeholder:string,popoverProps:object,range:shape({maxDate:string,minDate:string}),readOnly:bool,required:bool,size:string,title:string,value:string,variant:oneOf(["select","picker"])};export default UTDatePicker;
1
+ function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},_extends.apply(null,arguments)}import React,{useRef,useState,useEffect}from"react";import Popover from"@material-ui/core/Popover";import dayjs from"dayjs";import customParseFormat from"dayjs/plugin/customParseFormat";import{bool,elementType,func,object,shape,string,oneOf}from"prop-types";import UTBaseInputField from"../../../UTBaseInputField";import UTButton from"../../../UTButton";import UTFieldLabel from"../../../UTFieldLabel";import UTLabel from"../../../UTLabel";import UTValidation from"../../../UTValidation";import{COMPONENT_KEYS}from"../../../UTBaseInputField/constants";import Calendar from"./components/Calendar";import styles from"./styles.module.scss";import{DEFAULT_PROPS,DEFAULT_PLACEHOLDER,OUTPUT_LABEL_MASK,TYPING_ERROR_MESSAGE}from"./constants";import{dateMatchesFormat,getFinalDate}from"./utils";dayjs.extend(customParseFormat);const CALENDAR_PAPER_PROPS={className:styles.calendarPaper,onMouseDown:e=>e.preventDefault()},UTDatePicker=e=>{let{classNames:t={},CustomIcon:a,dataTestId:r,disabled:o,error:n="",helpText:l,onChange:s=()=>{},placeholder:i,popoverProps:c,range:d,readOnly:m=!1,required:u,size:p=DEFAULT_PROPS.size,title:T,value:E="",variant:P=DEFAULT_PROPS.variant}=e;const{maxDate:U,minDate:f}=d||{},[_,A]=useState(null),[v,L]=useState(!1),[O,g]=useState(""),[R,h]=useState(!1),[S,D]=useState(!1),y=useRef(null),F=useRef(null);useEffect(()=>{L(!1),g(""),D(!1),!E&&null!=_&&_.isValid()?A(null):dateMatchesFormat(E,OUTPUT_LABEL_MASK)?A(dayjs(E,OUTPUT_LABEL_MASK)):A(null)},[E]);const M=()=>{var e;o||m||(h(!0),null===(e=F.current)||void 0===e||e.focus())},b=v?O:null!=_&&_.isValid()?_.format(OUTPUT_LABEL_MASK):"",B=!!n||S,I=null==_?void 0:_.isValid(),C=i||DEFAULT_PLACEHOLDER,x=(I||v)&&!o&&!m,N=n||(S?TYPING_ERROR_MESSAGE:""),K="picker"===P,j=B&&!o?[{name:COMPONENT_KEYS.ICON,props:{showOnlyOnError:!0}}]:[],k={colorTheme:B?"error":R?"primary":"gray",Icon:a||"IconCalendarEvent"},w=m?void 0:React.createElement("div",{className:styles.endAdornments},React.createElement(UTButton,_extends({},x?{colorTheme:"dark",Icon:"IconX"}:k,{classNames:{root:styles.calendarButton},disabled:o,onClick:x?e=>{e.stopPropagation(),A(null),L(!1),g(""),D(!1),s("")}:M,size:"small",variant:"text"})));return React.createElement(React.Fragment,null,React.createElement("div",{className:styles.root},T&&React.createElement(UTFieldLabel,{className:null==t?void 0:t.upperTitle,required:u,withMarkdown:!0},T),React.createElement("div",{ref:y},React.createElement(UTBaseInputField,{alwaysShowPlaceholder:!0,classNames:t,dataTestId:r,inputRef:F,disabled:o,error:B,readOnly:m,inputSize:"sm"===p?"small":void 0,variant:K?"transparent":void 0,leftAdornments:j,maxLength:10,muiProps:{InputProps:{endAdornment:w},onChange:e=>{var t,a;const r=(e=>{const t=e.replace(/\D/g,"").slice(0,8);return t.length<=2?t:t.length<=4?"".concat(t.slice(0,2),"/").concat(t.slice(2)):"".concat(t.slice(0,2),"/").concat(t.slice(2,4),"/").concat(t.slice(4))})(v?e.target.value:null!==(t=null===(a=e.nativeEvent)||void 0===a?void 0:a.data)&&void 0!==t?t:"");g(r),L(!0);if(8===r.replace(/\D/g,"").length){const e=dateMatchesFormat(r,OUTPUT_LABEL_MASK)&&dayjs(r,OUTPUT_LABEL_MASK).isValid();D(!e),e&&A(dayjs(r,OUTPUT_LABEL_MASK))}else D(!1)},fullWidth:!0},onBlur:e=>{var t;if((null===(t=y.current)||void 0===t||!t.contains(e.relatedTarget))&&(h(!1),D(!1),v)){if(L(!1),g(""),!O)return A(null),void s("");if(dateMatchesFormat(O,OUTPUT_LABEL_MASK)){const e=dayjs(O,OUTPUT_LABEL_MASK);if(e.isValid()){const t=getFinalDate({date:e,maxDate:U,minDate:f});return A(t),void s(t.format(OUTPUT_LABEL_MASK))}}A(null),s("")}},onFocus:M,placeholder:C,value:b})),l&&React.createElement(UTLabel,{colorTheme:"gray",variant:"small",withMarkdown:!0},l),"select"===P&&N&&React.createElement(UTValidation,{dataTestId:r?"".concat(r,".errorMessage"):void 0,validationData:[{items:[{status:"error",text:N}]}]})),React.createElement(Popover,_extends({anchorEl:y.current,anchorOrigin:{horizontal:"left",vertical:"bottom"},disableAutoFocus:!0,disableEnforceFocus:!0,disableRestoreFocus:!0,onClose:()=>{h(!1),D(!1),v&&(L(!1),g(""),E&&dateMatchesFormat(E,OUTPUT_LABEL_MASK)?A(dayjs(E,OUTPUT_LABEL_MASK)):A(null))},open:R,PaperProps:CALENDAR_PAPER_PROPS,transformOrigin:{horizontal:"left",vertical:"top"}},c),React.createElement(Calendar,{dataTestId:r,maxDate:U,minDate:f,onDaySelect:e=>{const t=getFinalDate({date:e,maxDate:U,minDate:f});A(t),L(!1),g(""),D(!1),t.isValid()?s(t.format(OUTPUT_LABEL_MASK)):s(""),h(!1)},pickedDate:_})))};UTDatePicker.propTypes={classNames:object,CustomIcon:elementType,dataTestId:string,disabled:bool,error:string,helpText:string,onChange:func,placeholder:string,popoverProps:object,range:shape({maxDate:string,minDate:string}),readOnly:bool,required:bool,size:string,title:string,value:string,variant:oneOf(["select","picker"])};export default UTDatePicker;
@@ -1 +1 @@
1
- import dayjs from"dayjs";import{OUTPUT_LABEL_MASK}from"./constants";export const isSelected=(t,a)=>a&&t.isSame(a,"day");export const dateMatchesFormat=(t,a)=>dayjs(t,a).format(a)===t;export const getFinalDate=t=>{let{date:a,maxDate:e,minDate:s}=t;const o=dayjs(a);return e&&null!=o&&o.isAfter(dayjs(e,OUTPUT_LABEL_MASK))?dayjs(e,OUTPUT_LABEL_MASK):s&&null!=o&&o.isBefore(dayjs(s,OUTPUT_LABEL_MASK))?dayjs(s,OUTPUT_LABEL_MASK):o};export const getWeeks=t=>{const a=t.startOf("month"),e=t.endOf("month"),s=[];let o=a.subtract(a.day(),"day");do{const t=o;s.push(Array.from({length:7},(a,e)=>t.add(e,"day"))),o=o.add(7,"day")}while(o.isBefore(e)||o.isSame(e,"day"));return s};
1
+ import dayjs from"dayjs";import{TEST_IDS}from"../../../../constants/testIds";import{OUTPUT_LABEL_MASK}from"./constants";const{UTDatePickerV1TestID:UTDatePickerV1TestID}=TEST_IDS;export const isSelected=(t,e)=>e&&t.isSame(e,"day");export const dateMatchesFormat=(t,e)=>dayjs(t,e).format(e)===t;export const getFinalDate=t=>{let{date:e,maxDate:a,minDate:s}=t;const r=dayjs(e);return a&&null!=r&&r.isAfter(dayjs(a,OUTPUT_LABEL_MASK))?dayjs(a,OUTPUT_LABEL_MASK):s&&null!=r&&r.isBefore(dayjs(s,OUTPUT_LABEL_MASK))?dayjs(s,OUTPUT_LABEL_MASK):r};export const getWeeks=t=>{const e=t.startOf("month"),a=t.endOf("month"),s=[];let r=e.subtract(e.day(),"day");do{const t=r;s.push(Array.from({length:7},(e,a)=>t.add(a,"day"))),r=r.add(7,"day")}while(r.isBefore(a)||r.isSame(a,"day"));return s};export const getCalendarTestIds=t=>Object.fromEntries(Object.entries(UTDatePickerV1TestID).map(e=>{let[a,s]=e;return[a,t?"".concat(t,".").concat(a):s]}));
@@ -1 +1 @@
1
- function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var c=arguments[t];for(var a in c)({}).hasOwnProperty.call(c,a)&&(e[a]=c[a])}return e},_extends.apply(null,arguments)}import React,{useEffect,useMemo,useRef}from"react";import{bool,elementType,func,object,objectOf,shape,string}from"prop-types";import{objectIsEmpty}from"@widergy/web-utils/lib/object";import{capitalize}from"../../utils/componentUtils";import{mergeClasses}from"../../utils/classesUtils";import UTButton from"../UTButton";import UTLabel from"../UTLabel";import WithTheme from"../WithTheme";import{retrieveStyle}from"./theme";import{ACCEPT_BUTTON_TEXT,CANCEL_BUTTON_TEXT,STATUS_ICONS}from"./constants";import styles from"./styles.module.scss";const UTModal=e=>{let{cancelAction:t,children:c,classes:a,classNames:n,description:s,descriptionProps:o={},handleClickAway:l,isOpen:r,primaryAction:i,removeBodyPadding:m,secondaryAction:d,SecondaryActionComponent:p,size:T,status:y,title:u}=e;const f=useRef(null);useEffect(()=>{r?f.current.showModal():f.current.close()},[r]);const b=useMemo(()=>mergeClasses(a,n),[n]),E=STATUS_ICONS[y],g=!objectIsEmpty(d)||p;return React.createElement("dialog",{className:"".concat(styles.container," ").concat(b.container," ").concat(T?styles["container".concat(capitalize(T))]:styles.containerM),onClick:e=>l&&"DIALOG"===e.target.tagName&&l(),ref:f},React.createElement("div",null,E&&React.createElement("div",{className:"".concat(styles.status," ").concat(b["status".concat(capitalize(y))])},React.createElement(E,{className:"".concat(styles.icon," ").concat(b["icon".concat(capitalize(y))])})),React.createElement("div",{className:styles.header},React.createElement(UTLabel,{variant:"title3",weight:"medium"},u),s&&React.createElement(UTLabel,_extends({colorTheme:"gray"},o),s)),c&&React.createElement("div",{className:"".concat(styles.body," ").concat(!m&&styles.bodyPadding)},c),React.createElement("div",{className:"\n ".concat(styles.actions,"\n ").concat(b.actions,"\n ").concat(g&&styles.withSecondaryActions,"\n ")},g&&React.createElement("div",null,p?React.createElement(p,null):React.createElement(UTButton,_extends({colorTheme:"secondary",variant:"semitransparent"},d),d.label)),React.createElement("div",{className:styles.defaultActions},!objectIsEmpty(t)&&React.createElement(UTButton,_extends({colorTheme:"secondary",variant:"text"},t),t.label||CANCEL_BUTTON_TEXT),!objectIsEmpty(i)&&React.createElement(UTButton,_extends({colorTheme:"primary",variant:"filled"},i),i.label||ACCEPT_BUTTON_TEXT)))))};UTModal.propTypes={cancelAction:shape({label:string,onClick:func}),classes:objectOf(string),classNames:objectOf(string),description:string,descriptionProps:object,handleClickAway:func,isOpen:bool,primaryAction:shape({label:string,onClick:func}),removeBodyPadding:bool,secondaryAction:shape({label:string,onClick:func}),SecondaryActionComponent:elementType,size:string,status:string,title:string};export default WithTheme(retrieveStyle)(UTModal);
1
+ function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var c in a)({}).hasOwnProperty.call(a,c)&&(e[c]=a[c])}return e},_extends.apply(null,arguments)}import React,{useEffect,useMemo,useRef}from"react";import{bool,elementType,func,object,objectOf,shape,string}from"prop-types";import{objectIsEmpty}from"@widergy/web-utils/lib/object";import{capitalize}from"../../utils/componentUtils";import{mergeClasses}from"../../utils/classesUtils";import UTButton from"../UTButton";import UTLabel from"../UTLabel";import WithTheme from"../WithTheme";import{TEST_IDS}from"../../constants/testIds";import{retrieveStyle}from"./theme";import{ACCEPT_BUTTON_TEXT,CANCEL_BUTTON_TEXT,STATUS_ICONS}from"./constants";import styles from"./styles.module.scss";const{dialog:dialog}=TEST_IDS,UTModal=e=>{let{cancelAction:t,children:a,classes:c,classNames:n,dataTestId:o,description:s,descriptionProps:l={},handleClickAway:i,isOpen:r,primaryAction:m,removeBodyPadding:d,secondaryAction:T,SecondaryActionComponent:p,size:y,status:u,title:f}=e;const E=useRef(null);useEffect(()=>{r?E.current.showModal():E.current.close()},[r]);const b=useMemo(()=>mergeClasses(c,n),[n]),g=STATUS_ICONS[u],h=!objectIsEmpty(T)||p;return React.createElement("dialog",{className:"".concat(styles.container," ").concat(b.container," ").concat(y?styles["container".concat(capitalize(y))]:styles.containerM),"data-testid":o,onClick:e=>i&&"DIALOG"===e.target.tagName&&i(),ref:E},React.createElement("div",null,g&&React.createElement("div",{className:"".concat(styles.status," ").concat(b["status".concat(capitalize(u))])},React.createElement(g,{className:"".concat(styles.icon," ").concat(b["icon".concat(capitalize(u))])})),React.createElement("div",{className:styles.header},React.createElement(UTLabel,{dataTestId:o?"".concat(o,".").concat(dialog.title):void 0,variant:"title3",weight:"medium"},f),s&&React.createElement(UTLabel,_extends({colorTheme:"gray"},l),s)),a&&React.createElement("div",{className:"".concat(styles.body," ").concat(!d&&styles.bodyPadding)},a),React.createElement("div",{className:"\n ".concat(styles.actions,"\n ").concat(b.actions,"\n ").concat(h&&styles.withSecondaryActions,"\n ")},h&&React.createElement("div",null,p?React.createElement(p,null):React.createElement(UTButton,_extends({colorTheme:"secondary",variant:"semitransparent"},T),T.label)),React.createElement("div",{className:styles.defaultActions},!objectIsEmpty(t)&&React.createElement(UTButton,_extends({colorTheme:"secondary",dataTestId:o?"".concat(o,".").concat(dialog.cancelButton):void 0,variant:"text"},t),t.label||CANCEL_BUTTON_TEXT),!objectIsEmpty(m)&&React.createElement(UTButton,_extends({colorTheme:"primary",dataTestId:o?"".concat(o,".").concat(dialog.acceptButton):void 0,variant:"filled"},m),m.label||ACCEPT_BUTTON_TEXT)))))};UTModal.propTypes={cancelAction:shape({label:string,onClick:func}),classes:objectOf(string),classNames:objectOf(string),dataTestId:string,description:string,descriptionProps:object,handleClickAway:func,isOpen:bool,primaryAction:shape({label:string,onClick:func}),removeBodyPadding:bool,secondaryAction:shape({label:string,onClick:func}),SecondaryActionComponent:elementType,size:string,status:string,title:string};export default WithTheme(retrieveStyle)(UTModal);
@@ -1 +1 @@
1
- export const RADIO_VARIANTS={DEFAULT:"default",BUTTON:"button",CARD:"card"};export const ICON_SIZES={[RADIO_VARIANTS.CARD]:16};export const ICON_AREA_SIZE=32;export const ICON_AREA_RADIUS="var(--UT-radioGroup-card-icon-area-radius, 8px)";export const ICON_CONTENT_TYPES={UT_ICON:"utIcon",IMAGE:"image",COMPONENT:"component"};
1
+ export const RADIO_VARIANTS={DEFAULT:"default",BUTTON:"button",CARD:"card"};export const ICON_SIZES={[RADIO_VARIANTS.CARD]:16};export const ICON_AREA_SIZE=32;export const ICON_AREA_RADIUS="var(--UT-radioGroup-card-icon-area-radius, 8px)";export const TOOLTIP_ICON_SIZE=16;export const ICON_CONTENT_TYPES={UT_ICON:"utIcon",IMAGE:"image",COMPONENT:"component"};
@@ -1 +1 @@
1
- function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var o in a)({}).hasOwnProperty.call(a,o)&&(e[o]=a[o])}return e},_extends.apply(null,arguments)}import React from"react";import{object,bool,elementType,func,oneOfType,shape,string}from"prop-types";import UTTouchableWithoutFeedback from"../../../../../UTTouchableWithoutFeedback";import UTIcon from"../../../../../UTIcon";import UTLabel from"../../../../../UTLabel";import UTTooltip from"../../../../../UTTooltip";import WithTheme from"../../../../../WithTheme";import{retrieveStyle}from"./theme";import{getIconAreaColors,getIconContentType}from"./utils";import{RADIO_VARIANTS,ICON_SIZES,ICON_AREA_RADIUS,ICON_AREA_SIZE,ICON_CONTENT_TYPES}from"./constants";const Radio=e=>{let{classes:t,dataTestId:a,description:o,descriptionProps:r={},disabled:c,icon:n,iconProps:i={},iconSelectedProps:s={},name:l,nameProps:m={},nameSelectedProps:d={},onChange:T,prefix:p,selected:R,suffix:I,theme:E,tooltip:N,variant:A=RADIO_VARIANTS.DEFAULT}=e;const b=A===RADIO_VARIANTS.CARD,{areaBackground:h,areaBorderColor:f}=getIconAreaColors(E),g=l&&React.createElement(UTLabel,_extends({className:t.name,colorTheme:"dark"},m,R?d:{}),l);return React.createElement(UTTouchableWithoutFeedback,{className:t.root,dataTestId:a,disabled:c,onClick:()=>!c&&T()},A===RADIO_VARIANTS.DEFAULT&&React.createElement("div",{className:t.radioCircleContainer},React.createElement("div",{className:t.radioCircle},R&&React.createElement("div",{className:t.radioDot}))),React.createElement("div",{className:t.content},(()=>{if(!n)return null;const e=getIconContentType(n);if(e===ICON_CONTENT_TYPES.IMAGE)return React.createElement("img",{alt:n.alt||"",className:t.iconImage,src:n.src});if(e===ICON_CONTENT_TYPES.COMPONENT){const e=n;return React.createElement(e,{className:t.icon})}return React.createElement(UTIcon,_extends({colorTheme:"dark",name:n,size:ICON_SIZES[A]},b&&{area:!0,areaBackground:h,areaBorderColor:f,areaRadius:ICON_AREA_RADIUS,areaSize:ICON_AREA_SIZE},i,R?s:{}))})(),React.createElement("div",{className:t.contentContainer},React.createElement("div",{className:t.content},p&&React.createElement(UTLabel,{colorTheme:"gray"},p),b&&N?React.createElement("div",{className:t.titleAndTooltip},g,React.createElement(UTTooltip,{content:N},React.createElement("span",{className:t.tooltip},React.createElement(UTIcon,{className:t.infoIcon,colorTheme:R&&b?"accent":c&&b?"gray":"dark",name:"IconHelp",size:20})))):g,I&&React.createElement(UTLabel,{colorTheme:"gray",variant:"small",weight:"medium"},I)),React.createElement(UTLabel,_extends({className:t.description,colorTheme:"gray",variant:"body"},r),o))),b&&React.createElement("div",{className:t.cardRadio},R&&React.createElement("div",{className:t.radioDot})),R&&A===RADIO_VARIANTS.BUTTON&&React.createElement(UTIcon,{name:"IconCheck",colorTheme:"accent"}))};Radio.propTypes={classes:object,dataTestId:string,description:string,descriptionProps:object,disabled:bool,icon:oneOfType([string,elementType,shape({alt:string,src:string})]),iconProps:object,iconSelectedProps:object,name:string,nameProps:object,nameSelectedProps:object,onChange:func,prefix:string,selected:bool,suffix:string,theme:object,tooltip:string,variant:string};export default WithTheme(retrieveStyle)(Radio);
1
+ function _extends(){return _extends=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var o in a)({}).hasOwnProperty.call(a,o)&&(e[o]=a[o])}return e},_extends.apply(null,arguments)}import React from"react";import{object,bool,elementType,func,oneOfType,shape,string}from"prop-types";import UTTouchableWithoutFeedback from"../../../../../UTTouchableWithoutFeedback";import UTIcon from"../../../../../UTIcon";import UTLabel from"../../../../../UTLabel";import UTTooltip from"../../../../../UTTooltip";import WithTheme from"../../../../../WithTheme";import{retrieveStyle}from"./theme";import{getIconAreaColors,getIconContentType}from"./utils";import{RADIO_VARIANTS,ICON_SIZES,ICON_AREA_RADIUS,ICON_AREA_SIZE,ICON_CONTENT_TYPES,TOOLTIP_ICON_SIZE}from"./constants";const Radio=e=>{let{classes:t,dataTestId:a,description:o,descriptionProps:r={},disabled:c,icon:n,iconProps:s={},iconSelectedProps:i={},name:l,nameProps:m={},nameSelectedProps:T={},onChange:d,prefix:p,selected:I,suffix:R,theme:N,tooltip:E,variant:A=RADIO_VARIANTS.DEFAULT}=e;const O=A===RADIO_VARIANTS.CARD,_=I&&A===RADIO_VARIANTS.BUTTON,{areaBackground:b,areaBorderColor:h}=getIconAreaColors(N),C=l&&React.createElement(UTLabel,_extends({className:t.name,colorTheme:_?"accent":"dark"},m,I?T:{}),l);return React.createElement(UTTouchableWithoutFeedback,{className:t.root,dataTestId:a,disabled:c,onClick:()=>!c&&d()},A===RADIO_VARIANTS.DEFAULT&&React.createElement("div",{className:t.radioCircleContainer},React.createElement("div",{className:t.radioCircle},I&&React.createElement("div",{className:t.radioDot}))),React.createElement("div",{className:t.content},(()=>{if(!n)return null;const e=getIconContentType(n);if(e===ICON_CONTENT_TYPES.IMAGE)return React.createElement("img",{alt:n.alt||"",className:t.iconImage,src:n.src});if(e===ICON_CONTENT_TYPES.COMPONENT){const e=n;return React.createElement(e,{className:t.icon})}return React.createElement(UTIcon,_extends({colorTheme:"dark",name:n,size:ICON_SIZES[A]},O&&{area:!0,areaBackground:b,areaBorderColor:h,areaRadius:ICON_AREA_RADIUS,areaSize:ICON_AREA_SIZE},s,I?i:{}))})(),React.createElement("div",{className:t.contentContainer},React.createElement("div",{className:t.content},p&&React.createElement(UTLabel,{colorTheme:"gray"},p),E?React.createElement("div",{className:t.titleAndTooltip},C,React.createElement(UTTooltip,{content:E},React.createElement("span",{className:t.tooltip},React.createElement(UTIcon,{className:t.infoIcon,colorTheme:"gray",name:"IconHelp",shade:"04",size:TOOLTIP_ICON_SIZE})))):C,R&&React.createElement(UTLabel,{colorTheme:"gray"},R)),React.createElement(UTLabel,_extends({className:t.description,colorTheme:"gray",variant:"body"},r),o))),O&&React.createElement("div",{className:t.cardRadio},I&&React.createElement("div",{className:t.radioDot})),I&&A===RADIO_VARIANTS.BUTTON&&React.createElement(UTIcon,{name:"IconCheck",colorTheme:"accent"}))};Radio.propTypes={classes:object,dataTestId:string,description:string,descriptionProps:object,disabled:bool,icon:oneOfType([string,elementType,shape({alt:string,src:string})]),iconProps:object,iconSelectedProps:object,name:string,nameProps:object,nameSelectedProps:object,onChange:func,prefix:string,selected:bool,suffix:string,theme:object,tooltip:string,variant:string};export default WithTheme(retrieveStyle)(Radio);
@@ -1 +1 @@
1
- import{SPACING}from"../../constants";import{RADIO_VARIANTS}from"./constants";const SPACING_VALUES={[SPACING.SMALL]:"var(--UT-radioGroup-control-gap-sm, 4px)",[SPACING.MEDIUM]:"var(--UT-radioGroup-control-gap-md, 8px)"},getCardRadioColors=o=>{let{accent04:t,disabled:e,selected:r,theme:a}=o;const i=a.Palette.gray["04"];return{backgroundColor:r?e?i:t:"transparent",borderColor:r?e?i:t:a.Palette.light["05"]}};export const retrieveStyle=o=>{var t,e,r,a,i;let{theme:n,variant:l=RADIO_VARIANTS.DEFAULT,disabled:d,selected:c,spacing:p=SPACING.MEDIUM,reversed:s}=o;const A=(null===(t=n.Palette.actions)||void 0===t?void 0:t.accent["01"])||n.Palette.accent["01"],g=(null===(e=n.Palette.actions)||void 0===e?void 0:e.accent["02"])||n.Palette.accent["02"],u=(null===(r=n.Palette.actions)||void 0===r?void 0:r.accent["03"])||n.Palette.accent["03"],h=(null===(a=n.Palette.actions)||void 0===a?void 0:a.accent["04"])||n.Palette.accent["04"],I=(null===(i=n.Palette.actions)||void 0===i?void 0:i.accent["05"])||n.Palette.accent["05"],x={[RADIO_VARIANTS.CARD]:{backgroundColor:n.Palette.light["01"],boxShadow:"none",outline:"1px solid ".concat(n.Palette.light["04"]," !important"),"&:hover":{backgroundColor:n.Palette.light["03"]},"&:active":{backgroundColor:n.Palette.light["04"],"& $description":{color:n.Palette.gray["03"]}}},[RADIO_VARIANTS.BUTTON]:{backgroundColor:n.Palette.light["01"],"&:hover":{backgroundColor:n.Palette.light["03"]},"&:active":{backgroundColor:n.Palette.light["04"]}},[RADIO_VARIANTS.DEFAULT]:{}}[l],v={[RADIO_VARIANTS.CARD]:{boxShadow:"none",outline:"2px solid ".concat(u," !important"),"& $icon path":{fill:I},"&:hover":{backgroundColor:A,outline:"2px solid ".concat(u," !important")},"&:active":{backgroundColor:g,outline:"2px solid ".concat(u," !important")}},[RADIO_VARIANTS.BUTTON]:{},[RADIO_VARIANTS.DEFAULT]:{}}[l],C={[RADIO_VARIANTS.CARD]:{backgroundColor:n.Palette.light["03"],boxShadow:"none",outline:"2px solid transparent !important",pointerEvents:"none","& $name, & $description":{color:n.Palette.gray["04"]},"& $icon path":{fill:n.Palette.gray["04"]}},[RADIO_VARIANTS.BUTTON]:{backgroundColor:n.Palette.light["01"],opacity:.5,pointerEvents:"none"},[RADIO_VARIANTS.DEFAULT]:{opacity:.5,pointerEvents:"none"}}[l];return{root:{alignItems:"center !important",borderRadius:l===RADIO_VARIANTS.CARD?"var(--UT-radioGroup-card-radius, 12px)":"var(--UT-radioGroup-row-radius, 8px)",display:"flex",flexDirection:"row",gap:SPACING_VALUES[p]||SPACING_VALUES[SPACING.MEDIUM],minHeight:"var(--UT-radioGroup-row-min-height, 24px)",overflow:l===RADIO_VARIANTS.CARD?"visible":"hidden",...l!==RADIO_VARIANTS.DEFAULT&&{padding:"var(--UT-radioGroup-row-padding-y, 12px) var(--UT-radioGroup-row-padding-x, 16px)"},...d?C:c?v:x},radioCircleContainer:{borderRadius:"50%",overflow:"hidden",padding:3,"&:hover":{backgroundColor:A},"&:active":{backgroundColor:g}},radioCircle:{alignItems:"center",border:"1px solid ".concat(n.Palette.light["05"]),borderRadius:"50%",display:"flex",flexShrink:0,height:"var(--UT-radioGroup-control-size, 16px)",justifyContent:"center",width:"var(--UT-radioGroup-control-size, 16px)",...c&&{backgroundColor:h,borderColor:h}},radioDot:{backgroundColor:n.Palette.light["01"],borderRadius:"50%",height:"var(--UT-radioGroup-control-dot-size, 8px)",width:"var(--UT-radioGroup-control-dot-size, 8px)"},cardRadio:{alignItems:"center",border:"1px solid transparent",borderRadius:"50%",display:"flex",flexShrink:0,height:"var(--UT-radioGroup-control-size, 16px)",justifyContent:"center",width:"var(--UT-radioGroup-control-size, 16px)",...getCardRadioColors({accent04:h,disabled:d,selected:c,theme:n})},content:{alignItems:"center",display:"flex",flexDirection:s?"row-reverse":"row",gap:SPACING_VALUES[p]||SPACING_VALUES[SPACING.MEDIUM],marginRight:"auto"},contentContainer:{display:"flex",flexDirection:"column",gap:"var(--UT-radioGroup-content-gap, 4px)"},titleAndTooltip:{alignItems:"center",display:"flex",gap:"var(--gap-xs, 4px)"},tooltip:{display:"flex"},icon:{flexShrink:0,height:"36px",width:"36px"},iconImage:{borderRadius:"50%",flexShrink:0,height:"36px",objectFit:"cover",width:"36px"},infoIcon:{flexShrink:0},name:{},description:{}}};
1
+ import{SPACING}from"../../constants";import{RADIO_VARIANTS}from"./constants";const SPACING_VALUES={[SPACING.SMALL]:"var(--UT-radioGroup-control-gap-sm, 4px)",[SPACING.MEDIUM]:"var(--UT-radioGroup-control-gap-md, 8px)"},getCardRadioColors=o=>{let{accent04:t,disabled:e,selected:r,theme:a}=o;const i=a.Palette.gray["04"];return{backgroundColor:r?e?i:t:"transparent",borderColor:r?e?i:t:a.Palette.light["05"]}};export const retrieveStyle=o=>{var t,e,r,a,i;let{theme:n,variant:l=RADIO_VARIANTS.DEFAULT,disabled:d,selected:c,spacing:p=SPACING.MEDIUM,reversed:s}=o;const A=(null===(t=n.Palette.actions)||void 0===t?void 0:t.accent["01"])||n.Palette.accent["01"],g=(null===(e=n.Palette.actions)||void 0===e?void 0:e.accent["02"])||n.Palette.accent["02"],u=(null===(r=n.Palette.actions)||void 0===r?void 0:r.accent["03"])||n.Palette.accent["03"],h=(null===(a=n.Palette.actions)||void 0===a?void 0:a.accent["04"])||n.Palette.accent["04"],I=(null===(i=n.Palette.actions)||void 0===i?void 0:i.accent["05"])||n.Palette.accent["05"],x={[RADIO_VARIANTS.CARD]:{backgroundColor:n.Palette.light["01"],boxShadow:"none",outline:"1px solid ".concat(n.Palette.light["04"]," !important"),"&:hover":{backgroundColor:n.Palette.light["03"]},"&:active":{backgroundColor:n.Palette.light["04"],"& $description":{color:n.Palette.gray["03"]}}},[RADIO_VARIANTS.BUTTON]:{backgroundColor:n.Palette.light["01"],"&:hover":{backgroundColor:n.Palette.light["03"]},"&:active":{backgroundColor:n.Palette.light["04"]}},[RADIO_VARIANTS.DEFAULT]:{}}[l],v={[RADIO_VARIANTS.CARD]:{boxShadow:"none",outline:"2px solid ".concat(u," !important"),"& $icon path":{fill:I},"&:hover":{backgroundColor:A,outline:"2px solid ".concat(u," !important")},"&:active":{backgroundColor:g,outline:"2px solid ".concat(u," !important")}},[RADIO_VARIANTS.BUTTON]:{},[RADIO_VARIANTS.DEFAULT]:{}}[l],C={[RADIO_VARIANTS.CARD]:{backgroundColor:n.Palette.light["03"],boxShadow:"none",outline:"2px solid transparent !important",pointerEvents:"none","& $name, & $description":{color:n.Palette.gray["04"]},"& $icon path":{fill:n.Palette.gray["04"]}},[RADIO_VARIANTS.BUTTON]:{backgroundColor:n.Palette.light["01"],opacity:.5,pointerEvents:"none"},[RADIO_VARIANTS.DEFAULT]:{opacity:.5,pointerEvents:"none"}}[l];return{root:{alignItems:"center !important",borderRadius:l===RADIO_VARIANTS.CARD?"var(--UT-radioGroup-card-radius, 12px)":"var(--UT-radioGroup-row-radius, 8px)",display:"flex",flexDirection:"row",gap:SPACING_VALUES[p]||SPACING_VALUES[SPACING.MEDIUM],minHeight:"var(--UT-radioGroup-row-min-height, 24px)",overflow:"visible",...l!==RADIO_VARIANTS.DEFAULT&&{padding:"var(--UT-radioGroup-row-padding-y, 12px) var(--UT-radioGroup-row-padding-x, 16px)"},...d?C:c?v:x},radioCircleContainer:{borderRadius:"50%",overflow:"hidden",padding:3,"&:hover":{backgroundColor:A},"&:active":{backgroundColor:g}},radioCircle:{alignItems:"center",border:"1px solid ".concat(n.Palette.light["05"]),borderRadius:"50%",display:"flex",flexShrink:0,height:"var(--UT-radioGroup-control-size, 16px)",justifyContent:"center",width:"var(--UT-radioGroup-control-size, 16px)",...c&&{backgroundColor:h,borderColor:h}},radioDot:{backgroundColor:n.Palette.light["01"],borderRadius:"50%",height:"var(--UT-radioGroup-control-dot-size, 8px)",width:"var(--UT-radioGroup-control-dot-size, 8px)"},cardRadio:{alignItems:"center",border:"1px solid transparent",borderRadius:"50%",display:"flex",flexShrink:0,height:"var(--UT-radioGroup-control-size, 16px)",justifyContent:"center",width:"var(--UT-radioGroup-control-size, 16px)",...getCardRadioColors({accent04:h,disabled:d,selected:c,theme:n})},content:{alignItems:"center",display:"flex",flexDirection:s?"row-reverse":"row",gap:SPACING_VALUES[p]||SPACING_VALUES[SPACING.MEDIUM],marginRight:"auto"},contentContainer:{display:"flex",flexDirection:"column",gap:"var(--UT-radioGroup-content-gap, 4px)"},titleAndTooltip:{alignItems:"center",display:"flex",gap:"var(--gap-xs, 4px)"},tooltip:{display:"flex"},icon:{flexShrink:0,height:"36px",width:"36px"},iconImage:{borderRadius:"50%",flexShrink:0,height:"36px",objectFit:"cover",width:"36px"},infoIcon:{flexShrink:0},name:{},description:{}}};
@@ -1 +1 @@
1
- import{EditorContent,useEditorState}from"@tiptap/react";import isEmpty from"lodash/isEmpty";import{arrayOf,bool,func,object,objectOf,oneOf,oneOfType,string}from"prop-types";import React,{useCallback,useMemo,useRef,useState}from"react";import{mergeMultipleClassNames}from"../../utils/classesUtils.js";import UTFieldLabel from"../UTFieldLabel/index.js";import UTLabel from"../UTLabel/index.js";import UTValidation,{validationDataProptypes}from"../UTValidation/index.js";import{formatErrorToValidation}from"../UTValidation/utils.js";import EditorSkeleton from"./components/EditorSkeleton/index.js";import SubmitAction from"./components/SubmitAction/index.js";import Toolbar from"./components/Toolbar/index.js";import{DEFAULT_PROPS,MODULE_KEYS,TEST_IDS_RICH_TEXT,TITLE_VARIANTS}from"./constants.js";import useModuleResolution from"./hooks/useModuleResolution.js";import useRichTextEditor from"./hooks/useRichTextEditor.js";import{getFieldClassName}from"./utils.js";import styles from"./styles.module.scss";const UTRichText=e=>{var t;let{actions:o,classNames:a={},dataTestId:s=TEST_IDS_RICH_TEXT.root,disabled:l=!1,error:r,helpText:i,loading:n=!1,moduleConfig:d={},modules:m,onBlur:c,onChange:u,onFocus:T,onSubmit:p,placeholder:E,readOnly:b=!1,required:f=!1,submitButtonProps:S,title:R,titleVariant:_=DEFAULT_PROPS.titleVariant,validations:I,value:C}=e;const[y,g]=useState(!1),j=useModuleResolution({moduleConfig:d,modules:m}),O=useMemo(()=>j.flat(),[j]),h=useMemo(()=>mergeMultipleClassNames(styles,a),[a]),v=useMemo(()=>O.map(e=>{var t;return{...e,extensions:null!==(t=e.resolvedExtensions)&&void 0!==t?t:e.extensions}}),[O]),x=useCallback(e=>{g(!0),null==T||T(e)},[T]),U=useCallback(e=>{g(!1),null==c||c(e)},[c]),D=useRef(!1),M=useCallback(()=>!(!D.current||!p)&&(p(),!0),[p]),N=useRichTextEditor({activeModules:v,ariaLabel:R,dataTestId:TEST_IDS_RICH_TEXT.content,disabled:l,editorClassName:styles.editorContent,onBlur:U,onChange:u,onFocus:x,onSubmit:M,placeholder:E,readOnly:b,value:C}),L=null===(t=useEditorState({editor:N,selector:e=>{let{editor:t}=e;return!t||t.isEmpty}}))||void 0===t||t,F=Boolean(p)&&!l&&!n&&!L;D.current=F;const V=useMemo(()=>isEmpty(I)?r?formatErrorToValidation(r):null:I,[r,I]);return React.createElement("div",{className:h.container,"data-testid":s},R&&React.createElement(UTFieldLabel,{actions:o,dataTestId:TEST_IDS_RICH_TEXT.label,readOnly:b,required:f,size:_},R),React.createElement("div",{className:getFieldClassName({classes:h,disabled:l,error:r,isFocused:y,readOnly:b}),"data-testid":TEST_IDS_RICH_TEXT.field},n?React.createElement(EditorSkeleton,null):React.createElement(React.Fragment,null,!b&&React.createElement(Toolbar,{dataTestId:TEST_IDS_RICH_TEXT.toolbar.root,disabled:l,editor:N,moduleGroups:j}),React.createElement("div",{className:h.scrollArea},React.createElement(EditorContent,{className:h.editorWrapper,editor:N})),p&&!b&&React.createElement(SubmitAction,{dataTestId:TEST_IDS_RICH_TEXT.submitButton,disabled:!F,loading:n,onSubmit:p,submitButtonProps:S}))),i&&React.createElement(UTLabel,{className:h.helpText,colorTheme:"gray",dataTestId:TEST_IDS_RICH_TEXT.helpText,variant:"small",withMarkdown:!0},i),V&&React.createElement(UTValidation,{dataTestId:TEST_IDS_RICH_TEXT.validation,validationData:V}))};export const propTypes={actions:arrayOf(object),classNames:objectOf(string),dataTestId:string,disabled:bool,error:oneOfType([bool,string]),helpText:string,loading:bool,moduleConfig:objectOf(object),modules:arrayOf(oneOf(Object.values(MODULE_KEYS))),onBlur:func,onChange:func,onFocus:func,onSubmit:func,placeholder:string,readOnly:bool,required:bool,submitButtonProps:object,title:string,titleVariant:oneOf(Object.values(TITLE_VARIANTS)),validations:validationDataProptypes,value:object};UTRichText.propTypes=propTypes;export default UTRichText;
1
+ import{EditorContent,useEditorState}from"@tiptap/react";import isEmpty from"lodash/isEmpty";import{arrayOf,bool,func,object,objectOf,oneOf,oneOfType,string}from"prop-types";import React,{useCallback,useMemo,useRef,useState}from"react";import{mergeMultipleClassNames}from"../../utils/classesUtils.js";import UTFieldLabel from"../UTFieldLabel/index.js";import UTLabel from"../UTLabel/index.js";import UTValidation,{validationDataProptypes}from"../UTValidation/index.js";import{formatErrorToValidation}from"../UTValidation/utils.js";import EditorSkeleton from"./components/EditorSkeleton/index.js";import SubmitAction from"./components/SubmitAction/index.js";import Toolbar from"./components/Toolbar/index.js";import{DEFAULT_PROPS,MODULE_KEYS,TEST_IDS_RICH_TEXT,TITLE_VARIANTS}from"./constants.js";import useModuleResolution from"./hooks/useModuleResolution.js";import useRichTextEditor from"./hooks/useRichTextEditor.js";import{getFieldClassName}from"./utils.js";import styles from"./styles.module.scss";const UTRichText=e=>{var t;let{actions:o,classNames:a={},dataTestId:l=TEST_IDS_RICH_TEXT.root,disabled:r=!1,error:s,helpText:i,loading:n=!1,moduleConfig:d={},modules:m,onBlur:c,onChange:u,onFocus:T,onSubmit:p,placeholder:E,readOnly:b=!1,required:f=!1,submitButtonProps:R,title:S,titleVariant:_=DEFAULT_PROPS.titleVariant,validations:I,value:y}=e;const[C,O]=useState(!1),g=useModuleResolution({moduleConfig:d,modules:m}),j=useMemo(()=>g.flat(),[g]),v=useMemo(()=>mergeMultipleClassNames(styles,a),[a]),h=useMemo(()=>j.map(e=>{var t;return{...e,extensions:null!==(t=e.resolvedExtensions)&&void 0!==t?t:e.extensions}}),[j]),x=useCallback(e=>{O(!0),null==T||T(e)},[T]),U=useCallback(e=>{O(!1),null==c||c(e)},[c]),D=useRef(!1),M=useCallback(()=>!(!D.current||!p)&&(p(),!0),[p]),N=useRichTextEditor({activeModules:h,ariaLabel:S,dataTestId:TEST_IDS_RICH_TEXT.content,disabled:r,editorClassName:styles.editorContent,onBlur:U,onChange:u,onFocus:x,onSubmit:M,placeholder:E,readOnly:b,value:y}),L=null===(t=useEditorState({editor:N,selector:e=>{let{editor:t}=e;return!t||t.isEmpty}}))||void 0===t||t,k=Boolean(p)&&!r&&!n&&!L;D.current=k;const F=useMemo(()=>isEmpty(I)?s?formatErrorToValidation(s):null:I,[s,I]);return React.createElement("div",{className:v.container,"data-testid":l},S&&React.createElement(UTFieldLabel,{actions:o,dataTestId:TEST_IDS_RICH_TEXT.label,readOnly:b,required:f,size:_},S),React.createElement("div",{className:getFieldClassName({classes:v,disabled:r,error:s,isFocused:C,readOnly:b}),"data-testid":TEST_IDS_RICH_TEXT.field},n?React.createElement(EditorSkeleton,null):React.createElement(React.Fragment,null,!b&&React.createElement(Toolbar,{dataTestId:TEST_IDS_RICH_TEXT.toolbar.root,disabled:r,editor:N,moduleGroups:g}),React.createElement("div",{className:v.scrollArea},React.createElement(EditorContent,{className:v.editorWrapper,editor:N})),N&&!b&&!r&&h.map(e=>{let{EditorOverlay:t,...o}=e;return t&&React.createElement(t,{editor:N,key:o.key,module:o})}),p&&!b&&React.createElement(SubmitAction,{dataTestId:TEST_IDS_RICH_TEXT.submitButton,disabled:!k,loading:n,onSubmit:p,submitButtonProps:R}))),i&&React.createElement(UTLabel,{className:v.helpText,colorTheme:"gray",dataTestId:TEST_IDS_RICH_TEXT.helpText,variant:"small",withMarkdown:!0},i),F&&React.createElement(UTValidation,{dataTestId:TEST_IDS_RICH_TEXT.validation,validationData:F}))};export const propTypes={actions:arrayOf(object),classNames:objectOf(string),dataTestId:string,disabled:bool,error:oneOfType([bool,string]),helpText:string,loading:bool,moduleConfig:objectOf(object),modules:arrayOf(oneOf(Object.values(MODULE_KEYS))),onBlur:func,onChange:func,onFocus:func,onSubmit:func,placeholder:string,readOnly:bool,required:bool,submitButtonProps:object,title:string,titleVariant:oneOf(Object.values(TITLE_VARIANTS)),validations:validationDataProptypes,value:object};UTRichText.propTypes=propTypes;export default UTRichText;