zidan-select 2.2.1 → 2.2.3
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 +151 -22
- package/dist/file/plugin-file-core.css +1 -1
- package/dist/file/plugin-file-theme.css +1 -1
- package/dist/file/zidan-file.js +2 -2
- package/dist/select/plugin-select-core.css +1 -1
- package/dist/select/plugin-select-theme.css +1 -1
- package/dist/select/zidan-select.js +2 -2
- package/dist/zidan-form.js +2 -2
- package/docs/build.md +43 -3
- package/docs/index.html +20 -3
- package/docs/options.md +193 -0
- package/package.json +14 -4
- package/zidan-form.js +2 -2
package/README.md
CHANGED
|
@@ -10,6 +10,47 @@ two separate stylesheets.
|
|
|
10
10
|
[](docs/options.md)
|
|
11
11
|
[](LICENSE)
|
|
12
12
|
|
|
13
|
+
## Which files should you load?
|
|
14
|
+
|
|
15
|
+
> **You do not need to load everything.** Each build is complete and standalone — pick the one
|
|
16
|
+
> that matches your page. The full bundle is only for forms that enhance several inputs at once.
|
|
17
|
+
|
|
18
|
+
- **Only custom select dropdowns** — load **only** the select build's JavaScript and CSS. You do
|
|
19
|
+
not need the full form bundle if you only want styled `<select>` elements.
|
|
20
|
+
- **Only file upload inputs** — load **only** the file upload build's JavaScript and CSS if you
|
|
21
|
+
only want custom file pickers and want the rest of your form left untouched.
|
|
22
|
+
- **All form inputs at once** — load the **complete form bundle** (full JavaScript and CSS) to
|
|
23
|
+
style and enhance every supported input across your form: text fields, selects, file uploads,
|
|
24
|
+
checkboxes and radios.
|
|
25
|
+
|
|
26
|
+
Load **one** build per page. A subset is not an add-on: never load it together with the full
|
|
27
|
+
bundle.
|
|
28
|
+
|
|
29
|
+
| Build | JavaScript (CDN) | CSS (CDN) |
|
|
30
|
+
| --- | --- | --- |
|
|
31
|
+
| Full — every control | [zidan-form.js](https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/zidan-form.js) | [plugin-core.css](https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/plugin-core.css) + [plugin-theme.css](https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/plugin-theme.css) |
|
|
32
|
+
| Select-only — ≈95 kB | [zidan-select.js](https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/dist/select/zidan-select.js) | [plugin-select-core.css](https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/dist/select/plugin-select-core.css) + [plugin-select-theme.css](https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/dist/select/plugin-select-theme.css) |
|
|
33
|
+
| File-only — ≈76 kB | [zidan-file.js](https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/dist/file/zidan-file.js) | [plugin-file-core.css](https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/dist/file/plugin-file-core.css) + [plugin-file-theme.css](https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/dist/file/plugin-file-theme.css) |
|
|
34
|
+
|
|
35
|
+
Copyable snippets, ESM files and per-file sizes live in
|
|
36
|
+
[Select-only and file-only builds](#select-only-and-file-only-builds); the
|
|
37
|
+
[live demo](https://akhtar1985.github.io/zidan-select/#builds) shows all three side by side.
|
|
38
|
+
|
|
39
|
+
**Build a field visually:** the [field playground](https://akhtar1985.github.io/zidan-select/playground.html)
|
|
40
|
+
toggles every option for one control, previews it live and copies the matching HTML attributes or
|
|
41
|
+
vanilla JavaScript.
|
|
42
|
+
|
|
43
|
+
### Minified CDN URLs
|
|
44
|
+
|
|
45
|
+
jsDelivr minifies these on request from the published sources, so the `.min` files always match
|
|
46
|
+
the pinned version:
|
|
47
|
+
|
|
48
|
+
| Build | JS (min) | CSS (min) |
|
|
49
|
+
| --- | --- | --- |
|
|
50
|
+
| Full | [zidan-form.min.js](https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/zidan-form.min.js) | [plugin-core.min.css](https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/plugin-core.min.css) + [plugin-theme.min.css](https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/plugin-theme.min.css) |
|
|
51
|
+
| Select-only | [zidan-select.min.js](https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/dist/select/zidan-select.min.js) | [plugin-select-core.min.css](https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/dist/select/plugin-select-core.min.css) + [plugin-select-theme.min.css](https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/dist/select/plugin-select-theme.min.css) |
|
|
52
|
+
| File-only | [zidan-file.min.js](https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/dist/file/zidan-file.min.js) | [plugin-file-core.min.css](https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/dist/file/plugin-file-core.min.css) + [plugin-file-theme.min.css](https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/dist/file/plugin-file-theme.min.css) |
|
|
53
|
+
|
|
13
54
|
- **One file of JS** — `zidan-form.js` (classic script, UMD-ish) + `zidan-form.mjs` (ESM wrapper).
|
|
14
55
|
- **Split CSS** — `plugin-core.css` (structure only) and `plugin-theme.css` (tokens, presets, skins).
|
|
15
56
|
- **Opt-in per control** — nothing is touched unless it carries a `data-zidan*` attribute or is
|
|
@@ -168,14 +209,19 @@ override presets.
|
|
|
168
209
|
| `dist/select/` | Select-only build: `zidan-select.js`, `zidan-select.mjs`, `plugin-select-core.css`, `plugin-select-theme.css`. |
|
|
169
210
|
| `dist/file/` | File-only build: `zidan-file.js`, `zidan-file.mjs`, `plugin-file-core.css`, `plugin-file-theme.css`. |
|
|
170
211
|
| `index.html`, `demo.css`, `demo.js` | The tabbed demo / theme showcase (not shipped logic). |
|
|
212
|
+
| `playground.html`, `playground.css`, `playground.js` | Per-field option builder with live preview and copyable HTML / JS output (not shipped logic). |
|
|
213
|
+
| `robots.txt`, `sitemap.xml` | Crawler directives and the public page list for GitHub Pages (not shipped on npm). |
|
|
171
214
|
| `docs/` | Comparison, options, validation, frameworks, theming and build guides. |
|
|
172
215
|
|
|
173
216
|
Copyable URLs for the published files (pin the version in production):
|
|
174
217
|
|
|
175
|
-
- `zidan-form.js` — <https://cdn.jsdelivr.net/npm/zidan-select@2.2.
|
|
176
|
-
- `zidan-form.
|
|
177
|
-
- `
|
|
178
|
-
- `plugin-
|
|
218
|
+
- `zidan-form.js` — <https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/zidan-form.js>
|
|
219
|
+
- `zidan-form.min.js` — <https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/zidan-form.min.js>
|
|
220
|
+
- `zidan-form.mjs` — <https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/zidan-form.mjs>
|
|
221
|
+
- `plugin-core.css` — <https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/plugin-core.css>
|
|
222
|
+
- `plugin-core.min.css` — <https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/plugin-core.min.css>
|
|
223
|
+
- `plugin-theme.css` — <https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/plugin-theme.css>
|
|
224
|
+
- `plugin-theme.min.css` — <https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/plugin-theme.min.css>
|
|
179
225
|
- npm package — <https://www.npmjs.com/package/zidan-select>
|
|
180
226
|
- Source — <https://github.com/akhtar1985/zidan-select>
|
|
181
227
|
|
|
@@ -196,21 +242,27 @@ exactly like the full build.
|
|
|
196
242
|
|
|
197
243
|
Copyable CDN URLs (pin the version):
|
|
198
244
|
|
|
199
|
-
- `zidan-select.js` — <https://cdn.jsdelivr.net/npm/zidan-select@2.2.
|
|
200
|
-
- `zidan-select.
|
|
201
|
-
- `
|
|
202
|
-
- `plugin-select-
|
|
203
|
-
- `
|
|
204
|
-
- `
|
|
205
|
-
- `plugin-
|
|
206
|
-
- `
|
|
245
|
+
- `zidan-select.js` — <https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/dist/select/zidan-select.js>
|
|
246
|
+
- `zidan-select.min.js` — <https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/dist/select/zidan-select.min.js>
|
|
247
|
+
- `zidan-select.mjs` — <https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/dist/select/zidan-select.mjs>
|
|
248
|
+
- `plugin-select-core.css` — <https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/dist/select/plugin-select-core.css>
|
|
249
|
+
- `plugin-select-core.min.css` — <https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/dist/select/plugin-select-core.min.css>
|
|
250
|
+
- `plugin-select-theme.css` — <https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/dist/select/plugin-select-theme.css>
|
|
251
|
+
- `plugin-select-theme.min.css` — <https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/dist/select/plugin-select-theme.min.css>
|
|
252
|
+
- `zidan-file.js` — <https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/dist/file/zidan-file.js>
|
|
253
|
+
- `zidan-file.min.js` — <https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/dist/file/zidan-file.min.js>
|
|
254
|
+
- `zidan-file.mjs` — <https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/dist/file/zidan-file.mjs>
|
|
255
|
+
- `plugin-file-core.css` — <https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/dist/file/plugin-file-core.css>
|
|
256
|
+
- `plugin-file-core.min.css` — <https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/dist/file/plugin-file-core.min.css>
|
|
257
|
+
- `plugin-file-theme.css` — <https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/dist/file/plugin-file-theme.css>
|
|
258
|
+
- `plugin-file-theme.min.css` — <https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/dist/file/plugin-file-theme.min.css>
|
|
207
259
|
|
|
208
260
|
Select / combobox / tags only (≈95 kB JS, ≈12 kB core CSS, ≈32 kB theme CSS):
|
|
209
261
|
|
|
210
262
|
```html
|
|
211
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/zidan-select@2.2.
|
|
212
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/zidan-select@2.2.
|
|
213
|
-
<script src="https://cdn.jsdelivr.net/npm/zidan-select@2.2.
|
|
263
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/dist/select/plugin-select-core.css">
|
|
264
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/dist/select/plugin-select-theme.css">
|
|
265
|
+
<script src="https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/dist/select/zidan-select.js"></script>
|
|
214
266
|
<script>
|
|
215
267
|
// auto-init covers [data-zidan-select], class="zidan-select", zidan-form scopes
|
|
216
268
|
// and ZIDAN_FORM_CONFIG targets; JS-only options:
|
|
@@ -221,9 +273,9 @@ Select / combobox / tags only (≈95 kB JS, ≈12 kB core CSS, ≈32 kB theme CS
|
|
|
221
273
|
File upload only (≈76 kB JS, ≈9 kB core CSS, ≈35 kB theme CSS):
|
|
222
274
|
|
|
223
275
|
```html
|
|
224
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/zidan-select@2.2.
|
|
225
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/zidan-select@2.2.
|
|
226
|
-
<script src="https://cdn.jsdelivr.net/npm/zidan-select@2.2.
|
|
276
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/dist/file/plugin-file-core.css">
|
|
277
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/dist/file/plugin-file-theme.css">
|
|
278
|
+
<script src="https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/dist/file/zidan-file.js"></script>
|
|
227
279
|
<script>
|
|
228
280
|
zidanField('#upload', { variant: 'dropzone', upload: '/api/files' });
|
|
229
281
|
</script>
|
|
@@ -339,6 +391,69 @@ same config keys, marker classes and JSON attribute.
|
|
|
339
391
|
Windows/macOS keyboard behaviour, grouping, search and all select features live in
|
|
340
392
|
[`docs/options.md`](docs/options.md).
|
|
341
393
|
|
|
394
|
+
### JavaScript init: one select by ID or class
|
|
395
|
+
|
|
396
|
+
You do not need any `data-*` attribute. Pass a selector, an element or a NodeList as the first
|
|
397
|
+
argument to `zidanSelect()`:
|
|
398
|
+
|
|
399
|
+
```html
|
|
400
|
+
<select id="mymov" name="movie">
|
|
401
|
+
<option value="">Choose a movie…</option>
|
|
402
|
+
<option value="inception" selected>Inception</option>
|
|
403
|
+
<option value="dune">Dune</option>
|
|
404
|
+
</select>
|
|
405
|
+
|
|
406
|
+
<!-- select-only build; use zidan-form.js for every control -->
|
|
407
|
+
<script src="https://cdn.jsdelivr.net/npm/zidan-select@2.2.3/dist/select/zidan-select.js"></script>
|
|
408
|
+
<script>
|
|
409
|
+
const picker = zidanSelect('#mymov', {
|
|
410
|
+
mode: 'combobox', // 'select' | 'combobox' | 'tags'
|
|
411
|
+
label: 'Movie',
|
|
412
|
+
placeholder: 'Search a movie…',
|
|
413
|
+
searchable: true,
|
|
414
|
+
clearable: true,
|
|
415
|
+
maxDropdownHeight: 280,
|
|
416
|
+
noResultsText: 'Nothing matched'
|
|
417
|
+
});
|
|
418
|
+
|
|
419
|
+
// one call for every element with the class; returns an array
|
|
420
|
+
zidanSelect('.mymovclass', { mode: 'select', layout: 'soft-pill' });
|
|
421
|
+
</script>
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
Plain selects are left alone by auto-init (it only scans `[data-zidan-select]` and
|
|
425
|
+
`.zidan-select`), so this is the clean way to style a single existing field without touching
|
|
426
|
+
its markup. The call returns the instance (or an array for multiple matches).
|
|
427
|
+
|
|
428
|
+
Read the value and the selected `<option>` details:
|
|
429
|
+
|
|
430
|
+
```js
|
|
431
|
+
picker.getValue(); // 'inception' (array for multiple/tags)
|
|
432
|
+
picker.setValue('dune');
|
|
433
|
+
|
|
434
|
+
const native = document.querySelector('#mymov');
|
|
435
|
+
native.selectedOptions[0]; // the real <option> element
|
|
436
|
+
Array.from(native.selectedOptions).map(option => ({
|
|
437
|
+
value: option.value, label: option.text, disabled: option.disabled
|
|
438
|
+
}));
|
|
439
|
+
|
|
440
|
+
// replace the list (rebuilds the native options too)
|
|
441
|
+
picker.setOptions([
|
|
442
|
+
{ value: 'inception', label: 'Inception' },
|
|
443
|
+
{ value: 'dune', label: 'Dune', group: 'Villeneuve' },
|
|
444
|
+
{ value: 'arrival', label: 'Arrival', disabled: true }
|
|
445
|
+
]);
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
The file-only build uses the same targeted pattern: `zidanField('#upload', { variant: 'dropzone',
|
|
449
|
+
accept: 'image/*', maxFiles: 4 })` and `zidanField('.upload-field', options)`.
|
|
450
|
+
|
|
451
|
+
Every option in JavaScript form — with defaults, callbacks and rendering hooks — is in
|
|
452
|
+
[Select options](docs/options.md#select-options) and
|
|
453
|
+
[File upload](docs/options.md#file-upload-variants-uploading--rendering). Try the editable
|
|
454
|
+
options object live in the demo's **Select** tab →
|
|
455
|
+
[Direct JS init](https://akhtar1985.github.io/zidan-select/#select).
|
|
456
|
+
|
|
342
457
|
---
|
|
343
458
|
|
|
344
459
|
## Input types
|
|
@@ -879,16 +994,19 @@ The repo is dependency-free and works from source; `npm run build` only assemble
|
|
|
879
994
|
|
|
880
995
|
```bash
|
|
881
996
|
npm run dev # static server → http://localhost:4173
|
|
882
|
-
npm test # syntax + split-CSS + API checks (no browser, no deps)
|
|
883
|
-
npm run lint # node --check on every script
|
|
884
|
-
npm run build # dist/ (+ .min files when esbuild is installed)
|
|
997
|
+
npm test # syntax + split-CSS + API + playground/docs checks (no browser, no deps)
|
|
998
|
+
npm run lint # node --check on every script, playground.js included
|
|
999
|
+
npm run build # dist/ (+ local .min files when esbuild is installed)
|
|
885
1000
|
```
|
|
886
1001
|
|
|
887
1002
|
| Command | What it does |
|
|
888
1003
|
| --- | --- |
|
|
889
1004
|
| `scripts/serve.mjs` | No-dependency demo server on port 4173 (`PORT=8080 npm run dev`). |
|
|
890
1005
|
| `scripts/build.mjs` | Cleans `dist/`, copies the four assets, writes `dist/zidan-form.cjs`, and minifies with esbuild **if** it is installed. |
|
|
891
|
-
| `scripts/test.mjs` | Verifies syntax, that core CSS carries no colour literals, that all presets/adapters exist
|
|
1006
|
+
| `scripts/test.mjs` | Verifies syntax, that core CSS carries no colour literals, that all presets/adapters exist, the public API is exported, and the playground, README and demo stay wired to each other. |
|
|
1007
|
+
|
|
1008
|
+
Minified files on the CDN do not need esbuild: jsDelivr generates `.min.*` from the
|
|
1009
|
+
published sources, so the `@2.2.3` `.min` URLs above stay valid without a local build.
|
|
892
1010
|
|
|
893
1011
|
Publishing:
|
|
894
1012
|
|
|
@@ -947,6 +1065,17 @@ Full checklist, folder tree and release automation notes: [`docs/build.md`](docs
|
|
|
947
1065
|
|
|
948
1066
|
The 2.0 API is unchanged; every addition is opt-in.
|
|
949
1067
|
|
|
1068
|
+
**2.2.3** is a metadata-only release. It adds the author profile URL, expands the npm keywords
|
|
1069
|
+
with `form-validation`, `phone-input`, `range-slider` and `theming`, and sets
|
|
1070
|
+
`publishConfig.access` explicitly. No JavaScript or CSS behaviour changed; the version constant
|
|
1071
|
+
is bumped so cached copies stay distinguishable.
|
|
1072
|
+
|
|
1073
|
+
**2.2.2** adds a per-control [field playground](https://akhtar1985.github.io/zidan-select/playground.html)
|
|
1074
|
+
that previews every option and copies either HTML data attributes or the equivalent vanilla JS,
|
|
1075
|
+
lists the jsDelivr `.min` CDN URLs for all three builds, and states plainly in the README, demo
|
|
1076
|
+
and build guide that a select-only or file-only build is complete on its own — you do not need
|
|
1077
|
+
the full bundle unless one form enhances several input types at once.
|
|
1078
|
+
|
|
950
1079
|
**2.2.1** adds declarative no-JavaScript init — marker classes (`zidan-select`,
|
|
951
1080
|
`zidan-field`, `zidan-form`), ID/CSS targets through `window.ZIDAN_FORM_CONFIG` and
|
|
952
1081
|
`data-zidan-options` JSON — for the full build and both subset bundles, with docs and demo
|
package/dist/file/zidan-file.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ZidanForm File-only v2.2.
|
|
2
|
+
* ZidanForm File-only v2.2.3
|
|
3
3
|
* Zero-dependency drag & drop file upload with variants, previews, limits and progress.
|
|
4
4
|
* Pairs with plugin-file-core.css and plugin-file-theme.css.
|
|
5
5
|
*
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
})(typeof window !== 'undefined' ? window : this, function (global) {
|
|
30
30
|
'use strict';
|
|
31
31
|
|
|
32
|
-
var VERSION = '2.2.
|
|
32
|
+
var VERSION = '2.2.3';
|
|
33
33
|
|
|
34
34
|
// Loading the file twice (classic script + module wrapper, or two bundles)
|
|
35
35
|
// must not replace the classes and orphan the live instances.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ZidanForm Select-only v2.2.
|
|
2
|
+
* ZidanForm Select-only v2.2.3
|
|
3
3
|
* Zero-dependency select / combobox / tags enhancement. Every other control family is omitted.
|
|
4
4
|
* Pairs with plugin-select-core.css and plugin-select-theme.css.
|
|
5
5
|
*
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
})(typeof window !== 'undefined' ? window : this, function (global) {
|
|
30
30
|
'use strict';
|
|
31
31
|
|
|
32
|
-
var VERSION = '2.2.
|
|
32
|
+
var VERSION = '2.2.3';
|
|
33
33
|
|
|
34
34
|
// Loading the file twice (classic script + module wrapper, or two bundles)
|
|
35
35
|
// must not replace the classes and orphan the live instances.
|
package/dist/zidan-form.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ZidanForm v2.2.
|
|
2
|
+
* ZidanForm v2.2.3
|
|
3
3
|
* Zero-dependency form enhancement library: select / combobox / tags,
|
|
4
4
|
* checkboxes, switches, radio groups, file upload with drag & drop and
|
|
5
5
|
* upload progress, text / number / phone / date / range inputs and textarea.
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
})(typeof window !== 'undefined' ? window : this, function (global) {
|
|
33
33
|
'use strict';
|
|
34
34
|
|
|
35
|
-
var VERSION = '2.2.
|
|
35
|
+
var VERSION = '2.2.3';
|
|
36
36
|
|
|
37
37
|
// Loading the file twice (classic script + module wrapper, or two bundles)
|
|
38
38
|
// must not replace the classes and orphan the live instances.
|
package/docs/build.md
CHANGED
|
@@ -13,6 +13,10 @@ zidan-select/
|
|
|
13
13
|
├─ plugin-core.css # structure only
|
|
14
14
|
├─ plugin-theme.css # tokens, presets, layouts, framework adapters
|
|
15
15
|
├─ index.html # tabbed demo + theme showcase
|
|
16
|
+
├─ playground.html # per-field option builder
|
|
17
|
+
├─ playground.css/js # playground-only assets
|
|
18
|
+
├─ robots.txt # Pages crawler directives + sitemap pointer
|
|
19
|
+
├─ sitemap.xml # public Pages URLs
|
|
16
20
|
├─ demo.css / demo.js # demo-only assets
|
|
17
21
|
├─ package.json # npm metadata + scripts
|
|
18
22
|
├─ scripts/
|
|
@@ -24,6 +28,22 @@ zidan-select/
|
|
|
24
28
|
└─ LICENSE
|
|
25
29
|
```
|
|
26
30
|
|
|
31
|
+
### Which files should you load?
|
|
32
|
+
|
|
33
|
+
**You do not have to load everything.** If the page only needs one control, load only that
|
|
34
|
+
build; the complete form bundle is only for forms that enhance several inputs at once. A subset
|
|
35
|
+
is a standalone build, not an add-on, so never load it together with the full bundle.
|
|
36
|
+
|
|
37
|
+
| If the page only needs… | Load |
|
|
38
|
+
| --- | --- |
|
|
39
|
+
| Custom select dropdowns | `dist/select/zidan-select.js` plus `plugin-select-core.css` and `plugin-select-theme.css`. Every other input stays untouched; the full bundle is not needed. |
|
|
40
|
+
| File uploads | `dist/file/zidan-file.js` plus `plugin-file-core.css` and `plugin-file-theme.css`. The rest of the form is untouched. |
|
|
41
|
+
| Every input at once | `zidan-form.js` plus `plugin-core.css` and `plugin-theme.css`; one `initZidanForms()` call enhances text fields, selects, file uploads, checkboxes and radios together. |
|
|
42
|
+
|
|
43
|
+
Snippets and ESM variants for each row are under
|
|
44
|
+
[Select-only and file-only builds](#select-only-and-file-only-builds); the demo shows all three
|
|
45
|
+
side by side at the [builds section](https://akhtar1985.github.io/zidan-select/#builds).
|
|
46
|
+
|
|
27
47
|
## Scripts
|
|
28
48
|
|
|
29
49
|
| Command | Effect |
|
|
@@ -66,6 +86,22 @@ npm run build
|
|
|
66
86
|
Without esbuild the build still succeeds and prints that minification was skipped. Add
|
|
67
87
|
`dist/` to `.gitignore`; it is regenerated at publish time.
|
|
68
88
|
|
|
89
|
+
### Minified CDN URLs
|
|
90
|
+
|
|
91
|
+
You do not need esbuild to ship minified files from a CDN. jsDelivr generates `.min.*` on
|
|
92
|
+
request from the published sources, so these URLs track the pinned version even though the npm
|
|
93
|
+
tarball only contains the readable files:
|
|
94
|
+
|
|
95
|
+
| Build | JavaScript | Core CSS | Theme CSS |
|
|
96
|
+
| --- | --- | --- | --- |
|
|
97
|
+
| Full | `/zidan-form.min.js` | `/plugin-core.min.css` | `/plugin-theme.min.css` |
|
|
98
|
+
| Select-only | `/dist/select/zidan-select.min.js` | `/dist/select/plugin-select-core.min.css` | `/dist/select/plugin-select-theme.min.css` |
|
|
99
|
+
| File-only | `/dist/file/zidan-file.min.js` | `/dist/file/plugin-file-core.min.css` | `/dist/file/plugin-file-theme.min.css` |
|
|
100
|
+
|
|
101
|
+
Prepend `https://cdn.jsdelivr.net/npm/zidan-select@2.2.3` to each path. Check the three you use
|
|
102
|
+
with `curl -I` before changing a version, then update the URLs in the README, the demo build
|
|
103
|
+
cards and the playground in the same commit.
|
|
104
|
+
|
|
69
105
|
## Select-only and file-only builds
|
|
70
106
|
|
|
71
107
|
`scripts/build.mjs` slices the single source into two smaller distributables. The sections in
|
|
@@ -83,7 +119,7 @@ Both theme stylesheets keep the token set, the five preset themes (`default`, `m
|
|
|
83
119
|
adapters, so `data-zidan-theme`, `data-zidan-layout` and `data-zidan-framework` behave the same
|
|
84
120
|
as in the full build.
|
|
85
121
|
|
|
86
|
-
Approximate v2.2.
|
|
122
|
+
Approximate v2.2.3 sizes: select ≈95 kB JS + 12 kB core + 32 kB theme; file ≈76 kB JS +
|
|
87
123
|
9 kB core + 35 kB theme, against ≈194 kB JS + 36 kB core + 47 kB theme for the full build.
|
|
88
124
|
|
|
89
125
|
A page should load **one** flavour: a subset **or** the full build. The `__zidanFormGuard`
|
|
@@ -164,16 +200,20 @@ import 'zidan-select/file/css/theme';
|
|
|
164
200
|
## GitHub Pages
|
|
165
201
|
|
|
166
202
|
The demo is static and needs no build. `.github/workflows/pages.yml` assembles `_site/` on every
|
|
167
|
-
push to `main` — `index.html`, `
|
|
168
|
-
|
|
203
|
+
push to `main` — `index.html`, `playground.html`, `playground.css`, `playground.js`, `demo.css`,
|
|
204
|
+
`demo.js`, `robots.txt`, `sitemap.xml`, the four library files and `docs/` — then uploads it with
|
|
205
|
+
`actions/upload-pages-artifact` and publishes it with `actions/deploy-pages`.
|
|
169
206
|
|
|
170
207
|
One-time setup: **Settings → Pages → Build and deployment → Source: GitHub Actions**.
|
|
171
208
|
|
|
172
209
|
| URL | Serves |
|
|
173
210
|
| --- | --- |
|
|
174
211
|
| `https://akhtar1985.github.io/zidan-select/` | The tabbed demo |
|
|
212
|
+
| `https://akhtar1985.github.io/zidan-select/playground.html` | Per-field option playground |
|
|
175
213
|
| `https://akhtar1985.github.io/zidan-select/docs/` | Documentation index |
|
|
176
214
|
| `/#select`, `/#check`, `/#file`, `/#inputs`, `/#themes` | Deep links to a demo tab |
|
|
215
|
+
| `/playground.html#select`, `#file`, `#checkbox`, `#radio`, `#text` | Deep links to a playground control |
|
|
216
|
+
| `/robots.txt`, `/sitemap.xml` | Crawler directives and the four public page URLs |
|
|
177
217
|
|
|
178
218
|
The workflow only copies demo assets, so `scripts/`, `dist/`, `package.json` and local scratch
|
|
179
219
|
files are never published.
|
package/docs/index.html
CHANGED
|
@@ -4,6 +4,14 @@
|
|
|
4
4
|
<meta charset="utf-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
6
|
<title>ZidanForm documentation</title>
|
|
7
|
+
<meta name="description" content="ZidanForm documentation index: field playground, options and data attributes, validation compatibility, theming, framework integration, build and publish guides.">
|
|
8
|
+
<link rel="canonical" href="https://akhtar1985.github.io/zidan-select/docs/">
|
|
9
|
+
<meta property="og:type" content="website">
|
|
10
|
+
<meta property="og:title" content="ZidanForm documentation">
|
|
11
|
+
<meta property="og:description" content="Options, validation, theming, frameworks and build guides for the ZidanForm vanilla form library.">
|
|
12
|
+
<meta property="og:url" content="https://akhtar1985.github.io/zidan-select/docs/">
|
|
13
|
+
<meta property="og:image" content="https://akhtar1985.github.io/zidan-select/docs/demo-inputs.png">
|
|
14
|
+
<meta name="twitter:card" content="summary_large_image">
|
|
7
15
|
<style>
|
|
8
16
|
:root { color-scheme: light; }
|
|
9
17
|
* { box-sizing: border-box; }
|
|
@@ -39,14 +47,22 @@
|
|
|
39
47
|
<p class="lead">
|
|
40
48
|
Zero-dependency form enhancement: select, checkbox, switch, radio, file upload, text,
|
|
41
49
|
number, phone, date and range inputs — with input icons, steppers and upload progress.
|
|
42
|
-
Start with the <a href="../index.html">interactive demo</a
|
|
43
|
-
reference.
|
|
50
|
+
Start with the <a href="../index.html">interactive demo</a> or the
|
|
51
|
+
<a href="../playground.html">field playground</a>, then dive into the reference.
|
|
44
52
|
</p>
|
|
45
53
|
<a href="../index.html">
|
|
46
54
|
<img src="demo-inputs.png" alt="Input icons, number stepper, phone formatting and range controls in the ZidanForm demo"
|
|
47
55
|
style="display:block;width:100%;max-width:640px;margin:0 0 28px;border-radius:14px;border:1px solid #e4e8f1;box-shadow:0 1px 2px rgba(16,19,36,.05)">
|
|
48
56
|
</a>
|
|
49
57
|
<ul>
|
|
58
|
+
<li>
|
|
59
|
+
<strong><a href="../playground.html">Field playground</a></strong>
|
|
60
|
+
<span>Pick one control, toggle its options, preview it live and copy the matching HTML attributes or vanilla JavaScript call.</span>
|
|
61
|
+
</li>
|
|
62
|
+
<li>
|
|
63
|
+
<strong><a href="https://github.com/akhtar1985/zidan-select#which-files-should-you-load">Which files should I load?</a></strong>
|
|
64
|
+
<span>Only want a select, or only a file upload? Load only that build — you do not need the full bundle. The complete form JS and CSS is for forms that enhance every input at once.</span>
|
|
65
|
+
</li>
|
|
50
66
|
<li>
|
|
51
67
|
<strong><a href="https://github.com/akhtar1985/zidan-select/blob/main/docs/comparison.md">Why ZidanForm & comparison</a></strong>
|
|
52
68
|
<span>Feature matrix against Select2, Choices.js, Tom Select, Slim Select and Bootstrap, plus benefits, trade-offs and migration notes.</span>
|
|
@@ -77,7 +93,8 @@
|
|
|
77
93
|
</li>
|
|
78
94
|
</ul>
|
|
79
95
|
<footer>
|
|
80
|
-
Markdown guides open rendered on GitHub; <a href="../index.html">the demo</a
|
|
96
|
+
Markdown guides open rendered on GitHub; <a href="../index.html">the demo</a>, the
|
|
97
|
+
<a href="../playground.html">field playground</a> and the
|
|
81
98
|
<a href="validation.html">validation bench</a> run here on GitHub Pages.
|
|
82
99
|
Source: <a href="https://github.com/akhtar1985/zidan-select">github.com/akhtar1985/zidan-select</a>.
|
|
83
100
|
</footer>
|
package/docs/options.md
CHANGED
|
@@ -6,6 +6,65 @@ passed to `initZidanSelects()` / `initZidanForms()` / `zidanSelect()` / `zidanFi
|
|
|
6
6
|
`zidanField()` itself accepts any supported `<input>`/`<textarea>`, with or without a
|
|
7
7
|
`data-zidan*` attribute, which is how JS-only options are applied.
|
|
8
8
|
|
|
9
|
+
> **Prefer to click through the options?** The
|
|
10
|
+
> [field playground](https://akhtar1985.github.io/zidan-select/playground.html) exposes every
|
|
11
|
+
> option for one control at a time and copies both the HTML attribute form and the vanilla
|
|
12
|
+
> JavaScript object shown below.
|
|
13
|
+
|
|
14
|
+
## Direct init by ID or class
|
|
15
|
+
|
|
16
|
+
The first argument of `zidanSelect()` accepts a CSS selector, an element, or a NodeList. Plain
|
|
17
|
+
selects are not auto-initialised, so you can enhance exactly the field you want:
|
|
18
|
+
|
|
19
|
+
```html
|
|
20
|
+
<select id="mymov">…</select>
|
|
21
|
+
<select class="mymovclass">…</select>
|
|
22
|
+
<select class="mymovclass">…</select>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
```js
|
|
26
|
+
const picker = zidanSelect('#mymov', {
|
|
27
|
+
mode: 'combobox',
|
|
28
|
+
label: 'Movie',
|
|
29
|
+
placeholder: 'Search a movie…',
|
|
30
|
+
searchable: true,
|
|
31
|
+
clearable: true
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const pickers = zidanSelect('.mymovclass', { mode: 'select', layout: 'soft-pill' });
|
|
35
|
+
// one match → instance, several → array
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
`initZidanSelects(scope, options)` still bulk-enhances every `[data-zidan-select]` and
|
|
39
|
+
`.zidan-select` inside a scope; use it when the markup can carry attributes. `zidanSelect()`
|
|
40
|
+
is the targeted form for IDs, classes and elements you already have a reference to.
|
|
41
|
+
|
|
42
|
+
### Read values and option details
|
|
43
|
+
|
|
44
|
+
```js
|
|
45
|
+
picker.getValue(); // selected value; array for multiple/tags
|
|
46
|
+
picker.setValue('dune');
|
|
47
|
+
picker.getTags(); // tags mode
|
|
48
|
+
|
|
49
|
+
const native = picker.el; // the original <select>
|
|
50
|
+
native.selectedOptions; // selected <option> elements
|
|
51
|
+
Array.from(native.options).map(option => ({
|
|
52
|
+
value: option.value,
|
|
53
|
+
label: option.text,
|
|
54
|
+
disabled: option.disabled,
|
|
55
|
+
group: option.parentElement.tagName === 'OPTGROUP' ? option.parentElement.label : null
|
|
56
|
+
}));
|
|
57
|
+
|
|
58
|
+
picker.setOptions([ // rebuilds listbox and native <option>s
|
|
59
|
+
{ value: 'inception', label: 'Inception' },
|
|
60
|
+
{ value: 'dune', label: 'Dune', group: 'Villeneuve' },
|
|
61
|
+
{ value: 'arrival', label: 'Arrival', disabled: true }
|
|
62
|
+
]);
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Listen to the library callback in the options (`onChange: ({ instance, value }) => …`) or to the
|
|
66
|
+
native `change` event; the native `<select>` always holds the current value.
|
|
67
|
+
|
|
9
68
|
## No-JS init (IDs, classes, selectors, JSON)
|
|
10
69
|
|
|
11
70
|
For CMS templates where attributes are limited and custom scripts are unwelcome, init can be
|
|
@@ -317,6 +376,60 @@ Variants are set with `fileVariant` / `data-zidan-file-variant` (defaults to `dr
|
|
|
317
376
|
| `cancelLabel` / `retryLabel` | — | string | `Cancel` / `Retry` | Per-file action labels. |
|
|
318
377
|
| `renderFile` | — | function | — | `(itemElement, { file, index, state, field })` after the default row renders. |
|
|
319
378
|
|
|
379
|
+
### Every file option in one object
|
|
380
|
+
|
|
381
|
+
```js
|
|
382
|
+
const upload = zidanField('#files', {
|
|
383
|
+
/* Target by ID, class or element; no data-* attribute required */
|
|
384
|
+
|
|
385
|
+
/* Variant & copy */
|
|
386
|
+
variant: 'dropzone', // dropzone | button | avatar | gallery | compact
|
|
387
|
+
uploadIcon: 'upload', // any registered icon name or SVG markup
|
|
388
|
+
title: 'Choose a file',
|
|
389
|
+
dropHint: 'Drag & drop or browse',
|
|
390
|
+
layout: 'stacked', // stacked | inline | compact | floating | outlined | card
|
|
391
|
+
theme: 'default',
|
|
392
|
+
framework: 'none',
|
|
393
|
+
label: 'Attachments',
|
|
394
|
+
hint: 'PDF or images up to 5 MB.',
|
|
395
|
+
|
|
396
|
+
/* Rules */
|
|
397
|
+
accept: 'image/*,.pdf', // shown in the hint, checked against the picker
|
|
398
|
+
maxFiles: 4,
|
|
399
|
+
maxSizeMB: 5, // or maxSize: 5242880 (bytes)
|
|
400
|
+
showFileMeta: true,
|
|
401
|
+
showPreview: true,
|
|
402
|
+
replaceTitle: 'Change image',
|
|
403
|
+
|
|
404
|
+
/* Upload pipeline */
|
|
405
|
+
// upload: function (context) { … }, // custom uploader, contract below
|
|
406
|
+
// uploadUrl: '/api/files', // or XHR endpoint
|
|
407
|
+
uploadField: 'file',
|
|
408
|
+
// uploadData: function (file, field) { return { folder: 'avatars' }; },
|
|
409
|
+
// uploadHeaders: function (file, field) { return { 'X-Token': '…' }; },
|
|
410
|
+
withCredentials: false,
|
|
411
|
+
autoUpload: true,
|
|
412
|
+
simulateUpload: false, // visual-only pipeline
|
|
413
|
+
simulateDuration: 900, // ms
|
|
414
|
+
|
|
415
|
+
/* Per-file UI */
|
|
416
|
+
progressTemplate: 'Uploading {percent}%',
|
|
417
|
+
uploadedLabel: 'Uploaded',
|
|
418
|
+
failedLabel: 'Upload failed',
|
|
419
|
+
canceledLabel: 'Upload canceled',
|
|
420
|
+
cancelLabel: 'Cancel',
|
|
421
|
+
retryLabel: 'Retry',
|
|
422
|
+
// renderFile: function (itemElement, state) { … },
|
|
423
|
+
|
|
424
|
+
/* Callbacks — also zidan:upload-start/progress/success/error/cancel */
|
|
425
|
+
onUploadStart: function (event) { console.log('start', event.file); },
|
|
426
|
+
onUploadProgress: function (event) { console.log(event.progress); },
|
|
427
|
+
onUploadSuccess: function (event) { console.log('done', event.result); },
|
|
428
|
+
onUploadError: function (event) { console.log('failed', event.error); },
|
|
429
|
+
onUploadCancel: function (event) { console.log('canceled', event.file); }
|
|
430
|
+
});
|
|
431
|
+
```
|
|
432
|
+
|
|
320
433
|
Custom uploader contract:
|
|
321
434
|
|
|
322
435
|
```js
|
|
@@ -435,6 +548,86 @@ Callbacks: `onUploadStart`, `onUploadProgress`, `onUploadSuccess` / `onUpload`,
|
|
|
435
548
|
`onInit`, `onChange`, `onSelect`, `onOpen`, `onClose`, `onTagAdd`, `onTagRemove`, `onError`.
|
|
436
549
|
Every callback receives a single payload object with `instance` and the relevant value(s).
|
|
437
550
|
|
|
551
|
+
### Every select option in one object
|
|
552
|
+
|
|
553
|
+
Copy the block, delete what you do not need. Values shown are the defaults; only clauses that
|
|
554
|
+
change the shape of the result (options, value, callbacks) are commented out.
|
|
555
|
+
|
|
556
|
+
```js
|
|
557
|
+
const picker = zidanSelect('#mymov', {
|
|
558
|
+
/* Core */
|
|
559
|
+
mode: 'combobox', // 'select' | 'combobox' | 'tags' (default 'select')
|
|
560
|
+
layout: 'classic-clean', // 5 select layouts, see theming.md
|
|
561
|
+
themeFramework: 'none', // 'auto' | 'none' | 'vanilla' | 'bootstrap' | 'tailwind' | 'bulma' | 'foundation'
|
|
562
|
+
theme: 'default', // 'default' | 'modern' | 'minimal' | 'dark' | 'glass'
|
|
563
|
+
// id: 'mymov', // root id prefix; leave unset for class targets
|
|
564
|
+
// name: 'movie', // defaults to the native name
|
|
565
|
+
disabled: false,
|
|
566
|
+
required: false,
|
|
567
|
+
validation: null, // 'valid' | 'invalid' | null
|
|
568
|
+
scrollbar: 'default', // 'default' | 'thin' | 'fancy' | 'hover' | 'hidden'
|
|
569
|
+
customClasses: { root: '', control: '', input: '' },
|
|
570
|
+
|
|
571
|
+
/* Data — omit to use the native <option>s */
|
|
572
|
+
// options: [
|
|
573
|
+
// { value: 'inception', label: 'Inception' },
|
|
574
|
+
// { value: 'dune', label: 'Dune', group: 'Villeneuve' },
|
|
575
|
+
// { value: 'arrival', label: 'Arrival', disabled: true }
|
|
576
|
+
// ],
|
|
577
|
+
// suggestions: ['Interstellar', 'Oppenheimer'],
|
|
578
|
+
// value: 'inception', // string, or array for multiple/tags
|
|
579
|
+
label: 'Movie',
|
|
580
|
+
placeholder: 'Search a movie…',
|
|
581
|
+
|
|
582
|
+
/* Behaviour */
|
|
583
|
+
multiple: false, // mirrors native multiple by default
|
|
584
|
+
searchable: true, // false in plain 'select' mode
|
|
585
|
+
clearable: true,
|
|
586
|
+
closeOnSelect: true, // single mode
|
|
587
|
+
maxDropdownHeight: 280, // px
|
|
588
|
+
noResultsText: 'No results found',
|
|
589
|
+
emptyText: 'No options',
|
|
590
|
+
loadingText: 'Searching…',
|
|
591
|
+
clearText: 'Clear selection',
|
|
592
|
+
|
|
593
|
+
/* Combobox / async */
|
|
594
|
+
// fetchOptions: function (query, signal) {
|
|
595
|
+
// return fetch('/api/movies?q=' + encodeURIComponent(query), { signal: signal })
|
|
596
|
+
// .then(function (response) { return response.json(); });
|
|
597
|
+
// },
|
|
598
|
+
debounce: 250, // ms
|
|
599
|
+
minChars: 0,
|
|
600
|
+
searchValues: true, // match labels and values
|
|
601
|
+
|
|
602
|
+
/* Tags (mode: 'tags') */
|
|
603
|
+
maxTags: Infinity,
|
|
604
|
+
minTagLength: 1,
|
|
605
|
+
maxTagLength: Infinity,
|
|
606
|
+
caseSensitive: false,
|
|
607
|
+
allowFreeText: true,
|
|
608
|
+
delimiters: [','],
|
|
609
|
+
commitOnTab: false,
|
|
610
|
+
commitOnBlur: false,
|
|
611
|
+
valueDelimiter: ',',
|
|
612
|
+
|
|
613
|
+
/* Rendering hooks */
|
|
614
|
+
// filterOption: function (item, query) { return item.label.toLowerCase().includes(query.toLowerCase()); },
|
|
615
|
+
// renderOption: function (item) { return '<strong>' + item.label + '</strong>'; },
|
|
616
|
+
// renderSelected: function (value) { return value; },
|
|
617
|
+
// renderTag: function (tag) { return tag; },
|
|
618
|
+
// validateTag: function (tag) { return tag.length <= 24 || 'Use 24 characters or fewer'; },
|
|
619
|
+
// formatTag: function (tag) { return tag.toUpperCase(); },
|
|
620
|
+
|
|
621
|
+
/* Callbacks — also: onSelect, onOpen, onClose, onTagAdd, onTagRemove, onError */
|
|
622
|
+
onInit: function (event) { console.log('init', event.instance); },
|
|
623
|
+
onChange: function (event) { console.log('value', event.value); }
|
|
624
|
+
});
|
|
625
|
+
```
|
|
626
|
+
|
|
627
|
+
Data attributes remain available as a 1:1 fallback; the tables above list the matching
|
|
628
|
+
`data-zidan-*` name for each option, and `data-zidan-options` accepts any literal-value subset
|
|
629
|
+
as JSON.
|
|
630
|
+
|
|
438
631
|
### DOM data attributes
|
|
439
632
|
|
|
440
633
|
`data-zidan-select`, `data-zidan-mode`, `data-zidan-layout`, `data-zidan-framework`,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zidan-select",
|
|
3
|
-
"version": "2.2.
|
|
4
|
-
"description": "Zero-dependency form enhancement library: select/combobox/tags, checkboxes, switches, radio groups, drag & drop file upload with progress, text/number/phone/date/range inputs and textarea with input icons and steppers. Split core/theme CSS, 5 themes, 11 layouts, framework adapters
|
|
3
|
+
"version": "2.2.3",
|
|
4
|
+
"description": "Zero-dependency form enhancement library: select/combobox/tags, checkboxes, switches, radio groups, drag & drop file upload with progress, text/number/phone/date/range inputs and textarea with input icons and steppers. Split core/theme CSS, 5 themes, 11 layouts, framework adapters. Load only the select-only or file-only build if that is all you need, or the full form bundle to enhance every input at once.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"select",
|
|
7
7
|
"combobox",
|
|
@@ -11,14 +11,21 @@
|
|
|
11
11
|
"radio",
|
|
12
12
|
"file-upload",
|
|
13
13
|
"form",
|
|
14
|
+
"form-validation",
|
|
15
|
+
"phone-input",
|
|
16
|
+
"range-slider",
|
|
14
17
|
"vanilla-js",
|
|
15
18
|
"zero-dependency",
|
|
16
19
|
"accessible",
|
|
20
|
+
"theming",
|
|
17
21
|
"bootstrap",
|
|
18
22
|
"tailwind"
|
|
19
23
|
],
|
|
20
24
|
"license": "MIT",
|
|
21
|
-
"author":
|
|
25
|
+
"author": {
|
|
26
|
+
"name": "akhtar1985",
|
|
27
|
+
"url": "https://github.com/akhtar1985"
|
|
28
|
+
},
|
|
22
29
|
"homepage": "https://akhtar1985.github.io/zidan-select/",
|
|
23
30
|
"repository": {
|
|
24
31
|
"type": "git",
|
|
@@ -79,9 +86,12 @@
|
|
|
79
86
|
"dev": "node scripts/serve.mjs",
|
|
80
87
|
"build": "node scripts/build.mjs",
|
|
81
88
|
"test": "node scripts/test.mjs",
|
|
82
|
-
"lint": "node --check zidan-form.js && node --check demo.js && node --check zidan-form.mjs"
|
|
89
|
+
"lint": "node --check zidan-form.js && node --check demo.js && node --check playground.js && node --check zidan-form.mjs"
|
|
83
90
|
},
|
|
84
91
|
"engines": {
|
|
85
92
|
"node": ">=18"
|
|
93
|
+
},
|
|
94
|
+
"publishConfig": {
|
|
95
|
+
"access": "public"
|
|
86
96
|
}
|
|
87
97
|
}
|
package/zidan-form.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ZidanForm v2.2.
|
|
2
|
+
* ZidanForm v2.2.3
|
|
3
3
|
* Zero-dependency form enhancement library: select / combobox / tags,
|
|
4
4
|
* checkboxes, switches, radio groups, file upload with drag & drop and
|
|
5
5
|
* upload progress, text / number / phone / date / range inputs and textarea.
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
})(typeof window !== 'undefined' ? window : this, function (global) {
|
|
33
33
|
'use strict';
|
|
34
34
|
|
|
35
|
-
var VERSION = '2.2.
|
|
35
|
+
var VERSION = '2.2.3';
|
|
36
36
|
|
|
37
37
|
// Loading the file twice (classic script + module wrapper, or two bundles)
|
|
38
38
|
// must not replace the classes and orphan the live instances.
|