django-fast-treenode 2.0.11__py3-none-any.whl → 2.1.0__py3-none-any.whl
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.
- {django_fast_treenode-2.0.11.dist-info → django_fast_treenode-2.1.0.dist-info}/LICENSE +2 -2
- django_fast_treenode-2.1.0.dist-info/METADATA +161 -0
- django_fast_treenode-2.1.0.dist-info/RECORD +75 -0
- {django_fast_treenode-2.0.11.dist-info → django_fast_treenode-2.1.0.dist-info}/WHEEL +1 -1
- treenode/admin/__init__.py +9 -0
- treenode/admin/admin.py +295 -0
- treenode/admin/changelist.py +65 -0
- treenode/admin/mixins.py +302 -0
- treenode/apps.py +12 -1
- treenode/cache.py +2 -2
- treenode/docs/.gitignore +0 -0
- treenode/docs/about.md +36 -0
- treenode/docs/admin.md +104 -0
- treenode/docs/api.md +739 -0
- treenode/docs/cache.md +187 -0
- treenode/docs/import_export.md +35 -0
- treenode/docs/index.md +30 -0
- treenode/docs/installation.md +74 -0
- treenode/docs/migration.md +145 -0
- treenode/docs/models.md +128 -0
- treenode/docs/roadmap.md +45 -0
- treenode/forms.py +8 -10
- treenode/managers/__init__.py +21 -0
- treenode/managers/adjacency.py +203 -0
- treenode/managers/closure.py +278 -0
- treenode/models/__init__.py +2 -1
- treenode/models/adjacency.py +343 -0
- treenode/models/classproperty.py +3 -0
- treenode/models/closure.py +23 -24
- treenode/models/factory.py +12 -2
- treenode/models/mixins/__init__.py +23 -0
- treenode/models/mixins/ancestors.py +65 -0
- treenode/models/mixins/children.py +81 -0
- treenode/models/mixins/descendants.py +66 -0
- treenode/models/mixins/family.py +63 -0
- treenode/models/mixins/logical.py +68 -0
- treenode/models/mixins/node.py +210 -0
- treenode/models/mixins/properties.py +156 -0
- treenode/models/mixins/roots.py +96 -0
- treenode/models/mixins/siblings.py +99 -0
- treenode/models/mixins/tree.py +344 -0
- treenode/signals.py +26 -0
- treenode/static/treenode/css/tree_widget.css +201 -31
- treenode/static/treenode/css/treenode_admin.css +48 -41
- treenode/static/treenode/js/tree_widget.js +269 -131
- treenode/static/treenode/js/treenode_admin.js +131 -171
- treenode/templates/admin/tree_node_changelist.html +6 -0
- treenode/templates/admin/treenode_ajax_rows.html +7 -0
- treenode/tests/tests.py +488 -0
- treenode/urls.py +10 -6
- treenode/utils/__init__.py +2 -0
- treenode/utils/aid.py +46 -0
- treenode/utils/base16.py +38 -0
- treenode/utils/base36.py +3 -1
- treenode/utils/db.py +116 -0
- treenode/utils/exporter.py +2 -0
- treenode/utils/importer.py +0 -1
- treenode/utils/radix.py +61 -0
- treenode/version.py +2 -2
- treenode/views.py +118 -43
- treenode/widgets.py +91 -43
- django_fast_treenode-2.0.11.dist-info/METADATA +0 -698
- django_fast_treenode-2.0.11.dist-info/RECORD +0 -42
- treenode/admin.py +0 -439
- treenode/docs/Documentation +0 -636
- treenode/managers.py +0 -419
- treenode/models/proxy.py +0 -669
- {django_fast_treenode-2.0.11.dist-info → django_fast_treenode-2.1.0.dist-info}/top_level.txt +0 -0
@@ -11,52 +11,222 @@ Features:
|
|
11
11
|
- Custom styling for search fields and selection indicators.
|
12
12
|
- Enhances usability in tree-based data selection.
|
13
13
|
|
14
|
+
Main styles:
|
15
|
+
.tree-widget-display: styles the display area of the selected item, adding
|
16
|
+
padding, borders, and background.
|
17
|
+
.tree-dropdown-arrow: styles the dropdown arrow.
|
18
|
+
.tree-widget-dropdown: defines the style of the dropdown, including positioning,
|
19
|
+
size, and shadows.
|
20
|
+
.tree-search-wrapper: decorates the search area inside the dropdown.
|
21
|
+
.tree-search: styles the search input.
|
22
|
+
.tree-clear-button: button to clear the search input.
|
23
|
+
.tree-list and .tree-node: styles for the list and its items.
|
24
|
+
.expand-button: button to expand child elements.
|
25
|
+
|
26
|
+
Dark theme:
|
27
|
+
Uses the .dark-theme class to apply dark styles. Changes the background,
|
28
|
+
borders, and text color for the corresponding elements. Ensures comfortable use
|
29
|
+
of the widget in dark mode.
|
30
|
+
|
14
31
|
Version: 2.0.0
|
15
32
|
Author: Timur Kady
|
16
33
|
Email: timurkady@yandex.com
|
34
|
+
|
17
35
|
*/
|
18
36
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
37
|
+
.form-row.field-tn_parent {
|
38
|
+
position: relative;
|
39
|
+
overflow: visible !important;
|
40
|
+
z-index: auto;
|
41
|
+
}
|
42
|
+
|
43
|
+
.tree-widget {
|
44
|
+
position: relative;
|
45
|
+
width: 100%;
|
46
|
+
font-family: Arial, sans-serif;
|
47
|
+
}
|
48
|
+
|
49
|
+
.tree-widget-display {
|
50
|
+
display: flex;
|
51
|
+
align-items: center;
|
52
|
+
justify-content: space-between;
|
53
|
+
border: 1px solid #aaa;
|
54
|
+
border-radius: 4px;
|
55
|
+
background-color: #fff;
|
56
|
+
cursor: pointer;
|
57
|
+
transition: border-color 0.2s;
|
58
|
+
}
|
59
|
+
|
60
|
+
.tree-widget-display:hover {
|
61
|
+
border-color: #333;
|
62
|
+
}
|
63
|
+
|
64
|
+
.tree-dropdown-arrow {
|
65
|
+
font-size: 0.8em;
|
66
|
+
color: #888;
|
67
|
+
display: inline-block;
|
68
|
+
height: 100%;
|
69
|
+
background-color: lightgrey;
|
70
|
+
padding: 8px;
|
71
|
+
margin: 0;
|
72
|
+
border-radius: 0 4px 4px 0;
|
73
|
+
}
|
74
|
+
|
75
|
+
.tree-widget-dropdown {
|
76
|
+
display: none;
|
77
|
+
position: absolute;
|
78
|
+
top: 100%;
|
79
|
+
left: 0;
|
80
|
+
width: 100%;
|
81
|
+
max-height: 242px;
|
82
|
+
overflow-y: auto;
|
83
|
+
border: 1px solid #aaa;
|
84
|
+
border-top: none;
|
85
|
+
border-radius: 0 3px 3px 0;
|
86
|
+
background-color: #fff;
|
87
|
+
z-index: 1000;
|
88
|
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
|
89
|
+
}
|
90
|
+
|
91
|
+
.tree-search-wrapper {
|
92
|
+
display: flex;
|
93
|
+
align-items: center;
|
94
|
+
padding: 6px;
|
95
|
+
border-bottom: 1px solid #ddd;
|
96
|
+
background-color: #f9f9f9;
|
97
|
+
}
|
98
|
+
|
99
|
+
.tree-search-icon {
|
100
|
+
margin-right: 6px;
|
101
|
+
font-size: 1.3em;
|
102
|
+
}
|
103
|
+
|
104
|
+
.tree-search {
|
105
|
+
flex-grow: 1;
|
106
|
+
padding: 6px;
|
107
|
+
border: 1px solid #ccc;
|
108
|
+
border-radius: 4px;
|
109
|
+
font-size: 1em;
|
110
|
+
}
|
111
|
+
|
112
|
+
.tree-search-clear{
|
113
|
+
border: none;
|
114
|
+
border-radius: 3px;
|
115
|
+
background: none;
|
116
|
+
font-size: 1.8em;
|
117
|
+
cursor: pointer;
|
118
|
+
}
|
119
|
+
|
120
|
+
.tree-clear-button {
|
121
|
+
background: none;
|
122
|
+
border: none;
|
123
|
+
font-size: 1.2em;
|
124
|
+
color: #888;
|
125
|
+
cursor: pointer;
|
126
|
+
margin-left: 6px;
|
127
|
+
}
|
128
|
+
|
129
|
+
.tree-list {
|
130
|
+
list-style: none;
|
131
|
+
margin: 0 !important;
|
132
|
+
padding: 0 !important;
|
133
|
+
}
|
134
|
+
|
135
|
+
.tree-node {
|
136
|
+
display: block !important;
|
137
|
+
padding: 6px 0px !important;
|
138
|
+
cursor: pointer;
|
139
|
+
transition: background-color 0.2s;
|
140
|
+
}
|
141
|
+
|
142
|
+
.tree-node:hover {
|
143
|
+
background-color: #f0f0f0;
|
144
|
+
}
|
145
|
+
|
146
|
+
.tree-node[data-level="1"] {
|
147
|
+
padding-left: 20px;
|
148
|
+
}
|
149
|
+
|
150
|
+
.tree-node[data-level="2"] {
|
151
|
+
padding-left: 40px;
|
152
|
+
}
|
153
|
+
|
154
|
+
.expand-button {
|
155
|
+
display: inline-block;
|
156
|
+
width: 18px;
|
157
|
+
height: 18px;
|
158
|
+
background: var(--button-bg);
|
159
|
+
color: var(--button-fg);
|
160
|
+
border-radius: 3px;
|
161
|
+
border: none;
|
162
|
+
margin: 0px 5px;
|
163
|
+
cursor: pointer;
|
164
|
+
font-size: 12px;
|
165
|
+
line-height: 18px;
|
166
|
+
padding: 0px;
|
167
|
+
opacity: 0.8;
|
168
|
+
}
|
169
|
+
|
170
|
+
.no-expand {
|
171
|
+
display: inline-block;
|
172
|
+
width: 18px;
|
173
|
+
height: 18px;
|
174
|
+
border: none;
|
175
|
+
margin: 0px 5px;
|
176
|
+
}
|
177
|
+
|
178
|
+
.selected-node {
|
179
|
+
margin: 6px 12px;
|
180
|
+
}
|
181
|
+
|
182
|
+
/* Тёмная тема */
|
183
|
+
.dark-theme .tree-widget-display {
|
184
|
+
background-color: #333;
|
185
|
+
border-color: #555;
|
186
|
+
color: #eee;
|
187
|
+
}
|
188
|
+
|
189
|
+
.dark-theme .tree-dropdown-arrow {
|
190
|
+
color: #ccc;
|
191
|
+
}
|
192
|
+
|
193
|
+
.dark-theme .tree-widget-dropdown {
|
194
|
+
background-color: #444;
|
195
|
+
border-color: #555;
|
196
|
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
|
197
|
+
}
|
198
|
+
|
199
|
+
.dark-theme .tree-search-wrapper {
|
200
|
+
background-color: #555;
|
201
|
+
border-bottom-color: #666;
|
202
|
+
}
|
203
|
+
|
204
|
+
.dark-theme .tree-search {
|
205
|
+
background-color: #666;
|
206
|
+
border-color: #777;
|
207
|
+
color: #eee;
|
24
208
|
}
|
25
209
|
|
26
|
-
|
27
|
-
|
28
|
-
background-color: transparent !important;
|
29
|
-
color: #ddd !important;
|
210
|
+
.dark-theme .tree-search::placeholder {
|
211
|
+
color: #ccc;
|
30
212
|
}
|
31
213
|
|
32
|
-
|
33
|
-
|
34
|
-
.select2-dropdown.dark-theme .select2-results__option--selected {
|
35
|
-
background-color: #555 !important;
|
36
|
-
color: #fff !important;
|
214
|
+
.dark-theme .tree-clear-button {
|
215
|
+
color: #ccc;
|
37
216
|
}
|
38
217
|
|
39
|
-
|
40
|
-
|
41
|
-
background-color: #2c2c2c !important;
|
42
|
-
color: #ddd !important;
|
43
|
-
border: 1px solid #444 !important;
|
44
|
-
outline: none !important;
|
218
|
+
.dark-theme .tree-node {
|
219
|
+
color: #eee;
|
45
220
|
}
|
46
221
|
|
47
|
-
|
48
|
-
|
49
|
-
background-color: #2c2c2c !important;
|
50
|
-
border: 1px solid #444 !important;
|
51
|
-
color: #ddd !important;
|
222
|
+
.dark-theme .tree-node:hover {
|
223
|
+
background-color: #555;
|
52
224
|
}
|
53
225
|
|
54
|
-
|
55
|
-
|
56
|
-
border-color: #ddd transparent transparent transparent !important;
|
226
|
+
.dark-theme .expand-button {
|
227
|
+
color: #ccc;
|
57
228
|
}
|
58
229
|
|
59
|
-
|
60
|
-
|
61
|
-
color: #ddd !important;
|
230
|
+
.dark-theme .selected-node {
|
231
|
+
color: #eee;
|
62
232
|
}
|
@@ -11,9 +11,10 @@ Features:
|
|
11
11
|
- Smooth hover effects and animations.
|
12
12
|
- Consistent layout adjustments for better UI interaction.
|
13
13
|
|
14
|
-
Version: 2.
|
14
|
+
Version: 2.1.0
|
15
15
|
Author: Timur Kady
|
16
16
|
Email: timurkady@yandex.com
|
17
|
+
|
17
18
|
*/
|
18
19
|
|
19
20
|
|
@@ -22,13 +23,17 @@ Email: timurkady@yandex.com
|
|
22
23
|
100% {width: 100px; height: 100px;}
|
23
24
|
}
|
24
25
|
|
26
|
+
.field-drag, .field-toggle {
|
27
|
+
width: 18px !important;
|
28
|
+
text-align: center !important;
|
29
|
+
padding: 8px 0px !important;
|
30
|
+
}
|
31
|
+
|
25
32
|
.treenode-space {
|
26
33
|
display: inline-block;
|
27
|
-
width:
|
28
|
-
height:
|
29
|
-
margin
|
30
|
-
margin-bottom: 0px;
|
31
|
-
margin-right: 7px !important;
|
34
|
+
width: 18px;
|
35
|
+
height: 18px;
|
36
|
+
margin: 0px 3px !important;
|
32
37
|
background-color: transparent;
|
33
38
|
border: 1px solid transparent;
|
34
39
|
padding: 1px;
|
@@ -36,25 +41,28 @@ Email: timurkady@yandex.com
|
|
36
41
|
|
37
42
|
.treenode-toggle {
|
38
43
|
display: inline-block;
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
44
|
+
width: 18px;
|
45
|
+
height: 18px;
|
46
|
+
background: var(--button-bg);
|
47
|
+
color: var(--button-fg);
|
48
|
+
border-radius: 3px;
|
49
|
+
border: none;
|
50
|
+
margin: 0px 5px;
|
46
51
|
cursor: pointer;
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
52
|
+
font-size: 12px;
|
53
|
+
line-height: 18px;
|
54
|
+
padding: 0px;
|
55
|
+
opacity: 0.8;
|
56
|
+
transition: opacity 0.2s ease, color 0.2s ease;
|
57
|
+
}
|
58
|
+
|
59
|
+
.treenode-toggle[expanded="true"] {
|
60
|
+
color: green;
|
53
61
|
}
|
54
62
|
|
63
|
+
|
55
64
|
.treenode-toggle:hover {
|
56
|
-
|
57
|
-
color: #007bff;
|
65
|
+
opacity: 1.0;
|
58
66
|
}
|
59
67
|
|
60
68
|
.dark-theme .treenode-toggle {
|
@@ -68,24 +76,6 @@ Email: timurkady@yandex.com
|
|
68
76
|
color: #fff;
|
69
77
|
}
|
70
78
|
|
71
|
-
.treenode-toggle {
|
72
|
-
font-weight: bold;
|
73
|
-
display: inline-block;
|
74
|
-
|
75
|
-
text-align: center;
|
76
|
-
cursor: pointer;
|
77
|
-
margin-right: 5px;
|
78
|
-
border-radius: 4px;
|
79
|
-
|
80
|
-
padding: 2px;
|
81
|
-
transition: background-color 0.2s ease, color 0.2s ease;
|
82
|
-
}
|
83
|
-
|
84
|
-
.treenode-toggle:hover {
|
85
|
-
background-color: #e0e0e0;
|
86
|
-
color: #007bff;
|
87
|
-
}
|
88
|
-
|
89
79
|
.dark-theme .treenode-toggle {
|
90
80
|
color: #ccc;
|
91
81
|
background-color: #444;
|
@@ -97,10 +87,27 @@ Email: timurkady@yandex.com
|
|
97
87
|
color: #fff;
|
98
88
|
}
|
99
89
|
|
100
|
-
.treenode-
|
90
|
+
.treenode-drag-handle {
|
101
91
|
display: inline-block;
|
92
|
+
text-align: center;
|
93
|
+
font-weight: bold;
|
94
|
+
font-size: 10px;
|
95
|
+
width: 10px;
|
96
|
+
height: 10px;
|
97
|
+
line-height: 10px;
|
98
|
+
padding: 1px;
|
99
|
+
cursor: ns-resize;
|
100
|
+
opacity: 0.25;
|
102
101
|
}
|
103
102
|
|
104
|
-
.
|
103
|
+
.treenode-drag-handle:hover {
|
104
|
+
opacity: 1.0;
|
105
|
+
}
|
106
|
+
|
107
|
+
.dark-theme treenode-drag-handle {
|
105
108
|
color: #ccc;
|
106
109
|
}
|
110
|
+
|
111
|
+
.treenode-wrapper {
|
112
|
+
display: inline-block;
|
113
|
+
}
|