Skip to content

Commit ca1320b

Browse files
committed
Major upgrade to latest purescript + react
1 parent 17ac6b0 commit ca1320b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+20619
-1225
lines changed

.envrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use flake

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
webpack.config.js

.eslintrc.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@ env:
55
node: true
66
extends:
77
- eslint:recommended
8-
- plugin:prettier/recommended
8+
# - plugin:prettier/recommended
99
globals:
1010
Atomics: readonly
1111
SharedArrayBuffer: readonly
1212
parserOptions:
1313
ecmaFeatures:
1414
jsx: false
1515
ecmaVersion: 2018
16+
sourceType: module
1617
rules:
1718
strict:
1819
- error

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
/node_modules/
55
/bower_components/
66
/.psc-package/
7+
.spago
78

89
# testing
910
/coverage
@@ -26,6 +27,7 @@
2627
.env.development.local
2728
.env.test.local
2829
.env.production.local
30+
.direnv
2931

3032
npm-debug.log*
3133
yarn-debug.log*

bower.json

+71-53
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,73 @@
11
{
2-
"name": "purescript-lumi-components",
3-
"license": "Apache-2.0",
4-
"repository": {
5-
"type": "git",
6-
"url": "https://github.com/lumihq/purescript-lumi-components.git"
7-
},
8-
"ignore": [
9-
"*",
10-
"!src/**/*"
11-
],
12-
"dependencies": {
13-
"purescript-aff-coroutines": "^7.0.0",
14-
"purescript-aff": "^5.0.0",
15-
"purescript-arrays": "^5.0.0",
16-
"purescript-avar": "^3.0.0",
17-
"purescript-console": "^4.1.0",
18-
"purescript-coroutines": "^5.0.0",
19-
"purescript-fixed-precision": "^4.0.0",
20-
"purescript-foldable-traversable": "^4.0.0",
21-
"purescript-foreign-object": ">= 1.0.0 < 3.0.0",
22-
"purescript-generics-rep": "^6.0.0",
23-
"purescript-foreign": "^5.0.0",
24-
"purescript-gen": "^2.0.0",
25-
"purescript-integers": "^4.0.0",
26-
"purescript-maybe": "^4.0.0",
27-
"purescript-nullable": "^4.0.0",
28-
"purescript-numbers": "^7.0.0",
29-
"purescript-prelude": "^4.0.1",
30-
"purescript-profunctor-lenses": ">=4.0.0 <7.0.0",
31-
"purescript-random": "^4.0.0",
32-
"purescript-react-basic": "^15.0.0",
33-
"purescript-react-basic-dom": "lumihq/purescript-react-basic-dom#^3.3.0",
34-
"purescript-react-basic-classic": "lumihq/purescript-react-basic-classic#^1.0.1",
35-
"purescript-react-basic-emotion": "^5.0.0",
36-
"purescript-react-basic-hooks": "^6.0.0",
37-
"purescript-react-dnd-basic": "^8.0.0",
38-
"purescript-record": ">= 1.0.0 < 3.0.0",
39-
"purescript-simple-json": ">=4.0.0 <7.0.0",
40-
"purescript-strings": "^4.0.0",
41-
"purescript-tuples": "^5.0.0",
42-
"purescript-unsafe-reference": "^3.0.1",
43-
"purescript-validation": "^4.0.0",
44-
"purescript-js-timers": "^4.0.1",
45-
"purescript-heterogeneous": ">=0.3.0 <0.5.0",
46-
"purescript-free": "^5.1.0",
47-
"purescript-colors": "^5.0.0",
48-
"purescript-web-uievents": "^2.0.0",
49-
"purescript-foreign-generic": "^10.0.0"
50-
},
51-
"devDependencies": {
52-
"purescript-debug": "^4.0.0",
53-
"purescript-psci-support": "^4.0.0"
54-
}
2+
"name": "purescript-lumi-components",
3+
"license": [
4+
"Apache-2.0"
5+
],
6+
"repository": {
7+
"type": "git",
8+
"url": "https://github.com/lumihq/purescript-lumi-components"
9+
},
10+
"ignore": [
11+
"**/.*",
12+
"node_modules",
13+
"bower_components",
14+
"output"
15+
],
16+
"dependencies": {
17+
"purescript-aff": "^v7.1.0",
18+
"purescript-aff-coroutines": "^v9.0.0",
19+
"purescript-arrays": "^v7.2.1",
20+
"purescript-bifunctors": "^v6.0.0",
21+
"purescript-colors": "^v7.0.1",
22+
"purescript-console": "^v6.0.0",
23+
"purescript-control": "^v6.0.0",
24+
"purescript-coroutines": "^v7.0.0",
25+
"purescript-datetime": "^v6.1.0",
26+
"purescript-effect": "^v4.0.0",
27+
"purescript-either": "^v6.1.0",
28+
"purescript-enums": "^v6.0.1",
29+
"purescript-exceptions": "^v6.0.0",
30+
"purescript-fixed-precision": "^v5.0.0",
31+
"purescript-foldable-traversable": "^v6.0.0",
32+
"purescript-foreign": "^v7.0.0",
33+
"purescript-foreign-object": "^v4.1.0",
34+
"purescript-free": "^v7.0.0",
35+
"purescript-heterogeneous": "^v0.6.0",
36+
"purescript-integers": "^v6.0.0",
37+
"purescript-js-timers": "^v6.1.0",
38+
"purescript-js-uri": "https://github.com/purescript-contrib/purescript-js-uri.git#v3.1.0",
39+
"purescript-maybe": "^v6.0.0",
40+
"purescript-media-types": "^v6.0.0",
41+
"purescript-newtype": "^v5.0.0",
42+
"purescript-nonempty": "^v7.0.0",
43+
"purescript-nullable": "^v6.0.0",
44+
"purescript-numbers": "^v9.0.1",
45+
"purescript-ordered-collections": "^v3.0.0",
46+
"purescript-parallel": "^v6.0.0",
47+
"purescript-partial": "^v4.0.0",
48+
"purescript-prelude": "^v6.0.1",
49+
"purescript-profunctor-lenses": "^v8.0.0",
50+
"purescript-react-basic": "^v17.0.0",
51+
"purescript-react-basic-classic": "https://github.com/lumihq/purescript-react-basic-classic.git#v3.0.0",
52+
"purescript-react-basic-dnd": "https://github.com/lumihq/purescript-react-dnd-basic.git#v10.1.0",
53+
"purescript-react-basic-dom": "https://github.com/lumihq/purescript-react-basic-dom.git#v6.1.0",
54+
"purescript-react-basic-emotion": "^v7.1.0",
55+
"purescript-react-basic-hooks": "^v8.2.0",
56+
"purescript-record": "^v4.0.0",
57+
"purescript-refs": "^v6.0.0",
58+
"purescript-simple-json": "^v9.0.0",
59+
"purescript-st": "^v6.2.0",
60+
"purescript-strings": "^v6.0.1",
61+
"purescript-tailrec": "^v6.1.0",
62+
"purescript-transformers": "^v6.0.0",
63+
"purescript-tuples": "^v7.0.0",
64+
"purescript-unsafe-coerce": "^v6.0.0",
65+
"purescript-unsafe-reference": "^v5.0.0",
66+
"purescript-web-dom": "^v6.0.0",
67+
"purescript-web-events": "^v4.0.0",
68+
"purescript-web-file": "^v4.0.0",
69+
"purescript-web-html": "^v4.1.0",
70+
"purescript-web-storage": "^v5.0.0",
71+
"purescript-web-uievents": "^v4.0.0"
72+
}
5573
}

docs/Examples/EditableTable.example.purs

+11-7
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@ import Data.Foldable as Array
1010
import Data.Maybe (Maybe(..), fromMaybe)
1111
import Data.NonEmpty ((:|))
1212
import Data.Nullable as Nullable
13-
import Data.Number (isNaN)
13+
import Data.Number as Number
1414
import Data.Number.Format (fixed, toStringWith)
1515
import Effect.Console (log)
16-
import Global (readFloat)
1716
import Lumi.Components.Column (column_)
1817
import Lumi.Components.DropdownButton (dropdownIcon, dropdownIconDefaults)
1918
import Lumi.Components.EditableTable (editableTable, editableTableDefaults)
@@ -71,30 +70,35 @@ docs = unit # make component
7170
updateRow self row { description = fromMaybe row.description value }
7271
, style = R.css { width: "100%" }
7372
}
73+
, renderHeader: R.text
74+
, headerStyle: mempty
7475
}
7576
, { label: "Quantity"
7677
, renderCell: \row -> Input.input Input.number
7778
{ value = toString row.quantity
7879
, onChange = handler targetValue \value ->
7980
updateRow self row { quantity = fromMaybe row.quantity $ fromString =<< value }
8081
}
82+
, renderHeader: R.text
83+
, headerStyle: mempty
8184
}
8285
, { label: "Price"
8386
, renderCell: \row -> Input.input Input.number
8487
{ value = show row.price
8588
, step = Nullable.notNull $ Input.Step 0.01
8689
, onChange = handler targetValue \value ->
87-
updateRow self $ fromMaybe row do
88-
value' <- readFloat <$> value
89-
pure if isNaN value'
90-
then row
91-
else row { price = value' }
90+
updateRow self row { price = fromMaybe row.price $ Number.fromString =<< value }
9291
}
92+
, renderHeader: R.text
93+
, headerStyle: mempty
9394
}
9495
, { label: "Total"
9596
, renderCell: \row -> R.text $ toMoneyString (calculateTotal row)
97+
, renderHeader: R.text
98+
, headerStyle: mempty
9699
}
97100
]
101+
, infoColumns: []
98102
, maxRows: 5
99103
, onRowAdd: addRow self
100104
, onRowRemove: removeRow self

0 commit comments

Comments
 (0)