Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Commit 41ef8db

Browse files
authored
Initial version (#1)
* it compiles * extract State Query Message in Time picker * it works, sort of * preserve order of components from format * fix html * refactor Time * use Validation instead of Either in Constraint * 'Constraint f a' to 'Constraint a' * fix typos in error messages * add date picker * update example * fix enum generation * use one numberElement * use one choiseElement * use date with year set to 0 for initial value * add enumNumberElement * move textElement * add some enum types * remove unused imports * move constraint module * small refactor * fix placeholder issue * Add DateTime picker and refactor Example * add duration component; refactor elements * fix notify staff (actually it was not an issue at all) * remove some commets * fix format filename * add Interval * add separator to interval * pass initial value as arg * add error to interval setValue * update number element api * fix spacing * update ps-validation and ps-transformers * add validation in duration picker * refactor duration validation * refactor duration validation v2 * fix number input validation * add build task * fix mustBeMounted * fix numberInput invalidity * cosmetics * remove duration argument from duration picker * make numberComponent a Number.picker * refactor number picker * fix invalid style * cosmetic changes * rename Number.picker to Num.picker * apply calidation changes to Time * add Choice.picker * use Choice.picker in Time.picker * replace KleisliEndo with Join Star; refactor * use new version of ps-enums * cosmetics * add validation to Date.picker * add validation to DateTime picker * add validation to interval * fix error propagation > if when duration is Nothing user uses fractional value incorectly it will be parsed as valid number and input will not fail but there combination gives invalid duration and it will stay as nothing resulting in having valid values in input but indication of invlaidity we need to change state to invalid if we have value for all commands * value sin number input must "comute" * change Meridiem to Int in Time * refactor; fix warnings * use Array in Format instead of List; move format modules * move Internal; extract Utils * remove Utils.toAlt * move examples to it's own folder * update bower.json, add README and travis.yml * remove notes file * use when/unless * refactor Constraint Errors * max 2 empty lines * fix foralls * fix double colons * replace Datapicker with Datepicker * add space after ∀ * sort imports * fix some case formating * `when (x /= y)` to `unless (x == y)` * fix arrow * use more case of * int to index type in example * remove `$` before `case` * use asRight * use join in buildDuration * add asLeft * use do in interval eval * remove format from state * add moveStateTo * use transitionState in eval * replace => with ⇒ * replace <- with ← * make lines shorter; some cosmetic changes * cosmetic refactoring * utf fix * fix replace errors * refactor build functions * remove perens * remove comments * fix forall * remove comments * refactor - don't use unsafePartialBecause, but use halt - add common request/actions to .Types * reorder component types in more consistnat way order: - State - Message - Query - ChildSlot&Slot - ChildPath - HTML&DSL * update ps-datetime * add placeholders * refactor html query maping * update purescript-datetime version * update ps-foramtters * add length classes to input * add configuration for altering styles * cleen up type signature of Elements.* * add choiceEmptyTitle * add Newtype instance for Config
1 parent 4894a2a commit 41ef8db

26 files changed

+3042
-36
lines changed

.gitignore

Lines changed: 5 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,6 @@
1-
# Logs
2-
logs
3-
*.log
1+
/example/example.js
2+
/output/
3+
/bower_components/
4+
/node_modules/
45
npm-debug.log*
5-
6-
# Runtime data
7-
pids
8-
*.pid
9-
*.seed
10-
11-
# Directory for instrumented libs generated by jscoverage/JSCover
12-
lib-cov
13-
14-
# Coverage directory used by tools like istanbul
15-
coverage
16-
17-
# nyc test coverage
18-
.nyc_output
19-
20-
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
21-
.grunt
22-
23-
# node-waf configuration
24-
.lock-wscript
25-
26-
# Compiled binary addons (http://nodejs.org/api/addons.html)
27-
build/Release
28-
29-
# Dependency directories
30-
node_modules
31-
jspm_packages
32-
33-
# Optional npm cache directory
34-
.npm
35-
36-
# Optional REPL history
37-
.node_repl_history
6+
.psc-ide-port

.travis.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
language: node_js
2+
dist: trusty
3+
sudo: required
4+
node_js: 6
5+
install:
6+
- npm install -g bower
7+
- npm install && bower install
8+
script:
9+
- npm run build
10+
after_success:
11+
- >-
12+
test $TRAVIS_TAG &&
13+
echo $GITHUB_TOKEN | pulp login &&
14+
echo y | pulp publish --no-push

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# purescript-halogen-datepicker
2+
3+
[![Latest release](http://img.shields.io/github/release/slamdata/purescript-halogen-datepicker.svg)](https://github.com/slamdata/purescript-halogen-datepicker/releases)
4+
[![Build status](https://travis-ci.org/slamdata/purescript-halogen-datepicker.svg?branch=master)](https://travis-ci.org/slamdata/purescript-halogen-datepicker)
5+
6+
## Pickers included:
7+
8+
- Date
9+
- Time
10+
- DateTime
11+
- Duration
12+
- Interval
13+
14+
## Examples
15+
16+
To run examples
17+
18+
```bash
19+
npm run build
20+
http-server example
21+
```
22+
23+
you can install [http-server using npm](https://www.npmjs.com/package/http-server)

bower.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"name": "purescript-halogen-datepicker",
3+
"license": "Apache-2.0",
4+
"repository": {
5+
"type": "git",
6+
"url": "git://github.com/slamdata/purescript-halogen-datepicker.git"
7+
},
8+
"authors": [
9+
"Irakli Safareli <[email protected]>"
10+
],
11+
"ignore": [
12+
"**/.*",
13+
"bower_components",
14+
"node_modules",
15+
"output",
16+
"tests",
17+
"tmp",
18+
"bower.json",
19+
"package.json",
20+
"example"
21+
],
22+
"dependencies": {
23+
"purescript-enums": "^3.2.0",
24+
"purescript-formatters": "^2.0.0",
25+
"purescript-datetime": "^3.3.0",
26+
"purescript-halogen": "^2.0.1",
27+
"purescript-halogen-css": "^6.0.0",
28+
"purescript-generics-rep": "^5.0.0",
29+
"purescript-validation": "^3.1.0",
30+
"purescript-profunctor": "^3.1.0",
31+
"purescript-numbers": "^5.0.0",
32+
"purescript-these": "^3.0.0"
33+
}
34+
}

example/index.html

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<title>Halogen Datepicker Example</title>
5+
<style>
6+
body {
7+
font-family: sans-serif;
8+
max-width: 570px;
9+
margin: auto;
10+
}
11+
.Picker {
12+
list-style: none;
13+
padding: 0;
14+
margin: 20px 0 0.5ch;
15+
}
16+
.Picker--invalid .Picker-input {
17+
border: 1px solid red;
18+
outline-color: red;
19+
}
20+
.Picker-component {
21+
display: inline-block;
22+
}
23+
.Picker .Picker {
24+
margin: 0;
25+
display: inline-block;
26+
}
27+
.Picker-component + .Picker-component,
28+
.Picker .Picker + .Picker {
29+
margin-left: 0.5ch;
30+
}
31+
.Picker-input {
32+
border: 1px solid hsl(0, 0%, 85%);
33+
}
34+
.Picker-input--invalid {
35+
color: red;
36+
outline-color: red;
37+
}
38+
.Picker-placeholder {
39+
white-space: pre;
40+
}
41+
input, button {
42+
font-family: sans-serif;
43+
font-size: 14px;
44+
max-width: 70px;
45+
}
46+
input[type=text] {
47+
width: 500px;
48+
margin: 0px 4px;
49+
}
50+
</style>
51+
</head>
52+
<body>
53+
<script src="example.js"></script>
54+
</body>
55+
</html>

0 commit comments

Comments
 (0)