zidan-select 2.3.0 → 2.4.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/README.md +186 -72
- package/dist/file/plugin-file-core.css +8 -1
- package/dist/file/plugin-file-core.min.css +2 -2
- package/dist/file/plugin-file-theme.css +1 -1
- package/dist/file/plugin-file-theme.min.css +1 -1
- package/dist/file/zidan-file.d.ts +1 -1
- package/dist/file/zidan-file.js +94 -25
- package/dist/file/zidan-file.min.js +2 -2
- package/dist/plugin-core.css +109 -1
- package/dist/plugin-core.min.css +2 -2
- package/dist/plugin-theme.css +1 -1
- package/dist/plugin-theme.min.css +1 -1
- package/dist/select/plugin-select-core.css +1 -1
- package/dist/select/plugin-select-core.min.css +1 -1
- package/dist/select/plugin-select-theme.css +1 -1
- package/dist/select/plugin-select-theme.min.css +1 -1
- package/dist/select/zidan-select.d.ts +1 -1
- package/dist/select/zidan-select.js +233 -8
- package/dist/select/zidan-select.min.js +2 -2
- package/dist/zidan-form.js +383 -55
- package/dist/zidan-form.min.js +2 -2
- package/docs/build.md +66 -40
- package/docs/html-and-wordpress.md +20 -20
- package/docs/index.html +20 -8
- package/docs/options.md +76 -11
- package/docs/validation.md +8 -0
- package/package.json +6 -2
- package/plugin-core.css +109 -1
- package/plugin-theme.css +1 -1
- package/zidan-form.d.ts +28 -1
- package/zidan-form.js +383 -55
package/README.md
CHANGED
|
@@ -7,8 +7,8 @@ two separate stylesheets.
|
|
|
7
7
|
|
|
8
8
|
[](https://akhtar1985.github.io/zidan-select/)
|
|
9
9
|
[](https://www.npmjs.com/package/zidan-select)
|
|
10
|
-
[](docs/options.
|
|
11
|
-
[](LICENSE)
|
|
10
|
+
[](https://akhtar1985.github.io/zidan-select/docs/options.html)
|
|
11
|
+
[](https://github.com/akhtar1985/zidan-select/blob/main/LICENSE)
|
|
12
12
|
|
|
13
13
|
## Which files should you load?
|
|
14
14
|
|
|
@@ -28,9 +28,9 @@ bundle.
|
|
|
28
28
|
|
|
29
29
|
| Build | JavaScript (CDN) | CSS (CDN) |
|
|
30
30
|
| --- | --- | --- |
|
|
31
|
-
| Full — every control | [zidan-form.js](https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
32
|
-
| Select-only — ≈104 kB | [zidan-select.js](https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
33
|
-
| File-only — ≈82 kB | [zidan-file.js](https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
31
|
+
| Full — every control | [zidan-form.js](https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/zidan-form.js) | [plugin-core.css](https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/plugin-core.css) + [plugin-theme.css](https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/plugin-theme.css) |
|
|
32
|
+
| Select-only — ≈104 kB | [zidan-select.js](https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/dist/select/zidan-select.js) | [plugin-select-core.css](https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/dist/select/plugin-select-core.css) + [plugin-select-theme.css](https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/dist/select/plugin-select-theme.css) |
|
|
33
|
+
| File-only — ≈82 kB | [zidan-file.js](https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/dist/file/zidan-file.js) | [plugin-file-core.css](https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/dist/file/plugin-file-core.css) + [plugin-file-theme.css](https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/dist/file/plugin-file-theme.css) |
|
|
34
34
|
|
|
35
35
|
Copyable snippets, ESM files and per-file sizes live in
|
|
36
36
|
[Select-only and file-only builds](#select-only-and-file-only-builds); the
|
|
@@ -47,9 +47,9 @@ the pinned version:
|
|
|
47
47
|
|
|
48
48
|
| Build | JS (min) | CSS (min) |
|
|
49
49
|
| --- | --- | --- |
|
|
50
|
-
| Full | [zidan-form.min.js](https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
51
|
-
| Select-only | [zidan-select.min.js](https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
52
|
-
| File-only | [zidan-file.min.js](https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
50
|
+
| Full | [zidan-form.min.js](https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/dist/zidan-form.min.js) | [plugin-core.min.css](https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/dist/plugin-core.min.css) + [plugin-theme.min.css](https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/dist/plugin-theme.min.css) |
|
|
51
|
+
| Select-only | [zidan-select.min.js](https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/dist/select/zidan-select.min.js) | [plugin-select-core.min.css](https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/dist/select/plugin-select-core.min.css) + [plugin-select-theme.min.css](https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/dist/select/plugin-select-theme.min.css) |
|
|
52
|
+
| File-only | [zidan-file.min.js](https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/dist/file/zidan-file.min.js) | [plugin-file-core.min.css](https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/dist/file/plugin-file-core.min.css) + [plugin-file-theme.min.css](https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/dist/file/plugin-file-theme.min.css) |
|
|
53
53
|
|
|
54
54
|
- **One file of JS** — `zidan-form.js` (classic script, UMD-ish) + `zidan-form.mjs` (ESM wrapper).
|
|
55
55
|
- **Split CSS** — `plugin-core.css` (structure only) and `plugin-theme.css` (tokens, presets, skins).
|
|
@@ -118,7 +118,7 @@ the same two stylesheets and no dependencies.
|
|
|
118
118
|
**Trade-offs:** smaller community than Select2, no React/Vue component package, and for very
|
|
119
119
|
complex comboboxes (tokenized multi-search, drag-reorder tag editors) Select2 or Tom Select
|
|
120
120
|
still have deeper ecosystems. Full matrix, honest limitations and migration notes:
|
|
121
|
-
**[`docs/comparison.md`](docs/comparison.
|
|
121
|
+
**[`docs/comparison.md`](https://akhtar1985.github.io/zidan-select/docs/comparison.html)**.
|
|
122
122
|
|
|
123
123
|
---
|
|
124
124
|
|
|
@@ -131,24 +131,25 @@ still have deeper ecosystems. Full matrix, honest limitations and migration note
|
|
|
131
131
|
5. [Quick start](#quick-start)
|
|
132
132
|
6. [Input types](#input-types)
|
|
133
133
|
7. [Options & data attributes](#options--data-attributes)
|
|
134
|
-
8. [
|
|
135
|
-
9. [
|
|
136
|
-
10. [
|
|
137
|
-
11. [
|
|
138
|
-
12. [
|
|
139
|
-
13. [
|
|
140
|
-
14. [
|
|
141
|
-
15. [
|
|
142
|
-
16. [
|
|
134
|
+
8. [Remote data (AJAX)](#remote-data-ajax-selects)
|
|
135
|
+
9. [JavaScript API](#javascript-api)
|
|
136
|
+
10. [Themes, layouts & frameworks](#themes-layouts--frameworks)
|
|
137
|
+
11. [Validation libraries](#validation-libraries)
|
|
138
|
+
12. [Form lifecycle & state sync](#form-lifecycle--state-sync)
|
|
139
|
+
13. [React, Next.js, Vue, Angular](#react-nextjs-vue-angular)
|
|
140
|
+
14. [Build & publish](#build--publish)
|
|
141
|
+
15. [Browser support](#browser-support)
|
|
142
|
+
16. [What's new in 2.1–2.3](#whats-new-in-213)
|
|
143
|
+
17. [Migrating from 1.x](#migrating-from-1x)
|
|
143
144
|
|
|
144
145
|
---
|
|
145
146
|
|
|
146
147
|
## Live demo
|
|
147
148
|
|
|
148
|
-
[](https://akhtar1985.github.io/zidan-select/)
|
|
149
|
+
[](https://akhtar1985.github.io/zidan-select/)
|
|
149
150
|
|
|
150
151
|
**Demo:** <https://akhtar1985.github.io/zidan-select/> — deployed from `main` by
|
|
151
|
-
[`.github/workflows/pages.yml`](.github/workflows/pages.yml) on every push.
|
|
152
|
+
[`.github/workflows/pages.yml`](https://github.com/akhtar1985/zidan-select/blob/main/.github/workflows/pages.yml) on every push.
|
|
152
153
|
|
|
153
154
|
Deep links open the matching tab:
|
|
154
155
|
|
|
@@ -168,6 +169,14 @@ A mock **Shopify product page** — variant combobox, quantity stepper, gift-wra
|
|
|
168
169
|
radios, upload dropzone and the Liquid install snippets — runs at
|
|
169
170
|
<https://akhtar1985.github.io/zidan-select/shopify.html>.
|
|
170
171
|
|
|
172
|
+
A dedicated **[AJAX & remote data demo](https://akhtar1985.github.io/zidan-select/ajax.html)** wires
|
|
173
|
+
`data-zidan-fetch-url` to a real API and shows the hand-written `fetchOptions` contract with live
|
|
174
|
+
paging, abort and cache state.
|
|
175
|
+
|
|
176
|
+
Below the tabs sits the **[controls reference]**(https://akhtar1985.github.io/zidan-select/#controls)**
|
|
177
|
+
— all nine control families on one page with the options you reach for most, the two ways to
|
|
178
|
+
initialise a field and copyable examples, linking into the playground for the rest.
|
|
179
|
+
|
|
171
180
|
---
|
|
172
181
|
|
|
173
182
|
## Install
|
|
@@ -222,20 +231,22 @@ override presets.
|
|
|
222
231
|
| `plugin-theme.css` | Tokens, colours, states, presets, layout skins, framework adapters. |
|
|
223
232
|
| `dist/select/` | Select-only build: `zidan-select.js`, `zidan-select.mjs`, `plugin-select-core.css`, `plugin-select-theme.css`. |
|
|
224
233
|
| `dist/file/` | File-only build: `zidan-file.js`, `zidan-file.mjs`, `plugin-file-core.css`, `plugin-file-theme.css`. |
|
|
225
|
-
| `index.html`, `demo.css`, `demo.js` | The tabbed demo / theme showcase (not shipped logic). |
|
|
234
|
+
| `index.html`, `demo.css`, `demo.js` | The tabbed demo / theme showcase plus the controls reference section (not shipped logic). |
|
|
235
|
+
| `advanced.html`, `advanced.css`, `advanced.js` | Advanced reference: init and precedence, async paging, Promise validation, uploads, events, RTL and TypeScript, with copyable HTML/JS examples (not shipped logic). |
|
|
226
236
|
| `playground.html`, `playground.css`, `playground.js` | Per-field option builder with live preview and copyable HTML / JS output (not shipped logic). |
|
|
237
|
+
| `nav.css`, `nav.js` | Shared header, navigation and mobile menu button for the demo pages (not shipped logic). |
|
|
227
238
|
| `robots.txt`, `sitemap.xml` | Crawler directives and the public page list for GitHub Pages (not shipped on npm). |
|
|
228
239
|
| `docs/` | Comparison, options, validation, frameworks, theming, build and the static HTML/WordPress cookbook. |
|
|
229
240
|
|
|
230
241
|
Copyable URLs for the published files (pin the version in production):
|
|
231
242
|
|
|
232
|
-
- `zidan-form.js` — <https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
233
|
-
- `zidan-form.min.js` — <https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
234
|
-
- `zidan-form.mjs` — <https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
235
|
-
- `plugin-core.css` — <https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
236
|
-
- `plugin-core.min.css` — <https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
237
|
-
- `plugin-theme.css` — <https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
238
|
-
- `plugin-theme.min.css` — <https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
243
|
+
- `zidan-form.js` — <https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/zidan-form.js>
|
|
244
|
+
- `zidan-form.min.js` — <https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/dist/zidan-form.min.js>
|
|
245
|
+
- `zidan-form.mjs` — <https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/zidan-form.mjs>
|
|
246
|
+
- `plugin-core.css` — <https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/plugin-core.css>
|
|
247
|
+
- `plugin-core.min.css` — <https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/dist/plugin-core.min.css>
|
|
248
|
+
- `plugin-theme.css` — <https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/plugin-theme.css>
|
|
249
|
+
- `plugin-theme.min.css` — <https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/dist/plugin-theme.min.css>
|
|
239
250
|
- npm package — <https://www.npmjs.com/package/zidan-select>
|
|
240
251
|
- Source — <https://github.com/akhtar1985/zidan-select>
|
|
241
252
|
|
|
@@ -256,27 +267,27 @@ exactly like the full build.
|
|
|
256
267
|
|
|
257
268
|
Copyable CDN URLs (pin the version):
|
|
258
269
|
|
|
259
|
-
- `zidan-select.js` — <https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
260
|
-
- `zidan-select.min.js` — <https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
261
|
-
- `zidan-select.mjs` — <https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
262
|
-
- `plugin-select-core.css` — <https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
263
|
-
- `plugin-select-core.min.css` — <https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
264
|
-
- `plugin-select-theme.css` — <https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
265
|
-
- `plugin-select-theme.min.css` — <https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
266
|
-
- `zidan-file.js` — <https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
267
|
-
- `zidan-file.min.js` — <https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
268
|
-
- `zidan-file.mjs` — <https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
269
|
-
- `plugin-file-core.css` — <https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
270
|
-
- `plugin-file-core.min.css` — <https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
271
|
-
- `plugin-file-theme.css` — <https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
272
|
-
- `plugin-file-theme.min.css` — <https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
270
|
+
- `zidan-select.js` — <https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/dist/select/zidan-select.js>
|
|
271
|
+
- `zidan-select.min.js` — <https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/dist/select/zidan-select.min.js>
|
|
272
|
+
- `zidan-select.mjs` — <https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/dist/select/zidan-select.mjs>
|
|
273
|
+
- `plugin-select-core.css` — <https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/dist/select/plugin-select-core.css>
|
|
274
|
+
- `plugin-select-core.min.css` — <https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/dist/select/plugin-select-core.min.css>
|
|
275
|
+
- `plugin-select-theme.css` — <https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/dist/select/plugin-select-theme.css>
|
|
276
|
+
- `plugin-select-theme.min.css` — <https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/dist/select/plugin-select-theme.min.css>
|
|
277
|
+
- `zidan-file.js` — <https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/dist/file/zidan-file.js>
|
|
278
|
+
- `zidan-file.min.js` — <https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/dist/file/zidan-file.min.js>
|
|
279
|
+
- `zidan-file.mjs` — <https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/dist/file/zidan-file.mjs>
|
|
280
|
+
- `plugin-file-core.css` — <https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/dist/file/plugin-file-core.css>
|
|
281
|
+
- `plugin-file-core.min.css` — <https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/dist/file/plugin-file-core.min.css>
|
|
282
|
+
- `plugin-file-theme.css` — <https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/dist/file/plugin-file-theme.css>
|
|
283
|
+
- `plugin-file-theme.min.css` — <https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/dist/file/plugin-file-theme.min.css>
|
|
273
284
|
|
|
274
285
|
Select / combobox / tags only (≈104 kB JS, ≈12 kB core CSS, ≈32 kB theme CSS):
|
|
275
286
|
|
|
276
287
|
```html
|
|
277
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
278
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
279
|
-
<script src="https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
288
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/dist/select/plugin-select-core.css">
|
|
289
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/dist/select/plugin-select-theme.css">
|
|
290
|
+
<script src="https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/dist/select/zidan-select.js"></script>
|
|
280
291
|
<script>
|
|
281
292
|
// auto-init covers [data-zidan-select], class="zidan-select", zidan-form scopes
|
|
282
293
|
// and ZIDAN_FORM_CONFIG targets; JS-only options:
|
|
@@ -287,9 +298,9 @@ Select / combobox / tags only (≈104 kB JS, ≈12 kB core CSS, ≈32 kB theme C
|
|
|
287
298
|
File upload only (≈82 kB JS, ≈9 kB core CSS, ≈34 kB theme CSS):
|
|
288
299
|
|
|
289
300
|
```html
|
|
290
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
291
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
292
|
-
<script src="https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
301
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/dist/file/plugin-file-core.css">
|
|
302
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/dist/file/plugin-file-theme.css">
|
|
303
|
+
<script src="https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/dist/file/zidan-file.js"></script>
|
|
293
304
|
<script>
|
|
294
305
|
zidanField('#upload', { variant: 'dropzone', upload: '/api/files' });
|
|
295
306
|
</script>
|
|
@@ -312,7 +323,7 @@ targets apply.
|
|
|
312
323
|
## Quick start
|
|
313
324
|
|
|
314
325
|
> Building a plain HTML page, a WordPress site or a page-builder embed? The
|
|
315
|
-
> [static HTML & WordPress cookbook](docs/html-and-wordpress.
|
|
326
|
+
> [static HTML & WordPress cookbook](https://akhtar1985.github.io/zidan-select/docs/html-and-wordpress.html) has complete copy-paste pages
|
|
316
327
|
> (full, select-only, file-only, ID/class targeting, `functions.php` enqueue).
|
|
317
328
|
|
|
318
329
|
```html
|
|
@@ -407,7 +418,7 @@ the select build enhances selects, the file build enhances file inputs; both und
|
|
|
407
418
|
same config keys, marker classes and JSON attribute.
|
|
408
419
|
|
|
409
420
|
Windows/macOS keyboard behaviour, grouping, search and all select features live in
|
|
410
|
-
[`docs/options.md`](docs/options.
|
|
421
|
+
[`docs/options.md`](https://akhtar1985.github.io/zidan-select/docs/options.html).
|
|
411
422
|
|
|
412
423
|
### JavaScript init: one select by ID or class
|
|
413
424
|
|
|
@@ -422,7 +433,7 @@ argument to `zidanSelect()`:
|
|
|
422
433
|
</select>
|
|
423
434
|
|
|
424
435
|
<!-- select-only build; use zidan-form.js for every control -->
|
|
425
|
-
<script src="https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
436
|
+
<script src="https://cdn.jsdelivr.net/npm/zidan-select@2.4.0/dist/select/zidan-select.js"></script>
|
|
426
437
|
<script>
|
|
427
438
|
const picker = zidanSelect('#mymov', {
|
|
428
439
|
mode: 'combobox', // 'select' | 'combobox' | 'tags'
|
|
@@ -467,8 +478,8 @@ The file-only build uses the same targeted pattern: `zidanField('#upload', { var
|
|
|
467
478
|
accept: 'image/*', maxFiles: 4 })` and `zidanField('.upload-field', options)`.
|
|
468
479
|
|
|
469
480
|
Every option in JavaScript form — with defaults, callbacks and rendering hooks — is in
|
|
470
|
-
[Select options](docs/options.
|
|
471
|
-
[File upload](docs/options.
|
|
481
|
+
[Select options](https://akhtar1985.github.io/zidan-select/docs/options.html#select-options) and
|
|
482
|
+
[File upload](https://akhtar1985.github.io/zidan-select/docs/options.html#file-upload-variants-uploading--rendering). Try the editable
|
|
472
483
|
options object live in the demo's **Select** tab →
|
|
473
484
|
[Direct JS init](https://akhtar1985.github.io/zidan-select/#select).
|
|
474
485
|
|
|
@@ -679,10 +690,24 @@ zidanField('#price', {
|
|
|
679
690
|
rangeLabels: { 0: 'Free', 1000: 'Top' },
|
|
680
691
|
rangeFormat: value => '€' + Number(value).toLocaleString('en-US')
|
|
681
692
|
});
|
|
693
|
+
|
|
694
|
+
zidanField('#delivery', {
|
|
695
|
+
rangeBubbleMode: 'active', // always | active | never
|
|
696
|
+
rangeBubblePosition: 'bottom', // top | bottom
|
|
697
|
+
rangeFill: false, // no progress colour
|
|
698
|
+
rangeTicks: '0,10,20,30', // count, array, JSON or comma list
|
|
699
|
+
rangeTickLabels: true,
|
|
700
|
+
rangeMinLabel: 'Low',
|
|
701
|
+
rangeMaxLabel: 'High'
|
|
702
|
+
});
|
|
682
703
|
```
|
|
683
704
|
|
|
684
|
-
Variants: `default`, `gradient`, `stepped`, `minimal`. Bubble
|
|
685
|
-
|
|
705
|
+
Variants: `default`, `gradient`, `stepped`, `minimal`. Bubble (always / on hover-focus / never,
|
|
706
|
+
top or bottom), fill, min/max scale, custom scale ends, ticks and labels can each be set;
|
|
707
|
+
`rangeFormat` accepts a template (`{value}`, `{min}`, `{max}`) or a function and also feeds
|
|
708
|
+
`aria-valuetext`. Labeled ticks at both ends replace the min/max scale (classes
|
|
709
|
+
`zs-range-scale--hidden` and `zs-range-tick--start` / `--end`), so the start and end numbers
|
|
710
|
+
are printed once. `output` receives the formatted display value; `input.value` keeps the raw one.
|
|
686
711
|
|
|
687
712
|
### Date & time pickers
|
|
688
713
|
|
|
@@ -718,7 +743,7 @@ per field; clickable icons call `input.showPicker()` when available.
|
|
|
718
743
|
| `reveal` | `data-zidan-reveal` | boolean | `false` | Password show/hide. |
|
|
719
744
|
| `prefix` / `suffix` | `data-zidan-prefix` / `-suffix` | string | — | Static adornments. |
|
|
720
745
|
| `counter` | `data-zidan-counter` | number | `maxlength` | Character limit for the counter; overrides `maxlength`. |
|
|
721
|
-
| `output` | `data-zidan-output` | selector | — | Range value is mirrored into this element. |
|
|
746
|
+
| `output` | `data-zidan-output` | selector | — | Range display value (formatted when `rangeFormat` is set) is mirrored into this element. |
|
|
722
747
|
| `autoIcon` / `icon` | `data-zidan-auto-icon` / `data-zidan-icon` | boolean / string | `false` / — | Type-based or custom input icon (any registered name). |
|
|
723
748
|
| `iconPosition` / `iconClickable` | `data-zidan-icon-position` / `-icon-clickable` | `left`\|`right` / boolean | `left` / `false` | Side and behaviour of the icon. |
|
|
724
749
|
| `validationIcon` | `data-zidan-validation-icon` | boolean | `false` | Check/alert glyphs tied to validation state. |
|
|
@@ -728,7 +753,9 @@ per field; clickable icons call `input.showPicker()` when available.
|
|
|
728
753
|
| `phone` / `phoneCountry` / `phoneFormat` | `data-zidan-phone` / `-phone-country` / `-phone-format` | boolean / ISO-2 / `national`\|`international`\|`e164` | — / `US` / `national` | Phone formatting and validation. |
|
|
729
754
|
| `phoneCountrySelect` / `phoneCountries` | `data-zidan-phone-country-select` / `-phone-countries` | boolean / list | `true` / common set | Country selector. |
|
|
730
755
|
| `rangeVariant` / `rangeBubble` / `rangeMinMax` | `data-zidan-range-variant` / `-range-bubble` / `-range-minmax` | string / boolean / boolean | `default` / `true` / `true` | Range skin and chrome. |
|
|
731
|
-
| `
|
|
756
|
+
| `rangeBubbleMode` / `rangeBubblePosition` / `rangeFill` | `data-zidan-range-bubble-mode` / `-range-bubble-position` / `-range-fill` | `always`\|`active`\|`never` / `top`\|`bottom` / boolean | `always` / `top` / `true` | Bubble visibility and side, progress fill. |
|
|
757
|
+
| `rangeTicks` / `rangeTickLabels` / `rangeLabels` / `rangeFormat` | `data-zidan-range-ticks` / `-range-tick-labels` / — / `-range-format` | number\|array\|string / boolean / object / string\|function | `0` / `false` / — / — | Ticks (count, array, JSON or comma list), labels and value formatter. |
|
|
758
|
+
| `rangeMinLabel` / `rangeMaxLabel` | `data-zidan-range-min-label` / `-range-max-label` | string | — | Custom text for the scale ends. |
|
|
732
759
|
| `pickerButton` / `pickerIcon` | `data-zidan-picker-button` / `-picker-icon` | boolean / string | `false` / per type | Date/time picker button and icon. |
|
|
733
760
|
| `disableWeekends` / `disabledDates` | `data-zidan-disable-weekends` / `-disabled-dates` | boolean / list\|function | `false` / — | Date rules written into native validity. |
|
|
734
761
|
| `title` | `data-zidan-title` | string | `Choose a file` | File dropzone title. |
|
|
@@ -747,13 +774,86 @@ per field; clickable icons call `input.showPicker()` when available.
|
|
|
747
774
|
|
|
748
775
|
### Select options
|
|
749
776
|
|
|
750
|
-
See [`docs/options.md`](docs/options.
|
|
777
|
+
See [`docs/options.md`](https://akhtar1985.github.io/zidan-select/docs/options.html) for the complete table (`mode`, `layout`,
|
|
751
778
|
`themeFramework`, `searchable`, `clearable`, `multiple`, `maxTags`, `suggestions`,
|
|
752
779
|
`fetchOptions`, `debounce`, `minChars`, callbacks, `customClasses`, `scrollbar`, …).
|
|
753
780
|
|
|
754
781
|
Validation state options on both layers: **the plugin never submits or blocks a form** — it
|
|
755
782
|
mirrors state and lets your validator decide.
|
|
756
783
|
|
|
784
|
+
Three behaviours that are easy to miss:
|
|
785
|
+
|
|
786
|
+
- `searchable: false` in `select` mode makes the trigger `readOnly`, so typing can never filter
|
|
787
|
+
or hide the options. Open the list with a click, `Space`, `Enter` or `↓`.
|
|
788
|
+
- Tags with `allowFreeText: false` accept only values that already exist in the options or
|
|
789
|
+
`suggestions`; anything else is rejected with `"…" is not in the list.`
|
|
790
|
+
- `setValidation('invalid')` (and `data-zidan-validation="invalid"`) is pinned: it survives
|
|
791
|
+
`update()`, `refresh()`, `setValue()` and async re-checks until the user edits the control or
|
|
792
|
+
you call `setValidation(null)`.
|
|
793
|
+
|
|
794
|
+
---
|
|
795
|
+
|
|
796
|
+
## Remote data (AJAX selects)
|
|
797
|
+
|
|
798
|
+
Two ways to load options over HTTP. Both give you debounce, an `AbortSignal` per request, an LRU
|
|
799
|
+
cache, a **Load more** footer, error retry and the same events.
|
|
800
|
+
|
|
801
|
+
**1. Markup only** — one attribute builds the request:
|
|
802
|
+
|
|
803
|
+
```html
|
|
804
|
+
<select name="product"
|
|
805
|
+
data-zidan-select="combobox"
|
|
806
|
+
data-zidan-fetch-url="/api/products/search"
|
|
807
|
+
data-zidan-fetch-items-path="data.items"
|
|
808
|
+
data-zidan-fetch-total-path="data.total"
|
|
809
|
+
data-zidan-fetch-skip-param="skip"
|
|
810
|
+
data-zidan-fetch-page-size="20">
|
|
811
|
+
</select>
|
|
812
|
+
```
|
|
813
|
+
|
|
814
|
+
That requests `GET /api/products/search?q=…&limit=20&skip=0`, then `skip=20` for the next page,
|
|
815
|
+
and stops once `skip + limit >= data.total`.
|
|
816
|
+
|
|
817
|
+
**2. JavaScript** — `fetchOptions` when the request or the response shape is yours:
|
|
818
|
+
|
|
819
|
+
```js
|
|
820
|
+
const picker = zidanSelect('#owner', {
|
|
821
|
+
mode: 'combobox',
|
|
822
|
+
fetchPageSize: 20,
|
|
823
|
+
fetchOptions: async (query, signal, { page, pageSize }) => {
|
|
824
|
+
const res = await fetch('/api/users?q=' + encodeURIComponent(query)
|
|
825
|
+
+ '&page=' + page + '&size=' + pageSize, { signal });
|
|
826
|
+
const data = await res.json();
|
|
827
|
+
return {
|
|
828
|
+
items: data.rows.map(u => ({ value: u.id, label: u.name })),
|
|
829
|
+
hasMore: data.page + 1 < data.pages
|
|
830
|
+
};
|
|
831
|
+
}
|
|
832
|
+
});
|
|
833
|
+
```
|
|
834
|
+
|
|
835
|
+
| Option | Default | Notes |
|
|
836
|
+
| --- | --- | --- |
|
|
837
|
+
| `fetchUrl` | `null` | Endpoint for the declarative mode (`data-zidan-fetch-url`). |
|
|
838
|
+
| `fetchOptions(query, signal, context)` | — | Return an array, `{ items, hasMore }` or `{ items, total }`; `context` is `{ page, pageSize, append, instance }`. |
|
|
839
|
+
| `fetchPageSize` | `0` | Rows per request; a value above `0` enables paging and the load-more footer. |
|
|
840
|
+
| `fetchQueryParam` | `'q'` | Parameter that carries the search term (`''` omits it). |
|
|
841
|
+
| `fetchPageParam` | `'page'` | 1-based page parameter (`''` omits it). |
|
|
842
|
+
| `fetchSkipParam` | `null` | Send `skip = page × pageSize` instead — for dummyjson/Laravel-style APIs. |
|
|
843
|
+
| `fetchPageSizeParam` | `'limit'` | Parameter that carries `fetchPageSize`. |
|
|
844
|
+
| `fetchItemsPath`, `fetchTotalPath`, `fetchHasMorePath` | `null` | Dot paths into the JSON body (`data.items`, `data.total`). |
|
|
845
|
+
| `fetchMethod`, `fetchHeaders`, `fetchCredentials` | `'GET'`, `null`, `'same-origin'` | Request tuning (JavaScript only). |
|
|
846
|
+
| `debounce`, `minChars` | `250`, `0` | When typing starts a request. |
|
|
847
|
+
| `cacheResults`, `autoLoadMore`, `loadMoreText` | `true`, `true`, `Load more` | Paging behaviour. |
|
|
848
|
+
|
|
849
|
+
Rows map without a mapping function: `value`/`label`, or `id`/`slug`/`code` plus
|
|
850
|
+
`name`/`title`/`full_name`. Instance helpers: `loadMore()`, `hasMoreResults()`,
|
|
851
|
+
`getAsyncState()`, `refreshOptions()`, `clearCache()`; events: `zidan:load-more`, `zidan:error`.
|
|
852
|
+
|
|
853
|
+
**[Live AJAX demo](https://akhtar1985.github.io/zidan-select/ajax.html)** — one card uses the
|
|
854
|
+
attributes above against a public API, the other a hand-written `fetchOptions`, with paging,
|
|
855
|
+
abort and cache state on screen.
|
|
856
|
+
|
|
757
857
|
---
|
|
758
858
|
|
|
759
859
|
## JavaScript API
|
|
@@ -845,7 +945,7 @@ Custom theme — no build step, core never changes:
|
|
|
845
945
|
}
|
|
846
946
|
```
|
|
847
947
|
|
|
848
|
-
Token list, preset details and layout notes: [`docs/theming.md`](docs/theming.
|
|
948
|
+
Token list, preset details and layout notes: [`docs/theming.md`](https://akhtar1985.github.io/zidan-select/docs/theming.html).
|
|
849
949
|
|
|
850
950
|
### Layouts
|
|
851
951
|
|
|
@@ -940,8 +1040,8 @@ form.addEventListener('submit', event => {
|
|
|
940
1040
|
});
|
|
941
1041
|
```
|
|
942
1042
|
|
|
943
|
-
Full recipes: [`docs/validation.md`](docs/validation.
|
|
944
|
-
libraries next to a native form ships as [`docs/validation.html`](docs/validation.html).
|
|
1043
|
+
Full recipes: [`docs/validation.md`](https://akhtar1985.github.io/zidan-select/docs/validation-guide.html). A runnable page that loads all three
|
|
1044
|
+
libraries next to a native form ships as [`docs/validation.html`](https://akhtar1985.github.io/zidan-select/docs/validation.html).
|
|
945
1045
|
|
|
946
1046
|
---
|
|
947
1047
|
|
|
@@ -976,7 +1076,7 @@ Short version: initialise after mount, call `destroy()` before unmount, push sta
|
|
|
976
1076
|
be controlled through the instance, because the plugin owns the visible trigger.
|
|
977
1077
|
|
|
978
1078
|
Complete, copy-pasteable examples (React 18, Next.js App Router with SSR-safe imports, Vue 3
|
|
979
|
-
`onMounted`, Angular `ngAfterViewInit` + `ControlValueAccessor` notes): [`docs/frameworks.md`](docs/frameworks.
|
|
1079
|
+
`onMounted`, Angular `ngAfterViewInit` + `ControlValueAccessor` notes): [`docs/frameworks.md`](https://akhtar1985.github.io/zidan-select/docs/frameworks.html).
|
|
980
1080
|
|
|
981
1081
|
Next.js CSS imports:
|
|
982
1082
|
|
|
@@ -1024,24 +1124,38 @@ npm run build # dist/ (+ local .min files when esbuild is installed)
|
|
|
1024
1124
|
| `scripts/build.mjs` | Cleans `dist/`, copies the four assets, writes `dist/zidan-form.cjs`, emits the select-only and file-only bundles with declarations, and minifies every JS/CSS output with esbuild. |
|
|
1025
1125
|
| `scripts/test.mjs` | Verifies syntax, that core CSS carries no colour literals, that all presets/adapters exist, the public API is exported, the build artifacts ship, and the playground, README, demo and cookbook stay wired to each other — then runs 19 jsdom behaviour suites. |
|
|
1026
1126
|
| `scripts/dom/run.mjs` | jsdom suites for select, fields, uploads, async validation, pagination, RTL, teardown, and the select-only/file-only/minified bundles. |
|
|
1127
|
+
| `scripts/exa-search.mjs` | Exa web search for docs and release research: `npm run search -- "your question"` (`--num 10` for more results). Reads `EXA_API_KEY`; copy `.env.example` to `.env` (git-ignored) and add a key from https://dashboard.exa.ai/api-keys. |
|
|
1128
|
+
| `scripts/release.mjs` | One-command release: `npm run release -- patch --note "what changed"` bumps every version site, rolls `CHANGELOG.md`, runs the checks, commits and tags `vX.Y.Z`. |
|
|
1129
|
+
|
|
1130
|
+
`exa-js` is a dev dependency only, so the published bundle stays dependency-free.
|
|
1027
1131
|
|
|
1028
1132
|
**Minified files ship in the package.** `npm run build` writes real `.min.js` / `.min.css`
|
|
1029
1133
|
files into `dist/` (including both subset folders), so the URLs above work on unpkg, a
|
|
1030
1134
|
self-hosted CDN or jsDelivr without relying on the CDN's auto-minification.
|
|
1031
1135
|
|
|
1032
|
-
|
|
1136
|
+
Releasing is one command:
|
|
1033
1137
|
|
|
1034
1138
|
```bash
|
|
1035
|
-
npm
|
|
1036
|
-
|
|
1037
|
-
npm publish # `files` limits the tarball to JS, CSS, dist, docs, README, LICENSE
|
|
1038
|
-
git push --follow-tags
|
|
1139
|
+
npm run release -- patch --note "Fix the thing that broke" # or minor / major / 2.3.2
|
|
1140
|
+
git push origin main --follow-tags
|
|
1039
1141
|
```
|
|
1040
1142
|
|
|
1143
|
+
`scripts/release.mjs` writes the version into `package.json`, `package-lock.json`, the JS banner
|
|
1144
|
+
and `VERSION`, both CSS banners, the README CDN URLs, the demo pages and the docs; moves
|
|
1145
|
+
`## [Unreleased]` in [`CHANGELOG.md`](https://github.com/akhtar1985/zidan-select/blob/main/CHANGELOG.md) under a dated heading; runs the type check and
|
|
1146
|
+
`npm test`; then commits `Release X.Y.Z` and creates the annotated tag `vX.Y.Z`.
|
|
1147
|
+
`npm run release -- --dry-run` prints the plan without writing anything.
|
|
1148
|
+
|
|
1149
|
+
Pushing the tag runs [`.github/workflows/release.yml`](https://github.com/akhtar1985/zidan-select/blob/main/.github/workflows/release.yml), which
|
|
1150
|
+
publishes to npm through **trusted publishing** (OIDC) with `--provenance` — no token and no local
|
|
1151
|
+
`npm login`, and every tarball carries a provenance attestation. Prereleases go to the `next`
|
|
1152
|
+
dist-tag. The workflow refuses a tag that disagrees with `package.json` and refuses to republish a
|
|
1153
|
+
version that already exists on the registry. History lives in [`CHANGELOG.md`](https://github.com/akhtar1985/zidan-select/blob/main/CHANGELOG.md).
|
|
1154
|
+
|
|
1041
1155
|
GitHub Pages serves the repo root: the demo is `index.html` (no build needed), docs live in
|
|
1042
1156
|
`docs/`. Release notes should list theme/layout additions and any token renames.
|
|
1043
1157
|
|
|
1044
|
-
Full checklist, folder tree and release automation notes: [`docs/build.md`](docs/build.
|
|
1158
|
+
Full checklist, folder tree and release automation notes: [`docs/build.md`](https://akhtar1985.github.io/zidan-select/docs/build.html).
|
|
1045
1159
|
|
|
1046
1160
|
---
|
|
1047
1161
|
|
|
@@ -1060,7 +1174,7 @@ Full checklist, folder tree and release automation notes: [`docs/build.md`](docs
|
|
|
1060
1174
|
|
|
1061
1175
|
## What's new in 2.1–2.3
|
|
1062
1176
|
|
|
1063
|
-
**2.
|
|
1177
|
+
**2.4.0** adds the capabilities that were previously the library's biggest gaps:
|
|
1064
1178
|
|
|
1065
1179
|
- **Async validation** — `validate` and `validateDate` may return a Promise. Fields get a
|
|
1066
1180
|
`.zs-field--pending` spinner and `aria-busy`, block form submission through native validity,
|
|
@@ -1104,9 +1218,9 @@ Full checklist, folder tree and release automation notes: [`docs/build.md`](docs
|
|
|
1104
1218
|
`renderFile` and `zidan:upload-*` events.
|
|
1105
1219
|
- **Date rules** — weekend and blocked-date rules now write into native validity, so
|
|
1106
1220
|
`form.checkValidity()` and third-party validators see them.
|
|
1107
|
-
- **Docs & demo** — new option tables in [`docs/options.md`](docs/options.
|
|
1108
|
-
[`docs/theming.md`](docs/theming.
|
|
1109
|
-
[`docs/validation.md`](docs/validation.
|
|
1221
|
+
- **Docs & demo** — new option tables in [`docs/options.md`](https://akhtar1985.github.io/zidan-select/docs/options.html), token list in
|
|
1222
|
+
[`docs/theming.md`](https://akhtar1985.github.io/zidan-select/docs/theming.html), validation rules in
|
|
1223
|
+
[`docs/validation.md`](https://akhtar1985.github.io/zidan-select/docs/validation-guide.html), and a live event console on the demo page.
|
|
1110
1224
|
|
|
1111
1225
|
The 2.0 API is unchanged; every addition is opt-in.
|
|
1112
1226
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ZidanForm File-only v2.
|
|
2
|
+
* ZidanForm File-only v2.4.0 — plugin-file-core.css
|
|
3
3
|
* Structure for the file upload control only.
|
|
4
4
|
* Pairs with zidan-file.js and plugin-file-theme.css.
|
|
5
5
|
*
|
|
@@ -87,6 +87,13 @@
|
|
|
87
87
|
letter-spacing: 0.01em;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
+
/* The plugin renders its own label and hides the author's original one. Author
|
|
91
|
+
rules such as `.field-label { display:block }` would otherwise beat the
|
|
92
|
+
browser's [hidden] default and show both labels at once. */
|
|
93
|
+
[data-zs-hidden-label] {
|
|
94
|
+
display: none !important;
|
|
95
|
+
}
|
|
96
|
+
|
|
90
97
|
.zs-field__hint {
|
|
91
98
|
margin: 0;
|
|
92
99
|
font-size: 0.75rem;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ZidanForm File-only v2.
|
|
2
|
+
* ZidanForm File-only v2.4.0 — plugin-file-core.css
|
|
3
3
|
* Structure for the file upload control only.
|
|
4
4
|
* Pairs with zidan-file.js and plugin-file-theme.css.
|
|
5
5
|
*
|
|
6
6
|
* Generated by scripts/build.mjs — edit the shared stylesheets instead.
|
|
7
7
|
* https://github.com/akhtar1985/zidan-select
|
|
8
8
|
* MIT License © akhtar1985
|
|
9
|
-
*/.zs-root,.zs-field,.zs-radio-group{position:relative;display:block;width:100%;box-sizing:border-box;font-family:var(--zs-font-family, inherit);font-size:var(--zs-font-size, .9375rem);line-height:var(--zs-line-height, 1.4);-webkit-tap-highlight-color:transparent}.zs-root *,.zs-root *:before,.zs-root *:after,.zs-field *,.zs-field *:before,.zs-field *:after,.zs-radio-group *,.zs-radio-group *:before,.zs-radio-group *:after{box-sizing:border-box}.zs-field{position:relative;display:flex;flex-direction:column;gap:var(--zs-field-gap, 6px)}.zs-field--pending:after{content:"";position:absolute;top:2px;inset-inline-end:0;width:.85em;height:.85em;border-width:2px;border-style:solid;border-color:transparent;border-radius:50%;animation:zs-field-spin .7s linear infinite;pointer-events:none}@keyframes zs-field-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion: reduce){.zs-field--pending:after{animation-duration:2s}}.zs-field[data-zs-layout=inline]{flex-direction:row;align-items:center;flex-wrap:wrap;gap:10px}.zs-field__label{display:block;font-size:var(--zs-label-size, .8125rem);font-weight:600;letter-spacing:.01em}.zs-field__hint{margin:0;font-size:.75rem}.zs-field__meta{display:flex;align-items:baseline;justify-content:space-between;gap:10px}.zs-field__error{margin:0;font-size:.75rem;line-height:1.35}.zs-field__error[hidden]{display:none}.zs-counter{margin-inline-start:auto;font-size:.75rem;font-variant-numeric:tabular-nums;white-space:nowrap}.zs-native-input{position:absolute;width:1px;height:1px;margin:0;padding:0;border:0;opacity:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.zs-field--inline .zs-check,.zs-field--inline .zs-radio{margin:0}.zs-field--file .zs-file-drop{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:22px 16px;min-height:128px;text-align:center;border-width:1.5px;border-style:dashed;border-radius:var(--zs-radius, 10px);cursor:pointer;transition:border-color .15s ease,background-color .15s ease}.zs-file-icon{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;margin-bottom:4px;border-radius:50%}.zs-file-drop-title{font-weight:600}.zs-file-drop-hint{font-size:.75rem}.zs-file-list{display:flex;flex-direction:column;gap:6px;margin:0;padding:0;list-style:none}.zs-file-list[hidden]{display:none}.zs-file-item{display:flex;align-items:center;gap:10px;padding:8px 10px;border-width:var(--zs-border-width, 1px);border-style:solid;border-radius:var(--zs-radius, 10px)}.zs-file-thumb{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;overflow:hidden;border-radius:8px;font-size:.625rem;font-weight:700;letter-spacing:.02em}.zs-file-thumb img{width:100%;height:100%;object-fit:cover;display:block}.zs-file-info{display:flex;flex-direction:column;min-width:0;flex:1 1 auto}.zs-file-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.8125rem;font-weight:600}.zs-file-size{font-size:.6875rem}.zs-file-remove{flex:0 0 auto;width:26px;height:26px;padding:0;border:0;border-radius:50%;font-size:1rem;line-height:1;cursor:pointer;transition:background-color .15s ease}.zs-file-meta-row{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:20px}.zs-file-status{font-size:.75rem}.zs-file-clear{margin-inline-start:auto;padding:2px 8px;border-width:1px;border-style:solid;border-radius:999px;font-size:.6875rem;font-weight:600;cursor:pointer}.zs-file-clear[hidden]{display:none}.zs-field--file .zs-file-drop--button,.zs-field--file .zs-file-drop--compact{flex-direction:row;align-items:center;justify-content:flex-start;gap:8px;min-height:0;padding:10px 14px;text-align:start;border-style:solid}.zs-field--file .zs-file-drop--compact{padding:6px 10px}.zs-field--file .zs-file-drop--button .zs-file-icon,.zs-field--file .zs-file-drop--compact .zs-file-icon{margin:0;width:24px;height:24px}.zs-field--file .zs-file-drop--button .zs-file-drop-hint,.zs-field--file .zs-file-drop--compact .zs-file-drop-hint{margin-inline-start:auto}.zs-field--file .zs-file-drop--avatar{flex:0 0 auto;width:var(--zs-avatar-size, 96px);height:var(--zs-avatar-size, 96px);min-height:0;padding:0;overflow:hidden;border-style:solid;border-radius:50%}.zs-field--file .zs-file-drop--avatar .zs-file-drop-title,.zs-field--file .zs-file-drop--avatar .zs-file-drop-hint{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}.zs-field--file .zs-file-drop--avatar .zs-file-icon{margin:0}.zs-file-avatar{position:absolute;inset:0;display:block}.zs-file-avatar[hidden]{display:none}.zs-file-avatar img{width:100%;height:100%;object-fit:cover;display:block}.zs-file-drop--has-preview .zs-file-icon{display:none}.zs-field--file .zs-file-drop--gallery{flex-direction:row;flex-wrap:wrap;justify-content:center;gap:6px;min-height:88px;padding:14px}.zs-field[data-zs-file-variant=gallery] .zs-file-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:8px}.zs-field[data-zs-file-variant=gallery] .zs-file-item{flex-direction:column;align-items:stretch;gap:6px;padding:6px}.zs-field[data-zs-file-variant=gallery] .zs-file-thumb{width:100%;height:86px;border-radius:6px}.zs-field[data-zs-file-variant=gallery] .zs-file-actions{justify-content:flex-end}.zs-field[data-zs-file-variant=gallery] .zs-file-upload-state{flex-wrap:wrap}.zs-file-upload-state{display:flex;align-items:center;gap:6px;font-size:.6875rem}.zs-file-progress{position:relative;display:inline-block;flex:1 1 58px;height:4px;min-width:44px;overflow:hidden;border-radius:999px}.zs-file-progress-bar{display:block;height:100%;width:0;border-radius:inherit;transition:width .12s linear}.zs-file-actions{flex:0 0 auto;display:inline-flex;align-items:center;gap:4px}.zs-file-cancel,.zs-file-retry{padding:2px 6px;border:0;border-radius:5px;font:inherit;font-size:.6875rem;font-weight:600;cursor:pointer}.zs-form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(var(--zs-grid-min, 230px),1fr));gap:var(--zs-grid-gap, 16px);align-items:start}.zs-form-grid>.zs-full{grid-column:1 / -1}.zs-check input:focus-visible+.zs-check-box,.zs-check input:focus-visible+.zs-switch-track,.zs-radio input:focus-visible+.zs-radio-dot{outline:2px solid transparent;outline-offset:2px}.zs-input-native:focus-visible,.zs-file-input:focus-visible{outline:none}@media (prefers-reduced-motion: reduce){.zs-root,.zs-root *,.zs-root *:before,.zs-root *:after,.zs-field,.zs-field *,.zs-field *:before,.zs-field *:after,.zs-radio-group,.zs-radio-group *{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important;scroll-behavior:auto!important}.zs-root .zs-spinner{animation-duration:1.2s!important;animation-iteration-count:infinite!important}}
|
|
9
|
+
*/.zs-root,.zs-field,.zs-radio-group{position:relative;display:block;width:100%;box-sizing:border-box;font-family:var(--zs-font-family, inherit);font-size:var(--zs-font-size, .9375rem);line-height:var(--zs-line-height, 1.4);-webkit-tap-highlight-color:transparent}.zs-root *,.zs-root *:before,.zs-root *:after,.zs-field *,.zs-field *:before,.zs-field *:after,.zs-radio-group *,.zs-radio-group *:before,.zs-radio-group *:after{box-sizing:border-box}.zs-field{position:relative;display:flex;flex-direction:column;gap:var(--zs-field-gap, 6px)}.zs-field--pending:after{content:"";position:absolute;top:2px;inset-inline-end:0;width:.85em;height:.85em;border-width:2px;border-style:solid;border-color:transparent;border-radius:50%;animation:zs-field-spin .7s linear infinite;pointer-events:none}@keyframes zs-field-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion: reduce){.zs-field--pending:after{animation-duration:2s}}.zs-field[data-zs-layout=inline]{flex-direction:row;align-items:center;flex-wrap:wrap;gap:10px}.zs-field__label{display:block;font-size:var(--zs-label-size, .8125rem);font-weight:600;letter-spacing:.01em}[data-zs-hidden-label]{display:none!important}.zs-field__hint{margin:0;font-size:.75rem}.zs-field__meta{display:flex;align-items:baseline;justify-content:space-between;gap:10px}.zs-field__error{margin:0;font-size:.75rem;line-height:1.35}.zs-field__error[hidden]{display:none}.zs-counter{margin-inline-start:auto;font-size:.75rem;font-variant-numeric:tabular-nums;white-space:nowrap}.zs-native-input{position:absolute;width:1px;height:1px;margin:0;padding:0;border:0;opacity:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}.zs-field--inline .zs-check,.zs-field--inline .zs-radio{margin:0}.zs-field--file .zs-file-drop{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:22px 16px;min-height:128px;text-align:center;border-width:1.5px;border-style:dashed;border-radius:var(--zs-radius, 10px);cursor:pointer;transition:border-color .15s ease,background-color .15s ease}.zs-file-icon{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;margin-bottom:4px;border-radius:50%}.zs-file-drop-title{font-weight:600}.zs-file-drop-hint{font-size:.75rem}.zs-file-list{display:flex;flex-direction:column;gap:6px;margin:0;padding:0;list-style:none}.zs-file-list[hidden]{display:none}.zs-file-item{display:flex;align-items:center;gap:10px;padding:8px 10px;border-width:var(--zs-border-width, 1px);border-style:solid;border-radius:var(--zs-radius, 10px)}.zs-file-thumb{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;width:38px;height:38px;overflow:hidden;border-radius:8px;font-size:.625rem;font-weight:700;letter-spacing:.02em}.zs-file-thumb img{width:100%;height:100%;object-fit:cover;display:block}.zs-file-info{display:flex;flex-direction:column;min-width:0;flex:1 1 auto}.zs-file-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.8125rem;font-weight:600}.zs-file-size{font-size:.6875rem}.zs-file-remove{flex:0 0 auto;width:26px;height:26px;padding:0;border:0;border-radius:50%;font-size:1rem;line-height:1;cursor:pointer;transition:background-color .15s ease}.zs-file-meta-row{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:20px}.zs-file-status{font-size:.75rem}.zs-file-clear{margin-inline-start:auto;padding:2px 8px;border-width:1px;border-style:solid;border-radius:999px;font-size:.6875rem;font-weight:600;cursor:pointer}.zs-file-clear[hidden]{display:none}.zs-field--file .zs-file-drop--button,.zs-field--file .zs-file-drop--compact{flex-direction:row;align-items:center;justify-content:flex-start;gap:8px;min-height:0;padding:10px 14px;text-align:start;border-style:solid}.zs-field--file .zs-file-drop--compact{padding:6px 10px}.zs-field--file .zs-file-drop--button .zs-file-icon,.zs-field--file .zs-file-drop--compact .zs-file-icon{margin:0;width:24px;height:24px}.zs-field--file .zs-file-drop--button .zs-file-drop-hint,.zs-field--file .zs-file-drop--compact .zs-file-drop-hint{margin-inline-start:auto}.zs-field--file .zs-file-drop--avatar{flex:0 0 auto;width:var(--zs-avatar-size, 96px);height:var(--zs-avatar-size, 96px);min-height:0;padding:0;overflow:hidden;border-style:solid;border-radius:50%}.zs-field--file .zs-file-drop--avatar .zs-file-drop-title,.zs-field--file .zs-file-drop--avatar .zs-file-drop-hint{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}.zs-field--file .zs-file-drop--avatar .zs-file-icon{margin:0}.zs-file-avatar{position:absolute;inset:0;display:block}.zs-file-avatar[hidden]{display:none}.zs-file-avatar img{width:100%;height:100%;object-fit:cover;display:block}.zs-file-drop--has-preview .zs-file-icon{display:none}.zs-field--file .zs-file-drop--gallery{flex-direction:row;flex-wrap:wrap;justify-content:center;gap:6px;min-height:88px;padding:14px}.zs-field[data-zs-file-variant=gallery] .zs-file-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:8px}.zs-field[data-zs-file-variant=gallery] .zs-file-item{flex-direction:column;align-items:stretch;gap:6px;padding:6px}.zs-field[data-zs-file-variant=gallery] .zs-file-thumb{width:100%;height:86px;border-radius:6px}.zs-field[data-zs-file-variant=gallery] .zs-file-actions{justify-content:flex-end}.zs-field[data-zs-file-variant=gallery] .zs-file-upload-state{flex-wrap:wrap}.zs-file-upload-state{display:flex;align-items:center;gap:6px;font-size:.6875rem}.zs-file-progress{position:relative;display:inline-block;flex:1 1 58px;height:4px;min-width:44px;overflow:hidden;border-radius:999px}.zs-file-progress-bar{display:block;height:100%;width:0;border-radius:inherit;transition:width .12s linear}.zs-file-actions{flex:0 0 auto;display:inline-flex;align-items:center;gap:4px}.zs-file-cancel,.zs-file-retry{padding:2px 6px;border:0;border-radius:5px;font:inherit;font-size:.6875rem;font-weight:600;cursor:pointer}.zs-form-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(var(--zs-grid-min, 230px),1fr));gap:var(--zs-grid-gap, 16px);align-items:start}.zs-form-grid>.zs-full{grid-column:1 / -1}.zs-check input:focus-visible+.zs-check-box,.zs-check input:focus-visible+.zs-switch-track,.zs-radio input:focus-visible+.zs-radio-dot{outline:2px solid transparent;outline-offset:2px}.zs-input-native:focus-visible,.zs-file-input:focus-visible{outline:none}@media (prefers-reduced-motion: reduce){.zs-root,.zs-root *,.zs-root *:before,.zs-root *:after,.zs-field,.zs-field *,.zs-field *:before,.zs-field *:after,.zs-radio-group,.zs-radio-group *{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important;scroll-behavior:auto!important}.zs-root .zs-spinner{animation-duration:1.2s!important;animation-iteration-count:infinite!important}}
|