Skip to content

Commit

Permalink
added architecture components
Browse files Browse the repository at this point in the history
  • Loading branch information
hrach committed Feb 10, 2019
1 parent c154682 commit 91c6cf7
Show file tree
Hide file tree
Showing 20 changed files with 1,144 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.gitattributes export-ignore
.gitignore export-ignore
.github export-ignore
tests/ export-ignore
*.sh eol=lf
composer.json eol=lf
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/vendor
/composer.lock
8 changes: 8 additions & 0 deletions .phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
includes:
- vendor/phpstan/phpstan-nette/extension.neon
- vendor/phpstan/phpstan-nette/rules.neon

parameters:
ignoreErrors:
excludes_analyse:
- %currentWorkingDirectory%/src/Fragments/Traits/*
34 changes: 34 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
language: php

php:
- 7.1
- 7.2
- 7.3

matrix:
fast_finish: true

cache:
directories:
- $HOME/.composer/cache

before_script:
- composer install --no-interaction --prefer-source

- cp ./tests/php.unix-sample.ini ./tests/php.ini

- if [ "$TRAVIS_PHP_VERSION" == "7.3" ]; then cat ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini >> ./tests/php.ini; fi
- if [ "$TRAVIS_PHP_VERSION" == "7.3" ]; then NTESTER_FLAGS="--coverage ./coverage.xml --coverage-src ./src"; else TESTER_FLAGS=""; fi

script:
- ./tests/run.sh -s $NTESTER_FLAGS ./tests/cases
- if [ "$TRAVIS_PHP_VERSION" == "7.3" ]; then vendor/bin/phpstan analyze src -l 7 -c .phpstan.neon; fi

after_script:
- if [ "$TRAVIS_PHP_VERSION" == "7.3" ]; then composer require php-coveralls/php-coveralls; fi
- if [ "$TRAVIS_PHP_VERSION" == "7.3" ]; then php vendor/bin/php-coveralls -c tests/.coveralls.yml -v; fi

after_failure:
# Print *.actual content & log content
- for i in $(find tests -name \*.actual); do echo "--- $i"; cat $i; echo; echo; done
- for i in $(find tests -name \*.log); do echo "--- $i"; cat $i; echo; echo; done
43 changes: 43 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"name": "nextras/form-components",
"type": "library",
"description": "Form components for Nette Framework.",
"keywords": ["nette", "form", "components"],
"license": ["MIT", "BSD-3-Clause", "GPL-2.0", "GPL-3.0"],
"authors": [
{
"name": "Nextras Community",
"homepage": "https://github.com/nextras/form-components/graphs/contributors"
}
],
"require": {
"php": ">=7.1",
"nette/application": "~3.0",
"nette/component-model": "~3.0",
"nette/forms": "~3.0",
"nette/utils": "~3.0"
},
"require-dev": {
"latte/latte": "~3.0",
"nette/bootstrap": "~3.0",
"nette/di": "~3.0",
"nette/robot-loader": "~3.0",
"nette/tester": "~2.1",
"phpstan/phpstan-nette": "0.11",
"phpstan/phpstan-shim": "0.11.1",
"tracy/tracy": "~2.5"
},
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
},
"minimum-stability": "beta",
"prefer-stable": true,
"config": {
"sort-packages": true
},
"autoload": {
"psr-4": { "Nextras\\FormComponents\\": "src/" }
}
}
75 changes: 75 additions & 0 deletions license.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
Licenses
========

**License for the library except files extracted from Nette Framework:**

MIT License
-----------

Copyright (c) 2014 Nextras Project

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

**License for `src/Fragments/Traits/*` files extracted from Nette Framework:**

Good news! You may use Nette Framework under the terms of either
the New BSD License or the GNU General Public License (GPL) version 2 or 3.

The BSD License is recommended for most projects. It is easy to understand and it
places almost no restrictions on what you can do with the framework. If the GPL
fits better to your project, you can use the framework under this license.

You don't have to notify anyone which license you are using. You can freely
use Nette Framework in commercial projects as long as the copyright header
remains intact.

Please be advised that the name "Nette Framework" is a protected trademark and its
usage has some limitations. So please do not use word "Nette" in the name of your
project or top-level domain, and choose a name that stands on its own merits.
If your stuff is good, it will not take long to establish a reputation for yourselves.


New BSD License
---------------

Copyright (c) 2004, 2014 David Grudl (https://davidgrudl.com)
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of "Nette Framework" nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.

This software is provided by the copyright holders and contributors "as is" and
any express or implied warranties, including, but not limited to, the implied
warranties of merchantability and fitness for a particular purpose are
disclaimed. In no event shall the copyright owner or contributors be liable for
any direct, indirect, incidental, special, exemplary, or consequential damages
(including, but not limited to, procurement of substitute goods or services;
loss of use, data, or profits; or business interruption) however caused and on
any theory of liability, whether in contract, strict liability, or tort
(including negligence or otherwise) arising in any way out of the use of this
software, even if advised of the possibility of such damage.


GNU General Public License
--------------------------

GPL licenses are very very long, so instead of including them here we offer
you URLs with full text:

- [GPL version 2](http://www.gnu.org/licenses/gpl-2.0.html)
- [GPL version 3](http://www.gnu.org/licenses/gpl-3.0.html)
35 changes: 35 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Nextras Form Components
========================

[![Build Status](https://travis-ci.org/nextras/form-components.svg?branch=master)](https://travis-ci.org/nextras/form-components)
[![Downloads this Month](https://img.shields.io/packagist/dm/nextras/form-components.svg?style=flat)](https://packagist.org/packages/nextras/form-components)
[![Stable version](http://img.shields.io/packagist/v/nextras/form-components.svg?style=flat)](https://packagist.org/packages/nextras/form-components)
[![Code coverage](https://img.shields.io/coveralls/nextras/form-components.svg?style=flat)](https://coveralls.io/r/nextras/form-components)

This package provides architecture and UI components for building Nette forms.

Architecture components provide Nette Forms' BaseControl in two flavors:
- BaseControl that inherits from `Nette\Application\UI\Component` - form control with support for signal & state handling;
- BaseControl that inherits from `Nette\Application\UI\Control` - form control with support for template rendering + same feature as in UI\Component;

UI components:
- *AutocompleteControl* - text input with support for autocomplete signal handling;
- *DatePicker* - date picker - text input returning `DateTimeImmutable` instance;
- *DateTimePicker* - date picker - text input returning `DateTimeImmutable` instance;

### Installation

The best way to install is using [Composer](http://getcomposer.org/):

```sh
$ composer require nextras/form-components
```

### Documentation

See examples directory.


### License

Combined MIT and Nette's . See full [license](license.md).
Loading

0 comments on commit 91c6cf7

Please sign in to comment.