@hitachivantara/uikit-react-core 3.63.0 → 3.66.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 (172) hide show
  1. package/dist/AssetInventory/ListView/ListView.js +1 -1
  2. package/dist/AssetInventory/ListView/ListView.js.map +1 -1
  3. package/dist/Chart/Plot/Plot.d.ts +3 -3
  4. package/dist/SimpleGrid/SimpleGrid.d.ts +17 -0
  5. package/dist/SimpleGrid/SimpleGrid.js +73 -0
  6. package/dist/SimpleGrid/SimpleGrid.js.map +1 -0
  7. package/dist/SimpleGrid/index.d.ts +2 -0
  8. package/dist/SimpleGrid/index.js +16 -0
  9. package/dist/SimpleGrid/index.js.map +1 -0
  10. package/dist/SimpleGrid/styles.js +99 -0
  11. package/dist/SimpleGrid/styles.js.map +1 -0
  12. package/dist/Stack/Stack.d.ts +46 -0
  13. package/dist/Stack/Stack.js +195 -0
  14. package/dist/Stack/Stack.js.map +1 -0
  15. package/dist/Stack/index.d.ts +2 -0
  16. package/dist/Stack/index.js +16 -0
  17. package/dist/Stack/index.js.map +1 -0
  18. package/dist/Stack/styles.js +39 -0
  19. package/dist/Stack/styles.js.map +1 -0
  20. package/dist/TimePicker/PeriodPicker/PeriodPicker.js +112 -0
  21. package/dist/TimePicker/PeriodPicker/PeriodPicker.js.map +1 -0
  22. package/dist/TimePicker/PeriodPicker/index.js +21 -0
  23. package/dist/TimePicker/PeriodPicker/index.js.map +1 -0
  24. package/dist/TimePicker/PeriodPicker/styles.js +32 -0
  25. package/dist/TimePicker/PeriodPicker/styles.js.map +1 -0
  26. package/dist/TimePicker/TimePicker.d.ts +140 -0
  27. package/dist/TimePicker/TimePicker.js +748 -0
  28. package/dist/TimePicker/TimePicker.js.map +1 -0
  29. package/dist/TimePicker/UnitTimePicker/UnitTimePicker.js +243 -0
  30. package/dist/TimePicker/UnitTimePicker/UnitTimePicker.js.map +1 -0
  31. package/dist/TimePicker/UnitTimePicker/index.js +21 -0
  32. package/dist/TimePicker/UnitTimePicker/index.js.map +1 -0
  33. package/dist/TimePicker/UnitTimePicker/styles.js +75 -0
  34. package/dist/TimePicker/UnitTimePicker/styles.js.map +1 -0
  35. package/dist/TimePicker/enums.js +43 -0
  36. package/dist/TimePicker/enums.js.map +1 -0
  37. package/dist/TimePicker/index.d.ts +2 -0
  38. package/dist/TimePicker/index.js +16 -0
  39. package/dist/TimePicker/index.js.map +1 -0
  40. package/dist/TimePicker/styles.js +134 -0
  41. package/dist/TimePicker/styles.js.map +1 -0
  42. package/dist/TimePicker/timePickerConverter.js +90 -0
  43. package/dist/TimePicker/timePickerConverter.js.map +1 -0
  44. package/dist/TimePicker/timePickerFormatter.js +81 -0
  45. package/dist/TimePicker/timePickerFormatter.js.map +1 -0
  46. package/dist/TimePicker/timePickerUtils.js +36 -0
  47. package/dist/TimePicker/timePickerUtils.js.map +1 -0
  48. package/dist/index.d.ts +3 -0
  49. package/dist/index.js +9 -0
  50. package/dist/index.js.map +1 -1
  51. package/dist/legacy/AssetInventory/ListView/ListView.js +1 -1
  52. package/dist/legacy/AssetInventory/ListView/ListView.js.map +1 -1
  53. package/dist/legacy/Chart/Plot/Plot.d.ts +3 -3
  54. package/dist/legacy/SimpleGrid/SimpleGrid.d.ts +17 -0
  55. package/dist/legacy/SimpleGrid/SimpleGrid.js +59 -0
  56. package/dist/legacy/SimpleGrid/SimpleGrid.js.map +1 -0
  57. package/dist/legacy/SimpleGrid/index.d.ts +2 -0
  58. package/dist/legacy/SimpleGrid/index.js +2 -0
  59. package/dist/legacy/SimpleGrid/index.js.map +1 -0
  60. package/dist/legacy/SimpleGrid/styles.js +81 -0
  61. package/dist/legacy/SimpleGrid/styles.js.map +1 -0
  62. package/dist/legacy/Stack/Stack.d.ts +46 -0
  63. package/dist/legacy/Stack/Stack.js +156 -0
  64. package/dist/legacy/Stack/Stack.js.map +1 -0
  65. package/dist/legacy/Stack/index.d.ts +2 -0
  66. package/dist/legacy/Stack/index.js +2 -0
  67. package/dist/legacy/Stack/index.js.map +1 -0
  68. package/dist/legacy/Stack/styles.js +31 -0
  69. package/dist/legacy/Stack/styles.js.map +1 -0
  70. package/dist/legacy/TimePicker/PeriodPicker/PeriodPicker.js +78 -0
  71. package/dist/legacy/TimePicker/PeriodPicker/PeriodPicker.js.map +1 -0
  72. package/dist/legacy/TimePicker/PeriodPicker/index.js +7 -0
  73. package/dist/legacy/TimePicker/PeriodPicker/index.js.map +1 -0
  74. package/dist/legacy/TimePicker/PeriodPicker/styles.js +24 -0
  75. package/dist/legacy/TimePicker/PeriodPicker/styles.js.map +1 -0
  76. package/dist/legacy/TimePicker/TimePicker.d.ts +140 -0
  77. package/dist/legacy/TimePicker/TimePicker.js +696 -0
  78. package/dist/legacy/TimePicker/TimePicker.js.map +1 -0
  79. package/dist/legacy/TimePicker/UnitTimePicker/UnitTimePicker.js +206 -0
  80. package/dist/legacy/TimePicker/UnitTimePicker/UnitTimePicker.js.map +1 -0
  81. package/dist/legacy/TimePicker/UnitTimePicker/index.js +7 -0
  82. package/dist/legacy/TimePicker/UnitTimePicker/index.js.map +1 -0
  83. package/dist/legacy/TimePicker/UnitTimePicker/styles.js +58 -0
  84. package/dist/legacy/TimePicker/UnitTimePicker/styles.js.map +1 -0
  85. package/dist/legacy/TimePicker/enums.js +33 -0
  86. package/dist/legacy/TimePicker/enums.js.map +1 -0
  87. package/dist/legacy/TimePicker/index.d.ts +2 -0
  88. package/dist/legacy/TimePicker/index.js +2 -0
  89. package/dist/legacy/TimePicker/index.js.map +1 -0
  90. package/dist/legacy/TimePicker/styles.js +117 -0
  91. package/dist/legacy/TimePicker/styles.js.map +1 -0
  92. package/dist/legacy/TimePicker/timePickerConverter.js +71 -0
  93. package/dist/legacy/TimePicker/timePickerConverter.js.map +1 -0
  94. package/dist/legacy/TimePicker/timePickerFormatter.js +66 -0
  95. package/dist/legacy/TimePicker/timePickerFormatter.js.map +1 -0
  96. package/dist/legacy/TimePicker/timePickerUtils.js +27 -0
  97. package/dist/legacy/TimePicker/timePickerUtils.js.map +1 -0
  98. package/dist/legacy/index.d.ts +3 -0
  99. package/dist/legacy/index.js +1 -0
  100. package/dist/legacy/index.js.map +1 -1
  101. package/dist/modern/AssetInventory/AssetInventory.js +1 -0
  102. package/dist/modern/AssetInventory/AssetInventory.js.map +1 -1
  103. package/dist/modern/AssetInventory/ListView/ListView.js +2 -1
  104. package/dist/modern/AssetInventory/ListView/ListView.js.map +1 -1
  105. package/dist/modern/AssetInventory/Search/Search.js +1 -0
  106. package/dist/modern/AssetInventory/Search/Search.js.map +1 -1
  107. package/dist/modern/BaseDropdown/BaseDropdown.js +1 -0
  108. package/dist/modern/BaseDropdown/BaseDropdown.js.map +1 -1
  109. package/dist/modern/BreadCrumb/utils.js +1 -0
  110. package/dist/modern/BreadCrumb/utils.js.map +1 -1
  111. package/dist/modern/Chart/Plot/Plot.d.ts +3 -3
  112. package/dist/modern/FilterGroup/RightPanel/RightPanel.js +1 -0
  113. package/dist/modern/FilterGroup/RightPanel/RightPanel.js.map +1 -1
  114. package/dist/modern/Focus/Focus.js +1 -0
  115. package/dist/modern/Focus/Focus.js.map +1 -1
  116. package/dist/modern/List/List.js +5 -2
  117. package/dist/modern/List/List.js.map +1 -1
  118. package/dist/modern/SimpleGrid/SimpleGrid.d.ts +17 -0
  119. package/dist/modern/SimpleGrid/SimpleGrid.js +60 -0
  120. package/dist/modern/SimpleGrid/SimpleGrid.js.map +1 -0
  121. package/dist/modern/SimpleGrid/index.d.ts +2 -0
  122. package/dist/modern/SimpleGrid/index.js +2 -0
  123. package/dist/modern/SimpleGrid/index.js.map +1 -0
  124. package/dist/modern/SimpleGrid/styles.js +68 -0
  125. package/dist/modern/SimpleGrid/styles.js.map +1 -0
  126. package/dist/modern/Stack/Stack.d.ts +46 -0
  127. package/dist/modern/Stack/Stack.js +145 -0
  128. package/dist/modern/Stack/Stack.js.map +1 -0
  129. package/dist/modern/Stack/index.d.ts +2 -0
  130. package/dist/modern/Stack/index.js +2 -0
  131. package/dist/modern/Stack/index.js.map +1 -0
  132. package/dist/modern/Stack/styles.js +29 -0
  133. package/dist/modern/Stack/styles.js.map +1 -0
  134. package/dist/modern/Table/Table.js +1 -0
  135. package/dist/modern/Table/Table.js.map +1 -1
  136. package/dist/modern/Table/checkBoxUtils.js +1 -0
  137. package/dist/modern/Table/checkBoxUtils.js.map +1 -1
  138. package/dist/modern/TagsInput/TagsInput.js +1 -0
  139. package/dist/modern/TagsInput/TagsInput.js.map +1 -1
  140. package/dist/modern/TimePicker/PeriodPicker/PeriodPicker.js +75 -0
  141. package/dist/modern/TimePicker/PeriodPicker/PeriodPicker.js.map +1 -0
  142. package/dist/modern/TimePicker/PeriodPicker/index.js +7 -0
  143. package/dist/modern/TimePicker/PeriodPicker/index.js.map +1 -0
  144. package/dist/modern/TimePicker/PeriodPicker/styles.js +22 -0
  145. package/dist/modern/TimePicker/PeriodPicker/styles.js.map +1 -0
  146. package/dist/modern/TimePicker/TimePicker.d.ts +140 -0
  147. package/dist/modern/TimePicker/TimePicker.js +659 -0
  148. package/dist/modern/TimePicker/TimePicker.js.map +1 -0
  149. package/dist/modern/TimePicker/UnitTimePicker/UnitTimePicker.js +191 -0
  150. package/dist/modern/TimePicker/UnitTimePicker/UnitTimePicker.js.map +1 -0
  151. package/dist/modern/TimePicker/UnitTimePicker/index.js +7 -0
  152. package/dist/modern/TimePicker/UnitTimePicker/index.js.map +1 -0
  153. package/dist/modern/TimePicker/UnitTimePicker/styles.js +49 -0
  154. package/dist/modern/TimePicker/UnitTimePicker/styles.js.map +1 -0
  155. package/dist/modern/TimePicker/enums.js +32 -0
  156. package/dist/modern/TimePicker/enums.js.map +1 -0
  157. package/dist/modern/TimePicker/index.d.ts +2 -0
  158. package/dist/modern/TimePicker/index.js +2 -0
  159. package/dist/modern/TimePicker/index.js.map +1 -0
  160. package/dist/modern/TimePicker/styles.js +108 -0
  161. package/dist/modern/TimePicker/styles.js.map +1 -0
  162. package/dist/modern/TimePicker/timePickerConverter.js +66 -0
  163. package/dist/modern/TimePicker/timePickerConverter.js.map +1 -0
  164. package/dist/modern/TimePicker/timePickerFormatter.js +65 -0
  165. package/dist/modern/TimePicker/timePickerFormatter.js.map +1 -0
  166. package/dist/modern/TimePicker/timePickerUtils.js +26 -0
  167. package/dist/modern/TimePicker/timePickerUtils.js.map +1 -0
  168. package/dist/modern/index.d.ts +3 -0
  169. package/dist/modern/index.js +1 -0
  170. package/dist/modern/index.js.map +1 -1
  171. package/package.json +19 -20
  172. package/CHANGELOG.md +0 -4480
@@ -179,7 +179,7 @@ process.env.NODE_ENV !== "production" ? ListView.propTypes = {
179
179
  * List column configuration.
180
180
  */
181
181
  columnConfiguration: _propTypes.default.arrayOf(_propTypes.default.shape({
182
- title: _propTypes.default.String,
182
+ title: _propTypes.default.string,
183
183
  style: _propTypes.default.instanceOf(Object)
184
184
  })),
185
185
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/AssetInventory/ListView/ListView.js"],"names":["Rows","renderer","values","selectedValues","viewConfiguration","metadata","map","value","index","checked","includes","id","ListView","className","classes","emptyComponent","others","hasValues","length","renderGridDisplay","containerRef","enhancedViewConfiguration","root","columnConfiguration","tableHead","tableBody","elements","propTypes","PropTypes","string","node","shape","onSelection","func","isSelectable","bool","arrayOf","title","String","style","instanceOf","Object","actions","isRequired","label","icon","oneOfType","disabled","actionsCallback","maxVisibleActions","number","accessor","cellType","oneOf","sortable","sortFunction","searchable","searchFunction","styles","name"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;AAEA,IAAMA,IAAI,GAAG,SAAPA,IAAO;AAAA,MAAGC,QAAH,QAAGA,QAAH;AAAA,MAAaC,MAAb,QAAaA,MAAb;AAAA,MAAqBC,cAArB,QAAqBA,cAArB;AAAA,MAAqCC,iBAArC,QAAqCA,iBAArC;AAAA,MAAwDC,QAAxD,QAAw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IAAAA,SAAS,EAAEG,mBAAUC;AAhBE,GAAhB,EAiBNc,UA1EgB;;AA2EnB;AACF;AACA;AACA;AACA;AACE1C,EAAAA,QAAQ,EAAE2B,mBAAUK,IAAV,CAAeU,UAhFN;;AAiFnB;AACF;AACA;AACEzC,EAAAA,MAAM,EAAE0B,mBAAUQ,OAAV,CAAkBR,mBAAUY,UAAV,CAAqBC,MAArB,CAAlB,EAAgDE,UApFrC;;AAqFnB;AACF;AACA;AACExC,EAAAA,cAAc,EAAEyB,mBAAUQ,OAAV,CAAkBR,mBAAUC,MAA5B,CAxFG;;AAyFnB;AACF;AACA;AACExB,EAAAA,QAAQ,EAAEuB,mBAAUQ,OAAV,CACRR,mBAAUG,KAAV,CAAgB;AACdpB,IAAAA,EAAE,EAAEiB,mBAAUC,MADA;AAEdQ,IAAAA,KAAK,EAAET,mBAAUC,MAFH;AAGdsB,IAAAA,QAAQ,EAAEvB,mBAAUC,MAHN;AAIduB,IAAAA,QAAQ,EAAExB,mBAAUyB,KAAV,CAAgB,CAAC,eAAD,EAAkB,SAAlB,EAA6B,MAA7B,EAAqC,MAArC,CAAhB,CAJI;AAKdC,IAAAA,QAAQ,EAAE1B,mBAAUO,IALN;AAMdoB,IAAAA,YAAY,EAAE3B,mBAAUK,IANV;AAOduB,IAAAA,UAAU,EAAE5B,mBAAUO,IAPR;AAQdsB,IAAAA,cAAc,EAAE7B,mBAAUK;AARZ,GAAhB,CADQ;AA5FS,CAArB;;eA0Ge,sBAAWyB,eAAX,EAAmB;AAAEC,EAAAA,IAAI,EAAE;AAAR,CAAnB,EAA2C/C,QAA3C,C","sourcesContent":["import React, { useRef } from \"react\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\nimport { withStyles } from \"@material-ui/core\";\nimport { ListViewContextProvider } from \"./ListViewContext/ListViewContext\";\nimport ListViewHeaderRow from \"./ListViewHeaderRow\";\nimport Grid from \"../../Grid\";\nimport styles from \"./styles\";\n\nconst Rows = ({ renderer, values, selectedValues, viewConfiguration, metadata }) =>\n values.map((value, index) => {\n // eslint-disable-next-line no-param-reassign\n value.checked = selectedValues && selectedValues.includes(value.id);\n return renderer(value, index, viewConfiguration, metadata);\n });\n\nconst ListView = ({\n className,\n id,\n viewConfiguration,\n classes,\n renderer,\n values,\n selectedValues,\n metadata,\n emptyComponent,\n ...others\n}) => {\n const hasValues = values.length > 0;\n\n const renderGridDisplay = (containerRef) => {\n const enhancedViewConfiguration = {\n containerRef,\n ...viewConfiguration,\n };\n\n return (\n <Grid container justifyContent=\"center\" alignContent=\"stretch\">\n <Grid item xs={12} sm={12} md={12} lg={12} xl={12}>\n <div\n id={id}\n aria-rowcount={values.length}\n className={clsx(className, classes.root)}\n {...others}\n >\n {viewConfiguration?.columnConfiguration?.length > 0 && hasValues && (\n <div className={classes.tableHead}>\n <ListViewHeaderRow viewConfiguration={enhancedViewConfiguration} />\n </div>\n )}\n <ul className={classes.tableBody}>\n <ListViewContextProvider value={enhancedViewConfiguration}>\n <Rows\n classes={classes}\n renderer={renderer}\n values={values}\n selectedValues={selectedValues}\n metadata={metadata}\n viewConfiguration={enhancedViewConfiguration}\n containerRef={containerRef}\n />\n </ListViewContextProvider>\n </ul>\n </div>\n </Grid>\n </Grid>\n );\n };\n const containerRef = useRef(null);\n return (\n <>\n {!hasValues && emptyComponent}\n {hasValues && (\n <div className={classes.root} ref={containerRef}>\n <div className={classes.elements}>{renderGridDisplay(containerRef)}</div>\n </div>\n )}\n </>\n );\n};\n\nListView.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * Id to be applied to the root node.\n */\n id: PropTypes.string,\n /**\n * Component to the present when no data is available.\n */\n emptyComponent: PropTypes.node,\n /**\n * Configuration settings for the view.\n */\n viewConfiguration: PropTypes.shape({\n /**\n * Callback evoked in the selection of the card.\n */\n onSelection: PropTypes.func,\n /**\n * Defines if the view allows selections.\n */\n isSelectable: PropTypes.bool,\n /**\n * List column configuration.\n */\n columnConfiguration: PropTypes.arrayOf(\n PropTypes.shape({\n title: PropTypes.String,\n style: PropTypes.instanceOf(Object),\n })\n ),\n /**\n * List of actions to be passed to the cards.\n */\n actions: PropTypes.arrayOf(\n PropTypes.shape({\n id: PropTypes.string.isRequired,\n label: PropTypes.string.isRequired,\n icon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),\n disabled: PropTypes.bool,\n })\n ),\n /**\n * The callback function ran when an action is triggered, receiving `action` as param\n */\n actionsCallback: PropTypes.func,\n /**\n * The number of maximum visible actions before they're collapsed into a `DropDownMenu`.\n */\n maxVisibleActions: PropTypes.number,\n }),\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component root class.\n */\n root: PropTypes.string,\n /**\n * Styles applied to the component that contains the elements class.\n */\n elements: PropTypes.string,\n /**\n * Styles applied to the table header.\n */\n tableHead: PropTypes.string,\n /**\n * Styles applied to the table body.\n */\n tableBody: PropTypes.string,\n }).isRequired,\n /**\n * The function that will be used to render the list,\n * it receives the values one bye one, is recommended to use\n * the list View cell and list view Row to construct the renderer\n */\n renderer: PropTypes.func.isRequired,\n /**\n * The values that will be passed to the renderer one by one\n */\n values: PropTypes.arrayOf(PropTypes.instanceOf(Object)).isRequired,\n /**\n * Selected values.\n */\n selectedValues: PropTypes.arrayOf(PropTypes.string),\n /**\n * Metadata associated with the values.\n */\n metadata: PropTypes.arrayOf(\n PropTypes.shape({\n id: PropTypes.string,\n title: PropTypes.string,\n accessor: PropTypes.string,\n cellType: PropTypes.oneOf([\"alpha-numeric\", \"numeric\", \"date\", \"node\"]),\n sortable: PropTypes.bool,\n sortFunction: PropTypes.func,\n searchable: PropTypes.bool,\n searchFunction: PropTypes.func,\n })\n ),\n};\n\nexport default withStyles(styles, { name: \"HvListView\" })(ListView);\n"],"file":"ListView.js"}
1
+ {"version":3,"sources":["../../../src/AssetInventory/ListView/ListView.js"],"names":["Rows","renderer","values","selectedValues","viewConfiguration","metadata","map","value","index","checked","includes","id","ListView","className","classes","emptyComponent","others","hasValues","length","renderGridDisplay","containerRef","enhancedViewConfiguration","root","columnConfiguration","tableHead","tableBody","elements","propTypes","PropTypes","string","node","shape","onSelection","func","isSelectable","bool","arrayOf","title","style","instanceOf","Object","actions","isRequired","label","icon","oneOfType","disabled","actionsCallback","maxVisibleActions","number","accessor","cellType","oneOf","sortable","sortFunction","searchable","searchFunction","styles","name"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;AAEA,IAAMA,IAAI,GAAG,SAAPA,IAAO;AAAA,MAAGC,QAAH,QAAGA,QAAH;AAAA,MAAaC,MAAb,QAAaA,MAAb;AAAA,MAAqBC,cAArB,QAAqBA,cAArB;AAAA,MAAqCC,iBAArC,QAAqCA,iBAArC;AAAA,MAAwDC,QAAxD,QAAwDA,QAAxD;AAAA,SACXH,MAAM,CAACI,GAAP,CAAW,UAACC,KAAD,EAAQC,KAAR,EAAkB;AAC3B;AACAD,IAAAA,KAAK,CAACE,OAAN,GAAgBN,cAAc,IAAIA,cAAc,CAACO,QAAf,CAAwBH,KAAK,CAACI,EAA9B,CAAlC;AACA,WAAOV,QAAQ,CAACM,KAAD,EAAQC,KAAR,EAAeJ,iBAAf,EAAkCC,QAAlC,CAAf;AACD,GAJD,CADW;AAAA,CAAb;;AAOA,IAAMO,QAAQ,GAAG,SAAXA,QAAW,QAWX;AAAA,MAVJC,SAUI,SAVJA,SAUI;AAAA,MATJF,EASI,SATJA,EASI;AAAA,MARJP,iBAQI,SARJA,iBAQI;AAAA,MAPJU,OAOI,SAPJA,OAOI;AAAA,MANJb,QAMI,SANJA,QAMI;AAAA,MALJC,MAKI,SALJA,MAKI;AAAA,MAJJC,cAII,SAJJA,cAII;AAAA,MAHJE,QAGI,SAHJA,QAGI;AAAA,MAFJU,cAEI,SAFJA,cAEI;AAAA,MADDC,MACC;AACJ,MAAMC,SAAS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EAA6B,MAA7B,EAAqC,MAArC,CAAhB,CAJI;AAKdC,IAAAA,QAAQ,EAAEzB,mBAAUO,IALN;AAMdmB,IAAAA,YAAY,EAAE1B,mBAAUK,IANV;AAOdsB,IAAAA,UAAU,EAAE3B,mBAAUO,IAPR;AAQdqB,IAAAA,cAAc,EAAE5B,mBAAUK;AARZ,GAAhB,CADQ;AA5FS,CAArB;;eA0Ge,sBAAWwB,eAAX,EAAmB;AAAEC,EAAAA,IAAI,EAAE;AAAR,CAAnB,EAA2C9C,QAA3C,C","sourcesContent":["import React, { useRef } from \"react\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\nimport { withStyles } from \"@material-ui/core\";\nimport { ListViewContextProvider } from \"./ListViewContext/ListViewContext\";\nimport ListViewHeaderRow from \"./ListViewHeaderRow\";\nimport Grid from \"../../Grid\";\nimport styles from \"./styles\";\n\nconst Rows = ({ renderer, values, selectedValues, viewConfiguration, metadata }) =>\n values.map((value, index) => {\n // eslint-disable-next-line no-param-reassign\n value.checked = selectedValues && selectedValues.includes(value.id);\n return renderer(value, index, viewConfiguration, metadata);\n });\n\nconst ListView = ({\n className,\n id,\n viewConfiguration,\n classes,\n renderer,\n values,\n selectedValues,\n metadata,\n emptyComponent,\n ...others\n}) => {\n const hasValues = values.length > 0;\n\n const renderGridDisplay = (containerRef) => {\n const enhancedViewConfiguration = {\n containerRef,\n ...viewConfiguration,\n };\n\n return (\n <Grid container justifyContent=\"center\" alignContent=\"stretch\">\n <Grid item xs={12} sm={12} md={12} lg={12} xl={12}>\n <div\n id={id}\n aria-rowcount={values.length}\n className={clsx(className, classes.root)}\n {...others}\n >\n {viewConfiguration?.columnConfiguration?.length > 0 && hasValues && (\n <div className={classes.tableHead}>\n <ListViewHeaderRow viewConfiguration={enhancedViewConfiguration} />\n </div>\n )}\n <ul className={classes.tableBody}>\n <ListViewContextProvider value={enhancedViewConfiguration}>\n <Rows\n classes={classes}\n renderer={renderer}\n values={values}\n selectedValues={selectedValues}\n metadata={metadata}\n viewConfiguration={enhancedViewConfiguration}\n containerRef={containerRef}\n />\n </ListViewContextProvider>\n </ul>\n </div>\n </Grid>\n </Grid>\n );\n };\n const containerRef = useRef(null);\n return (\n <>\n {!hasValues && emptyComponent}\n {hasValues && (\n <div className={classes.root} ref={containerRef}>\n <div className={classes.elements}>{renderGridDisplay(containerRef)}</div>\n </div>\n )}\n </>\n );\n};\n\nListView.propTypes = {\n /**\n * Class names to be applied.\n */\n className: PropTypes.string,\n /**\n * Id to be applied to the root node.\n */\n id: PropTypes.string,\n /**\n * Component to the present when no data is available.\n */\n emptyComponent: PropTypes.node,\n /**\n * Configuration settings for the view.\n */\n viewConfiguration: PropTypes.shape({\n /**\n * Callback evoked in the selection of the card.\n */\n onSelection: PropTypes.func,\n /**\n * Defines if the view allows selections.\n */\n isSelectable: PropTypes.bool,\n /**\n * List column configuration.\n */\n columnConfiguration: PropTypes.arrayOf(\n PropTypes.shape({\n title: PropTypes.string,\n style: PropTypes.instanceOf(Object),\n })\n ),\n /**\n * List of actions to be passed to the cards.\n */\n actions: PropTypes.arrayOf(\n PropTypes.shape({\n id: PropTypes.string.isRequired,\n label: PropTypes.string.isRequired,\n icon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),\n disabled: PropTypes.bool,\n })\n ),\n /**\n * The callback function ran when an action is triggered, receiving `action` as param\n */\n actionsCallback: PropTypes.func,\n /**\n * The number of maximum visible actions before they're collapsed into a `DropDownMenu`.\n */\n maxVisibleActions: PropTypes.number,\n }),\n /**\n * A Jss Object used to override or extend the styles applied.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component root class.\n */\n root: PropTypes.string,\n /**\n * Styles applied to the component that contains the elements class.\n */\n elements: PropTypes.string,\n /**\n * Styles applied to the table header.\n */\n tableHead: PropTypes.string,\n /**\n * Styles applied to the table body.\n */\n tableBody: PropTypes.string,\n }).isRequired,\n /**\n * The function that will be used to render the list,\n * it receives the values one bye one, is recommended to use\n * the list View cell and list view Row to construct the renderer\n */\n renderer: PropTypes.func.isRequired,\n /**\n * The values that will be passed to the renderer one by one\n */\n values: PropTypes.arrayOf(PropTypes.instanceOf(Object)).isRequired,\n /**\n * Selected values.\n */\n selectedValues: PropTypes.arrayOf(PropTypes.string),\n /**\n * Metadata associated with the values.\n */\n metadata: PropTypes.arrayOf(\n PropTypes.shape({\n id: PropTypes.string,\n title: PropTypes.string,\n accessor: PropTypes.string,\n cellType: PropTypes.oneOf([\"alpha-numeric\", \"numeric\", \"date\", \"node\"]),\n sortable: PropTypes.bool,\n sortFunction: PropTypes.func,\n searchable: PropTypes.bool,\n searchFunction: PropTypes.func,\n })\n ),\n};\n\nexport default withStyles(styles, { name: \"HvListView\" })(ListView);\n"],"file":"ListView.js"}
@@ -1,6 +1,6 @@
1
1
  import * as React from "react";
2
2
  import { StandardProps } from "@material-ui/core";
3
- import type { Config, Layout, PlotData as PlotlyPlotData } from "plotly.js";
3
+ import type { Config, Layout, Data as PlotlyPlotData } from "plotly.js";
4
4
 
5
5
  export type PlotData = PlotlyPlotData;
6
6
  export type PlotLayout = Layout;
@@ -17,11 +17,11 @@ export interface HvPlotProps
17
17
  /**
18
18
  * Plotly layout object.
19
19
  */
20
- layout?: PlotLayout;
20
+ layout?: Partial<PlotLayout>;
21
21
  /**
22
22
  * Plotly config object.
23
23
  */
24
- config?: PlotConfig;
24
+ config?: Partial<PlotConfig>;
25
25
  /**
26
26
  * OnHover function.
27
27
  */
@@ -0,0 +1,17 @@
1
+ import { FunctionComponent } from "react";
2
+
3
+ export type Spacing = "xs" | "sm" | "md" | "lg";
4
+ export type Breakpoints = {
5
+ cols?: number;
6
+ maxWidth?: number;
7
+ minWidth?: number;
8
+ spacing?: Spacing;
9
+ };
10
+
11
+ export interface SimpleGridProps extends FunctionComponent {
12
+ spacing?: Spacing;
13
+ cols?: number;
14
+ breakpoints?: Breakpoints;
15
+ }
16
+
17
+ export default function HvSimpleGrid(props: SimpleGridProps): JSX.Element | null;
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.default = void 0;
9
+
10
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
+
12
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
13
+
14
+ var _react = _interopRequireDefault(require("react"));
15
+
16
+ var _propTypes = _interopRequireDefault(require("prop-types"));
17
+
18
+ var _styles = _interopRequireDefault(require("./styles"));
19
+
20
+ var _excluded = ["children", "breakpoints", "spacing", "cols"];
21
+
22
+ var SimpleGrid = function SimpleGrid(_ref) {
23
+ var children = _ref.children,
24
+ breakpoints = _ref.breakpoints,
25
+ _ref$spacing = _ref.spacing,
26
+ spacing = _ref$spacing === void 0 ? "sm" : _ref$spacing,
27
+ cols = _ref.cols,
28
+ others = (0, _objectWithoutProperties2.default)(_ref, _excluded);
29
+ var classes = (0, _styles.default)({
30
+ breakpoints: breakpoints,
31
+ cols: cols,
32
+ spacing: spacing
33
+ })();
34
+ return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
35
+ className: classes.container
36
+ }, others), children);
37
+ };
38
+
39
+ process.env.NODE_ENV !== "production" ? SimpleGrid.propTypes = {
40
+ /**
41
+ * -
42
+ */
43
+ children: _propTypes.default.node,
44
+
45
+ /**
46
+ * Spacing with pre-defined values according the values defined in the theme
47
+ */
48
+ spacing: _propTypes.default.oneOf(["sm", "md", "lg", "xl"]),
49
+
50
+ /**
51
+ * Provide an array to define responsive behavior:
52
+ *
53
+ * maxWidth or minWidth: max-width or min-width at which media query will work
54
+ *
55
+ * cols: number of columns per row at given max-width
56
+ *
57
+ * spacing: optional spacing at given max-width, if not provided spacing from component prop will be used instead
58
+ */
59
+ breakpoints: _propTypes.default.arrayOf(_propTypes.default.shape({
60
+ maxWidth: _propTypes.default.number,
61
+ minWidth: _propTypes.default.number,
62
+ cols: _propTypes.default.number,
63
+ spacing: _propTypes.default.oneOf(["sm", "md", "lg", "xl"])
64
+ })),
65
+
66
+ /**
67
+ * Number of how many columns the content will be displayed
68
+ */
69
+ cols: _propTypes.default.number
70
+ } : void 0;
71
+ var _default = SimpleGrid;
72
+ exports.default = _default;
73
+ //# sourceMappingURL=SimpleGrid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/SimpleGrid/SimpleGrid.js"],"names":["SimpleGrid","children","breakpoints","spacing","cols","others","classes","container","propTypes","PropTypes","node","oneOf","arrayOf","shape","maxWidth","number","minWidth"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AACA;;;;AAEA,IAAMA,UAAU,GAAG,SAAbA,UAAa,OAAgE;AAAA,MAA7DC,QAA6D,QAA7DA,QAA6D;AAAA,MAAnDC,WAAmD,QAAnDA,WAAmD;AAAA,0BAAtCC,OAAsC;AAAA,MAAtCA,OAAsC,6BAA5B,IAA4B;AAAA,MAAtBC,IAAsB,QAAtBA,IAAsB;AAAA,MAAbC,MAAa;AACjF,MAAMC,OAAO,GAAG,qBAAU;AAAEJ,IAAAA,WAAW,EAAXA,WAAF;AAAeE,IAAAA,IAAI,EAAJA,IAAf;AAAqBD,IAAAA,OAAO,EAAPA;AAArB,GAAV,GAAhB;AACA,sBACE;AAAK,IAAA,SAAS,EAAEG,OAAO,CAACC;AAAxB,KAAuCF,MAAvC,GACGJ,QADH,CADF;AAKD,CAPD;;AASA,wCAAAD,UAAU,CAACQ,SAAX,GAAuB;AACrB;AACF;AACA;AACEP,EAAAA,QAAQ,EAAEQ,mBAAUC,IAJC;;AAKrB;AACF;AACA;AACEP,EAAAA,OAAO,EAAEM,mBAAUE,KAAV,CAAgB,CAAC,IAAD,EAAO,IAAP,EAAa,IAAb,EAAmB,IAAnB,CAAhB,CARY;;AASrB;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACET,EAAAA,WAAW,EAAEO,mBAAUG,OAAV,CACXH,mBAAUI,KAAV,CAAgB;AACdC,IAAAA,QAAQ,EAAEL,mBAAUM,MADN;AAEdC,IAAAA,QAAQ,EAAEP,mBAAUM,MAFN;AAGdX,IAAAA,IAAI,EAAEK,mBAAUM,MAHF;AAIdZ,IAAAA,OAAO,EAAEM,mBAAUE,KAAV,CAAgB,CAAC,IAAD,EAAO,IAAP,EAAa,IAAb,EAAmB,IAAnB,CAAhB;AAJK,GAAhB,CADW,CAlBQ;;AA0BrB;AACF;AACA;AACEP,EAAAA,IAAI,EAAEK,mBAAUM;AA7BK,CAAvB;eAgCef,U","sourcesContent":["import React from \"react\";\nimport PropTypes from \"prop-types\";\nimport useStyles from \"./styles\";\n\nconst SimpleGrid = ({ children, breakpoints, spacing = \"sm\", cols, ...others }) => {\n const classes = useStyles({ breakpoints, cols, spacing })();\n return (\n <div className={classes.container} {...others}>\n {children}\n </div>\n );\n};\n\nSimpleGrid.propTypes = {\n /**\n * -\n */\n children: PropTypes.node,\n /**\n * Spacing with pre-defined values according the values defined in the theme\n */\n spacing: PropTypes.oneOf([\"sm\", \"md\", \"lg\", \"xl\"]),\n /**\n * Provide an array to define responsive behavior:\n *\n * maxWidth or minWidth: max-width or min-width at which media query will work\n *\n * cols: number of columns per row at given max-width\n *\n * spacing: optional spacing at given max-width, if not provided spacing from component prop will be used instead\n */\n breakpoints: PropTypes.arrayOf(\n PropTypes.shape({\n maxWidth: PropTypes.number,\n minWidth: PropTypes.number,\n cols: PropTypes.number,\n spacing: PropTypes.oneOf([\"sm\", \"md\", \"lg\", \"xl\"]),\n })\n ),\n /**\n * Number of how many columns the content will be displayed\n */\n cols: PropTypes.number,\n};\n\nexport default SimpleGrid;\n"],"file":"SimpleGrid.js"}
@@ -0,0 +1,2 @@
1
+ export { default } from "./SimpleGrid";
2
+ export * from "./SimpleGrid";
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ Object.defineProperty(exports, "default", {
9
+ enumerable: true,
10
+ get: function get() {
11
+ return _SimpleGrid.default;
12
+ }
13
+ });
14
+
15
+ var _SimpleGrid = _interopRequireDefault(require("./SimpleGrid"));
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/SimpleGrid/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA","sourcesContent":["export { default } from \"./SimpleGrid\";\n"],"file":"index.js"}
@@ -0,0 +1,99 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.object.keys.js");
4
+
5
+ require("core-js/modules/es.symbol.js");
6
+
7
+ require("core-js/modules/es.array.filter.js");
8
+
9
+ require("core-js/modules/es.object.get-own-property-descriptor.js");
10
+
11
+ require("core-js/modules/web.dom-collections.for-each.js");
12
+
13
+ require("core-js/modules/es.object.get-own-property-descriptors.js");
14
+
15
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
16
+
17
+ Object.defineProperty(exports, "__esModule", {
18
+ value: true
19
+ });
20
+ exports.default = void 0;
21
+
22
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
23
+
24
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
25
+
26
+ require("core-js/modules/es.array.sort.js");
27
+
28
+ require("core-js/modules/es.object.to-string.js");
29
+
30
+ require("core-js/modules/es.array.concat.js");
31
+
32
+ var _core = require("@material-ui/core");
33
+
34
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
35
+
36
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
37
+
38
+ function size(props) {
39
+ if (typeof props.size === "number") {
40
+ return props.size;
41
+ }
42
+
43
+ return props.sizes[props.size] || props.size || props.sizes.md;
44
+ }
45
+
46
+ function getSortedBreakpoints(theme, breakpoints) {
47
+ if (breakpoints.length === 0) {
48
+ return breakpoints;
49
+ }
50
+
51
+ var property = "maxWidth" in breakpoints[0] ? "maxWidth" : "minWidth";
52
+ var sorted = (0, _toConsumableArray2.default)(breakpoints).sort(function (a, b) {
53
+ return size({
54
+ size: b[property],
55
+ sizes: theme.breakpoints
56
+ }) - size({
57
+ size: a[property],
58
+ sizes: theme.breakpoints
59
+ });
60
+ });
61
+ return property === "minWidth" ? sorted.reverse() : sorted;
62
+ }
63
+
64
+ var styles = function styles(props) {
65
+ return (0, _core.makeStyles)(function (theme) {
66
+ var breakpoints = props.breakpoints,
67
+ spacing = props.spacing,
68
+ cols = props.cols;
69
+ var gridBreakpoints = null;
70
+
71
+ if (breakpoints) {
72
+ gridBreakpoints = getSortedBreakpoints(theme, breakpoints).reduce(function (acc, breakpoint) {
73
+ var property = "maxWidth" in breakpoint ? "max-width" : "min-width";
74
+ var breakpointSize = size({
75
+ size: property === "max-width" ? breakpoint.maxWidth : breakpoint.minWidth,
76
+ sizes: theme.breakpoints
77
+ });
78
+ acc["@media (".concat(property, ": ").concat(breakpointSize + (property === "max-width" ? 0 : 1), "px)")] = {
79
+ gridTemplateColumns: "repeat(".concat(breakpoint.cols, ", minmax(0, 1fr))"),
80
+ gap: theme.hv.spacing[spacing]
81
+ };
82
+ return acc;
83
+ }, {});
84
+ }
85
+
86
+ return {
87
+ container: _objectSpread({
88
+ boxSizing: "border-box",
89
+ display: "grid",
90
+ gridTemplateColumns: "repeat(".concat(cols, ", minmax(0, 1fr))"),
91
+ gap: theme.hv.spacing[spacing]
92
+ }, gridBreakpoints)
93
+ };
94
+ });
95
+ };
96
+
97
+ var _default = styles;
98
+ exports.default = _default;
99
+ //# sourceMappingURL=styles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/SimpleGrid/styles.js"],"names":["size","props","sizes","md","getSortedBreakpoints","theme","breakpoints","length","property","sorted","sort","a","b","reverse","styles","spacing","cols","gridBreakpoints","reduce","acc","breakpoint","breakpointSize","maxWidth","minWidth","gridTemplateColumns","gap","hv","container","boxSizing","display"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;AAEA,SAASA,IAAT,CAAcC,KAAd,EAAqB;AACnB,MAAI,OAAOA,KAAK,CAACD,IAAb,KAAsB,QAA1B,EAAoC;AAClC,WAAOC,KAAK,CAACD,IAAb;AACD;;AAED,SAAOC,KAAK,CAACC,KAAN,CAAYD,KAAK,CAACD,IAAlB,KAA2BC,KAAK,CAACD,IAAjC,IAAyCC,KAAK,CAACC,KAAN,CAAYC,EAA5D;AACD;;AAED,SAASC,oBAAT,CAA8BC,KAA9B,EAAqCC,WAArC,EAAkD;AAChD,MAAIA,WAAW,CAACC,MAAZ,KAAuB,CAA3B,EAA8B;AAC5B,WAAOD,WAAP;AACD;;AAED,MAAME,QAAQ,GAAG,cAAcF,WAAW,CAAC,CAAD,CAAzB,GAA+B,UAA/B,GAA4C,UAA7D;AACA,MAAMG,MAAM,GAAG,iCAAIH,WAAJ,EAAiBI,IAAjB,CACb,UAACC,CAAD,EAAIC,CAAJ;AAAA,WACEZ,IAAI,CAAC;AAAEA,MAAAA,IAAI,EAAEY,CAAC,CAACJ,QAAD,CAAT;AAAqBN,MAAAA,KAAK,EAAEG,KAAK,CAACC;AAAlC,KAAD,CAAJ,GACAN,IAAI,CAAC;AAAEA,MAAAA,IAAI,EAAEW,CAAC,CAACH,QAAD,CAAT;AAAqBN,MAAAA,KAAK,EAA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PC,QAAAA,OAAO,EAAE,MAFF;AAGPL,QAAAA,mBAAmB,mBAAYR,IAAZ,sBAHZ;AAIPS,QAAAA,GAAG,EAAEpB,KAAK,CAACqB,EAAN,CAASX,OAAT,CAAiBA,OAAjB;AAJE,SAKJE,eALI;AADJ,KAAP;AASD,GA7BD,CADa;AAAA,CAAf;;eAgCeH,M","sourcesContent":["import { makeStyles } from \"@material-ui/core\";\n\nfunction size(props) {\n if (typeof props.size === \"number\") {\n return props.size;\n }\n\n return props.sizes[props.size] || props.size || props.sizes.md;\n}\n\nfunction getSortedBreakpoints(theme, breakpoints) {\n if (breakpoints.length === 0) {\n return breakpoints;\n }\n\n const property = \"maxWidth\" in breakpoints[0] ? \"maxWidth\" : \"minWidth\";\n const sorted = [...breakpoints].sort(\n (a, b) =>\n size({ size: b[property], sizes: theme.breakpoints }) -\n size({ size: a[property], sizes: theme.breakpoints })\n );\n\n return property === \"minWidth\" ? sorted.reverse() : sorted;\n}\n\nconst styles = (props) =>\n makeStyles((theme) => {\n const { breakpoints, spacing, cols } = props;\n let gridBreakpoints = null;\n if (breakpoints) {\n gridBreakpoints = getSortedBreakpoints(theme, breakpoints).reduce((acc, breakpoint) => {\n const property = \"maxWidth\" in breakpoint ? \"max-width\" : \"min-width\";\n const breakpointSize = size({\n size: property === \"max-width\" ? breakpoint.maxWidth : breakpoint.minWidth,\n sizes: theme.breakpoints,\n });\n\n acc[`@media (${property}: ${breakpointSize + (property === \"max-width\" ? 0 : 1)}px)`] = {\n gridTemplateColumns: `repeat(${breakpoint.cols}, minmax(0, 1fr))`,\n gap: theme.hv.spacing[spacing],\n };\n\n return acc;\n }, {});\n }\n\n return {\n container: {\n boxSizing: \"border-box\",\n display: \"grid\",\n gridTemplateColumns: `repeat(${cols}, minmax(0, 1fr))`,\n gap: theme.hv.spacing[spacing],\n ...gridBreakpoints,\n },\n };\n });\n\nexport default styles;\n"],"file":"styles.js"}
@@ -0,0 +1,46 @@
1
+ import { StandardProps, DividerProps } from "@material-ui/core";
2
+ import React from "react";
3
+ import { HvThemeSpacing } from "../theme";
4
+
5
+ export type HvStackClassKey = "root";
6
+
7
+ export type StackDirection = {
8
+ xs: string;
9
+ sm: string;
10
+ md: string;
11
+ lg: string;
12
+ xl: string;
13
+ };
14
+
15
+ export interface HvStackProps
16
+ extends StandardProps<React.HTMLAttributes<HTMLDivElement>, HvStackClassKey> {
17
+ /**
18
+ * Children of the stack component.
19
+ */
20
+ children: React.ReactNode;
21
+ /**
22
+ * The direction of the stack.
23
+ * Can be either a string or an object that states the direction for each breakpoint.
24
+ */
25
+ direction?: string | StackDirection;
26
+ /**
27
+ * Indicates that the form element is disabled.
28
+ */
29
+ spacing?: HvThemeSpacing;
30
+ /**
31
+ * The divider component to be used between the stack elements.
32
+ * - If `true` the Material-UI Divider component will be used.
33
+ * - If a React node is passed then the custom divider will be used.
34
+ */
35
+ divider?: boolean | React.ReactNode;
36
+ /**
37
+ * The properties to pass on to the Material-UI component.
38
+ */
39
+ dividerProps: DividerProps;
40
+ /**
41
+ * Sets whether or not there should be arrow navigation between the stack elements
42
+ */
43
+ withNavigation: boolean;
44
+ }
45
+
46
+ export default function HvStack(props: HvStackProps): JSX.Element | null;
@@ -0,0 +1,195 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.string.iterator.js");
4
+
5
+ require("core-js/modules/es.weak-map.js");
6
+
7
+ require("core-js/modules/es.object.get-own-property-descriptor.js");
8
+
9
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
10
+
11
+ var _typeof = require("@babel/runtime/helpers/typeof");
12
+
13
+ Object.defineProperty(exports, "__esModule", {
14
+ value: true
15
+ });
16
+ exports.default = void 0;
17
+
18
+ require("core-js/modules/es.array.iterator.js");
19
+
20
+ require("core-js/modules/es.object.to-string.js");
21
+
22
+ require("core-js/modules/web.dom-collections.iterator.js");
23
+
24
+ require("core-js/modules/es.array.map.js");
25
+
26
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
27
+
28
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
29
+
30
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
31
+
32
+ var _react = _interopRequireWildcard(require("react"));
33
+
34
+ var _propTypes = _interopRequireDefault(require("prop-types"));
35
+
36
+ var _clsx = _interopRequireDefault(require("clsx"));
37
+
38
+ var _core = require("@material-ui/core");
39
+
40
+ var _isString = _interopRequireDefault(require("lodash/isString"));
41
+
42
+ var _isBoolean = _interopRequireDefault(require("lodash/isBoolean"));
43
+
44
+ var _styles = _interopRequireDefault(require("./styles"));
45
+
46
+ var _useWidth = _interopRequireDefault(require("../utils/useWidth"));
47
+
48
+ var _Focus = _interopRequireDefault(require("../Focus"));
49
+
50
+ var _excluded = ["classes", "children", "direction", "spacing", "divider", "withNavigation", "dividerProps"];
51
+
52
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
53
+
54
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
55
+
56
+ /**
57
+ * @returns {string} - Returns a direction for the stack: column or row. If the
58
+ * `direction` property is a string and a valid direction then we
59
+ * use it. If it's an object with multiple directions by breakpoint
60
+ * we use the appropriate one or search for the nearest breakpoint
61
+ * smaller than the current one to use.
62
+ */
63
+ var getDirection = function getDirection(direction, width, breakpoints) {
64
+ if ((0, _isString.default)(direction)) return direction;
65
+
66
+ for (var i = breakpoints.indexOf(width); i >= 0; i -= 1) {
67
+ if (direction[breakpoints[i]] !== undefined) {
68
+ return direction[breakpoints[i]];
69
+ }
70
+ }
71
+
72
+ return "column";
73
+ };
74
+ /**
75
+ * A Stack component allows the organization of its children in a vertical or horizontal layout.
76
+ *
77
+ * It also allows the specification of the spacing between the stack elements and the adition of a divider between the elements.
78
+ */
79
+
80
+
81
+ var HvStack = function HvStack(props) {
82
+ var classes = props.classes,
83
+ children = props.children,
84
+ _props$direction = props.direction,
85
+ direction = _props$direction === void 0 ? "column" : _props$direction,
86
+ _props$spacing = props.spacing,
87
+ spacing = _props$spacing === void 0 ? "sm" : _props$spacing,
88
+ _props$divider = props.divider,
89
+ divider = _props$divider === void 0 ? false : _props$divider,
90
+ _props$withNavigation = props.withNavigation,
91
+ withNavigation = _props$withNavigation === void 0 ? false : _props$withNavigation,
92
+ _props$dividerProps = props.dividerProps,
93
+ dividerProps = _props$dividerProps === void 0 ? {} : _props$dividerProps,
94
+ others = (0, _objectWithoutProperties2.default)(props, _excluded);
95
+ var width = (0, _useWidth.default)();
96
+ var theme = (0, _core.useTheme)();
97
+ var containerRef = (0, _react.useRef)(null);
98
+ var breakpoints = (0, _react.useMemo)(function () {
99
+ return (0, _toConsumableArray2.default)(theme.breakpoints.keys);
100
+ }, [theme]);
101
+ var processedDirection = (0, _react.useMemo)(function () {
102
+ return getDirection(direction, width, breakpoints);
103
+ }, [direction, width, breakpoints]);
104
+ /**
105
+ * @returns {node} - The divider component to use. If the property `divider` is
106
+ * set to `true` then the Material-UI divider is used, otherwise
107
+ * we use the custom divider the user passed.
108
+ */
109
+
110
+ var getDividerComponent = (0, _react.useCallback)(function () {
111
+ if ((0, _isBoolean.default)(divider) && divider) {
112
+ return /*#__PURE__*/_react.default.createElement(_core.Divider, (0, _extends2.default)({
113
+ orientation: processedDirection === "column" ? "horizontal" : "vertical",
114
+ flexItem: processedDirection === "row",
115
+ role: "separator"
116
+ }, dividerProps));
117
+ }
118
+
119
+ return divider;
120
+ }, [divider, dividerProps, processedDirection]);
121
+ return /*#__PURE__*/_react.default.createElement("div", (0, _extends2.default)({
122
+ ref: containerRef,
123
+ className: (0, _clsx.default)(classes.root, classes[processedDirection], classes[spacing])
124
+ }, others), _react.default.Children.map(children, function (child, i) {
125
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, divider && i !== 0 && getDividerComponent(divider, processedDirection), withNavigation ? /*#__PURE__*/_react.default.createElement(_Focus.default, {
126
+ rootRef: containerRef,
127
+ focusDisabled: false,
128
+ strategy: "grid",
129
+ navigationJump: processedDirection === "column" ? 1 : children.length,
130
+ filterClass: "child"
131
+ }, /*#__PURE__*/_react.default.createElement("div", {
132
+ className: "child"
133
+ }, child)) : child);
134
+ }));
135
+ };
136
+
137
+ process.env.NODE_ENV !== "production" ? HvStack.propTypes = {
138
+ /**
139
+ * A Jss Object used to override or extend the styles applied to the radio button.
140
+ */
141
+ classes: _propTypes.default.shape({
142
+ /**
143
+ * Styles applied to the component.
144
+ */
145
+ root: _propTypes.default.string
146
+ }).isRequired,
147
+
148
+ /**
149
+ * Children of the stack component.
150
+ */
151
+ children: _propTypes.default.node,
152
+
153
+ /**
154
+ * The direction of the stack.
155
+ * Can be either a string or an object that states the direction for each breakpoint.
156
+ */
157
+ direction: _propTypes.default.oneOfType([_propTypes.default.oneOf(["column", "row"]), _propTypes.default.shape({
158
+ xs: _propTypes.default.string,
159
+ sm: _propTypes.default.string,
160
+ md: _propTypes.default.string,
161
+ lg: _propTypes.default.string,
162
+ xl: _propTypes.default.string
163
+ })]),
164
+
165
+ /**
166
+ * The spacing between elements of the stack.
167
+ */
168
+ spacing: _propTypes.default.oneOf(["xs", "sm", "md", "lg", "xl"]),
169
+
170
+ /**
171
+ * The divider component to be used between the stack elements.
172
+ *
173
+ * - If `true` the Material-UI Divider component will be used.
174
+ *
175
+ * - If a React node is passed then the custom divider will be used.
176
+ */
177
+ divider: _propTypes.default.oneOfType([_propTypes.default.bool, _propTypes.default.node]),
178
+
179
+ /**
180
+ * The properties to pass on to the Material-UI component.
181
+ */
182
+ dividerProps: _propTypes.default.object,
183
+
184
+ /**
185
+ * Sets whether or not there should be arrow navigation between the stack elements
186
+ */
187
+ withNavigation: _propTypes.default.bool
188
+ } : void 0;
189
+
190
+ var _default = (0, _core.withStyles)(_styles.default, {
191
+ name: "HvStack"
192
+ })(HvStack);
193
+
194
+ exports.default = _default;
195
+ //# sourceMappingURL=Stack.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/Stack/Stack.js"],"names":["getDirection","direction","width","breakpoints","i","indexOf","undefined","HvStack","props","classes","children","spacing","divider","withNavigation","dividerProps","others","theme","containerRef","keys","processedDirection","getDividerComponent","root","React","Children","map","child","length","propTypes","PropTypes","shape","string","isRequired","node","oneOfType","oneOf","xs","sm","md","lg","xl","bool","object","styles","name"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAMA,YAAY,GAAG,SAAfA,YAAe,CAACC,SAAD,EAAYC,KAAZ,EAAmBC,WAAnB,EAAmC;AACtD,MAAI,uBAASF,SAAT,CAAJ,EAAyB,OAAOA,SAAP;;AAEzB,OAAK,IAAIG,CAAC,GAAGD,WAAW,CAACE,OAAZ,CAAoBH,KAApB,CAAb,EAAyCE,CAAC,IAAI,CAA9C,EAAiDA,CAAC,IAAI,CAAtD,EAAyD;AACvD,QAAIH,SAAS,CAACE,WAAW,CAACC,CAAD,CAAZ,CAAT,KAA8BE,SAAlC,EAA6C;AAC3C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SAAS,EAAE2B,mBAAUK,SAAV,CAAoB,CAC7BL,mBAAUM,KAAV,CAAgB,CAAC,QAAD,EAAW,KAAX,CAAhB,CAD6B,EAE7BN,mBAAUC,KAAV,CAAgB;AACdM,IAAAA,EAAE,EAAEP,mBAAUE,MADA;AAEdM,IAAAA,EAAE,EAAER,mBAAUE,MAFA;AAGdO,IAAAA,EAAE,EAAET,mBAAUE,MAHA;AAIdQ,IAAAA,EAAE,EAAEV,mBAAUE,MAJA;AAKdS,IAAAA,EAAE,EAAEX,mBAAUE;AALA,GAAhB,CAF6B,CAApB,CAlBO;;AA4BlB;AACF;AACA;AACEnB,EAAAA,OAAO,EAAEiB,mBAAUM,KAAV,CAAgB,CAAC,IAAD,EAAO,IAAP,EAAa,IAAb,EAAmB,IAAnB,EAAyB,IAAzB,CAAhB,CA/BS;;AAgClB;AACF;AACA;AACA;AACA;AACA;AACA;AACEtB,EAAAA,OAAO,EAAEgB,mBAAUK,SAAV,CAAoB,CAACL,mBAAUY,IAAX,EAAiBZ,mBAAUI,IAA3B,CAApB,CAvCS;;AAwClB;AACF;AACA;AACElB,EAAAA,YAAY,EAAEc,mBAAUa,MA3CN;;AA4ClB;AACF;AACA;AACE5B,EAAAA,cAAc,EAAEe,mBAAUY;AA/CR,CAApB;;eAkDe,sBAAWE,eAAX,EAAmB;AAAEC,EAAAA,IAAI,EAAE;AAAR,CAAnB,EAAwCpC,OAAxC,C","sourcesContent":["import React, { useMemo, useCallback, useRef } from \"react\";\nimport PropTypes from \"prop-types\";\nimport clsx from \"clsx\";\nimport { withStyles, Divider, useTheme } from \"@material-ui/core\";\nimport isString from \"lodash/isString\";\nimport isBoolean from \"lodash/isBoolean\";\nimport styles from \"./styles\";\nimport useWidth from \"../utils/useWidth\";\nimport Focus from \"../Focus\";\n\n/**\n * @returns {string} - Returns a direction for the stack: column or row. If the\n * `direction` property is a string and a valid direction then we\n * use it. If it's an object with multiple directions by breakpoint\n * we use the appropriate one or search for the nearest breakpoint\n * smaller than the current one to use.\n */\nconst getDirection = (direction, width, breakpoints) => {\n if (isString(direction)) return direction;\n\n for (let i = breakpoints.indexOf(width); i >= 0; i -= 1) {\n if (direction[breakpoints[i]] !== undefined) {\n return direction[breakpoints[i]];\n }\n }\n return \"column\";\n};\n\n/**\n * A Stack component allows the organization of its children in a vertical or horizontal layout.\n *\n * It also allows the specification of the spacing between the stack elements and the adition of a divider between the elements.\n */\nconst HvStack = (props) => {\n const {\n classes,\n children,\n direction = \"column\",\n spacing = \"sm\",\n divider = false,\n withNavigation = false,\n dividerProps = {},\n ...others\n } = props;\n const width = useWidth();\n const theme = useTheme();\n const containerRef = useRef(null);\n\n const breakpoints = useMemo(() => [...theme.breakpoints.keys], [theme]);\n\n const processedDirection = useMemo(\n () => getDirection(direction, width, breakpoints),\n [direction, width, breakpoints]\n );\n\n /**\n * @returns {node} - The divider component to use. If the property `divider` is\n * set to `true` then the Material-UI divider is used, otherwise\n * we use the custom divider the user passed.\n */\n const getDividerComponent = useCallback(() => {\n if (isBoolean(divider) && divider) {\n return (\n <Divider\n orientation={processedDirection === \"column\" ? \"horizontal\" : \"vertical\"}\n flexItem={processedDirection === \"row\"}\n role=\"separator\"\n {...dividerProps}\n />\n );\n }\n return divider;\n }, [divider, dividerProps, processedDirection]);\n\n return (\n <div\n ref={containerRef}\n className={clsx(classes.root, classes[processedDirection], classes[spacing])}\n {...others}\n >\n {React.Children.map(children, (child, i) => {\n return (\n <>\n {divider && i !== 0 && getDividerComponent(divider, processedDirection)}\n {withNavigation ? (\n <Focus\n rootRef={containerRef}\n focusDisabled={false}\n strategy=\"grid\"\n navigationJump={processedDirection === \"column\" ? 1 : children.length}\n filterClass=\"child\"\n >\n <div className=\"child\">{child}</div>\n </Focus>\n ) : (\n child\n )}\n </>\n );\n })}\n </div>\n );\n};\n\nHvStack.propTypes = {\n /**\n * A Jss Object used to override or extend the styles applied to the radio button.\n */\n classes: PropTypes.shape({\n /**\n * Styles applied to the component.\n */\n root: PropTypes.string,\n }).isRequired,\n /**\n * Children of the stack component.\n */\n children: PropTypes.node,\n /**\n * The direction of the stack.\n * Can be either a string or an object that states the direction for each breakpoint.\n */\n direction: PropTypes.oneOfType([\n PropTypes.oneOf([\"column\", \"row\"]),\n PropTypes.shape({\n xs: PropTypes.string,\n sm: PropTypes.string,\n md: PropTypes.string,\n lg: PropTypes.string,\n xl: PropTypes.string,\n }),\n ]),\n /**\n * The spacing between elements of the stack.\n */\n spacing: PropTypes.oneOf([\"xs\", \"sm\", \"md\", \"lg\", \"xl\"]),\n /**\n * The divider component to be used between the stack elements.\n *\n * - If `true` the Material-UI Divider component will be used.\n *\n * - If a React node is passed then the custom divider will be used.\n */\n divider: PropTypes.oneOfType([PropTypes.bool, PropTypes.node]),\n /**\n * The properties to pass on to the Material-UI component.\n */\n dividerProps: PropTypes.object,\n /**\n * Sets whether or not there should be arrow navigation between the stack elements\n */\n withNavigation: PropTypes.bool,\n};\n\nexport default withStyles(styles, { name: \"HvStack\" })(HvStack);\n"],"file":"Stack.js"}
@@ -0,0 +1,2 @@
1
+ export { default } from "./Stack";
2
+ export * from "./Stack";
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ Object.defineProperty(exports, "default", {
9
+ enumerable: true,
10
+ get: function get() {
11
+ return _Stack.default;
12
+ }
13
+ });
14
+
15
+ var _Stack = _interopRequireDefault(require("./Stack"));
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/Stack/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA","sourcesContent":["export { default } from \"./Stack\";\n"],"file":"index.js"}
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var styles = function styles(theme) {
9
+ return {
10
+ root: {
11
+ display: "flex"
12
+ },
13
+ column: {
14
+ flexDirection: "column"
15
+ },
16
+ row: {
17
+ flexDirection: "row"
18
+ },
19
+ xs: {
20
+ gap: theme.hvSpacing("xs")
21
+ },
22
+ sm: {
23
+ gap: theme.hvSpacing("sm")
24
+ },
25
+ md: {
26
+ gap: theme.hvSpacing("md")
27
+ },
28
+ lg: {
29
+ gap: theme.hvSpacing("lg")
30
+ },
31
+ xl: {
32
+ gap: theme.hvSpacing("xl")
33
+ }
34
+ };
35
+ };
36
+
37
+ var _default = styles;
38
+ exports.default = _default;
39
+ //# sourceMappingURL=styles.js.map