@shortfuse/materialdesignweb 0.8.0 → 0.9.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 (394) hide show
  1. package/README.md +32 -24
  2. package/bin/mdw-css.js +1 -1
  3. package/components/Badge.js +12 -5
  4. package/components/Body.js +3 -0
  5. package/components/BottomAppBar.js +1 -8
  6. package/components/BottomSheet.js +424 -0
  7. package/components/Box.js +11 -49
  8. package/components/Button.js +61 -82
  9. package/components/Card.js +56 -61
  10. package/components/Checkbox.js +7 -25
  11. package/components/CheckboxIcon.js +10 -28
  12. package/components/Chip.js +13 -11
  13. package/components/Dialog.js +49 -98
  14. package/components/Display.js +55 -0
  15. package/components/Fab.js +83 -17
  16. package/components/FabContainer.js +48 -0
  17. package/components/FilterChip.js +34 -32
  18. package/components/Grid.js +176 -0
  19. package/components/Headline.js +5 -28
  20. package/components/Icon.js +54 -69
  21. package/components/IconButton.js +71 -120
  22. package/components/Input.js +669 -83
  23. package/components/InputChip.js +161 -0
  24. package/components/Label.js +3 -0
  25. package/components/List.js +1 -5
  26. package/components/ListItem.js +39 -23
  27. package/components/ListOption.js +79 -62
  28. package/components/Listbox.js +19 -10
  29. package/components/Menu.js +8 -18
  30. package/components/MenuItem.js +25 -26
  31. package/components/NavBar.js +53 -19
  32. package/components/NavDrawer.js +15 -15
  33. package/components/NavDrawerItem.js +2 -4
  34. package/components/NavItem.js +40 -33
  35. package/components/NavRail.js +23 -21
  36. package/components/NavRailItem.js +5 -2
  37. package/components/Page.js +105 -0
  38. package/components/Pane.js +18 -0
  39. package/components/Popup.js +17 -8
  40. package/components/Radio.js +2 -5
  41. package/components/RadioIcon.js +10 -14
  42. package/components/Ripple.js +11 -7
  43. package/components/Root.js +209 -0
  44. package/components/Scrim.js +87 -0
  45. package/components/Search.js +12 -20
  46. package/components/SegmentedButton.js +33 -36
  47. package/components/SegmentedButtonGroup.js +9 -3
  48. package/components/Select.js +6 -7
  49. package/components/Shape.js +5 -65
  50. package/components/SideSheet.js +308 -0
  51. package/components/Slider.js +71 -34
  52. package/components/Snackbar.js +22 -16
  53. package/components/SnackbarContainer.js +42 -0
  54. package/components/Surface.js +15 -10
  55. package/components/Switch.js +3 -16
  56. package/components/SwitchIcon.js +40 -32
  57. package/components/Tab.js +57 -38
  58. package/components/TabContent.js +1 -0
  59. package/components/TabList.js +60 -32
  60. package/components/TabPanel.js +1 -1
  61. package/components/Table.js +116 -0
  62. package/components/TextArea.js +16 -15
  63. package/components/Title.js +4 -9
  64. package/components/Tooltip.js +43 -21
  65. package/components/TopAppBar.js +56 -78
  66. package/constants/shapes.js +36 -0
  67. package/constants/typography.js +127 -0
  68. package/core/Composition.js +354 -192
  69. package/core/CompositionAdapter.js +11 -12
  70. package/core/CustomElement.js +588 -236
  71. package/core/css.js +117 -12
  72. package/core/customTypes.js +120 -25
  73. package/core/dom.js +17 -11
  74. package/core/jsonMergePatch.js +12 -10
  75. package/core/observe.js +298 -253
  76. package/core/optimizations.js +9 -9
  77. package/core/template.js +14 -57
  78. package/dist/index.min.js +85 -115
  79. package/dist/index.min.js.map +4 -4
  80. package/dist/meta.json +1 -1
  81. package/dom/HTMLOptionsCollectionProxy.js +106 -0
  82. package/{theming/themableMixinLoader.js → loaders/palette.js} +4 -3
  83. package/loaders/theme.js +12 -0
  84. package/mixins/AriaReflectorMixin.js +53 -13
  85. package/mixins/AriaToolbarMixin.js +3 -0
  86. package/mixins/ControlMixin.js +76 -33
  87. package/mixins/DelegatesFocusMixin.js +54 -0
  88. package/mixins/DensityMixin.js +2 -2
  89. package/mixins/ElevationMixin.js +62 -0
  90. package/mixins/FlexableMixin.js +66 -37
  91. package/mixins/FormAssociatedMixin.js +60 -8
  92. package/mixins/HyperlinkMixin.js +66 -0
  93. package/mixins/InputMixin.js +205 -32
  94. package/mixins/KeyboardNavMixin.js +8 -6
  95. package/mixins/NavigationListenerMixin.js +33 -0
  96. package/mixins/PopupMixin.js +176 -208
  97. package/mixins/ResizeObserverMixin.js +16 -4
  98. package/mixins/RippleMixin.js +8 -6
  99. package/mixins/ScrollListenerMixin.js +1 -1
  100. package/mixins/SemiStickyMixin.js +44 -98
  101. package/mixins/ShapeMaskedMixin.js +117 -0
  102. package/mixins/ShapeMixin.js +22 -204
  103. package/mixins/StateMixin.js +70 -34
  104. package/mixins/TextFieldMixin.js +107 -143
  105. package/mixins/ThemableMixin.js +44 -56
  106. package/mixins/TooltipTriggerMixin.js +291 -359
  107. package/mixins/TouchTargetMixin.js +1 -1
  108. package/mixins/TypographyMixin.js +121 -0
  109. package/package.json +110 -74
  110. package/services/rtl.js +10 -0
  111. package/services/svgAlias.js +17 -0
  112. package/{theming/index.js → services/theme.js} +24 -174
  113. package/types/bin/mdw-css.d.ts +3 -0
  114. package/types/bin/mdw-css.d.ts.map +1 -0
  115. package/types/components/Badge.d.ts +39 -0
  116. package/types/components/Badge.d.ts.map +1 -0
  117. package/types/components/Body.d.ts +29 -0
  118. package/types/components/Body.d.ts.map +1 -0
  119. package/types/components/BottomAppBar.d.ts +73 -0
  120. package/types/components/BottomAppBar.d.ts.map +1 -0
  121. package/types/components/BottomSheet.d.ts +109 -0
  122. package/types/components/BottomSheet.d.ts.map +1 -0
  123. package/types/components/Box.d.ts +16 -0
  124. package/types/components/Box.d.ts.map +1 -0
  125. package/types/components/Button.d.ts +714 -0
  126. package/types/components/Button.d.ts.map +1 -0
  127. package/types/components/Card.d.ts +412 -0
  128. package/types/components/Card.d.ts.map +1 -0
  129. package/types/components/Checkbox.d.ts +205 -0
  130. package/types/components/Checkbox.d.ts.map +1 -0
  131. package/types/components/CheckboxIcon.d.ts +44 -0
  132. package/types/components/CheckboxIcon.d.ts.map +1 -0
  133. package/types/components/Chip.d.ts +1425 -0
  134. package/types/components/Chip.d.ts.map +1 -0
  135. package/types/components/Dialog.d.ts +286 -0
  136. package/types/components/Dialog.d.ts.map +1 -0
  137. package/types/components/DialogActions.d.ts +4 -0
  138. package/types/components/DialogActions.d.ts.map +1 -0
  139. package/types/components/Display.d.ts +45 -0
  140. package/types/components/Display.d.ts.map +1 -0
  141. package/types/components/Divider.d.ts +10 -0
  142. package/types/components/Divider.d.ts.map +1 -0
  143. package/types/components/Fab.d.ts +741 -0
  144. package/types/components/Fab.d.ts.map +1 -0
  145. package/types/components/FabContainer.d.ts +10 -0
  146. package/types/components/FabContainer.d.ts.map +1 -0
  147. package/types/components/FilterChip.d.ts +4283 -0
  148. package/types/components/FilterChip.d.ts.map +1 -0
  149. package/types/components/Grid.d.ts +37 -0
  150. package/types/components/Grid.d.ts.map +1 -0
  151. package/types/components/Headline.d.ts +47 -0
  152. package/types/components/Headline.d.ts.map +1 -0
  153. package/types/components/Icon.d.ts +103 -0
  154. package/types/components/Icon.d.ts.map +1 -0
  155. package/types/components/IconButton.d.ts +1486 -0
  156. package/types/components/IconButton.d.ts.map +1 -0
  157. package/types/components/Input.d.ts +51288 -0
  158. package/types/components/Input.d.ts.map +1 -0
  159. package/types/components/InputChip.d.ts +243 -0
  160. package/types/components/InputChip.d.ts.map +1 -0
  161. package/types/components/Label.d.ts +29 -0
  162. package/types/components/Label.d.ts.map +1 -0
  163. package/types/components/List.d.ts +31 -0
  164. package/types/components/List.d.ts.map +1 -0
  165. package/types/components/ListItem.d.ts +349 -0
  166. package/types/components/ListItem.d.ts.map +1 -0
  167. package/types/components/ListOption.d.ts +1493 -0
  168. package/types/components/ListOption.d.ts.map +1 -0
  169. package/types/components/Listbox.d.ts +12012 -0
  170. package/types/components/Listbox.d.ts.map +1 -0
  171. package/types/components/Menu.d.ts +119 -0
  172. package/types/components/Menu.d.ts.map +1 -0
  173. package/types/components/MenuItem.d.ts +3109 -0
  174. package/types/components/MenuItem.d.ts.map +1 -0
  175. package/types/components/NavBar.d.ts +18 -0
  176. package/types/components/NavBar.d.ts.map +1 -0
  177. package/types/components/NavBarItem.d.ts +186 -0
  178. package/types/components/NavBarItem.d.ts.map +1 -0
  179. package/types/components/NavDrawer.d.ts +108 -0
  180. package/types/components/NavDrawer.d.ts.map +1 -0
  181. package/types/components/NavDrawerItem.d.ts +186 -0
  182. package/types/components/NavDrawerItem.d.ts.map +1 -0
  183. package/types/components/NavItem.d.ts +190 -0
  184. package/types/components/NavItem.d.ts.map +1 -0
  185. package/types/components/NavRail.d.ts +109 -0
  186. package/types/components/NavRail.d.ts.map +1 -0
  187. package/types/components/NavRailItem.d.ts +186 -0
  188. package/types/components/NavRailItem.d.ts.map +1 -0
  189. package/types/components/Page.d.ts +24 -0
  190. package/types/components/Page.d.ts.map +1 -0
  191. package/types/components/Pane.d.ts +44 -0
  192. package/types/components/Pane.d.ts.map +1 -0
  193. package/types/components/Popup.d.ts +76 -0
  194. package/types/components/Popup.d.ts.map +1 -0
  195. package/types/components/Progress.d.ts +19 -0
  196. package/types/components/Progress.d.ts.map +1 -0
  197. package/types/components/Radio.d.ts +199 -0
  198. package/types/components/Radio.d.ts.map +1 -0
  199. package/types/components/RadioIcon.d.ts +46 -0
  200. package/types/components/RadioIcon.d.ts.map +1 -0
  201. package/types/components/Ripple.d.ts +34 -0
  202. package/types/components/Ripple.d.ts.map +1 -0
  203. package/types/components/Root.d.ts +68 -0
  204. package/types/components/Root.d.ts.map +1 -0
  205. package/types/components/Scrim.d.ts +6 -0
  206. package/types/components/Scrim.d.ts.map +1 -0
  207. package/types/components/Search.d.ts +16 -0
  208. package/types/components/Search.d.ts.map +1 -0
  209. package/types/components/SegmentedButton.d.ts +718 -0
  210. package/types/components/SegmentedButton.d.ts.map +1 -0
  211. package/types/components/SegmentedButtonGroup.d.ts +44 -0
  212. package/types/components/SegmentedButtonGroup.d.ts.map +1 -0
  213. package/types/components/Select.d.ts +1361 -0
  214. package/types/components/Select.d.ts.map +1 -0
  215. package/types/components/Shape.d.ts +10 -0
  216. package/types/components/Shape.d.ts.map +1 -0
  217. package/types/components/SideSheet.d.ts +106 -0
  218. package/types/components/SideSheet.d.ts.map +1 -0
  219. package/types/components/Slider.d.ts +382 -0
  220. package/types/components/Slider.d.ts.map +1 -0
  221. package/types/components/Snackbar.d.ts +65 -0
  222. package/types/components/Snackbar.d.ts.map +1 -0
  223. package/types/components/SnackbarContainer.d.ts +6 -0
  224. package/types/components/SnackbarContainer.d.ts.map +1 -0
  225. package/types/components/Surface.d.ts +45 -0
  226. package/types/components/Surface.d.ts.map +1 -0
  227. package/types/components/Switch.d.ts +183 -0
  228. package/types/components/Switch.d.ts.map +1 -0
  229. package/types/components/SwitchIcon.d.ts +169 -0
  230. package/types/components/SwitchIcon.d.ts.map +1 -0
  231. package/types/components/Tab.d.ts +879 -0
  232. package/types/components/Tab.d.ts.map +1 -0
  233. package/types/components/TabContent.d.ts +122 -0
  234. package/types/components/TabContent.d.ts.map +1 -0
  235. package/types/components/TabList.d.ts +6266 -0
  236. package/types/components/TabList.d.ts.map +1 -0
  237. package/types/components/TabPanel.d.ts +28 -0
  238. package/types/components/TabPanel.d.ts.map +1 -0
  239. package/types/components/Table.d.ts +2 -0
  240. package/types/components/Table.d.ts.map +1 -0
  241. package/types/components/TextArea.d.ts +1394 -0
  242. package/types/components/TextArea.d.ts.map +1 -0
  243. package/types/components/Title.d.ts +47 -0
  244. package/types/components/Title.d.ts.map +1 -0
  245. package/types/components/Tooltip.d.ts +49 -0
  246. package/types/components/Tooltip.d.ts.map +1 -0
  247. package/types/components/TopAppBar.d.ts +130 -0
  248. package/types/components/TopAppBar.d.ts.map +1 -0
  249. package/types/constants/colorKeywords.d.ts +2 -0
  250. package/types/constants/colorKeywords.d.ts.map +1 -0
  251. package/types/constants/shapes.d.ts +38 -0
  252. package/types/constants/shapes.d.ts.map +1 -0
  253. package/types/constants/typography.d.ts +212 -0
  254. package/types/constants/typography.d.ts.map +1 -0
  255. package/types/core/Composition.d.ts +252 -0
  256. package/types/core/Composition.d.ts.map +1 -0
  257. package/types/core/CompositionAdapter.d.ts +92 -0
  258. package/types/core/CompositionAdapter.d.ts.map +1 -0
  259. package/types/core/CustomElement.d.ts +302 -0
  260. package/types/core/CustomElement.d.ts.map +1 -0
  261. package/types/core/css.d.ts +44 -0
  262. package/types/core/css.d.ts.map +1 -0
  263. package/types/core/customTypes.d.ts +26 -0
  264. package/types/core/customTypes.d.ts.map +1 -0
  265. package/types/core/dom.d.ts +32 -0
  266. package/types/core/dom.d.ts.map +1 -0
  267. package/types/core/jsonMergePatch.d.ts +31 -0
  268. package/types/core/jsonMergePatch.d.ts.map +1 -0
  269. package/types/core/observe.d.ts +113 -0
  270. package/types/core/observe.d.ts.map +1 -0
  271. package/types/core/optimizations.d.ts +7 -0
  272. package/types/core/optimizations.d.ts.map +1 -0
  273. package/types/core/template.d.ts +47 -0
  274. package/types/core/template.d.ts.map +1 -0
  275. package/types/core/uid.d.ts +6 -0
  276. package/types/core/uid.d.ts.map +1 -0
  277. package/types/dom/HTMLOptionsCollectionProxy.d.ts +18 -0
  278. package/types/dom/HTMLOptionsCollectionProxy.d.ts.map +1 -0
  279. package/types/index.d.ts +88 -0
  280. package/types/index.d.ts.map +1 -0
  281. package/types/loaders/palette.d.ts +2 -0
  282. package/types/loaders/palette.d.ts.map +1 -0
  283. package/types/loaders/theme.d.ts +2 -0
  284. package/types/loaders/theme.d.ts.map +1 -0
  285. package/types/mixins/AriaReflectorMixin.d.ts +23 -0
  286. package/types/mixins/AriaReflectorMixin.d.ts.map +1 -0
  287. package/types/mixins/AriaToolbarMixin.d.ts +32 -0
  288. package/types/mixins/AriaToolbarMixin.d.ts.map +1 -0
  289. package/types/mixins/ControlMixin.d.ts +124 -0
  290. package/types/mixins/ControlMixin.d.ts.map +1 -0
  291. package/types/mixins/DelegatesFocusMixin.d.ts +5 -0
  292. package/types/mixins/DelegatesFocusMixin.d.ts.map +1 -0
  293. package/types/mixins/DensityMixin.d.ts +5 -0
  294. package/types/mixins/DensityMixin.d.ts.map +1 -0
  295. package/types/mixins/ElevationMixin.d.ts +33 -0
  296. package/types/mixins/ElevationMixin.d.ts.map +1 -0
  297. package/types/mixins/FlexableMixin.d.ts +13 -0
  298. package/types/mixins/FlexableMixin.d.ts.map +1 -0
  299. package/types/mixins/FormAssociatedMixin.d.ts +122 -0
  300. package/types/mixins/FormAssociatedMixin.d.ts.map +1 -0
  301. package/types/mixins/HyperlinkMixin.d.ts +22 -0
  302. package/types/mixins/HyperlinkMixin.d.ts.map +1 -0
  303. package/types/mixins/InputMixin.d.ts +179 -0
  304. package/types/mixins/InputMixin.d.ts.map +1 -0
  305. package/types/mixins/KeyboardNavMixin.d.ts +47 -0
  306. package/types/mixins/KeyboardNavMixin.d.ts.map +1 -0
  307. package/types/mixins/NavigationListenerMixin.d.ts +8 -0
  308. package/types/mixins/NavigationListenerMixin.d.ts.map +1 -0
  309. package/types/mixins/PopupMixin.d.ts +82 -0
  310. package/types/mixins/PopupMixin.d.ts.map +1 -0
  311. package/types/mixins/RTLObserverMixin.d.ts +7 -0
  312. package/types/mixins/RTLObserverMixin.d.ts.map +1 -0
  313. package/types/mixins/ResizeObserverMixin.d.ts +12 -0
  314. package/types/mixins/ResizeObserverMixin.d.ts.map +1 -0
  315. package/types/mixins/RippleMixin.d.ts +92 -0
  316. package/types/mixins/RippleMixin.d.ts.map +1 -0
  317. package/types/mixins/ScrollListenerMixin.d.ts +41 -0
  318. package/types/mixins/ScrollListenerMixin.d.ts.map +1 -0
  319. package/types/mixins/SemiStickyMixin.d.ts +50 -0
  320. package/types/mixins/SemiStickyMixin.d.ts.map +1 -0
  321. package/types/mixins/ShapeMaskedMixin.d.ts +9 -0
  322. package/types/mixins/ShapeMaskedMixin.d.ts.map +1 -0
  323. package/types/mixins/ShapeMixin.d.ts +38 -0
  324. package/types/mixins/ShapeMixin.d.ts.map +1 -0
  325. package/types/mixins/StateMixin.d.ts +27 -0
  326. package/types/mixins/StateMixin.d.ts.map +1 -0
  327. package/types/mixins/TextFieldMixin.d.ts +1354 -0
  328. package/types/mixins/TextFieldMixin.d.ts.map +1 -0
  329. package/types/mixins/ThemableMixin.d.ts +9 -0
  330. package/types/mixins/ThemableMixin.d.ts.map +1 -0
  331. package/types/mixins/TooltipTriggerMixin.d.ts +106 -0
  332. package/types/mixins/TooltipTriggerMixin.d.ts.map +1 -0
  333. package/types/mixins/TouchTargetMixin.d.ts +3 -0
  334. package/types/mixins/TouchTargetMixin.d.ts.map +1 -0
  335. package/types/mixins/TypographyMixin.d.ts +17 -0
  336. package/types/mixins/TypographyMixin.d.ts.map +1 -0
  337. package/types/services/rtl.d.ts +3 -0
  338. package/types/services/rtl.d.ts.map +1 -0
  339. package/types/services/svgAlias.d.ts +13 -0
  340. package/types/services/svgAlias.d.ts.map +1 -0
  341. package/types/services/theme.d.ts +45 -0
  342. package/types/services/theme.d.ts.map +1 -0
  343. package/types/utils/cli.d.ts +3 -0
  344. package/types/utils/cli.d.ts.map +1 -0
  345. package/types/utils/function.d.ts +3 -0
  346. package/types/utils/function.d.ts.map +1 -0
  347. package/types/utils/jsx-runtime.d.ts +20 -0
  348. package/types/utils/jsx-runtime.d.ts.map +1 -0
  349. package/types/utils/material-color/blend.d.ts +34 -0
  350. package/types/utils/material-color/blend.d.ts.map +1 -0
  351. package/types/utils/material-color/hct/Cam16.d.ts +142 -0
  352. package/types/utils/material-color/hct/Cam16.d.ts.map +1 -0
  353. package/types/utils/material-color/hct/Hct.d.ts +93 -0
  354. package/types/utils/material-color/hct/Hct.d.ts.map +1 -0
  355. package/types/utils/material-color/hct/ViewingConditions.d.ts +69 -0
  356. package/types/utils/material-color/hct/ViewingConditions.d.ts.map +1 -0
  357. package/types/utils/material-color/hct/hctSolver.d.ts +30 -0
  358. package/types/utils/material-color/hct/hctSolver.d.ts.map +1 -0
  359. package/types/utils/material-color/helper.d.ts +8 -0
  360. package/types/utils/material-color/helper.d.ts.map +1 -0
  361. package/types/utils/material-color/palettes/CorePalette.d.ts +75 -0
  362. package/types/utils/material-color/palettes/CorePalette.d.ts.map +1 -0
  363. package/types/utils/material-color/palettes/TonalPalette.d.ts +38 -0
  364. package/types/utils/material-color/palettes/TonalPalette.d.ts.map +1 -0
  365. package/types/utils/material-color/scheme/Scheme.d.ts +264 -0
  366. package/types/utils/material-color/scheme/Scheme.d.ts.map +1 -0
  367. package/types/utils/material-color/utils/color.d.ts +172 -0
  368. package/types/utils/material-color/utils/color.d.ts.map +1 -0
  369. package/types/utils/material-color/utils/math.d.ts +94 -0
  370. package/types/utils/material-color/utils/math.d.ts.map +1 -0
  371. package/types/utils/pixelmatch.d.ts +22 -0
  372. package/types/utils/pixelmatch.d.ts.map +1 -0
  373. package/types/utils/popup.d.ts +106 -0
  374. package/types/utils/popup.d.ts.map +1 -0
  375. package/types/utils/searchParams.d.ts +3 -0
  376. package/types/utils/searchParams.d.ts.map +1 -0
  377. package/types/utils/svg.d.ts +7 -0
  378. package/types/utils/svg.d.ts.map +1 -0
  379. package/utils/material-color/scheme/Scheme.js +1 -1
  380. package/utils/pixelmatch.js +360 -0
  381. package/utils/popup.js +86 -10
  382. package/utils/searchParams.js +19 -0
  383. package/components/ExtendedFab.js +0 -32
  384. package/components/Layout.js +0 -504
  385. package/components/Nav.js +0 -38
  386. package/core/DomAdapter.js +0 -586
  387. package/core/ICustomElement.d.ts +0 -291
  388. package/core/ICustomElement.js +0 -1
  389. package/core/test.js +0 -126
  390. package/core/typings.d.ts +0 -142
  391. package/core/typings.js +0 -1
  392. package/mixins/SurfaceMixin.js +0 -127
  393. package/theming/loader.js +0 -22
  394. /package/{utils/color_keywords.js → constants/colorKeywords.js} +0 -0
@@ -1,291 +0,0 @@
1
- /* eslint-disable no-use-before-define */
2
-
3
- import Composition from './Composition.js';
4
- import {
5
- CompositionEventListener,
6
- CompositionEventListenerObject,
7
- HTMLTemplater,
8
- ObserverOptions,
9
- ObserverPropertyType,
10
- ParsedObserverPropertyType,
11
- ParsedProps,
12
- } from './typings.js';
13
-
14
- type ClassOf<T extends { prototype: unknown; } > = T;
15
-
16
- type CallbackArguments<T1 = any, T2 = T1> = {
17
- composition: Composition<T1>;
18
- html: HTMLTemplater<T1, Partial<T2>>;
19
- inline: (fn: (this:T1, data: {[K in keyof T2]?: T2[K]}) => any) => string;
20
- template: DocumentFragment;
21
- element: T1;
22
- }
23
-
24
- type IDLParameter<C extends object> = {
25
- [P in string] :
26
- ObserverPropertyType
27
- | ObserverOptions<ObserverPropertyType, unknown, C>
28
- | ((this:C, data:Partial<C>, fn?: () => any) => any)
29
- };
30
-
31
- type ExtendedClass<T1 extends typeof ICustomElement, T2 extends abstract new (...args: any) => any> =
32
- Omit<T1, 'prototype'> & T2;
33
-
34
- type ConstructorLess<T1 extends object, T2 extends abstract new (...args: any) => any> = T1 & T2;
35
-
36
- declare type DefinedPropertiesOf<T extends ({ prototype: unknown; } & (new (...args: any) => any)), P> =
37
- {[K in keyof T]: T[K]}
38
- & { new(): (...args: ConstructorParameters<T>) => InstanceType<T> & P}
39
- & { prototype: T['prototype'] & P };
40
-
41
- type CompositionCallback<T1, T2=T1> = {
42
- composed?: (this: T1, options: CallbackArguments<T1, T2>) => any,
43
- constructed?: (this: T1, options: CallbackArguments<T1, T2>) => any,
44
- connected?: (this: T1, options: CallbackArguments<T1, T2>) => any,
45
- disconnected?: (this: T1, options: CallbackArguments<T1, T2>) => any,
46
- props?: {
47
- [P in keyof T1] : (
48
- this: T1,
49
- oldValue: T1[P],
50
- newValue: T1[P],
51
- changes:any,
52
- element: T1
53
- ) => any
54
- },
55
- attrs?: {[K in keyof any]: (
56
- this: T1,
57
- oldValue: string,
58
- newValue: string,
59
- element: T1
60
- ) => unknown
61
- },
62
- } & {
63
- [P in keyof T1 & string as `${P}Changed`]?: (
64
- this: T1,
65
- oldValue: T1[P],
66
- newValue: T1[P],
67
- changes:any,
68
- element: T1
69
- ) => any
70
- }
71
-
72
- declare interface ICustomElementInstance extends HTMLElement {
73
- ariaActiveDescendantElement: Element
74
- propChangedCallback<
75
- T extends ICustomElementInstance,
76
- K extends string = string,
77
- >(this:T,
78
- name: K,
79
- oldValue: K extends keyof T ? T[K] : unknown,
80
- newValue: K extends keyof T ? T[K] : unknown,
81
- changes?: K extends keyof T ? T[K] extends object ? Partial<T[K]> : T[K] : unknown): void;
82
-
83
- }
84
-
85
- interface ConstructorOf<T> {
86
- new(): T;
87
- }
88
-
89
- export declare const ICustomElement: {
90
- new(): ICustomElementInstance;
91
- prototype: ICustomElementInstance;
92
-
93
- _onComposeCallbacks: ((callback: CallbackArguments) => any)[];
94
-
95
- _onConnectedCallbacks: ((callback: CallbackArguments) => any)[];
96
-
97
- _onDisconnectedCallbacks: ((callback: CallbackArguments) => any)[];
98
-
99
- _onConstructedCallbacks: ((callback: CallbackArguments) => any)[];
100
-
101
- schema: Record<string, unknown>;
102
-
103
- extend<T extends typeof ICustomElement>(this: T): T;
104
-
105
- tsClassFix<T extends typeof ICustomElement>(this:T): T & (new (...args:any[]) => InstanceType<T>)
106
-
107
- html<T extends typeof ICustomElement>(
108
- this: T,
109
- string: TemplateStringsArray,
110
- // eslint-disable-next-line no-shadow
111
- ...substitutions: (string|Element|((this:InstanceType<T>, data:InstanceType<T> & T['schema'], injections?:any) => any))[]
112
- ): T
113
-
114
- css<
115
- T1 extends typeof ICustomElement,
116
- T2 extends TemplateStringsArray|HTMLStyleElement|CSSStyleSheet>(
117
- this: T1,
118
- array: T2,
119
- ...rest: T2 extends TemplateStringsArray ? any[] : (HTMLStyleElement|CSSStyleSheet)[]
120
- ): T1
121
-
122
- define<
123
- CLASS extends typeof ICustomElement,
124
- ARGS extends ConstructorParameters<CLASS>,
125
- INSTANCE extends InstanceType<CLASS>,
126
- PROPS extends {
127
- [P in keyof any] :
128
- {
129
- enumerable?: boolean;
130
- configurable?: boolean;
131
- writable?: boolean;
132
- value?: any;
133
- get?: ((this: INSTANCE) => any);
134
- set?: (this: INSTANCE, value: any) => void;
135
- } | ((this: INSTANCE, ...args:any[]) => any)
136
- },
137
- VALUE extends {
138
- [KEY in keyof PROPS]: PROPS[KEY] extends (...args2:any[]) => infer R ? R
139
- : PROPS[KEY] extends TypedPropertyDescriptor<infer R> ? R : never
140
- }>
141
- (this: CLASS, props: PROPS & ThisType<PROPS & INSTANCE>): CLASS
142
- & (new (...args: ARGS) => INSTANCE & VALUE)
143
-
144
- observe<
145
- CLASS extends typeof ICustomElement,
146
- ARGS extends ConstructorParameters<CLASS>,
147
- INSTANCE extends InstanceType<CLASS>,
148
- PROPS extends IDLParameter<INSTANCE>,
149
- VALUE extends {
150
- [KEY in keyof PROPS]:
151
- PROPS[KEY] extends (...args2:any[]) => infer R ? R
152
- : PROPS[KEY] extends ObserverPropertyType ? ParsedObserverPropertyType<PROPS[KEY]>
153
- : PROPS[KEY] extends {type: 'object'} & ObserverOptions<any, infer R> ? (unknown extends R ? object : R)
154
- : PROPS[KEY] extends {type: ObserverPropertyType} ? ParsedObserverPropertyType<PROPS[KEY]['type']>
155
- : PROPS[KEY] extends ObserverOptions<any, infer R> ? (unknown extends R ? string : R)
156
- : never
157
- },
158
- > (this: CLASS, props: PROPS)
159
- : CLASS & (new (...args: ARGS) => INSTANCE & VALUE)
160
-
161
- props: typeof ICustomElement.observe;
162
-
163
- set<
164
- CLASS extends typeof ICustomElement,
165
- ARGS extends ConstructorParameters<CLASS>,
166
- INSTANCE extends InstanceType<CLASS>,
167
- PROPS extends object>
168
- (this: CLASS, source: PROPS & ThisType<PROPS & INSTANCE>, options?: Partial<PropertyDescriptor>)
169
- : CLASS & (new(...args: ARGS) => INSTANCE & PROPS)
170
-
171
- methods: typeof ICustomElement.set;
172
-
173
- overrides<
174
- CLASS extends typeof ICustomElement,
175
- ARGS extends ConstructorParameters<CLASS>,
176
- INSTANCE extends InstanceType<CLASS>,
177
- PROPS extends Partial<INSTANCE>>
178
- (this: CLASS, source: PROPS & ThisType<PROPS & INSTANCE>, options?: Partial<PropertyDescriptor>)
179
- : CLASS & (new(...args: ARGS) => INSTANCE & PROPS)
180
-
181
- expressions<
182
- CLASS extends typeof ICustomElement,
183
- ARGS extends ConstructorParameters<CLASS>,
184
- INSTANCE extends InstanceType<CLASS>,
185
- PROPS extends {
186
- [K in keyof any]: ((this: INSTANCE, data?: INSTANCE & CLASS['schema']) => string|boolean|null)
187
- }
188
- >(this: CLASS, expressions: PROPS & ThisType<INSTANCE & PROPS>):
189
- CLASS & (new (...args: ARGS) => INSTANCE & PROPS)
190
-
191
- defineStatic<
192
- T1 extends typeof ICustomElement,
193
- T2 extends IDLParameter<T1>>
194
- (this: T1, props: T2):T1 & ParsedProps<T2>;
195
-
196
- setStatic<
197
- T1 extends typeof ICustomElement,
198
- T2 extends {
199
- [K in keyof any]: (
200
- ((this:T1, ...args:any[]) => any)
201
- |string|number|boolean|any[]|object)}
202
- >
203
- (this: T1, source: T2 & ThisType<T1 & T2>):T1 & T2;
204
-
205
- autoRegister<T extends typeof ICustomElement>
206
- (this: T, elementName: string): T;
207
-
208
- setSchema<
209
- T1 extends typeof ICustomElement,
210
- T2 extends {[K in keyof any]: unknown}
211
- >
212
- (this: T1, schema: T2): T1 & {schema: T2};
213
-
214
- register<T extends typeof ICustomElement>
215
- (this: T, elementName?: string, force?: boolean): T;
216
-
217
- append<
218
- T extends typeof ICustomElement,
219
- >
220
- (this: T, ...parts: ConstructorParameters<typeof Composition<InstanceType<T>>>): T;
221
-
222
- mixin<
223
- BASE extends typeof ICustomElement,
224
- FN extends (...args:any[]) => any,
225
- RETURN extends ReturnType<FN>,
226
- SUBCLASS extends ClassOf<RETURN>,
227
- ARGS extends ConstructorParameters<SUBCLASS>,
228
- BASE_INSTANCE extends InstanceType<BASE>,
229
- SUBCLASS_INSTANCE extends InstanceType<SUBCLASS>>
230
- (this: BASE, mixin: FN): SUBCLASS & BASE
231
- & (new (...args: ARGS) => SUBCLASS_INSTANCE & BASE_INSTANCE)
232
-
233
- events<T extends typeof ICustomElement>
234
- (
235
- this: T,
236
- listeners?: CompositionEventListenerObject<InstanceType<T>>,
237
- options?: Partial<CompositionEventListener<InstanceType<T>>>,
238
- ): T;
239
-
240
- childEvents<T extends typeof ICustomElement>
241
- (
242
- this: T,
243
- listenerMap: {
244
- [P in keyof any]: CompositionEventListenerObject<InstanceType<T>>
245
- },
246
- options?: Partial<CompositionEventListener<InstanceType<T>>>,
247
- ): T;
248
-
249
- on<
250
- T1 extends typeof ICustomElement,
251
- T2 extends InstanceType<T1>,
252
- T3 extends CompositionCallback<T2, T2 & T1['schema']>,
253
- T4 extends keyof T3,
254
- >
255
- (this: T1, name: T3|T4, callbacks?: T3[T4] & ThisType<T2>): T1
256
-
257
- onPropChanged<
258
- T1 extends typeof ICustomElement,
259
- T2 extends InstanceType<T1>
260
- >
261
- (
262
- this: T1,
263
- options: {
264
- [P in keyof T2]? : (
265
- // eslint-disable-next-line no-shadow
266
- this: T2,
267
- oldValue: T2[P],
268
- newValue: T2[P],
269
- changes:any,
270
- element: T2
271
- ) => void
272
- },
273
- ): T1;
274
-
275
- onAttributeChanged<
276
- T1 extends typeof ICustomElement,
277
- T2 extends InstanceType<T1>
278
- >
279
- (
280
- this: T1,
281
- options: {
282
- [x:string]: (
283
- // eslint-disable-next-line no-shadow
284
- this: T2,
285
- oldValue: string,
286
- newValue: string,
287
- element: T2
288
- ) => void
289
- },
290
- ): T1;
291
- };
@@ -1 +0,0 @@
1
- export class ICustomElement extends HTMLElement {}
package/core/test.js DELETED
@@ -1,126 +0,0 @@
1
- import CustomElement from './CustomElement.js';
2
-
3
- /** @param {number} max */
4
- function _random(max) {
5
- return Math.round(Math.random() * 1000) % max;
6
- }
7
-
8
- CustomElement
9
- .extend()
10
- .observe({
11
- data: { type: 'object', reflect: false, value: [] },
12
- selected: { type: 'integer', reflect: false },
13
- })
14
- .methods({
15
- buildData(count = 1000) {
16
- const adjectives = ['pretty', 'large', 'big', 'small', 'tall', 'short', 'long', 'handsome', 'plain', 'quaint', 'clean', 'elegant', 'easy', 'angry', 'crazy', 'helpful', 'mushy', 'odd', 'unsightly', 'adorable', 'important', 'inexpensive', 'cheap', 'expensive', 'fancy'];
17
- const colours = ['red', 'yellow', 'blue', 'green', 'pink', 'brown', 'purple', 'brown', 'white', 'black', 'orange'];
18
- const nouns = ['table', 'chair', 'house', 'bbq', 'desk', 'car', 'pony', 'cookie', 'sandwich', 'burger', 'pizza', 'mouse', 'keyboard'];
19
- const data = [];
20
- for (let i = 0; i < count; i++) { data.push({ id: this.id++, label: `${adjectives[_random(adjectives.length)]} ${colours[_random(colours.length)]} ${nouns[_random(nouns.length)]}` }); }
21
- return data;
22
- },
23
- updateData(mod = 10) {
24
- for (let i = 0; i < this.data.length; i += 10) {
25
- this.data[i].label += ' !!!';
26
- // this.data[i] = Object.assign({}, this.data[i], {label: this.data[i].label +' !!!'});
27
- }
28
- },
29
-
30
- onItemClick({ currentTarget }) {
31
- this.selected = currentTarget.dataset.id;
32
- return false;
33
- },
34
- onRemoveClick({ currentTarget }) {
35
- const id = currentTarget.dataset.id;
36
- this.data = this.data.filter((item) => item.id !== id);
37
- return false;
38
- },
39
- })
40
- .html`
41
- <link href="/css/currentStyle.css" rel="stylesheet"/>
42
- <div class=container>
43
- <div class=jumbotron>
44
- <div class=row>
45
- <div class=col-md-6><h1>MDW unkeyed</h1></div>
46
- <div class=col-md-6>
47
- <div class=row>
48
- <div class="col-sm-6 smallpad">
49
- <button id=run class="btn btn-primary btn-block">Create 1,000 rows</button>
50
- </div>
51
- <div class="col-sm-6 smallpad">
52
- <button id=runlots class="btn btn-primary btn-block">Create 10,000 rows</button>
53
- </div>
54
- <div class="col-sm-6 smallpad">
55
- <button id=add class="btn btn-primary btn-block">Append 1,000 rows</button>
56
- </div>
57
- <div class="col-sm-6 smallpad">
58
- <button id=update class="btn btn-primary btn-block">Update every 10th row</button>
59
- </div>
60
- <div class="col-sm-6 smallpad">
61
- <button id=clear class="btn btn-primary btn-block" >Clear</button>
62
- </div>
63
- <div class="col-sm-6 smallpad">
64
- <button id=swaprows class="btn btn-primary btn-block">Swap Rows</button>
65
- </div>
66
- </div>
67
- </div>
68
- </div>
69
- </div>
70
- <table id=table class="table table-hover table-striped test-data">
71
- <tbody>
72
- <tr mdw-for="{item of data}" id={item.id} class=${({ item, _selected }) => (item?.id == _selected ? 'danger' : '')}>
73
- <td class="col-md-1">{item.id}</td>
74
- <td class="col-md-4"><a on-click={onLabelClick} data-id={item.id} >{item.label}</a></td>
75
- <td class="col-md-1"><a on-click={onRemoveClick} data-id={item.id} ><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></a></td>
76
- <td class="col-md-6"></td>
77
- </tr>
78
- </tbody>
79
- </table>
80
- <span class="preloadicon glyphicon glyphicon-remove" aria-hidden="true"></span>
81
- </div>
82
- `
83
- .childEvents({
84
- run: {
85
- click() {
86
- this.data = this.buildData();
87
- this.selected = null;
88
- },
89
- },
90
- runlots: {
91
- click() {
92
- this.data = this.buildData(10_000);
93
- this.selected = null;
94
- },
95
- },
96
- add: {
97
- click() {
98
- this.data = this.data.concat(this.buildData(1000));
99
- this.selected = null;
100
- },
101
- },
102
- update: {
103
- click() {
104
- this.updateData();
105
- this.data = this.data.slice();
106
- this.selected = null;
107
- },
108
- },
109
- swaprows: {
110
- click() {
111
- if (this.data.length > 998) {
112
- const newData = this.data.slice();
113
- const tmp = this.newData[1];
114
- this.newData[1] = this.newData[998];
115
- this.newData[998] = tmp;
116
- this.data = newData;
117
- }
118
- },
119
- },
120
- clear: {
121
- click() {
122
- this.data = [];
123
- this.selected = null;
124
- },
125
- },
126
- }).register('benchmark-app');
package/core/typings.d.ts DELETED
@@ -1,142 +0,0 @@
1
- type ObserverPropertyType = 'string' | 'boolean' | 'map' | 'set' | 'float' | 'integer' | 'object' | 'function' | 'array';
2
-
3
- type InlineTemplate<T1, T2=T1> = (fn: (this:T1, data: T2) => any) => string;
4
-
5
- type HTMLTemplater<T1, T2=T1> = ((
6
- string: TemplateStringsArray, ...substitutions: (string|DocumentFragment|Element|((this:T1, data:T2) => any))[]
7
- ) => DocumentFragment);
8
-
9
- type ParsedObserverPropertyType<T extends ObserverPropertyType> =
10
- T extends 'boolean' ? boolean
11
- : T extends 'string' ? string
12
- : T extends 'float' | 'integer' ? number
13
- : T extends 'array' ? any[]
14
- : T extends 'object' ? any
15
- : T extends 'function' ? (...args:any) => any
16
- : unknown;
17
-
18
- type ObserverOptions<
19
- T1 extends ObserverPropertyType,
20
- T2 = any,
21
- C extends object = any
22
- > = {
23
- type?: T1;
24
- attr?: string;
25
-
26
- /** Default true */
27
- readonly?: boolean
28
- enumerable?: boolean;
29
-
30
- /** Defaults to false if type is boolean */
31
- nullable?: boolean;
32
-
33
- /** Empty value when not nullable */
34
- empty?: T2;
35
- /** Initial value (empty value if not specified) */
36
- value?: T2;
37
- values?: WeakMap<C, T2>;
38
- reflect?: boolean | 'write' | 'read';
39
- /** Function used when null passed */
40
- changedCallback?: (this:C, oldValue:T2, newValue:T2, changes:any)=>any;
41
- nullParser?: (this:C, value:null|undefined)=>T2;
42
- parser?: (this:C, value:any)=>T2;
43
- /** Function used when comparing */
44
- diff?: (this:C, a:T2, b:T2)=> any,
45
- is?: (this:C, a:T2, b:T2)=>boolean
46
- get?: (this:C, data:Partial<C>, fn?: () => T2) => T2
47
- set?: (this:C, value: T2, fn?:(value2: T2) => any) => any,
48
- attributeChangedCallback?: (this:C, name:string, oldValue: string, newValue: string) => any;
49
- propChangedCallback?: (this:C, name:string, oldValue: T2, newValue: T2, changes:any) => any;
50
- computedValues?: WeakMap<C, T2>;
51
- watchers?: [keyof C, (this:C, ...args:any[]) => any][];
52
- needsSelfInvalidation?: WeakSet<C>,
53
- }
54
-
55
- type ObserverConfiguration<
56
- T1 extends ObserverPropertyType,
57
- T2 = any,
58
- K = string,
59
- C extends object = any> = ObserverOptions<T1, T2, C> & {
60
- key: K,
61
- values?: WeakMap<C, T2>;
62
- attrValues?: WeakMap<C, string>;
63
- };
64
-
65
- type ParsedProps<T> = {
66
- [P in keyof T]:
67
- T[P] extends (...args:any[]) => infer T2 ? T2
68
- : T[P] extends ObserverPropertyType
69
- ? ParsedObserverPropertyType<T[P]>
70
- : T[P] extends {type: ObserverPropertyType}
71
- ? ParsedObserverPropertyType<T[P]['type']>
72
- : T[P] extends ObserverOptions<null, infer T2>
73
- ? unknown extends T2 ? string : T2
74
- : never
75
- };
76
-
77
- interface HTMLElementEventMapFixed extends HTMLElementEventMap {
78
- input: InputEvent;
79
- }
80
-
81
- type HTMLElementCancellableEventMap = Pick<HTMLElementEventMapFixed,
82
- 'auxclick' |
83
- 'beforeinput' |
84
- // 'cancel' |
85
- 'click' |
86
- 'compositionstart' |
87
- 'contextmenu' |
88
- 'drag' |
89
- 'dragenter' |
90
- 'dragover' |
91
- 'dragstart' |
92
- 'drop' |
93
- 'invalid' |
94
- 'keydown' |
95
- 'keypress' |
96
- 'keyup' |
97
- 'mousedown' |
98
- 'mousemove' |
99
- 'mouseout' |
100
- 'mouseover' |
101
- 'mouseup' |
102
- 'pointerdown' |
103
- 'pointermove' |
104
- 'pointerout' |
105
- 'pointerover' |
106
- 'pointerup' |
107
- 'reset' |
108
- 'selectstart' |
109
- 'submit' |
110
- 'touchend' |
111
- 'touchmove' |
112
- 'touchstart' |
113
- 'wheel'
114
- >
115
-
116
- type CompositionEventMap = HTMLElementEventMapFixed & {
117
- [P in keyof HTMLElementCancellableEventMap as `~${P}`]: Omit<HTMLElementCancellableEventMap[P], 'preventDefault'>
118
- };
119
-
120
- type CompositionEventListener<T, K = keyof CompositionEventMap> = {
121
- type?: K
122
- tag?: string,
123
- capture?: boolean;
124
- once?: boolean;
125
- passive?: boolean;
126
- signal?: AbortSignal;
127
- handleEvent?: (
128
- this: T,
129
- event: (K extends keyof CompositionEventMap ? CompositionEventMap[K] : Event) & {currentTarget:HTMLElement}
130
- ) => any;
131
- prop?: string;
132
- deepProp?: string[],
133
- };
134
-
135
- type CompositionEventListenerObject<T> =
136
- {
137
- [P in keyof CompositionEventMap]?: (keyof T & string)
138
- | ((this: T, event: CompositionEventMap[P] & {currentTarget:HTMLElement}) => any)
139
- | CompositionEventListener<T, P>
140
- };
141
-
142
- export type dummyObject = {};
package/core/typings.js DELETED
@@ -1 +0,0 @@
1
- export {};
@@ -1,127 +0,0 @@
1
- /**
2
- * @param {ReturnType<import('./StateMixin.js').default> & ReturnType<import('./ThemableMixin.js').default>} Base
3
- */
4
- export default function SurfaceMixin(Base) {
5
- return Base
6
- .observe({
7
- elevated: 'boolean',
8
- elevation: 'integer',
9
- _raised: {
10
- type: 'boolean',
11
- get({ hoveredState, pressedState }) {
12
- return hoveredState && !pressedState;
13
- },
14
- },
15
- })
16
- .html`
17
- <div id=surface class=surface raised={_raised} disabled={disabledState} color={color}></div>
18
- `
19
- .css`
20
- :host {
21
-
22
- /** Filter blur is 1/2 CSS blur */
23
-
24
- /** Reference Properties */
25
- /*
26
- --mdw-surface__box-shadow__1__umbra: 0px 1px 2px 0px rgba(var(--mdw-color__shadow), 0.30);
27
- --mdw-surface__box-shadow__2__umbra: 0px 1px 2px 0px rgba(var(--mdw-color__shadow), 0.30);
28
- --mdw-surface__box-shadow__3__umbra: 0px 1px 3px 0px rgba(var(--mdw-color__shadow), 0.30);
29
- --mdw-surface__box-shadow__4__umbra: 0px 2px 3px 0px rgba(var(--mdw-color__shadow), 0.30);
30
- --mdw-surface__box-shadow__5__umbra: 0px 4px 4px 0px rgba(var(--mdw-color__shadow), 0.30);
31
-
32
- --mdw-surface__filter__0__umbra: drop-shadow(0px 1px 1px rgba(var(--mdw-color__shadow), 0));
33
- --mdw-surface__filter__1__umbra: drop-shadow(0px 1px 1px rgba(var(--mdw-color__shadow), 0.30));
34
- --mdw-surface__filter__2__umbra: drop-shadow(0px 1px 1px rgba(var(--mdw-color__shadow), 0.30));
35
- --mdw-surface__filter__3__umbra: drop-shadow(0px 1px 1.5px rgba(var(--mdw-color__shadow), 0.30));
36
- --mdw-surface__filter__4__umbra: drop-shadow(0px 2px 1.5px rgba(var(--mdw-color__shadow), 0.30));
37
- --mdw-surface__filter__5__umbra: drop-shadow(0px 4px 2px rgba(var(--mdw-color__shadow), 0.30));
38
-
39
- --mdw-surface__box-shadow__1__penumbra: 0px 1px 3px 1px rgba(var(--mdw-color__shadow), 0.15);
40
- --mdw-surface__box-shadow__2__penumbra: 0px 2px 6px 2px rgba(var(--mdw-color__shadow), 0.15);
41
- --mdw-surface__box-shadow__3__penumbra: 0px 4px 8px 3px rgba(var(--mdw-color__shadow), 0.15);
42
- --mdw-surface__box-shadow__4__penumbra: 0px 6px 10px 4px rgba(var(--mdw-color__shadow), 0.15);
43
- --mdw-surface__box-shadow__5__penumbra: 0px 8px 12px 6px rgba(var(--mdw-color__shadow), 0.15);
44
-
45
- --mdw-surface__filter__0__penumbra: drop-shadow(0px 1px 2.5px rgba(var(--mdw-color__shadow), 0));
46
- --mdw-surface__filter__1__penumbra: drop-shadow(0px 1px 2.5px rgba(var(--mdw-color__shadow), 0.25));
47
- --mdw-surface__filter__2__penumbra: drop-shadow(0px 2px 5px rgba(var(--mdw-color__shadow), 0.25));
48
- --mdw-surface__filter__3__penumbra: drop-shadow(0px 4px 7px rgba(var(--mdw-color__shadow), 0.263));
49
- --mdw-surface__filter__4__penumbra: drop-shadow(0px 6px 9px rgba(var(--mdw-color__shadow), 0.27));
50
- --mdw-surface__filter__5__penumbra: drop-shadow(0px 8px 12px rgba(var(--mdw-color__shadow), 0.30));
51
-
52
- --mdw-surface__filter__0: var(--mdw-surface__shadow__0__umbra) var(--mdw-surface__shadow__0__penumbra);
53
- --mdw-surface__filter__1: var(--mdw-surface__shadow__1__umbra) var(--mdw-surface__shadow__1__penumbra);
54
- --mdw-surface__filter__2: var(--mdw-surface__shadow__2__umbra) var(--mdw-surface__shadow__2__penumbra);
55
- --mdw-surface__filter__3: var(--mdw-surface__shadow__3__umbra) var(--mdw-surface__shadow__3__penumbra);
56
- --mdw-surface__filter__4: var(--mdw-surface__shadow__4__umbra) var(--mdw-surface__shadow__4__penumbra);
57
- --mdw-surface__filter__5: var(--mdw-surface__shadow__5__umbra) var(--mdw-surface__shadow__5__penumbra);
58
- */
59
-
60
- /** Flatten for performance */
61
- --mdw-surface__shadow__0: drop-shadow(0px 1px 001px rgba(0,0,0,000)) drop-shadow(0px 1px 2.5px rgba(0,0,0,00000));
62
- --mdw-surface__shadow__1: drop-shadow(0px 1px 001px rgba(0,0,0,0.3)) drop-shadow(0px 1px 2.5px rgba(0,0,0,0.250));
63
- --mdw-surface__shadow__2: drop-shadow(0px 1px 001px rgba(0,0,0,0.3)) drop-shadow(0px 2px 005px rgba(0,0,0,0.250));
64
- --mdw-surface__shadow__3: drop-shadow(0px 1px 1.5px rgba(0,0,0,0.3)) drop-shadow(0px 4px 007px rgba(0,0,0,0.263));
65
- --mdw-surface__shadow__4: drop-shadow(0px 2px 1.5px rgba(0,0,0,0.3)) drop-shadow(0px 6px 009px rgba(0,0,0,0.270));
66
- --mdw-surface__shadow__5: drop-shadow(0px 4px 2.0px rgba(0,0,0,0.3)) drop-shadow(0px 8px 012px rgba(0,0,0,0.300));
67
-
68
- /** Configurables */
69
-
70
- --mdw-surface__shadow__resting: none;
71
- --mdw-surface__shadow: var(--mdw-surface__shadow__resting);
72
- z-index: 0;
73
- }
74
-
75
- :host([elevation="0"]) {
76
- --mdw-surface__shadow__resting: none;
77
- }
78
-
79
- :host([elevation="1"]) {
80
- --mdw-surface__shadow__resting: var(--mdw-surface__shadow__1);
81
- }
82
-
83
- :host([elevation="2"]) {
84
- --mdw-surface__shadow__resting: var(--mdw-surface__shadow__2);
85
- }
86
-
87
- :host([elevation="3"]) {
88
- --mdw-surface__shadow__resting: var(--mdw-surface__shadow__3);
89
- }
90
-
91
- :host([elevation="4"]) {
92
- --mdw-surface__shadow__resting: var(--mdw-surface__shadow__4);
93
- }
94
-
95
- :host([elevation="5"]) {
96
- --mdw-surface__shadow__resting: var(--mdw-surface__shadow__5);
97
- }
98
-
99
- :host([elevation]) {
100
- --mdw-surface__shadow__raised: var(--mdw-surface__shadow__resting);
101
- }
102
-
103
- .surface {
104
- position: absolute;
105
- inset: 0;
106
-
107
- pointer-events: none;
108
-
109
- filter: var(--mdw-surface__shadow);
110
- z-index: -1;
111
-
112
- transition-delay: 1ms;
113
- transition-duration: 200ms;
114
- transition-property: filter;
115
- transition-timing-function: linear;
116
- will-change: filter;
117
- }
118
-
119
- .surface[raised] {
120
- filter: var(--mdw-surface__shadow__raised, var(--mdw-surface__shadow__resting));
121
- }
122
-
123
- .surface[disabled] {
124
- filter:none;
125
- }
126
- `;
127
- }