refast_grid 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,92 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ pip-wheel-metadata/
24
+ share/python-wheels/
25
+ *.egg-info/
26
+ .installed.cfg
27
+ *.egg
28
+ MANIFEST
29
+
30
+ # PyInstaller
31
+ *.manifest
32
+ *.spec
33
+
34
+ # Installer logs
35
+ pip-log.txt
36
+ pip-delete-this-directory.txt
37
+
38
+ # Unit test / coverage reports
39
+ htmlcov/
40
+ .tox/
41
+ .nox/
42
+ .coverage
43
+ .coverage.*
44
+ .cache
45
+ nosetests.xml
46
+ coverage.xml
47
+ *.cover
48
+ *.py,cover
49
+ .hypothesis/
50
+ .pytest_cache/
51
+
52
+ # Translations
53
+ *.mo
54
+ *.pot
55
+
56
+ # Environments
57
+ .env
58
+ .venv
59
+ env/
60
+ venv/
61
+ ENV/
62
+ env.bak/
63
+ venv.bak/
64
+
65
+ # IDEs
66
+ .idea/
67
+ .vscode/
68
+ *.swp
69
+ *.swo
70
+ *~
71
+
72
+ # Jupyter Notebook
73
+ .ipynb_checkpoints
74
+
75
+ # pyenv
76
+ .python-version
77
+
78
+ # Node.js
79
+ node_modules/
80
+ npm-debug.log*
81
+ yarn-debug.log*
82
+ yarn-error.log*
83
+
84
+ # Frontend build artifacts (keep the static directory but not its contents except .gitkeep)
85
+ # Note: Built assets are not committed, they're built during install via hatch hook
86
+ src/refast_grid/static/*.js
87
+ src/refast_grid/static/*.css
88
+ !src/refast_grid/static/.gitkeep
89
+
90
+ # OS files
91
+ .DS_Store
92
+ Thumbs.db
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Najeem Muhammed
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
@@ -0,0 +1,139 @@
1
+ Metadata-Version: 2.4
2
+ Name: refast_grid
3
+ Version: 0.2.0
4
+ Summary: Spreadsheet component for refast
5
+ Project-URL: Homepage, https://github.com/idling-mind/refast_grid
6
+ Project-URL: Bug Tracker, https://github.com/idling-mind/refast_grid/issues
7
+ Project-URL: Documentation, https://github.com/idling-mind/refast_grid#readme
8
+ Author-email: Najeem Muhammed <najeem@gmail.com>
9
+ License-File: LICENSE
10
+ Classifier: Framework :: FastAPI
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
19
+ Requires-Python: >=3.11
20
+ Requires-Dist: refast>=0.0.1
21
+ Provides-Extra: dev
22
+ Requires-Dist: pytest; extra == 'dev'
23
+ Requires-Dist: ruff; extra == 'dev'
24
+ Requires-Dist: ty; extra == 'dev'
25
+ Description-Content-Type: text/markdown
26
+
27
+ # refast_grid
28
+
29
+ Spreadsheet component for refast
30
+
31
+ A [Refast](https://github.com/idling-mind/refast) extension that provides the `RefastGrid` component.
32
+
33
+ ## Installation
34
+
35
+ ```bash
36
+ pip install refast_grid
37
+ ```
38
+
39
+ ## Usage
40
+
41
+ ### Option 1: Auto-Discovery (Recommended)
42
+
43
+ When you install the package, Refast will automatically discover and load the extension:
44
+
45
+ ```python
46
+ from fastapi import FastAPI
47
+ from refast import RefastApp, Context
48
+ from refast.components import Container, Button, Row
49
+ from refast_grid import RefastGrid
50
+
51
+ # Extension is auto-discovered, no need to manually register
52
+ ui = RefastApp(title="RefastGrid Demo")
53
+
54
+
55
+ @ui.page("/")
56
+ def home(ctx: Context):
57
+ return Container(
58
+ children=[
59
+ RefastGrid(
60
+ id="my-component",
61
+ value="Hello, World!",
62
+ ),
63
+ ]
64
+ )
65
+
66
+
67
+ app = FastAPI()
68
+ app.include_router(ui.router)
69
+
70
+ if __name__ == "__main__":
71
+ import uvicorn
72
+ uvicorn.run(app, host="0.0.0.0", port=8000)
73
+ ```
74
+
75
+ ### Option 2: Manual Registration
76
+
77
+ If you want to disable auto-discovery and register extensions manually:
78
+
79
+ ```python
80
+ from refast import RefastApp
81
+ from refast_grid import RefastGrid, RefastGridExtension
82
+
83
+ ui = RefastApp(
84
+ title="RefastGrid Demo",
85
+ auto_discover_extensions=False,
86
+ extensions=[RefastGridExtension()],
87
+ )
88
+ ```
89
+
90
+ ## Component Props
91
+
92
+ | Prop | Type | Default | Description |
93
+ |------|------|---------|-------------|
94
+ | `value` | str | "" | The value to display |
95
+ | `on_change` | Callback | None | Called when the value changes |
96
+ | `id` | str | None | Component ID |
97
+ | `class_name` | str | "" | CSS classes to apply |
98
+
99
+ ## Development
100
+
101
+ ### Prerequisites
102
+
103
+ - Python 3.11+
104
+ - Node.js 18+
105
+ - npm
106
+
107
+ ### Building the Frontend
108
+
109
+ ```bash
110
+ cd frontend
111
+ npm install
112
+ npm run build
113
+ ```
114
+
115
+ This builds the UMD bundle to `src/refast_grid/static/`.
116
+
117
+ ### Installing Locally
118
+
119
+ ```bash
120
+ # Install with automatic frontend build (via hatch hook)
121
+ pip install -e .
122
+
123
+ # Or build frontend first, then install
124
+ cd frontend && npm install && npm run build && cd ..
125
+ pip install -e .
126
+ ```
127
+
128
+ ### Running the Example
129
+
130
+ ```bash
131
+ python usage.py
132
+ ```
133
+
134
+ Then open http://localhost:8000 in your browser.
135
+
136
+
137
+ ## License
138
+
139
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
@@ -0,0 +1,113 @@
1
+ # refast_grid
2
+
3
+ Spreadsheet component for refast
4
+
5
+ A [Refast](https://github.com/idling-mind/refast) extension that provides the `RefastGrid` component.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ pip install refast_grid
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ### Option 1: Auto-Discovery (Recommended)
16
+
17
+ When you install the package, Refast will automatically discover and load the extension:
18
+
19
+ ```python
20
+ from fastapi import FastAPI
21
+ from refast import RefastApp, Context
22
+ from refast.components import Container, Button, Row
23
+ from refast_grid import RefastGrid
24
+
25
+ # Extension is auto-discovered, no need to manually register
26
+ ui = RefastApp(title="RefastGrid Demo")
27
+
28
+
29
+ @ui.page("/")
30
+ def home(ctx: Context):
31
+ return Container(
32
+ children=[
33
+ RefastGrid(
34
+ id="my-component",
35
+ value="Hello, World!",
36
+ ),
37
+ ]
38
+ )
39
+
40
+
41
+ app = FastAPI()
42
+ app.include_router(ui.router)
43
+
44
+ if __name__ == "__main__":
45
+ import uvicorn
46
+ uvicorn.run(app, host="0.0.0.0", port=8000)
47
+ ```
48
+
49
+ ### Option 2: Manual Registration
50
+
51
+ If you want to disable auto-discovery and register extensions manually:
52
+
53
+ ```python
54
+ from refast import RefastApp
55
+ from refast_grid import RefastGrid, RefastGridExtension
56
+
57
+ ui = RefastApp(
58
+ title="RefastGrid Demo",
59
+ auto_discover_extensions=False,
60
+ extensions=[RefastGridExtension()],
61
+ )
62
+ ```
63
+
64
+ ## Component Props
65
+
66
+ | Prop | Type | Default | Description |
67
+ |------|------|---------|-------------|
68
+ | `value` | str | "" | The value to display |
69
+ | `on_change` | Callback | None | Called when the value changes |
70
+ | `id` | str | None | Component ID |
71
+ | `class_name` | str | "" | CSS classes to apply |
72
+
73
+ ## Development
74
+
75
+ ### Prerequisites
76
+
77
+ - Python 3.11+
78
+ - Node.js 18+
79
+ - npm
80
+
81
+ ### Building the Frontend
82
+
83
+ ```bash
84
+ cd frontend
85
+ npm install
86
+ npm run build
87
+ ```
88
+
89
+ This builds the UMD bundle to `src/refast_grid/static/`.
90
+
91
+ ### Installing Locally
92
+
93
+ ```bash
94
+ # Install with automatic frontend build (via hatch hook)
95
+ pip install -e .
96
+
97
+ # Or build frontend first, then install
98
+ cd frontend && npm install && npm run build && cd ..
99
+ pip install -e .
100
+ ```
101
+
102
+ ### Running the Example
103
+
104
+ ```bash
105
+ python usage.py
106
+ ```
107
+
108
+ Then open http://localhost:8000 in your browser.
109
+
110
+
111
+ ## License
112
+
113
+ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.