@appius-fr/apx 2.7.1 → 2.8.0

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.
package/APX.mjs CHANGED
@@ -3,8 +3,7 @@ import augmentWithTristate from './modules/tristate/tristate.mjs';
3
3
  import augmentWithScrollableTable from './modules/scrollableTable/scrollableTable.mjs';
4
4
  import dialog from './modules/dialog/dialog.mjs';
5
5
  import toast from './modules/toast/toast.mjs';
6
- import { loadCss } from './modules/common.mjs';
7
- import { augmentWithPack, tools } from './modules/tools/exports.mjs';
6
+ import { augmentWithPack, tools, loadCss } from './modules/tools/exports.mjs';
8
7
 
9
8
  /**
10
9
  * Creates an APX object that wraps one or more HTML elements.
package/README.md CHANGED
@@ -123,9 +123,9 @@ APX('table.my-table').scrollableTable('refresh');
123
123
 
124
124
  ### `tools` (since 2.6.0)
125
125
 
126
- The `tools` module provides utility functions for common web development tasks. Currently includes form handling utilities with more tools planned for future releases.
126
+ The `tools` module provides utility functions for common web development tasks: form handling (form-packer), dynamic CSS loading (`loadCss`), scrollbar measurement (`getScrollbarSize`), and more planned for future releases. Since 2.8.0, `loadCss` lives in tools (upgraded; idempotent, rejects on failure, optional options) and `getScrollbarSize` was added.
127
127
 
128
- **Documentation:** [`modules/tools/README.md`](./modules/tools/README.md)
128
+ **Documentation:** [`modules/tools/README.md`](./modules/tools/README.md) · **Changelog:** [`modules/tools/CHANGELOG.md`](./modules/tools/CHANGELOG.md)
129
129
 
130
130
  **Quick Start:**
131
131
  ```javascript
@@ -133,20 +133,26 @@ The `tools` module provides utility functions for common web development tasks.
133
133
  const data = APX('form#myForm').pack();
134
134
  // or
135
135
  const data = APX.tools.packFormToJSON(document.querySelector('#myForm'));
136
+
137
+ // Load CSS (idempotent; since 2.8.0 also APX.tools.loadCss)
138
+ await APX.loadCss('/path/to/styles.css');
139
+
140
+ // Scrollbar size in pixels (cached; since 2.8.0)
141
+ const scrollbarWidth = APX.tools.getScrollbarSize();
136
142
  ```
137
143
 
138
- **Sub-modules:**
144
+ **Sub-modules / utilities:**
139
145
  - **`form-packer`**: Convert HTML forms to JSON with support for nested objects, arrays, and complex structures.
140
146
  - Documentation: [`modules/tools/form-packer/README.md`](./modules/tools/form-packer/README.md)
147
+ - **`loadCss`** (since 2.8.0 in tools): Dynamic CSS loading; also available as `APX.loadCss`. See [`modules/tools/README.md`](./modules/tools/README.md).
148
+ - **`getScrollbarSize`** (since 2.8.0): Scrollbar size in pixels; `APX.tools.getScrollbarSize()`.
141
149
 
142
150
  **Demo page:**
143
151
  - `demo/modules/tools/index.html` (interactive form examples and validation)
144
152
 
145
153
  ### Utilities
146
154
 
147
- - **`loadCss`**: Dynamically load CSS files into your document.
148
-
149
- Documentation: [`modules/common.mjs`](./modules/common.mjs)
155
+ - **`loadCss`**: Dynamically load CSS files (since 2.8.0: idempotent, rejects on failure, optional `options`). Use `APX.loadCss(url)` or `APX.tools.loadCss(url, options?)`. See [`modules/tools/README.md`](./modules/tools/README.md).
150
156
 
151
157
  ## Usage
152
158
 
@@ -198,7 +204,7 @@ const apx7 = APX(() => APX('.example'));
198
204
 
199
205
  ### Utilities
200
206
 
201
- - **`APX.loadCss()`**: Dynamically load CSS files.
207
+ - **`APX.loadCss(url, options?)`**: Dynamically load CSS files (since 2.8.0: idempotent, rejects on failure; optional `options`: `id`, `media`, `before`). Also `APX.tools.loadCss()`.
202
208
  - **`APX.dialog()`**: Manage and display dialogs. See [`modules/dialog/README.md`](./modules/dialog/README.md)
203
209
  - **`APX.toast`**: Toast notification system. See [`modules/toast/README.md`](./modules/toast/README.md)
204
210
  - **`APX('table').scrollableTable(options)`**: Scrollable tbody with fixed thead/tfoot. See [`modules/scrollableTable/README.md`](./modules/scrollableTable/README.md)