zidan-select 2.3.1 → 2.4.1
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 +171 -83
- package/dist/file/plugin-file-core.css +1 -1
- package/dist/file/plugin-file-core.min.css +1 -1
- 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 +2 -2
- package/dist/file/zidan-file.min.js +2 -2
- package/dist/plugin-core.css +1 -1
- package/dist/plugin-core.min.css +1 -1
- 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 +133 -2
- package/dist/select/zidan-select.min.js +2 -2
- package/dist/zidan-form.js +133 -2
- package/dist/zidan-form.min.js +2 -2
- package/docs/build.md +76 -48
- package/docs/comparison.md +3 -3
- package/docs/frameworks.md +19 -13
- package/docs/html-and-wordpress.md +20 -20
- package/docs/index.html +144 -84
- package/docs/options.md +138 -35
- package/docs/validation.html +96 -56
- package/docs/validation.md +7 -7
- package/package.json +4 -3
- package/plugin-core.css +1 -1
- package/plugin-theme.css +1 -1
- package/zidan-form.d.ts +45 -21
- package/zidan-form.js +133 -2
package/docs/build.md
CHANGED
|
@@ -25,8 +25,11 @@ zidan-select/
|
|
|
25
25
|
├─ scripts/
|
|
26
26
|
│ ├─ serve.mjs # dependency-free dev server (port 4173)
|
|
27
27
|
│ ├─ build.mjs # assembles dist/ and the select/file subset bundles
|
|
28
|
-
│
|
|
28
|
+
│ ├─ test.mjs # syntax / split-CSS / API checks
|
|
29
|
+
│ └─ release.mjs # one-command version bump, changelog roll, commit and tag
|
|
29
30
|
├─ docs/ # comparison, options, validation, frameworks, theming, build
|
|
31
|
+
├─ .github/workflows/ # pages.yml (demo) and release.yml (npm publish with provenance)
|
|
32
|
+
├─ CHANGELOG.md
|
|
30
33
|
├─ README.md
|
|
31
34
|
└─ LICENSE
|
|
32
35
|
```
|
|
@@ -55,6 +58,7 @@ side by side at the [builds section](https://akhtar1985.github.io/zidan-select/#
|
|
|
55
58
|
| `npm test` | `node --check` on every script, asserts `plugin-core.css` has no colour literals, checks all presets/adapters and the exported API. |
|
|
56
59
|
| `npm run lint` | Syntax check only. |
|
|
57
60
|
| `npm run build` | Cleans `dist/`, copies the four assets, writes `dist/zidan-form.cjs`, generates the select-only and file-only bundles, and minifies **if** esbuild is installed. |
|
|
61
|
+
| `npm run release -- patch` | Bumps every version site, rolls `CHANGELOG.md`, runs the checks, commits and tags `vX.Y.Z`. |
|
|
58
62
|
|
|
59
63
|
There is no watch task: the JS and CSS are the distributables, so edit and reload. `npm run
|
|
60
64
|
dev` sends `Cache-Control: no-store`, which is enough for the demo.
|
|
@@ -95,13 +99,13 @@ Without esbuild the build still succeeds and prints that minification was skippe
|
|
|
95
99
|
|
|
96
100
|
| Build | JavaScript | Core CSS | Theme CSS |
|
|
97
101
|
| --- | --- | --- | --- |
|
|
98
|
-
| Full | `/dist/zidan-form.min.js` | `/dist/plugin-core.min.css` | `/dist/plugin-theme.min.css` |
|
|
99
|
-
| Select-only | `/dist/select/zidan-select.min.js` | `/dist/select/plugin-select-core.min.css` | `/dist/select/plugin-select-theme.min.css` |
|
|
100
|
-
| File-only | `/dist/file/zidan-file.min.js` | `/dist/file/plugin-file-core.min.css` | `/dist/file/plugin-file-theme.min.css` |
|
|
102
|
+
| Full | `/dist/zidan-form.min.js` — ≈131 kB | `/dist/plugin-core.min.css` — ≈31 kB | `/dist/plugin-theme.min.css` — ≈39 kB |
|
|
103
|
+
| Select-only | `/dist/select/zidan-select.min.js` — ≈68 kB | `/dist/select/plugin-select-core.min.css` — ≈9 kB | `/dist/select/plugin-select-theme.min.css` — ≈27 kB |
|
|
104
|
+
| File-only | `/dist/file/zidan-file.min.js` — ≈50 kB | `/dist/file/plugin-file-core.min.css` — ≈7 kB | `/dist/file/plugin-file-theme.min.css` — ≈29 kB |
|
|
101
105
|
|
|
102
|
-
Prepend `https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
103
|
-
These are real files in the npm tarball, so unpkg and self-hosted CDNs serve the same bytes
|
|
104
|
-
|
|
106
|
+
Prepend `https://cdn.jsdelivr.net/npm/zidan-select@2.4.1` to each path (or your own origin).
|
|
107
|
+
These are real files in the npm tarball, so unpkg and self-hosted CDNs serve the same bytes.
|
|
108
|
+
Use these package files rather than relying on a CDN's auto-minification.
|
|
105
109
|
Check the three you use with `curl -I` before changing a version, then update the URLs in the
|
|
106
110
|
README, the demo build cards and the playground in the same commit.
|
|
107
111
|
|
|
@@ -122,19 +126,26 @@ Both theme stylesheets keep the token set, the five preset themes (`default`, `m
|
|
|
122
126
|
adapters, so `data-zidan-theme`, `data-zidan-layout` and `data-zidan-framework` behave the same
|
|
123
127
|
as in the full build.
|
|
124
128
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
129
|
+
Measured v2.4.1 sizes (1 kB = 1,024 bytes; readable → minified):
|
|
130
|
+
|
|
131
|
+
| Build | JavaScript | Core CSS | Theme CSS |
|
|
132
|
+
| --- | --- | --- | --- |
|
|
133
|
+
| Full | 229,274 B (≈224 kB) → 134,575 B (≈131 kB) | 41,054 B (≈40 kB) → 31,422 B (≈31 kB) | 47,697 B (≈47 kB) → 39,983 B (≈39 kB) |
|
|
134
|
+
| Select-only | 116,926 B (≈114 kB) → 69,144 B (≈68 kB) | 12,456 B (≈12 kB) → 9,511 B (≈9 kB) | 32,559 B (≈32 kB) → 27,505 B (≈27 kB) |
|
|
135
|
+
| File-only | 87,728 B (≈86 kB) → 51,406 B (≈50 kB) | 9,939 B (≈10 kB) → 7,210 B (≈7 kB) | 34,991 B (≈34 kB) → 29,929 B (≈29 kB) |
|
|
128
136
|
|
|
129
137
|
A page should load **one** flavour: a subset **or** the full build. The `__zidanFormGuard`
|
|
130
138
|
check keeps the first initialised copy, so loading two flavours together does not merge their
|
|
131
139
|
APIs — use the full build when a page needs both select and file upload.
|
|
132
140
|
|
|
133
141
|
Declarative init comes along in both subsets because the marker scan and the factory live in the
|
|
134
|
-
shared/factory sections every variant keeps. `class="zidan-select"`, `
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
142
|
+
shared/factory sections every variant keeps. `class="zidan-select"`, `data-zidan-options` JSON
|
|
143
|
+
and `window.ZIDAN_FORM_CONFIG` targets all work without a JS call; a `zidan-form` scope enhances
|
|
144
|
+
every select in the select bundle and every file input in the file bundle. The select-only bundle
|
|
145
|
+
also contains the complete AJAX/pagination implementation — `fetchUrl`, `fetchOptions`,
|
|
146
|
+
`fetchPageSize`, `loadMore()`, `refreshOptions()`, `getAsyncState()` and cache clearing — because
|
|
147
|
+
those sections are part of its build. The file-only bundle intentionally excludes select APIs;
|
|
148
|
+
it keeps the shared validation, theming, declarative-init and upload features.
|
|
138
149
|
|
|
139
150
|
Build-time safety: every generated JS file is passed through `node --check`, and missing sections
|
|
140
151
|
abort the build instead of producing a partial bundle.
|
|
@@ -150,25 +161,64 @@ abort the build instead of producing a partial bundle.
|
|
|
150
161
|
|
|
151
162
|
## Versioning
|
|
152
163
|
|
|
153
|
-
Semantic versioning, with the
|
|
164
|
+
Semantic versioning, with the history in [`CHANGELOG.md`](../CHANGELOG.md):
|
|
154
165
|
|
|
155
166
|
- **patch** — bug fixes, no token/API changes.
|
|
156
167
|
- **minor** — new themes, layouts, adapters, options (backwards compatible).
|
|
157
168
|
- **major** — renamed tokens, removed attributes, changed defaults.
|
|
158
169
|
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
170
|
+
The runtime guard (`__zidanFormGuard`) compares `VERSION` in `zidan-form.js`, so the version
|
|
171
|
+
constant, the `package.json` field, the lockfile and the CSS banners must always agree —
|
|
172
|
+
`npm test` fails when they drift.
|
|
173
|
+
|
|
174
|
+
## Releasing
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
npm run release -- patch --note "Fix the thing that broke" # or: minor | major | 2.3.2
|
|
178
|
+
git push origin main --follow-tags
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
`scripts/release.mjs` is the whole release:
|
|
182
|
+
|
|
183
|
+
1. writes the new version into `package.json`, `package-lock.json`, the banner and `VERSION` in
|
|
184
|
+
`zidan-form.js`, both CSS banners, the README CDN URLs, `index.html`, `advanced.html`,
|
|
185
|
+
`docs/build.md` and `docs/html-and-wordpress.md`;
|
|
186
|
+
2. moves `## [Unreleased]` in `CHANGELOG.md` under `## [X.Y.Z] - YYYY-MM-DD` — write your notes
|
|
187
|
+
there, or pass `--note "…"`; it refuses to cut a release with no notes;
|
|
188
|
+
3. runs `npm run types && npm test`;
|
|
189
|
+
4. commits `Release X.Y.Z` and creates the annotated tag `vX.Y.Z`.
|
|
190
|
+
|
|
191
|
+
Flags: `--dry-run` (print the plan, write nothing), `--no-commit` (edit files and the changelog
|
|
192
|
+
only), `--skip-checks`. It requires a clean tracked working tree, so the release commit holds only
|
|
193
|
+
the bump, and it refuses a version that is already tagged.
|
|
194
|
+
|
|
195
|
+
Pushing the tag starts `.github/workflows/release.yml`. Nothing else to run: it publishes to npm and
|
|
196
|
+
creates the matching GitHub Release, so the Releases panel and the changelog stay in step.
|
|
162
197
|
|
|
163
198
|
## Publishing to npm
|
|
164
199
|
|
|
200
|
+
Publishing happens in CI:
|
|
201
|
+
|
|
202
|
+
| Trigger | What happens |
|
|
203
|
+
| --- | --- |
|
|
204
|
+
| Tag `vX.Y.Z` pushed | Verifies the tag against `package.json`, refuses an existing version, runs `prepublishOnly` (types → build → test), publishes with `--provenance`, then creates the GitHub Release for the tag with that version's `CHANGELOG.md` section as the body (`scripts/changelog-section.mjs`), falling back to `--generate-notes` when the section is missing. |
|
|
205
|
+
| **Actions → Publish to npm → Run workflow** | The same job without a tag, for publishing the version already committed. |
|
|
206
|
+
|
|
207
|
+
Authentication is **npm trusted publishing** over OIDC: the job requests `id-token: write` and
|
|
208
|
+
needs no token secret. One-time setup on npmjs.com — **zidan-select → Settings → Trusted
|
|
209
|
+
publishing → GitHub Actions**, owner `akhtar1985`, repository `zidan-select`, workflow
|
|
210
|
+
`release.yml`, environment left empty. Requires npm 11.5.1+; the workflow runs `node-version: 24`.
|
|
211
|
+
|
|
212
|
+
Without trusted publishing, create a granular access token with read+write on `zidan-select`,
|
|
213
|
+
store it as the `NPM_TOKEN` repository secret, and uncomment the `NODE_AUTH_TOKEN` env block at
|
|
214
|
+
the bottom of the workflow. Remove it once OIDC works.
|
|
215
|
+
|
|
216
|
+
Manual publishing remains a last resort:
|
|
217
|
+
|
|
165
218
|
```bash
|
|
166
219
|
npm login
|
|
167
220
|
npm test
|
|
168
|
-
npm version minor -m "release: v%s"
|
|
169
|
-
npm run build
|
|
170
221
|
npm publish # tarball limited by package.json "files"
|
|
171
|
-
git push --follow-tags
|
|
172
222
|
```
|
|
173
223
|
|
|
174
224
|
First publish: `npm publish --access public`. Scoped forks need `--access public` on every
|
|
@@ -225,31 +275,9 @@ One-time setup: **Settings → Pages → Build and deployment → Source: GitHub
|
|
|
225
275
|
The workflow only copies demo assets, so `scripts/`, `dist/`, `package.json` and local scratch
|
|
226
276
|
files are never published.
|
|
227
277
|
|
|
228
|
-
## Release automation
|
|
229
|
-
|
|
230
|
-
```yaml
|
|
231
|
-
# .github/workflows/publish.yml
|
|
232
|
-
name: publish
|
|
233
|
-
on:
|
|
234
|
-
release:
|
|
235
|
-
types: [published]
|
|
236
|
-
jobs:
|
|
237
|
-
npm:
|
|
238
|
-
runs-on: ubuntu-latest
|
|
239
|
-
permissions:
|
|
240
|
-
contents: read
|
|
241
|
-
id-token: write
|
|
242
|
-
steps:
|
|
243
|
-
- uses: actions/checkout@v4
|
|
244
|
-
- uses: actions/setup-node@v4
|
|
245
|
-
with:
|
|
246
|
-
node-version: 20
|
|
247
|
-
registry-url: https://registry.npmjs.org
|
|
248
|
-
- run: npm test
|
|
249
|
-
- run: npm run build
|
|
250
|
-
- run: npm publish --provenance --access public
|
|
251
|
-
env:
|
|
252
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
253
|
-
```
|
|
278
|
+
## Release automation
|
|
254
279
|
|
|
255
|
-
|
|
280
|
+
[`.github/workflows/release.yml`](../.github/workflows/release.yml) is the complete workflow:
|
|
281
|
+
tag-triggered, provenance-enabled, dist-tag aware (`latest`, or `next` for prereleases), with
|
|
282
|
+
guards against a mismatched tag and a duplicate version. It installs the dev tooling with
|
|
283
|
+
`npm ci` only to build and test — the published package still has no runtime dependencies.
|
package/docs/comparison.md
CHANGED
|
@@ -31,8 +31,8 @@ same two stylesheets.
|
|
|
31
31
|
| Built-in themes | **5** + custom tokens | Themes via CSS | Themes via CSS | Themes via CSS | Themes via CSS | 1 (Bootstrap) |
|
|
32
32
|
| CSS-framework adapters | **Bootstrap, Tailwind, Bulma, Foundation** | — | — | — | — | n/a |
|
|
33
33
|
| Validation coexistence tests | **jQuery Validation, JustValidate, Parsley, native** | — | — | — | — | Native + framework |
|
|
34
|
-
| Framework support | **React, Next.js, Vue,
|
|
35
|
-
| Weight |
|
|
34
|
+
| Framework support | **React, Next.js, Vue, Angular guides** | Community wrappers | Community wrappers | Community wrappers | Community wrappers | Framework kits |
|
|
35
|
+
| Weight | ≈224 kB raw JS + two CSS files | larger, plus jQuery | moderate | moderate | small | large (whole framework) |
|
|
36
36
|
|
|
37
37
|
Feature claims above describe each project's *core* package. Plugins and community add-ons can
|
|
38
38
|
close some gaps — check the other project's current docs before deciding.
|
|
@@ -66,7 +66,7 @@ close some gaps — check the other project's current docs before deciding.
|
|
|
66
66
|
Bootstrap.
|
|
67
67
|
- **No framework components.** React/Vue/Angular integration is lifecycle wiring around the
|
|
68
68
|
vanilla API, not a native component library.
|
|
69
|
-
- **Newer.** Version 2.
|
|
69
|
+
- **Newer.** Version 2.x is a rename/expansion of `zidan-select`; pin a version and read the
|
|
70
70
|
migration notes.
|
|
71
71
|
|
|
72
72
|
## Choose ZidanForm when…
|
package/docs/frameworks.md
CHANGED
|
@@ -25,9 +25,11 @@ export default function ProfileForm() {
|
|
|
25
25
|
|
|
26
26
|
useEffect(() => {
|
|
27
27
|
initZidanSelects(host.current);
|
|
28
|
-
initZidanForms(host.current
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
initZidanForms(host.current, {
|
|
29
|
+
onChange: ({ instance, value }) => {
|
|
30
|
+
if (instance.kind === 'radio-group') setPlan(value);
|
|
31
|
+
}
|
|
32
|
+
});
|
|
31
33
|
|
|
32
34
|
return () => {
|
|
33
35
|
ZidanForm.fields
|
|
@@ -115,16 +117,27 @@ inside a server-only module.
|
|
|
115
117
|
|
|
116
118
|
```vue
|
|
117
119
|
<script setup>
|
|
118
|
-
import { onBeforeUnmount, onMounted, ref } from 'vue';
|
|
120
|
+
import { onBeforeUnmount, onMounted, ref, watch } from 'vue';
|
|
119
121
|
import { ZidanForm, ZidanSelect, initZidanForms, initZidanSelects } from 'zidan-select';
|
|
120
122
|
import 'zidan-select/css/core';
|
|
121
123
|
import 'zidan-select/css/theme';
|
|
122
124
|
|
|
123
125
|
const host = ref(null);
|
|
126
|
+
const model = ref('France');
|
|
124
127
|
|
|
125
128
|
onMounted(() => {
|
|
126
129
|
initZidanSelects(host.value);
|
|
127
130
|
initZidanForms(host.value);
|
|
131
|
+
const country = host.value.querySelector('select[name="country"]');
|
|
132
|
+
country.addEventListener('zidan:change', event => {
|
|
133
|
+
model.value = event.detail.value;
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
watch(model, value => {
|
|
138
|
+
const country = host.value?.querySelector('select[name="country"]');
|
|
139
|
+
const field = ZidanSelect.instances.find(instance => instance.el === country);
|
|
140
|
+
field?.setValue(value);
|
|
128
141
|
});
|
|
129
142
|
|
|
130
143
|
onBeforeUnmount(() => {
|
|
@@ -147,15 +160,8 @@ onBeforeUnmount(() => {
|
|
|
147
160
|
</template>
|
|
148
161
|
```
|
|
149
162
|
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
```js
|
|
153
|
-
host.value.addEventListener('zidan:change', event => {
|
|
154
|
-
model.value = event.detail.value;
|
|
155
|
-
});
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
and push back with `field.setValue(model.value)` in a `watch()`.
|
|
163
|
+
The `model` ref above demonstrates two-way binding: the native `zidan:change` event updates
|
|
164
|
+
Vue state, and `watch()` pushes external changes back through the select instance.
|
|
159
165
|
|
|
160
166
|
## Angular
|
|
161
167
|
|
|
@@ -33,15 +33,15 @@ colours), `plugin-theme.css` carries colours, presets and skins.
|
|
|
33
33
|
| File uploads only | `dist/file/zidan-file.js` + `plugin-file-core.css` + `plugin-file-theme.css` |
|
|
34
34
|
| Several control types together | `zidan-form.js` + `plugin-core.css` + `plugin-theme.css` |
|
|
35
35
|
|
|
36
|
-
Pinned CDN URLs (replace `2.
|
|
36
|
+
Pinned CDN URLs (replace `2.4.1` when you upgrade):
|
|
37
37
|
|
|
38
38
|
| Build | JavaScript | CSS |
|
|
39
39
|
| --- | --- | --- |
|
|
40
|
-
| Full | `https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
41
|
-
| Select-only | `https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
42
|
-
| File-only | `https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
40
|
+
| Full | `https://cdn.jsdelivr.net/npm/zidan-select@2.4.1/zidan-form.js` | `…@2.4.1/plugin-core.css` + `…@2.4.1/plugin-theme.css` |
|
|
41
|
+
| Select-only | `https://cdn.jsdelivr.net/npm/zidan-select@2.4.1/dist/select/zidan-select.js` | `…@2.4.1/dist/select/plugin-select-core.css` + `…plugin-select-theme.css` |
|
|
42
|
+
| File-only | `https://cdn.jsdelivr.net/npm/zidan-select@2.4.1/dist/file/zidan-file.js` | `…@2.4.1/dist/file/plugin-file-core.css` + `…plugin-file-theme.css` |
|
|
43
43
|
|
|
44
|
-
Prefer self-hosting? Download the same files (`npm pack zidan-select@2.
|
|
44
|
+
Prefer self-hosting? Download the same files (`npm pack zidan-select@2.4.1`, or the raw files
|
|
45
45
|
from GitHub) and keep them next to your page:
|
|
46
46
|
|
|
47
47
|
```
|
|
@@ -174,8 +174,8 @@ see the native `FormData`.
|
|
|
174
174
|
<title>ZidanForm static example</title>
|
|
175
175
|
|
|
176
176
|
<!-- structure first, theme second -->
|
|
177
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
178
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
177
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/zidan-select@2.4.1/plugin-core.css">
|
|
178
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/zidan-select@2.4.1/plugin-theme.css">
|
|
179
179
|
</head>
|
|
180
180
|
<body>
|
|
181
181
|
|
|
@@ -251,7 +251,7 @@ see the native `FormData`.
|
|
|
251
251
|
</form>
|
|
252
252
|
</main>
|
|
253
253
|
|
|
254
|
-
<script src="https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
254
|
+
<script src="https://cdn.jsdelivr.net/npm/zidan-select@2.4.1/zidan-form.js"></script>
|
|
255
255
|
<script>
|
|
256
256
|
// Demo only: show the native FormData instead of navigating away.
|
|
257
257
|
document.querySelector('.zidan-form').addEventListener('submit', function (event) {
|
|
@@ -289,9 +289,9 @@ and `ZidanSelect`; `zidanField` does not exist here.
|
|
|
289
289
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
290
290
|
<title>Select-only example</title>
|
|
291
291
|
<link rel="stylesheet"
|
|
292
|
-
href="https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
292
|
+
href="https://cdn.jsdelivr.net/npm/zidan-select@2.4.1/dist/select/plugin-select-core.css">
|
|
293
293
|
<link rel="stylesheet"
|
|
294
|
-
href="https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
294
|
+
href="https://cdn.jsdelivr.net/npm/zidan-select@2.4.1/dist/select/plugin-select-theme.css">
|
|
295
295
|
</head>
|
|
296
296
|
<body style="max-width:520px;margin:40px auto;padding:0 20px">
|
|
297
297
|
|
|
@@ -311,7 +311,7 @@ and `ZidanSelect`; `zidanField` does not exist here.
|
|
|
311
311
|
</select>
|
|
312
312
|
</p>
|
|
313
313
|
|
|
314
|
-
<script src="https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
314
|
+
<script src="https://cdn.jsdelivr.net/npm/zidan-select@2.4.1/dist/select/zidan-select.js"></script>
|
|
315
315
|
<script>
|
|
316
316
|
zidanSelect('#country', {
|
|
317
317
|
mode: 'combobox',
|
|
@@ -342,9 +342,9 @@ Only uploads on this page? Load the file-only build. It exposes `zidanField`,
|
|
|
342
342
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
343
343
|
<title>File upload example</title>
|
|
344
344
|
<link rel="stylesheet"
|
|
345
|
-
href="https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
345
|
+
href="https://cdn.jsdelivr.net/npm/zidan-select@2.4.1/dist/file/plugin-file-core.css">
|
|
346
346
|
<link rel="stylesheet"
|
|
347
|
-
href="https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
347
|
+
href="https://cdn.jsdelivr.net/npm/zidan-select@2.4.1/dist/file/plugin-file-theme.css">
|
|
348
348
|
</head>
|
|
349
349
|
<body style="max-width:520px;margin:40px auto;padding:0 20px">
|
|
350
350
|
|
|
@@ -356,7 +356,7 @@ Only uploads on this page? Load the file-only build. It exposes `zidanField`,
|
|
|
356
356
|
<input id="shots" type="file" name="shots" multiple accept="image/*">
|
|
357
357
|
</form>
|
|
358
358
|
|
|
359
|
-
<script src="https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
359
|
+
<script src="https://cdn.jsdelivr.net/npm/zidan-select@2.4.1/dist/file/zidan-file.js"></script>
|
|
360
360
|
<script>
|
|
361
361
|
zidanField('#cv', {
|
|
362
362
|
variant: 'dropzone',
|
|
@@ -475,9 +475,9 @@ add_action('wp_enqueue_scripts', function () {
|
|
|
475
475
|
|
|
476
476
|
$base = get_stylesheet_directory_uri() . '/assets/zidan';
|
|
477
477
|
|
|
478
|
-
wp_enqueue_style('zidan-core', $base . '/plugin-core.css', array(), '2.
|
|
479
|
-
wp_enqueue_style('zidan-theme', $base . '/plugin-theme.css', array('zidan-core'), '2.
|
|
480
|
-
wp_enqueue_script('zidan-form', $base . '/zidan-form.js', array(), '2.
|
|
478
|
+
wp_enqueue_style('zidan-core', $base . '/plugin-core.css', array(), '2.4.1');
|
|
479
|
+
wp_enqueue_style('zidan-theme', $base . '/plugin-theme.css', array('zidan-core'), '2.4.1');
|
|
480
|
+
wp_enqueue_script('zidan-form', $base . '/zidan-form.js', array(), '2.4.1', true);
|
|
481
481
|
|
|
482
482
|
// Optional: configure fields by ID/class without inline HTML scripts.
|
|
483
483
|
wp_add_inline_script('zidan-form', "window.ZIDAN_FORM_CONFIG = {
|
|
@@ -552,9 +552,9 @@ Shopify has its own section: [9. Shopify](#9-shopify).
|
|
|
552
552
|
```html
|
|
553
553
|
<!-- inside one embed block: markup first, script last -->
|
|
554
554
|
<select class="zidan-select" data-zidan-options='{"mode":"combobox"}'>…</select>
|
|
555
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
556
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
557
|
-
<script src="https://cdn.jsdelivr.net/npm/zidan-select@2.
|
|
555
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/zidan-select@2.4.1/plugin-core.css">
|
|
556
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/zidan-select@2.4.1/plugin-theme.css">
|
|
557
|
+
<script src="https://cdn.jsdelivr.net/npm/zidan-select@2.4.1/zidan-form.js"></script>
|
|
558
558
|
```
|
|
559
559
|
|
|
560
560
|
For the single-select case, the select-only build is smaller: swap in the
|