Coder Social home page Coder Social logo

gdotdesign / elm-ui Goto Github PK

View Code? Open in Web Editor NEW
918.0 25.0 39.0 6.04 MB

UI library for making web applications with Elm

Home Page: https://elm-ui.netlify.com

License: BSD 2-Clause "Simplified" License

Elm 97.22% JavaScript 2.78%
elm elm-ui component-library components ui-kit ui-components

elm-ui's Introduction

Elm UI

Elm Package Version Build Status Chat on Gitter

An opinionated UI library for making web applications with Elm.


### This package is not maintained any more and there are no plans to update it to work with Elm 0.19

Elm 0.19 made some breaking changes, which result in a lot of rewriting. It's not an easy work, your contributes will help a lot. New feature is on the branch elm/0.19.


Getting Started

Head over to the official website elm-ui.netlify.com to get started.

Changelog

Detailed changes for each release are documented in the release notes.

Development

For those who are interested in contributing to Elm-UI, please refer to our contributing guide to see how to run this project.

elm-ui's People

Contributors

akovari avatar bakkdoor avatar eimfach avatar gdotdesign avatar iiska avatar infernalknight avatar janiczek avatar kwrooijen avatar nodew avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

elm-ui's Issues

importing modules fails

I have simple project generated by elm-ui init command. Now I'im trying to add simply module, for example exposing only one string.
After importing it in Main module, elm-ui build fails with error:

Copying public folder contents...
Building HTML...
Building JavaScript: Main...
  > I cannot find module 'TestModule'.
  >
  > Module 'Main' is trying to import it.
  >
  > Potential problems could be:
  >   * Misspelled the module name
  >   * Need to add a source directory or new dependency to elm-package.json
  >

Build failed!

I'm not doing some magic here. It's simpliest as possible module, placed directly next to Main.elm.
Windows 10, 64x

Animated Drawer

I'm not a fan of "burger" buttons that produce a drawer, however drawers/sidebars are pretty excellent for complicated web apps, and I think it'd be a nice addition to your already relatively comprehensive package.

Issue by elm-ui install

I did follow the basic step from the readme but I got an error i do not know ho to handle
Thanks

seb@Jessie:~/Sites/elmui$ elm-ui install
Installing Elm packages...
events.js:154
throw er; // Unhandled 'error' event
^

Error: spawn /usr/lib/node_modules/elm-ui/node_modules/elm/Elm-Platform/0.16.0/.cabal-sandbox/bin/elm-package ENOENT
at exports._errnoException (util.js:856:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
at onErrorNT (internal/child_process.js:344:16)
at _combinedTickCallback (node.js:377:13)
at process._tickCallback (node.js:401:11)
at Function.Module.runMain (module.js:449:11)
at startup (node.js:141:18)
at node.js:933:3

Confused about the Model....

Suppose I have a List of Things...

type alias Thing = {
  name : String,
  active : Bool
}

...and I want to render each thing with a Checkbox...
The documentation says that I have to put a specific type of data on my model, like this:

type alias Thing = {
  name : String,
  active : Ui.Checkbox.Model
}

That feels strange! I was hoping to keep my Model abstract, and free of any UI dependencies!
Why can't my model just use a Bool?
Am I doing it wrong?

install not works on windows

Windows 10 x64, elm 0.18, nodejs 6.x. Init passed successfully, fails on install:

C:\Users\xxx\repos\test>elm-ui install
Resolving versions...
error { '0':
Error: Unable to satisfy version constraint: gdotdesign/elm-ui@>=0.4.0 <1.0.0 from root
at C:\Users\xxx\AppData\Roaming\npm\node_modules\elm-ui\node_modules\semver-resolver\lib\index.js:182:25
at C:\Users\xxx\AppData\Roaming\npm\node_modules\elm-ui\node_modules\lodash\lodash.js:4320:15
at baseForOwn (C:\Users\xxx\AppData\Roaming\npm\node_modules\elm-ui\node_modules\lodash\lodash.js:2722:24)
at Function.forOwn (C:\Users\xxx\AppData\Roaming\npm\node_modules\elm-ui\node_modules\lodash\lodash.js:11992:24)
at SemverResolver.maxSatisfying (C:\Users\xxx\AppData\Roaming\npm\node_modules\elm-ui\node_modules\semver-resolver\lib\index.js:164:24)
at C:\Users\xxx\AppData\Roaming\npm\node_modules\elm-ui\node_modules\semver-resolver\lib\index.js:279:32
at Array.forEach (native)
at SemverResolver.resolveVersions (C:\Users\xxx\AppData\Roaming\npm\node_modules\elm-ui\node_modules\semver-resolver\lib\index.js:274:26)
at process._tickCallback (internal/process/next_tick.js:103:7) }

elm pkg install error

Hi, thanks for sharing this project.

I installed elm-ui from npm globally (had to use sudo since it wasn't local), then ran init (and also later tried new) to scaffold a new project, then cd to new project folder and ran elm-ui install ... but got the following error:

Installing elm packages...
events.js:154
      throw er; // Unhandled 'error' event
      ^

Error: spawn /usr/local/lib/node_modules/elm-ui/node_modules/elm/Elm-Platform/0.16.0/.cabal-sandbox/bin/elm-package ENOENT
    at exports._errnoException (util.js:856:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
    at onErrorNT (internal/child_process.js:344:16)
    at nextTickCallbackWith2Args (node.js:474:9)
    at process._tickCallback (node.js:388:17)
    at Function.Module.runMain (module.js:449:11)
    at startup (node.js:139:18)
    at node.js:999:3

I have no Elm-Platform/ in the spawn path.
I do have elm 0.16.0 installed.

> elm
Elm Platform 0.16.0 - a way to run all Elm tools
...

using
node v5.5.0
npm v3.3.12

any ideas?

thx!

Add Ui.TimePicker

Cool library! Thanks!
But I can't find Ui.TimePicker. I think we should add this kind of component in the future.

Text helpers would be great

I come from AngularJS and over there I used a lot. It's a pretty good UI framework for angular, they have it all covered (almost). For example, they have this typography section that helps you make text look good. Maybe we could have something like Ui.Text around here? I really missed that and maybe lots of people also do.

Of course, maybe I'm just missing something, but the only way I think I could get this kind of behavior would be search through source code and using styles from some specific components that use formatted text.

Thanks a lot! This library is simply GREAT and BEAUTIFUL.

KitchenSink demo in Webkit\Safari

Please check out how Elm UI demo works in webkit. Feels very slow on both mobile and on desktop.
Also dropdowns and few other widgets doesn't seem to work.

Thanks for your work! :) ๐Ÿ‘

Ui.Chooser.view doesn't do a true lazy render

I've run into a bit of a hitch related to my previous issue ( #50 ). So I have on average, 100 drop downs where each drop down selection will cause data changes in the other drop downs. Your code here will force a redraw of all options, even though most of my choosers are not opened (I have closeOnSelect).

I was able to modify your code on the line I linked to:

children =
  if model.open then
    (List.map (renderItem model) (items model))
  else
    []

The performance boost was huge for my use case. Even doing a render on open with 500 items, it wasn't laggy or visibly offensive. Having 1000 was laggy, so maybe there is a better optimization here.

Impossible to install elm-ui under ubuntu 15.10

Hi,

When I tried to install elm-ui (Modification with sudo before command line)
npm install elm-ui -g

I have those errors:
`> [email protected] install /usr/lib/node_modules/elm-ui/node_modules/intern

node support/fixdeps.js

fs.js:945
return binding.symlink(preprocessSymlinkDestination(target, type, path),
^

Error: EACCES: permission denied, symlink '/usr/lib/node_modules/elm-ui/node_modules/dojo' -> '/usr/lib/node_modules/elm-ui/node_modules/intern/node_modules/dojo'
at Error (native)
at Object.fs.symlinkSync (fs.js:945:18)
at /usr/lib/node_modules/elm-ui/node_modules/intern/support/fixdeps.js:33:6
at Array.forEach (native)
at Object. (/usr/lib/node_modules/elm-ui/node_modules/intern/support/fixdeps.js:14:28)
at Module._compile (module.js:413:34)
at Object.Module._extensions..js (module.js:422:10)
at Module.load (module.js:357:32)
at Function.Module._load (module.js:314:12)
at Function.Module.runMain (module.js:447:10)
/usr/lib
โ””โ”€โ”€ (empty)

npm WARN optional Skipping failed optional dependency /elm-ui/chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: [email protected]
npm ERR! Linux 4.2.0-16-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "elm-ui" "-g"
npm ERR! node v5.7.0
npm ERR! npm v3.6.0
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: node support/fixdeps.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node support/fixdeps.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the intern package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node support/fixdeps.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs intern
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls intern
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /home/gael/Projets/elm/npm-debug.log
npm ERR! code 1
`

We can found the complete log files of npm
npm-debug.log.zip

Thanks for your help.

Clarify "Elm-UI uses stuff that are not allowed in the official repository"

Since Elm-UI uses stuff that are not allowed in the official repository you cannot installed it via the default method

When I came across that phrase on the front page of the docs, it sounded pretty serious and ominous and I became nervous and had a bunch of questions: Is it for legal or licensing reasons? philosophical? technical? Some combination of those?

It seems #24 has more context about this, so perhaps just link that phrase to #24 as a start.

relative main.css

Hey, this is more of a dumbass query than an "issue" per se - but I don't see a way of overriding the location of main.css

https://github.com/gdotdesign/elm-ui/blob/0.2/source/Ui/App.elm#L123

I've got my elm app as a sub-path of one of my projects which means it's accessed via

/foo/index.html

and the initial load can't take place when I pull it up in an app. I notice in the kitchen sink and master branch it looks like this

https://github.com/gdotdesign/elm-ui/blob/master/source/Ui/App.elm#L99

So it works fine; I assume the kitchen sink wouldn't work under the current gh-pages set-up therefore.

( http://gdotdesign.github.io/elm-ui/ <-- sub-path)

Am I missing something? Happy to do this as my first ever PR if it's something that needs changing somehow :)

UI.Pager with Navigation

Can anyone please help with an example of how to use the UI.Pager component with Navigation lib to change the browser url path when you navigate when UI.Pager.update or UI.Pager.select is called.
Thanks

Delayed style loading in a variety of browsers

Everything works fine on desktop Chrome, as well as the built-in Gnome browser. However, things are strange on desktop Firefox, Tablet/Phone Chrome, and Safari+Chrome on iPhone.

Upon page load, before the user has interacted with anything, we see this weirdness (no centering has occured, giant quarter circle in the Button, footer is lifted up from its base position):

2017-05-01-185818_828x724_scrot

After an interaction has been performed (say clicking Submit without filling things out, to cause a Notification to occur):
2017-05-01-185824_828x724_scrot

Any thoughts?

Runtime error from native code: Failed to execute 'observe' on 'MutationObserver'

Windows 7 64-bit
Chrome 56.0.2924.87

It seems document.body is null when observe() is called on the MutationObserver.

The console error:

image

The failing line:

image

Code that raises the exception (minimal slider component):

module Slider exposing (..)

import Html exposing (h1, p, text, div, node)
import Html.Attributes

import Ui.Slider


type alias Model =
  { slider : Ui.Slider.Model
  }


initialModel : Model
initialModel =
  { slider = 
      Ui.Slider.init ()
      |> Ui.Slider.setValue 0.8
  }

type Msg
  = SliderChanged Float
  | SliderMsg Ui.Slider.Msg


update : Msg -> Model -> ( Model, Cmd Msg )
update msg model =
  case msg of   
    SliderMsg sliderMsg ->
      let
        ( slider_, cmd_ ) = Ui.Slider.update sliderMsg model.slider
      in
        ( { model | slider = slider_ }
        , Cmd.map SliderMsg cmd_
        )
        
    SliderChanged _ ->
      ( model, Cmd.none )


subscriptions model =
  Sub.batch
    [ Ui.Slider.onChange SliderChanged model.slider
    ]


main : Program Never Model Msg
main =
    Html.program
      { init = ( initialModel, Cmd.none ),
        update = update,
        view = view,
        subscriptions = subscriptions
      }


view model =
  Html.div
    [ ]
    [ Html.map SliderMsg (Ui.Slider.view model.slider) ]

Cannot use Ui.DatePicker.subscriptions and Ui.DatePicker.subscribe when dealing with a list of date pickers.

I've run into a problem subscribing to events and changes using Ui.DatePicker. I have a model that has a list of { Int, Ui.DatePicker.Model, String } where int is my own index/identifier, and string just converts the date picker selection into iso8601 for test purposes. When I don't use a list, everything seems to work fine. Once I introduce the list, even with a single element on it, I'm no longer able to see the select event and build my iso8601 string.

Another compound issue is that I'm not able to change months in the calendar picker.

I've built a minimal example here, and was wondering if this boils down to a problem with my implementation, or if there is a bug in elm-ui. Any help would be appreciated.

module Main exposing (..)

import Html exposing (div, span, strong, text)
import Date
import Time
import Debug

import Date.Extra.Format exposing (isoString)

import Ext.Date
import Ui.Container
import Ui.App
import Ui.DatePicker
import Ui


type alias Picker =
  { id : Int
  , datePicker : Ui.DatePicker.Model
  , iso8601 : String
  }

type alias Model =
  { app : Ui.App.Model
  , pickers : List Picker
  }


type Msg
  = UiAppMessage Ui.App.Msg
  | UiDatePickerMessage Picker Ui.DatePicker.Msg
  | SetIso8601 Picker Time.Time


init : Model
init =
  let
    datePicker : Ui.DatePicker.Model
    datePicker =
      Ui.DatePicker.init (Ext.Date.now ())

    picker : Int -> Picker
    picker id =
      { id = id
      , datePicker = datePicker
      , iso8601 = "Waiting for a date selection"
      }

    pickers : Int -> List Picker
    pickers count =
      count
        |> List.range 1
        |> List.map picker

  in
    { app = Ui.App.init
    , pickers = pickers 1
    }


update : Msg -> Model -> ( Model, Cmd Msg )
update msg model =
  case msg of
    UiAppMessage subMsg ->
      let
        ( app, effect ) = Ui.App.update subMsg model.app

      in
        ( { model | app = app }, Cmd.map UiAppMessage effect )


    UiDatePickerMessage picker subMsg ->
      let
        ( datePicker, effect ) = Ui.DatePicker.update subMsg picker.datePicker

        newPicker : Picker
        newPicker = { picker | datePicker = datePicker }

        replacePicker : Picker -> Picker
        replacePicker onPicker =
          if onPicker.id == newPicker.id then
            newPicker
          else
            onPicker

        updatePickers : List Picker
        updatePickers =
          model.pickers
            |> List.map replacePicker

      in
        ( { model | pickers = updatePickers }
        , Cmd.map (UiDatePickerMessage newPicker) effect
        )


    SetIso8601 picker time ->
      let
        iso8601 : String
        iso8601 =
          time
            |> Date.fromTime
            |> isoString

        newPicker : Picker
        newPicker = { picker | iso8601 = iso8601 }

        replacePicker : Picker -> Picker
        replacePicker onPicker =
          if onPicker.id == newPicker.id then
            newPicker
          else
            onPicker

        updatePickers : List Picker
        updatePickers =
          model.pickers
            |> List.map replacePicker

      in
        ( { model | pickers = updatePickers }
        , Cmd.none
        )


view : Model -> Html.Html Msg
view model =
  let
    viewPicker : Picker -> Html.Html Msg
    viewPicker picker =
      div
        []
        [ div [] [ text picker.iso8601 ]
        -- Is the problem here?
        , Html.map (UiDatePickerMessage picker) (Ui.DatePicker.render "en_gb" picker.datePicker)
        ]

    viewPickers : List (Html.Html Msg)
    viewPickers =
      model.pickers
        |> List.map viewPicker

  in
    Ui.App.view
      UiAppMessage
      model.app
      [ Ui.Container.column [] viewPickers ]


subscriptions model =
  let
    subscriptionsToPickerDatePickers pickers =
      let
        -- Is the problem here?
        subscribe picker = Sub.map (UiDatePickerMessage picker) (Ui.DatePicker.subscriptions picker.datePicker)

      in
        -- When I switch between Sub.none and my Sub.batch, I get different results.
        -- With Sub.none, my `subscriptionsToPickerDatePickerChanges` seems to do the right thing and I am able to update my iso8601 fields in my model
        -- With my Sub.batch, this doesn't work
        -- In both cases, I cannot change months
        Sub.none
        -- pickers
        --   |> List.map subscribe
        --   |> Sub.batch

    subscriptionsToPickerDatePickerChanges pickers =
      let
        -- Is the problem here?
        subscribe picker = Ui.DatePicker.subscribe (SetIso8601 picker) picker.datePicker

      in
        pickers
          |> List.map subscribe
          |> Sub.batch

  in
    Sub.batch
      [ subscriptionsToPickerDatePickers model.pickers
      , subscriptionsToPickerDatePickerChanges model.pickers
      ]

main =
  Html.program
    { init = ( init, Cmd.none )
    , view = view
    , update = update
    , subscriptions = subscriptions
    }

Modal rendering issues

So I have two issues,

First, if I pass a "" to title or a [] to footer, then those pieces shouldn't render. There are definitely reasonable use-cases to not have a title or footer.

Second, I'm having a small handful of mobile issues. For context, I'm embedding a calendar into a modal.

  • If I'm zoomed in, the modal can be off-screen or off-center. I don't know if that's easily fixable, or not.
  • If I'm in landscape, my calendar overflows the modal. Is it possible to set a min-height on the modal and allowing the page to scroll?

Otherwise, this library is great, so thanks for taking the time to develop it.

elm-ui install version constraint failure

I'm getting the following error when trying to use elm-ui install:

Resolving versions...
error { '0': [Error: Unable to satisfy version constraint: gdotdesign/elm-ui@>=0.4.0 <1.0.0 from root] }

I can't install Elm-UI on Linux (Ubuntu)

Here is the npm error from sudo npm install -g elm-ui:

...
`npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm ERR! Linux 4.8.0-37-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "elm-ui"
npm ERR! node v7.5.0
npm ERR! npm v4.1.2
npm ERR! path /usr/lib/node_modules/elm-ui/bin/index.js
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod

npm ERR! enoent ENOENT: no such file or directory, chmod '/usr/lib/node_modules/elm-ui/bin/index.js'
npm ERR! enoent ENOENT: no such file or directory, chmod '/usr/lib/node_modules/elm-ui/bin/index.js'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! Please include the following file with any support request:
npm ERR! /home/tithos/Web/Elm/npm-debug.log
`

Is linux support in the works?

Can't run elm-ui server, throws js effor

When I run the server I get this error.. Not sure where to go from here? Any thoughts...

Packages configured successfully!
iMac:my-elm-ui Ken16$ elm-ui server
Listening on localhost:8001
events.js:141
throw er; // Unhandled 'error' event
^

Error: listen EADDRINUSE :::8001
at Object.exports._errnoException (util.js:873:11)
at exports._exceptionWithHostPort (util.js:896:20)
at Server._listen2 (net.js:1250:14)
at listen (net.js:1286:10)
at Server.listen (net.js:1382:5)
at Application.app.listen (/usr/local/lib/node_modules/elm-ui/node_modules/koa/lib/application.js:74:24)
at Object.module.exports [as serve] (/usr/local/lib/node_modules/elm-ui/bin/lib/command/serve.js:66:7)
at Command. (/usr/local/lib/node_modules/elm-ui/bin/index.js:53:11)
at Command.listener (/usr/local/lib/node_modules/elm-ui/node_modules/commander/index.js:301:8)
at emitTwo (events.js:87:13)
iMac:my-elm-ui Ken16$

Chooser custom text for "No items to display!"

As a programmer that's using the elm-ui chooser, I would like to set the text for when there are no items to display or to select.
no items
In above picture I would like to set the text to "No movies to select."

I would be nice if it was possible to change this text the same way as the placeholder text can be changed.

The value of the string is now hard coded in Styles/Chooser.elm on line 115.

Before trying to create a pull request for this I would like to known if someone is already busy with this feature, are there any tips how to implement this and if this feature is a good idea in general.

Windows Support

Windows binaries are living in an other directories then the unix ones, and we need to find the right one.

Missing some REALLY important components

I've used some ui frameworks around there and the availability of components and ease of use helped me build rich, intuitive, organized and beautiful UIs. All of that because they sticked to very good design guidelines AND provided some really importante components.

I miss some components in Elm UI. I tried to build a simples ui and soon I missed lists, cards and text. Maybe these would be some GREAT improvements around here!

Some examples:

Have a clear button on text/search fields

at least optionally, maybe depending on user os.
its really comfortable to have those if you are using an os where you can select-and-middle-mouse-button to copy and paste.

openFile: does not exist (No such file or directory)

I get this error after elm-ui init sample elm-ui install elm-ui server and trying to hit localhost:8001.
elm-make: /Users/ero/development/elm/sample/source/source/Main.elm: openFile: does not exist (No such file or directory)

The elm-ui server gives this error in the terminal:
Error: Cannot find module '/Users/ero/development/elm/sample/source/config/development.json'

Under Windows, elm-ui install gives an error

After installing elm-ui, init a new directory, elm-ui install in that directory gives:
bash$ elm-ui install
Resolving versions...
Starting downloads...

fs.js:809
return binding.rename(pathModule._makeLong(oldPath),
^

Error: EPERM: operation not permitted, rename 'C:\Users\richard\Dropbox\Projects\test\elm-stuff\packages\coreytrampe\elm-vendor\elm-vendor-2.0.3' -> 'C:\Users\richard\Dropbox\Projects\test\elm-stuff\packages\coreytrampe\elm-vendor\2.0.3'
at Error (native)
at Object.fs.renameSync (fs.js:809:18)
at C:\Users\richard\AppData\Roaming\npm\node_modules\elm-ui\node_modules\elm-github-install\src\index.js:43:16
at ZipFile. (C:\Users\richard\AppData\Roaming\npm\node_modules\elm-ui\node_modules\extract-zip\index.js:29:11)
at emitNone (events.js:86:13)
at ZipFile.emit (events.js:185:7)
at FdSlicer. (C:\Users\richard\AppData\Roaming\npm\node_modules\elm-ui\node_modules\yauzl\index.js:182:10)
at FdSlicer.g (events.js:291:16)
at emitNone (events.js:86:13)
at FdSlicer.emit (events.js:185:7)
bash$

CSS Gradient Glitch

Hi there,
First let me say, that this is an awesome project. I think this is going to become the go to framework for Elm as bootstrap is for css / js.

Issue:
Now, here's the bug I came across on Safari on macOS.
The "fade-out" gradient in the "Choser" Elements has a fade to dark instead of white.

Reason:
The "transparent" keyword. Only Safari & FF seems to use the right w3 standard which is, rgba( 0,0,0,0), all the other browsers use 255,255,255

Proposed fix:
To standardize the right gradient across all browsers, I would suggest using rgba(255.255.255.0) instead of the transparent keyword in all CSS.

Any comments ?
Keep up the good work !

Image of wrong gradient

Error: Node Sass could not find a binding for your current environment: OS X 64-bit with Node.js 6.x

Hi,

Nice project! I'm eager to test it out, but unfortunately I cannot as after issuing the

elm-ui init appi

It throws this error

/usr/local/lib/node_modules/elm-ui/node_modules/node-sass/lib/index.js:14
    throw new Error(errors.missingBinary());
    ^

Error: Missing binding /usr/local/lib/node_modules/elm-ui/node_modules/node-sass/vendor/darwin-x64-48/binding.node
**Node Sass could not find a binding for your current environment: OS X 64-bit with Node.js 6.x**

Found bindings for the following environments:
  - OS X 64-bit with Node.js 4.x

This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass` to build the binding for your current environment.
    at Object.<anonymous> (/usr/local/lib/node_modules/elm-ui/node_modules/node-sass/lib/index.js:14:11)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/usr/local/lib/node_modules/elm-ui/bin/lib/render/css.js:3:12)
    at Module._compile (module.js:541:32)```

Elm ui setup does not handle whitespace in path?

When I follow the instructions on the homepage (http://elm-ui.info/)

I get the following error:
"You have errors in of your Elm file(s):
elm-make: /Users/phartman/Documents/OneDrive: openFile: does not exist (No such file or directory)"

Where OneDrive is the first part of a directory name containing whitespace.

add date range picker

ofc you could just use two date pickers, but having it in one single picker highlighting the range would be nice.

Tabs +1

I don't want to interfere with your priorities, but for me, Tabs would be really nice to have.
Thanks for contributing to the community.

Allow multiple modal widths

It would be nice to be able to set a small/medium/large width on modals, or allow some style overrides for the width.

Access to Ui.Chooser.Msg definitions (and maybe in other components)

For context, I'm working on a project where I have a table of ui choosers. No chooser can have a repeat value (unless nothing is selected), and when data is selected, it also propagates to other choosers, removing the option that was selected from the source chooser. There are other filters and rules, but I think that is enough to understand what I'm doing.

My setup looks something like this (I've trimmed it down to the most basic example):

type Msg
  = UiMessage Ui.App.Msg
  | SelectableChanged Selectable Ui.Chooser.Msg

type alias Selectable =
  { row : Int
  , column : Int
  , chooser : Ui.Chooser.Model
  }

type alias Model =
  { app : Ui.App.Model
  , selectables : List Selectable
  , rows : List String
  , columns : List String
  , bigCollectionThatGetsConvertedIntoChooserItems : List a -- Has a string id and name field that can be mapped into Ui.Chooser.Items
  }

update : Msg -> Model -> ( Model, Cmd Msg )
update msg model =
  case msg of
    UiMessage subMsg ->
      let
        (nextApp, effect) = Ui.App.update subMsg model.app
      in
        ( { model | app = nextApp }
        , Cmd.map UiMessage effect
        )

    SelectableChanged selectable subMsg ->
      let
        (chooser, effect) = Ui.Chooser.update subMsg selectable.chooser
        nextSelectable = { selectable | chooser = chooser }

        replaceSelectable selectable =
          if selectable.row == nextSelectable.row && selectable.column == nextSelectable.column then
            nextSelectable
          else
            selectable

        selectables =
          model.selectables
            |> List.map replaceSelectable
            |> List.map myFiltersThatImNotGoingToWriteBecauseItCloudsThisExample
      in
        ( { model | selectables = selectables }
        , Cmd.map (SelectableChanged nextSelectable) effect

My big collection can have over 100 items, and the filters may map over each item a few times per update. I have a dynamic number of rows and columns, but it wouldn't be unusual for me to have 4 columns and 20 rows, so 100 cells, each with potentially 100 items in each cell.

Now to the problem; I only need to update the other choosers when a single chooser gets a new value, but SelectableChanged occurs with focus, open, close, blur, key movement, and select.

My current solution is to do something like:

selectables =
  let
    replacedSelectables =
      model.selectables
        |> List.map replaceSelectable
  in
    case subMsg of
      Ui.Chooser.Select value ->
        replacedSelectables
          |> List.filter myFiltersThatImNotGoingToWriteBecauseItCloudsThisExample

      _ ->
        replacedSelectables

This occasionally does some sort of infinite loop that locks up my browser and ramps up memory use, but I'm sure with some tweaks it will do the right thing.

Optionally, I'm up for other solutions that don't require modifying the source in my elm-stuff directory. I'm mostly an elm beginner, so maybe there is some other sort of map I can do, but it's not at all obvious to me right now.

So if my solution works (and I'm just doing something wrong), it would be great to have access to the various component Msg types so I can do my filtering on demand, and otherwise, you can close this issue and I'll ask on an elm message board for advice.

Community Package

First off, thanks for the great UI framework. Given that Elm is marketed as a front-end language, it's a shame there aren't more UI libs like this.

That said, I've noticed that there are quite a few Elm projects that don't end up on package.elm-lang.org. Is there a particular reason elm-ui doesn't fit in there, or do you otherwise have plans to eventually add it?

I'm pretty new to Elm, so please forgive me if I've missed something obvious (I do realize that you rolled your own build/scaffolding system, so perhaps its advantages out-weigh the standard packaging system). The community package site just seems to me a very convenient central repo that reduces adoption overhead.

Unable to install both elm-ui and elm-css

When adding both elm-ui and elm-css to my dependencies I get the following error:

The elm-package.json constraints of 'gdotdesign/elm-ui' are probably
letting too much stuff through. Definitely open an issue on the relevant github
repo to get this fixed and save other people from this pain.

In the meantime, take a look through the direct dependencies of the broken
package and see if any of them have had releases recently. If you find the new
thing that is causing problems, you can artificially constrain things by adding
some extra constraints to your elm-package.json as a stopgap measure.

However I think the issue is that both elm-ui and elm-css have a module named Css.
I see that this project has its own Css solution, but my project is already quite invested in elm-css, and I just wanted to use elm-ui for the HTML components.

Is there any way I can use both elm-ui and elm-css ?

version of Elm?

which version(s) of Elm are you using for this and are there updates to elm-ui when there are updates to the elm architecture? I think 0.18 has some changes that may affect the lib? I'm mainly curious to know if I can use this with 0.17.x

thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.