Skip to content

Commit

Permalink
Major upgrade to latest purescript + react
Browse files Browse the repository at this point in the history
  • Loading branch information
mjrussell committed Sep 7, 2023
1 parent 17ac6b0 commit ca1320b
Show file tree
Hide file tree
Showing 73 changed files with 20,619 additions and 1,225 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
webpack.config.js
3 changes: 2 additions & 1 deletion .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ env:
node: true
extends:
- eslint:recommended
- plugin:prettier/recommended
# - plugin:prettier/recommended
globals:
Atomics: readonly
SharedArrayBuffer: readonly
parserOptions:
ecmaFeatures:
jsx: false
ecmaVersion: 2018
sourceType: module
rules:
strict:
- error
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
/node_modules/
/bower_components/
/.psc-package/
.spago

# testing
/coverage
Expand All @@ -26,6 +27,7 @@
.env.development.local
.env.test.local
.env.production.local
.direnv

npm-debug.log*
yarn-debug.log*
Expand Down
124 changes: 71 additions & 53 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,55 +1,73 @@
{
"name": "purescript-lumi-components",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "https://github.com/lumihq/purescript-lumi-components.git"
},
"ignore": [
"*",
"!src/**/*"
],
"dependencies": {
"purescript-aff-coroutines": "^7.0.0",
"purescript-aff": "^5.0.0",
"purescript-arrays": "^5.0.0",
"purescript-avar": "^3.0.0",
"purescript-console": "^4.1.0",
"purescript-coroutines": "^5.0.0",
"purescript-fixed-precision": "^4.0.0",
"purescript-foldable-traversable": "^4.0.0",
"purescript-foreign-object": ">= 1.0.0 < 3.0.0",
"purescript-generics-rep": "^6.0.0",
"purescript-foreign": "^5.0.0",
"purescript-gen": "^2.0.0",
"purescript-integers": "^4.0.0",
"purescript-maybe": "^4.0.0",
"purescript-nullable": "^4.0.0",
"purescript-numbers": "^7.0.0",
"purescript-prelude": "^4.0.1",
"purescript-profunctor-lenses": ">=4.0.0 <7.0.0",
"purescript-random": "^4.0.0",
"purescript-react-basic": "^15.0.0",
"purescript-react-basic-dom": "lumihq/purescript-react-basic-dom#^3.3.0",
"purescript-react-basic-classic": "lumihq/purescript-react-basic-classic#^1.0.1",
"purescript-react-basic-emotion": "^5.0.0",
"purescript-react-basic-hooks": "^6.0.0",
"purescript-react-dnd-basic": "^8.0.0",
"purescript-record": ">= 1.0.0 < 3.0.0",
"purescript-simple-json": ">=4.0.0 <7.0.0",
"purescript-strings": "^4.0.0",
"purescript-tuples": "^5.0.0",
"purescript-unsafe-reference": "^3.0.1",
"purescript-validation": "^4.0.0",
"purescript-js-timers": "^4.0.1",
"purescript-heterogeneous": ">=0.3.0 <0.5.0",
"purescript-free": "^5.1.0",
"purescript-colors": "^5.0.0",
"purescript-web-uievents": "^2.0.0",
"purescript-foreign-generic": "^10.0.0"
},
"devDependencies": {
"purescript-debug": "^4.0.0",
"purescript-psci-support": "^4.0.0"
}
"name": "purescript-lumi-components",
"license": [
"Apache-2.0"
],
"repository": {
"type": "git",
"url": "https://github.com/lumihq/purescript-lumi-components"
},
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"output"
],
"dependencies": {
"purescript-aff": "^v7.1.0",
"purescript-aff-coroutines": "^v9.0.0",
"purescript-arrays": "^v7.2.1",
"purescript-bifunctors": "^v6.0.0",
"purescript-colors": "^v7.0.1",
"purescript-console": "^v6.0.0",
"purescript-control": "^v6.0.0",
"purescript-coroutines": "^v7.0.0",
"purescript-datetime": "^v6.1.0",
"purescript-effect": "^v4.0.0",
"purescript-either": "^v6.1.0",
"purescript-enums": "^v6.0.1",
"purescript-exceptions": "^v6.0.0",
"purescript-fixed-precision": "^v5.0.0",
"purescript-foldable-traversable": "^v6.0.0",
"purescript-foreign": "^v7.0.0",
"purescript-foreign-object": "^v4.1.0",
"purescript-free": "^v7.0.0",
"purescript-heterogeneous": "^v0.6.0",
"purescript-integers": "^v6.0.0",
"purescript-js-timers": "^v6.1.0",
"purescript-js-uri": "https://github.com/purescript-contrib/purescript-js-uri.git#v3.1.0",
"purescript-maybe": "^v6.0.0",
"purescript-media-types": "^v6.0.0",
"purescript-newtype": "^v5.0.0",
"purescript-nonempty": "^v7.0.0",
"purescript-nullable": "^v6.0.0",
"purescript-numbers": "^v9.0.1",
"purescript-ordered-collections": "^v3.0.0",
"purescript-parallel": "^v6.0.0",
"purescript-partial": "^v4.0.0",
"purescript-prelude": "^v6.0.1",
"purescript-profunctor-lenses": "^v8.0.0",
"purescript-react-basic": "^v17.0.0",
"purescript-react-basic-classic": "https://github.com/lumihq/purescript-react-basic-classic.git#v3.0.0",
"purescript-react-basic-dnd": "https://github.com/lumihq/purescript-react-dnd-basic.git#v10.1.0",
"purescript-react-basic-dom": "https://github.com/lumihq/purescript-react-basic-dom.git#v6.1.0",
"purescript-react-basic-emotion": "^v7.1.0",
"purescript-react-basic-hooks": "^v8.2.0",
"purescript-record": "^v4.0.0",
"purescript-refs": "^v6.0.0",
"purescript-simple-json": "^v9.0.0",
"purescript-st": "^v6.2.0",
"purescript-strings": "^v6.0.1",
"purescript-tailrec": "^v6.1.0",
"purescript-transformers": "^v6.0.0",
"purescript-tuples": "^v7.0.0",
"purescript-unsafe-coerce": "^v6.0.0",
"purescript-unsafe-reference": "^v5.0.0",
"purescript-web-dom": "^v6.0.0",
"purescript-web-events": "^v4.0.0",
"purescript-web-file": "^v4.0.0",
"purescript-web-html": "^v4.1.0",
"purescript-web-storage": "^v5.0.0",
"purescript-web-uievents": "^v4.0.0"
}
}
18 changes: 11 additions & 7 deletions docs/Examples/EditableTable.example.purs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ import Data.Foldable as Array
import Data.Maybe (Maybe(..), fromMaybe)
import Data.NonEmpty ((:|))
import Data.Nullable as Nullable
import Data.Number (isNaN)
import Data.Number as Number
import Data.Number.Format (fixed, toStringWith)
import Effect.Console (log)
import Global (readFloat)
import Lumi.Components.Column (column_)
import Lumi.Components.DropdownButton (dropdownIcon, dropdownIconDefaults)
import Lumi.Components.EditableTable (editableTable, editableTableDefaults)
Expand Down Expand Up @@ -71,30 +70,35 @@ docs = unit # make component
updateRow self row { description = fromMaybe row.description value }
, style = R.css { width: "100%" }
}
, renderHeader: R.text
, headerStyle: mempty
}
, { label: "Quantity"
, renderCell: \row -> Input.input Input.number
{ value = toString row.quantity
, onChange = handler targetValue \value ->
updateRow self row { quantity = fromMaybe row.quantity $ fromString =<< value }
}
, renderHeader: R.text
, headerStyle: mempty
}
, { label: "Price"
, renderCell: \row -> Input.input Input.number
{ value = show row.price
, step = Nullable.notNull $ Input.Step 0.01
, onChange = handler targetValue \value ->
updateRow self $ fromMaybe row do
value' <- readFloat <$> value
pure if isNaN value'
then row
else row { price = value' }
updateRow self row { price = fromMaybe row.price $ Number.fromString =<< value }
}
, renderHeader: R.text
, headerStyle: mempty
}
, { label: "Total"
, renderCell: \row -> R.text $ toMoneyString (calculateTotal row)
, renderHeader: R.text
, headerStyle: mempty
}
]
, infoColumns: []
, maxRows: 5
, onRowAdd: addRow self
, onRowRemove: removeRow self
Expand Down
Loading

0 comments on commit ca1320b

Please sign in to comment.