-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0304345
commit f31473a
Showing
121 changed files
with
26,499 additions
and
2,374 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"presets": [ | ||
[ | ||
"@babel/preset-env", | ||
{ | ||
"useBuiltIns": "usage", | ||
"corejs": "3.0.0" | ||
} | ||
] | ||
], | ||
"plugins": [ | ||
"@babel/plugin-syntax-dynamic-import", | ||
"@babel/plugin-transform-class-properties" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[production staging] | ||
>5% | ||
last 2 versions | ||
not ie > 0 | ||
not ie_mob > 0 | ||
Firefox ESR | ||
|
||
[development] | ||
last 1 chrome version | ||
last 1 firefox version | ||
last 1 edge version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"parser": "@babel/eslint-parser", | ||
"extends": [ | ||
"eslint:recommended" | ||
], | ||
"env": { | ||
"browser": true, | ||
"node": true | ||
}, | ||
"parserOptions": { | ||
"ecmaVersion": 8, | ||
"sourceType": "module", | ||
"requireConfigFile": false | ||
}, | ||
"rules": { | ||
"semi": 2 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
lts/iron |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"extends": "stylelint-config-standard-scss", | ||
"rules": { | ||
"at-rule-no-unknown": null, | ||
"scss/at-rule-no-unknown": true, | ||
"scss/at-import-partial-extension": null | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,2 @@ | ||
# Changelog | ||
|
||
## 1.0.5 | ||
|
||
1. Add `show_previews` option to control whether to show previews or not | ||
|
||
## 1.0.4 | ||
|
||
1. Add component `Preview` support | ||
|
||
## 1.0.2 | ||
|
||
1. Initial release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
build: | ||
npm run build | ||
poetry build | ||
|
||
publish: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1 @@ | ||
# README | ||
|
||
[![PyPI version](https://badge.fury.io/py/django-viewcomponent.svg)](https://badge.fury.io/py/django-viewcomponent) | ||
[![PyPI Supported Python Versions](https://img.shields.io/pypi/pyversions/django-viewcomponent.svg)](https://pypi.python.org/pypi/django-viewcomponent/) | ||
|
||
django-viewcomponent is a Django library that provides a way to create reusable components for your Django project. | ||
|
||
It is inspired by Rails [ViewComponent](https://viewcomponent.org/). | ||
|
||
## Why use django-viewcomponent | ||
|
||
### Single responsibility | ||
|
||
django-viewcomponent can help developers to build reusable components from the Django templates, and make the templates more readable and maintainable. | ||
|
||
### Testing | ||
|
||
django-viewcomponent components are Python objects, so they can be **easily tested** without touching Django view and Django urls. | ||
|
||
## Documentation | ||
|
||
[Documentation](https://django-viewcomponent.readthedocs.io/en/latest/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// This is the scss entry file | ||
import "../styles/index.scss"; | ||
|
||
// import Stimulus controllers | ||
import "../controllers/index"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { Application } from "@hotwired/stimulus"; | ||
import { definitionsFromContext } from "@hotwired/stimulus-webpack-helpers"; | ||
import { | ||
Alert, | ||
Dropdown, | ||
Modal, | ||
Tabs, | ||
Popover, | ||
Toggle, | ||
} from "tailwindcss-stimulus-components"; | ||
|
||
const application = Application.start(); | ||
application.debug = process.env.NODE_ENV === "development"; | ||
window.Stimulus = application; | ||
|
||
// load local controllers, only xxx_controller.js would be loaded | ||
const context = require.context("./", true, /\.(js|ts)$/); | ||
application.load(definitionsFromContext(context)); | ||
|
||
// register 3-party controllers | ||
application.register("alert", Alert); | ||
application.register("dropdown", Dropdown); | ||
application.register("modal", Modal); | ||
application.register("tabs", Tabs); | ||
application.register("popover", Popover); | ||
application.register("toggle", Toggle); |
Oops, something went wrong.