Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    sofathitesh
    @sofathitesh
    sudo sbt clean fastOptJS::webpack
    and then its compile fine
    after that i try to use MuiAppBar in code
    and again i complie my code i found these errors
    [error] ModuleNotFoundError: Module not found: Error: Can't resolve 'material-ui/AppBar' in '/home/sofat/AndroidApp/js'
    [error] at factoryCallback (/home/sofat/AndroidApp/target/scala-2.12/scalajs-bundler/main/node_modules/webpack/lib/Compilation.js:264:39)
    [error] at factory (/home/sofat/AndroidApp/target/scala-2.12/scalajs-bundler/main/node_modules/webpack/lib/NormalModuleFactory.js:247:20)
    [error] at resolver (/home/sofat/AndroidApp/target/scala-2.12/scalajs-bundler/main/node_modules/webpack/lib/NormalModuleFactory.js:65:21)
    [error] at asyncLib.parallel (/home/sofat/AndroidApp/target/scala-2.12/scalajs-bundler/main/node_modules/webpack/lib/NormalModuleFactory.js:138:21)
    [error] at /home/sofat/AndroidApp/target/scala-2.12/scalajs-bundler/main/node_modules/webpack/node_modules/async/dist/async.js:3888:9
    [error] at /home/sofat/AndroidApp/target/scala-2.12/scalajs-bundler/main/node_modules/webpack/node_modules/async/dist/async.js:473:16
    [error] at iteratorCallback (/home/sofat/AndroidApp/target/scala-2.12/scalajs-bundler/main/node_modules/webpack/node_modules/async/dist/async.js:1062:13)
    [error] at /home/sofat/AndroidApp/target/scala-2.12/scalajs-bundler/main/node_modules/webpack/node_modules/async/dist/async.js:969:16
    [error] at /home/sofat/AndroidApp/target/scala-2.12/scalajs-bundler/main/node_modules/webpack/node_modules/async/dist/async.js:3885:13
    [error] at resolvers.normal.resolve (/home/sofat/AndroidApp/target/scala-2.12/scalajs-bundler/main/node_modules/webpack/lib/NormalModuleFactory.js:130:23)
    [error] at onError (/home/sofat/AndroidApp/target/scala-2.12/scalajs-bundler/main/node_modules/enhanced-resolve/lib/Resolver.js:65:10)
    [error] at loggingCallbackWrapper (/home/sofat/AndroidApp/target/scala-2.12/scalajs-bundler/main/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19)
    [error] at runAfter (/home/sofat/AndroidApp/target/scala-2.12/scalajs-bundler/main/node_modules/enhanced-resolve/lib/Resolver.js:158:4)
    [error] at innerCallback (/home/sofat/AndroidApp/target/scala-2.12/scalajs-bundler/main/node_modules/enhanced-resolve/lib/Resolver.js:146:3)
    [error] at loggingCallbackWrapper (/home/sofat/AndroidApp/target/scala-2.12/scalajs-bundler/main/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19)
    [error] at next (/home/sofat/AndroidApp/target/scala-2.12/scalajs-bundler/main/node_modules/tapable/lib/Tapable.js:252:11)
    [error] at /home/sofat/AndroidApp/target/scala-2.12/scalajs-bundler/main/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js:40:4
    [error] at loggingCallbackWrapper (/home/sofat/AndroidApp/target/scala-2.12/scalajs-bundler/main/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19)
    [error] at runAfter (/home/sofat/AndroidApp/target/scala-2.12/scalajs-bundler/main/node_modules/enhanced-resolve/lib/Resolver.js:158:4)
    [error] at innerCallback (/home/sofat/AndroidApp/target/scala-2.12/scalajs-bundler/main/node_modules/enhanced-resolve/lib/Resolver.js:146:3)
    [error] at loggingCallbackWrapper (/home/sofat/AndroidApp/target/scala-2.12/scalajs-bundler/main/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19)
    [error] at next (/home/sofat/AndroidApp/target/scala-2.12/scalajs-bundler/main/node_modules/tapable/lib/Tapable.js:252:11)
    [error] at innerCallback (/home/sofat/AndroidApp/target/scala-2.12/scalajs-bundler/main/node_modules/enhanced-resolve/lib/Resolver.js:144:11)
    [error] at loggingCallbackWrapper (/home/sofat/AndroidApp/target/scala-2.12/scalajs-bundler/main/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19)
    [error] at next (/home/sofat/AndroidApp/target/scala-2.12/scalajs-bundler/main/node_modules/tapable/lib/Tapable.js:249:35)
    [error] at resolver.doResolve.createInnerCallback (/home/sofat/AndroidApp/target/scala-2.12/scalajs-bundler/main/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js:44:6)
    [error] at loggingCallbackWrapper (/home/sofat/AndroidApp/target/scala-2.12/scalajs-bundler/main/node_modules/enhanced-resolve/lib/createInnerCa
    i use npm install material-ui but not working
    please any one help me in this
    ????
    @chandu0101
    Roberto Leibman
    @rleibman
    I'm sorry, I have not had the time or the patience to release the latest and greatest version of the library... so:
    Number 2: Try the 1.1.0 branch.
    Hamza Rhaiem
    @hamzarhaiem

    I am trying to get the MuiStepper work

    val materialui = "0.16.7" // "0.15.1"
    val scala = "2.11.11"
    val scalajsReactComponents = "0.8.0"

    The code below is inspired from this exemple https://codesandbox.io/s/r6401x80o

    I am new to React, State, Props, etc

    Nothing happend when i call my component :( :(

    object ScalaMuiStepper {
    
      def getSteps(): Array[String] = {
        Array("Select campaign settings", "Create an ad group", "Create an ad")
      }
    
      def getStepContent(step: Int): String = {
        step match {
          case 0 => "For each ad campaign that you create, you can control how much you're willing to spend on clicks and conversions, which networks and geographical locations you want your ads to show on, and more."
          case 1 => "An ad group contains one or more ads which target a shared set of keywords."
          case 2 => "Try out different ad text to see what brings in the most customers, and learn how to enhance your ads using features like ad extensions.If you run into any problems with your ads, find out how to tell if they're running and how to resolve approval issues."
          case whoa => "Unknown step"
        }
      }
    
      case class ScalaMuiStepperState(activeStep: Double)
    
      case class ScalaMuiStepperProps()
    
      class Backend(t: BackendScope[ScalaMuiStepperProps, ScalaMuiStepperState]) {
    
        def handleNext: ReactEvent => Callback = e => t.modState(s => s.copy(activeStep = s.activeStep + 1))
    
        def handleBack: ReactEvent => Callback = e => t.modState(s => s.copy(activeStep = s.activeStep - 1))
    
        //to be called later if needed
        def handleReset: ReactEvent => Callback = e => t.modState(s => s.copy(activeStep = 0))
    
        def render(state: ScalaMuiStepperState) = {
          val steps = getSteps()
          <.div(^.id := "ScalaMuiStepper")(
            MuiMuiThemeProvider()(
              MuiStepper(activeStep = state.activeStep)(
                steps.zipWithIndex.map {
                  case (step, index) =>
                    MuiStep(key = step, active = index == state.activeStep)(
                      MuiStepLabel(active = index == state.activeStep, icon = index + 1)(step + index.toString),
                      MuiStepContent(active = index == state.activeStep)(
                        getStepContent(index),
                        <.div()(
                          MuiRaisedButton(disabled = state.activeStep == 0, onClick = handleBack)("Back"),
                          MuiRaisedButton(primary = true, onClick = handleNext)("Next")
                        )
                      )
                    )
                }
              )
            )
          )
        }
    
      }
    
      private val component = ScalaComponent.builder[ScalaMuiStepperProps]("ScalaMuiStepper")
        .renderBackend[Backend]
        .build
    
      def apply() = {
        component(ScalaMuiStepperProps())
      }
    }
    Roberto Leibman
    @rleibman
    Did you see my comment above?
    Hamza Rhaiem
    @hamzarhaiem
    Just did now, you mean i am using the wrong version?
    Roberto Leibman
    @rleibman
    Not wrong, just very old.
    Hamza Rhaiem
    @hamzarhaiem
    Thanks for your response but there's no Stepper demo anywhere :(
    Roberto Leibman
    @rleibman
    Yeah, I've been focusing on SemanticUI, whereas @oyvindberg has worked on MaterialUI... the demos quickly get out of date.
    Hamza Rhaiem
    @hamzarhaiem
    I see, any help with the stepper please? I am trying to follow the React exemple!
    Roberto Leibman
    @rleibman
    Have you had any success with a very simple page? let's say, just a button?
    Hamza Rhaiem
    @hamzarhaiem
    Yes i successfully integrated mui with scalajs, it's just the stepper that i can't find any exemple on the internet! :(
    Roberto Leibman
    @rleibman
    Did you look through the plain js demos? e.g. https://material-ui.com/demos/steppers/ I've found that it's not that hard to convert from that to scala js.
    Hamza Rhaiem
    @hamzarhaiem
    That's what i am already doing with this https://codesandbox.io/s/r6401x80o but i am facing difficltues with it as you can see!
    Roberto Leibman
    @rleibman
    You're saying you don't see anything... any errors on the error console?
    Øyvind Raddum Berg
    @oyvindberg
    I haven't used the steppers at all @hamzarhaiem so I cannot help directly either. What i normally do is to inspect the component with react dev tools (in your browser) to see that the data it gets looks reasonable, and try to compare against javascript demos like @rleibman suggested
    Hamza Rhaiem
    @hamzarhaiem

    I am trying to localised rhe MuiDatePicker (fr) like this exemple https://v0.material-ui.com/#/components/date-picker

        val frDt = "global.Intl.DateTimeFormat".asInstanceOf[js.Function]
    
          MuiDatePicker(
            DateTimeFormat = frDt,
            locale = "fr",
            mode = PortraitLandscape.landscape
          )()

    And i am having this error..

    material_ui-bundle.js:4 Uncaught TypeError: e is not a constructor
        at h (material_ui-bundle.js:4)
        at material_ui-bundle.js:18
        at Array.map (<anonymous>)
        at t.value (material_ui-bundle.js:18)
        at index-bundle.js:30
        at s (index-bundle.js:29)
        at g._renderValidatedComponentWithoutOwnerOrContext (index-bundle.js:30)
        at g._renderValidatedComponent (index-bundle.js:30)
        at g.performInitialMount (index-bundle.js:30)
        at g.mountComponent (index-bundle.js:29)

    Any help please?? :(

    Bijan Chokoufe Nejad
    @bijancn
    sorry, really no idea @hamzarhaiem. Maybe you can open a PR/issue with a minimal test case and we can try to fix it?
    Hamza Rhaiem
    @hamzarhaiem
    @bijancn I am able to find Intl.scala but i can't pass Intl.DateTimeFormat like the JS exemple!
    Øyvind Raddum Berg
    @oyvindberg
    @hamzarhaiem val frDt = "global.Intl.DateTimeFormat".asInstanceOf[js.Function] is wrong, youre passing a string there while it expects a function. Use js.Dynamic.global.Intl.DateTimeFormat.asInstanceOf[js.Function] perhaps
    or rather, if it is already typed up and DateTimeFormat is a class (i havent used this) you could try js.constructorOf[Intl.DateTimeFormat] and cast that
    trepidacious
    @trepidacious
    I was just wondering how the code generation for material-ui facade works? Would be great to be up to date with mui 1.5.0, I was looking at their API docs, and I think they generate them with https://github.com/reactjs/react-docgen
    Which made me think that might be a good place to start for code generation, I tried it out and react-docgen will indeed generate a giant json file with contents very like the API docs, slightly annoyingly it just says "object" in a lot of places, but I was thinking it would be a start
    I guess it is doing a similar thing but with its own parsing, wow that's impressive :)
    Øyvind Raddum Berg
    @oyvindberg
    Yeah, that's how it's currently done. That generator code is now integrated into the main repo
    trepidacious
    @trepidacious
    Ah cool - I was wondering why the facade is behind the current material-ui version, does the generator code work with say 1.5.0?
    Øyvind Raddum Berg
    @oyvindberg
    Nobody has put in the work
    It might be easy to do, depending on how much has changed
    trepidacious
    @trepidacious
    Ah that's cool, I just wanted to check there wasn't some basic incompatibility with the approach
    I'll see if there's anything I can do, would be nice to have the most recent version, it does seem like they've made some improvements
    Did anyone ever look at using the docgen approach, or is the direct JS parsing just better?
    Øyvind Raddum Berg
    @oyvindberg
    Notice that the direct js parsing is really just there to extract the propTypes, then we rewrite those (with some manual typing) to scala.js definitions
    so propTypes and documentation, none of those approaches are optimal
    trepidacious
    @trepidacious
    @oyvindberg Yup it seems like a tricky task... I put up some very basic code based on react-docgen json output here: https://github.com/trepidacious/scalajs-react-material-ui
    It seems to kind of work, no icons or support for sum (oneof) props yet
    One nice thing is it puts the API docs in as scaladocs for the prop parameters
    It processes everything (unless I've missed something) from 1.5.0, I've tried a couple of components and they seem to kind of work ;)
    Øyvind Raddum Berg
    @oyvindberg
    awesome work @trepidacious - react-docgen seems to do all the work of extracting the propTypes, which we parse javascript to do
    trepidacious
    @trepidacious
    @oyvindberg Thanks, I was hoping it would be helpful, I kind of stumbled across it because I was wondering where the material-ui docs came from :)
    Adianto Wibisono
    @wongiseng_twitter
    Question, ReactTable, is there a way to hide pagination total and page size selector?