yafowil.widget.array 2.0.0__tar.gz → 2.0.1__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.
Files changed (28) hide show
  1. {yafowil_widget_array-2.0.0 → yafowil_widget_array-2.0.1}/.gitignore +1 -1
  2. {yafowil_widget_array-2.0.0 → yafowil_widget_array-2.0.1}/CHANGES.rst +58 -0
  3. {yafowil_widget_array-2.0.0 → yafowil_widget_array-2.0.1}/PKG-INFO +3 -2
  4. yafowil_widget_array-2.0.1/biome.json +31 -0
  5. yafowil_widget_array-2.0.1/include.mk +16 -0
  6. {yafowil_widget_array-2.0.0 → yafowil_widget_array-2.0.1}/pyproject.toml +24 -1
  7. {yafowil_widget_array-2.0.0 → yafowil_widget_array-2.0.1}/src/yafowil/widget/array/__init__.py +80 -96
  8. {yafowil_widget_array-2.0.0 → yafowil_widget_array-2.0.1}/src/yafowil/widget/array/example.py +210 -125
  9. {yafowil_widget_array-2.0.0 → yafowil_widget_array-2.0.1}/src/yafowil/widget/array/resources/bootstrap5/widget.js +48 -52
  10. yafowil_widget_array-2.0.1/src/yafowil/widget/array/resources/bootstrap5/widget.min.js +1 -0
  11. {yafowil_widget_array-2.0.0 → yafowil_widget_array-2.0.1}/src/yafowil/widget/array/resources/default/widget.js +48 -52
  12. yafowil_widget_array-2.0.1/src/yafowil/widget/array/resources/default/widget.min.js +1 -0
  13. {yafowil_widget_array-2.0.0 → yafowil_widget_array-2.0.1}/src/yafowil/widget/array/tests/test_widget.py +547 -608
  14. {yafowil_widget_array-2.0.0 → yafowil_widget_array-2.0.1}/src/yafowil/widget/array/widget.py +54 -53
  15. yafowil_widget_array-2.0.0/src/yafowil/widget/array/resources/bootstrap5/widget.min.js +0 -1
  16. yafowil_widget_array-2.0.0/src/yafowil/widget/array/resources/default/widget.min.js +0 -1
  17. {yafowil_widget_array-2.0.0 → yafowil_widget_array-2.0.1}/LICENSE.rst +0 -0
  18. {yafowil_widget_array-2.0.0 → yafowil_widget_array-2.0.1}/README.rst +0 -0
  19. {yafowil_widget_array-2.0.0 → yafowil_widget_array-2.0.1}/src/yafowil/widget/array/resources/bootstrap/widget.min.css +0 -0
  20. {yafowil_widget_array-2.0.0 → yafowil_widget_array-2.0.1}/src/yafowil/widget/array/resources/bootstrap5/widget.min.css +0 -0
  21. {yafowil_widget_array-2.0.0 → yafowil_widget_array-2.0.1}/src/yafowil/widget/array/resources/default/images/icon_add.png +0 -0
  22. {yafowil_widget_array-2.0.0 → yafowil_widget_array-2.0.1}/src/yafowil/widget/array/resources/default/images/icon_down.png +0 -0
  23. {yafowil_widget_array-2.0.0 → yafowil_widget_array-2.0.1}/src/yafowil/widget/array/resources/default/images/icon_down_disabled.png +0 -0
  24. {yafowil_widget_array-2.0.0 → yafowil_widget_array-2.0.1}/src/yafowil/widget/array/resources/default/images/icon_remove.png +0 -0
  25. {yafowil_widget_array-2.0.0 → yafowil_widget_array-2.0.1}/src/yafowil/widget/array/resources/default/images/icon_up.png +0 -0
  26. {yafowil_widget_array-2.0.0 → yafowil_widget_array-2.0.1}/src/yafowil/widget/array/resources/default/images/icon_up_disabled.png +0 -0
  27. {yafowil_widget_array-2.0.0 → yafowil_widget_array-2.0.1}/src/yafowil/widget/array/resources/default/widget.min.css +0 -0
  28. {yafowil_widget_array-2.0.0 → yafowil_widget_array-2.0.1}/src/yafowil/widget/array/resources/plone5/widget.min.css +0 -0
@@ -9,7 +9,7 @@
9
9
  /dist/
10
10
  /htmlcov/
11
11
  /node_modules/
12
- /pnpm-lock.yaml
12
+ /package-lock.json
13
13
  /py2/
14
14
  /py3/
15
15
  /pypy3/
@@ -1,6 +1,64 @@
1
1
  Changes
2
2
  =======
3
3
 
4
+ 2.0.1 (2026-10-31)
5
+ ------------------
6
+
7
+ - Fix ids containing the dotted path of an array entry on adding, removing or
8
+ moving rows, e.g. the ``yafowil.widget.dict`` table id
9
+ ``dictwidget_myform.myarray.0.entry``. Such ids kept the template or old
10
+ index, or lost their ``.entry`` suffix.
11
+ [rnix]
12
+
13
+ - Fix names with a suffix after the index losing the suffix on adding, removing
14
+ or moving rows, e.g. the ``myform.myarray.0-exists`` marker of checkbox and
15
+ select widgets inside arrays.
16
+ [rnix]
17
+
18
+ - Fix the array path matching inside other names on adding, removing or moving
19
+ rows. E.g. the id ``array-arr-0-sub`` of an array inside the root array
20
+ ``arr`` became ``arra1-arr-0-sub``. The path now matches only at a name
21
+ delimiter and followed by an index.
22
+ [rnix]
23
+
24
+ - Extend the JS tests to 100 % coverage, all modules including bundles are
25
+ loaded by the tests now.
26
+ [rnix]
27
+
28
+ - Lint and format the JS code with biome. ``make check`` runs ``biome check``,
29
+ ``make format`` runs ``biome check --write`` (see ``include.mk``). Behavior
30
+ unchanged.
31
+ [rnix]
32
+
33
+ - JS tooling: Use ``pnpm-lock.yaml`` instead of ``package-lock.json``. Upgrade
34
+ ``@web/test-runner`` to 1.0 and run the JS tests headless in Chromium via
35
+ Playwright, installed in the JS CI workflow. Replace the unmaintained
36
+ ``rollup-plugin-terser`` with ``@rollup/plugin-terser``. Drop the accidental
37
+ ``install`` dev dependency. Pin patched versions of vulnerable transitive
38
+ dependencies via ``pnpm.overrides``.
39
+ [rnix]
40
+
41
+ - Modernise the code ruff flags as outdated: ``u''`` prefixes and ``.format()``
42
+ over f-strings. Behaviour unchanged. ``super(Class, self)`` is kept, see
43
+ ``cone.app``.
44
+ [rnix]
45
+
46
+ - Sort the imports with ruff (one per line, ``from`` imports first, no
47
+ sections) and format the code with ``ruff format`` (90 characters per line,
48
+ single quotes).
49
+ [rnix]
50
+
51
+ - Add ``qa.ruff`` domain to Makefile and pin the ruff configuration in
52
+ ``pyproject.toml``, ``make check`` runs ``ruff check``.
53
+ [rnix]
54
+
55
+ - Drop the Python 2 remnants: ``yafowil.compat`` usage and ``IS_PY2`` branches.
56
+ [rnix]
57
+
58
+ - Declare ``requires-python = ">=3.10"``.
59
+ [rnix]
60
+
61
+
4
62
  2.0.0 (2026-02-03)
5
63
  ------------------
6
64
 
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
1
+ Metadata-Version: 2.5
2
2
  Name: yafowil.widget.array
3
- Version: 2.0.0
3
+ Version: 2.0.1
4
4
  Summary: Array Widget for YAFOWIL
5
5
  Author-email: Yafowil Contributors <dev@conestack.org>
6
6
  License: Simplified BSD
@@ -15,6 +15,7 @@ Classifier: Programming Language :: Python :: 3.12
15
15
  Classifier: Programming Language :: Python :: 3.13
16
16
  Classifier: Programming Language :: Python :: 3.14
17
17
  Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
18
+ Requires-Python: >=3.10
18
19
  Requires-Dist: yafowil>3.99
19
20
  Provides-Extra: test
20
21
  Requires-Dist: lxml; extra == 'test'
@@ -0,0 +1,31 @@
1
+ {
2
+ "$schema": "https://biomejs.dev/schemas/2.6.3/schema.json",
3
+ "files": {
4
+ "includes": ["js/src/**/*.js", "js/tests/**/*.js"]
5
+ },
6
+ "formatter": {
7
+ "enabled": true,
8
+ "indentStyle": "space",
9
+ "indentWidth": 4,
10
+ "lineWidth": 100
11
+ },
12
+ "linter": {
13
+ "enabled": true,
14
+ "rules": {
15
+ "preset": "recommended",
16
+ "correctness": {
17
+ "noUnusedVariables": "warn"
18
+ },
19
+ "complexity": {
20
+ "noStaticOnlyClass": "off",
21
+ "noThisInStatic": "off"
22
+ }
23
+ }
24
+ },
25
+ "javascript": {
26
+ "formatter": {
27
+ "quoteStyle": "single",
28
+ "semicolons": "always"
29
+ }
30
+ }
31
+ }
@@ -0,0 +1,16 @@
1
+ ##############################################################################
2
+ # biome (JS linting and formatting)
3
+ ##############################################################################
4
+
5
+ .PHONY: biome-check
6
+ biome-check: $(NODEJS_TARGET)
7
+ @echo "Run biome check"
8
+ @biome check
9
+
10
+ .PHONY: biome-format
11
+ biome-format: $(NODEJS_TARGET)
12
+ @echo "Run biome format"
13
+ @biome check --write
14
+
15
+ CHECK_TARGETS+=biome-check
16
+ FORMAT_TARGETS+=biome-format
@@ -4,9 +4,10 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "yafowil.widget.array"
7
- version = "2.0.0"
7
+ version = "2.0.1"
8
8
  description = "Array Widget for YAFOWIL"
9
9
  readme = "README.rst"
10
+ requires-python = ">=3.10"
10
11
  license = {text = "Simplified BSD"}
11
12
  authors = [{name = "Yafowil Contributors", email = "dev@conestack.org"}]
12
13
  classifiers = [
@@ -66,5 +67,27 @@ consider_namespace_packages = true
66
67
  addopts = ["--import-mode=importlib"]
67
68
  pythonpath = "src"
68
69
 
70
+ [tool.coverage.run]
71
+ omit = ["*/example.py"]
72
+
73
+ [tool.ruff]
74
+ line-length = 90
75
+
76
+ [tool.ruff.lint]
77
+ select = ["E4", "E7", "E9", "F", "I", "UP"]
78
+ # UP008: zero-argument ``super()`` breaks on ``@plumbing`` decorated classes.
79
+ # UP031: ``%`` formatting is kept.
80
+ ignore = ["UP008", "UP031"]
81
+
82
+ [tool.ruff.lint.isort]
83
+ force-single-line = true
84
+ from-first = true
85
+ no-sections = true
86
+ lines-after-imports = 2
87
+ order-by-type = false
88
+
89
+ [tool.ruff.format]
90
+ quote-style = "single"
91
+
69
92
  [tool.zest-releaser]
70
93
  create-wheel = true
@@ -19,16 +19,18 @@ array_js = wr.ScriptResource(
19
19
  path='yafowil-array/default',
20
20
  depends='jquery-js',
21
21
  resource='widget.js',
22
- compressed='widget.min.js'
22
+ compressed='widget.min.js',
23
23
  )
24
24
 
25
25
  # B/C resources ##############################################################
26
26
 
27
- js = [{
28
- 'group': 'yafowil.widget.array.common',
29
- 'resource': 'default/widget.js',
30
- 'order': 20,
31
- }]
27
+ js = [
28
+ {
29
+ 'group': 'yafowil.widget.array.common',
30
+ 'resource': 'default/widget.js',
31
+ 'order': 20,
32
+ }
33
+ ]
32
34
 
33
35
 
34
36
  ##############################################################################
@@ -38,25 +40,27 @@ js = [{
38
40
  # webresource ################################################################
39
41
 
40
42
  default_resources = wr.ResourceGroup(
41
- name='yafowil.widget.array',
42
- directory=resources_dir,
43
- path='yafowil-array'
43
+ name='yafowil.widget.array', directory=resources_dir, path='yafowil-array'
44
44
  )
45
45
  default_resources.add(array_js)
46
- default_resources.add(wr.StyleResource(
47
- name='yafowil-array-css',
48
- directory=os.path.join(resources_dir, 'default'),
49
- path='yafowil-array/default',
50
- resource='widget.min.css'
51
- ))
46
+ default_resources.add(
47
+ wr.StyleResource(
48
+ name='yafowil-array-css',
49
+ directory=os.path.join(resources_dir, 'default'),
50
+ path='yafowil-array/default',
51
+ resource='widget.min.css',
52
+ )
53
+ )
52
54
 
53
55
  # B/C resources ##############################################################
54
56
 
55
- default_css = [{
56
- 'group': 'yafowil.widget.array.common',
57
- 'resource': 'default/widget.min.css',
58
- 'order': 20,
59
- }]
57
+ default_css = [
58
+ {
59
+ 'group': 'yafowil.widget.array.common',
60
+ 'resource': 'default/widget.min.css',
61
+ 'order': 20,
62
+ }
63
+ ]
60
64
 
61
65
 
62
66
  ##############################################################################
@@ -66,25 +70,27 @@ default_css = [{
66
70
  # webresource ################################################################
67
71
 
68
72
  bootstrap_resources = wr.ResourceGroup(
69
- name='yafowil.widget.array',
70
- directory=resources_dir,
71
- path='yafowil-array'
73
+ name='yafowil.widget.array', directory=resources_dir, path='yafowil-array'
72
74
  )
73
75
  bootstrap_resources.add(array_js)
74
- bootstrap_resources.add(wr.StyleResource(
75
- name='yafowil-array-css',
76
- directory=os.path.join(resources_dir, 'bootstrap'),
77
- path='yafowil-array/bootstrap',
78
- resource='widget.min.css'
79
- ))
76
+ bootstrap_resources.add(
77
+ wr.StyleResource(
78
+ name='yafowil-array-css',
79
+ directory=os.path.join(resources_dir, 'bootstrap'),
80
+ path='yafowil-array/bootstrap',
81
+ resource='widget.min.css',
82
+ )
83
+ )
80
84
 
81
85
  # B/C resources ##############################################################
82
86
 
83
- bootstrap_css = [{
84
- 'group': 'yafowil.widget.array.common',
85
- 'resource': 'bootstrap/widget.min.css',
86
- 'order': 20,
87
- }]
87
+ bootstrap_css = [
88
+ {
89
+ 'group': 'yafowil.widget.array.common',
90
+ 'resource': 'bootstrap/widget.min.css',
91
+ 'order': 20,
92
+ }
93
+ ]
88
94
 
89
95
 
90
96
  ##############################################################################
@@ -93,9 +99,7 @@ bootstrap_css = [{
93
99
 
94
100
  # webresource ################################################################
95
101
  bootstrap5_resources = wr.ResourceGroup(
96
- name='yafowil.widget.array',
97
- directory=resources_dir,
98
- path='yafowil-array'
102
+ name='yafowil.widget.array', directory=resources_dir, path='yafowil-array'
99
103
  )
100
104
  bootstrap5_js = wr.ScriptResource(
101
105
  name='yafowil-array-js',
@@ -103,24 +107,27 @@ bootstrap5_js = wr.ScriptResource(
103
107
  path='yafowil-array/bootstrap5',
104
108
  depends='jquery-js',
105
109
  resource='widget.js',
106
- compressed='widget.min.js'
110
+ compressed='widget.min.js',
107
111
  )
108
112
  bootstrap5_resources.add(bootstrap5_js)
109
- bootstrap5_resources.add(wr.StyleResource(
110
- name='yafowil-array-css',
111
- directory=os.path.join(resources_dir, 'bootstrap5'),
112
- path='yafowil-array/bootstrap5',
113
- resource='widget.min.css'
114
- ))
113
+ bootstrap5_resources.add(
114
+ wr.StyleResource(
115
+ name='yafowil-array-css',
116
+ directory=os.path.join(resources_dir, 'bootstrap5'),
117
+ path='yafowil-array/bootstrap5',
118
+ resource='widget.min.css',
119
+ )
120
+ )
115
121
 
116
122
  # B/C resources ##############################################################
117
123
 
118
- bootstrap5_css = [{
119
- 'group': 'yafowil.widget.array.common',
120
- 'resource': 'bootstrap5/widget.min.css',
121
- 'order': 20,
122
- }]
123
-
124
+ bootstrap5_css = [
125
+ {
126
+ 'group': 'yafowil.widget.array.common',
127
+ 'resource': 'bootstrap5/widget.min.css',
128
+ 'order': 20,
129
+ }
130
+ ]
124
131
 
125
132
 
126
133
  ##############################################################################
@@ -130,31 +137,34 @@ bootstrap5_css = [{
130
137
  # webresource ################################################################
131
138
 
132
139
  plone5_resources = wr.ResourceGroup(
133
- name='yafowil.widget.array',
134
- directory=resources_dir,
135
- path='yafowil-array'
140
+ name='yafowil.widget.array', directory=resources_dir, path='yafowil-array'
136
141
  )
137
142
  plone5_resources.add(array_js)
138
- plone5_resources.add(wr.StyleResource(
139
- name='yafowil-array-css',
140
- directory=os.path.join(resources_dir, 'plone5'),
141
- path='yafowil-array/plone5',
142
- resource='widget.min.css'
143
- ))
143
+ plone5_resources.add(
144
+ wr.StyleResource(
145
+ name='yafowil-array-css',
146
+ directory=os.path.join(resources_dir, 'plone5'),
147
+ path='yafowil-array/plone5',
148
+ resource='widget.min.css',
149
+ )
150
+ )
144
151
 
145
152
  # B/C resources ##############################################################
146
153
 
147
- plone5_css = [{
148
- 'group': 'yafowil.widget.array.common',
149
- 'resource': 'plone5/widget.min.css',
150
- 'order': 20,
151
- }]
154
+ plone5_css = [
155
+ {
156
+ 'group': 'yafowil.widget.array.common',
157
+ 'resource': 'plone5/widget.min.css',
158
+ 'order': 20,
159
+ }
160
+ ]
152
161
 
153
162
 
154
163
  ##############################################################################
155
164
  # Registration
156
165
  ##############################################################################
157
166
 
167
+
158
168
  @entry_point(order=10)
159
169
  def register():
160
170
  from yafowil.widget.array import widget # noqa
@@ -162,50 +172,24 @@ def register():
162
172
  widget_name = 'yafowil.widget.array'
163
173
 
164
174
  # Default
165
- factory.register_theme(
166
- 'default',
167
- widget_name,
168
- resources_dir,
169
- js=js,
170
- css=default_css
171
- )
175
+ factory.register_theme('default', widget_name, resources_dir, js=js, css=default_css)
172
176
  factory.register_resources('default', widget_name, default_resources)
173
177
 
174
178
  # Bootstrap
175
179
  factory.register_theme(
176
- ['bootstrap', 'bootstrap3'],
177
- widget_name,
178
- resources_dir,
179
- js=js,
180
- css=bootstrap_css
180
+ ['bootstrap', 'bootstrap3'], widget_name, resources_dir, js=js, css=bootstrap_css
181
181
  )
182
182
  factory.register_resources(
183
- ['bootstrap', 'bootstrap3'],
184
- widget_name,
185
- bootstrap_resources
183
+ ['bootstrap', 'bootstrap3'], widget_name, bootstrap_resources
186
184
  )
187
185
 
188
186
  # Bootstrap 5
189
187
  factory.register_theme(
190
- ['bootstrap5'],
191
- widget_name,
192
- resources_dir,
193
- js=bootstrap5_js,
194
- css=bootstrap5_css
188
+ ['bootstrap5'], widget_name, resources_dir, js=bootstrap5_js, css=bootstrap5_css
195
189
  )
196
190
 
197
- factory.register_resources(
198
- ['bootstrap5'],
199
- widget_name,
200
- bootstrap5_resources
201
- )
191
+ factory.register_resources(['bootstrap5'], widget_name, bootstrap5_resources)
202
192
 
203
193
  # Plone 5
204
- factory.register_theme(
205
- 'plone5',
206
- widget_name,
207
- resources_dir,
208
- js=js,
209
- css=plone5_css
210
- )
194
+ factory.register_theme('plone5', widget_name, resources_dir, js=js, css=plone5_css)
211
195
  factory.register_resources('plone5', widget_name, plone5_resources)