@ditojs/ui 2.92.0 → 2.94.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ditojs/ui",
3
- "version": "2.92.0",
3
+ "version": "2.94.0",
4
4
  "type": "module",
5
5
  "description": "Dito.js UI is a simple UI library, built with Vue.js for use in Dito.js Admin and elsewhere",
6
6
  "repository": "https://github.com/ditojs/dito/tree/main/packages/ui",
@@ -21,15 +21,8 @@
21
21
  "src/",
22
22
  "dist/"
23
23
  ],
24
- "scripts": {
25
- "build:icons": "inline-assets src/icons/*.svg --template src/icons/template.js > src/styles/mixins/_icons.scss",
26
- "build:vite": "vite build",
27
- "build": "pnpm run build:icons && pnpm run build:vite",
28
- "watch": "pnpm run build:vue --mode 'development' --watch",
29
- "prepare": "pnpm run build"
30
- },
31
24
  "engines": {
32
- "node": ">= 20.0.0"
25
+ "node": ">= 24.0.0"
33
26
  },
34
27
  "browserslist": [
35
28
  "> 1%",
@@ -38,12 +31,17 @@
38
31
  "ie_mob >= 11"
39
32
  ],
40
33
  "dependencies": {
41
- "@ditojs/utils": "^2.92.0",
42
- "@soda/get-current-script": "^1.0.2"
34
+ "@soda/get-current-script": "^1.0.2",
35
+ "@ditojs/utils": "^2.94.0"
43
36
  },
44
37
  "devDependencies": {
45
- "@ditojs/build": "^2.92.0",
46
- "vite": "^8.0.0"
38
+ "vite": "^8.0.3",
39
+ "@ditojs/build": "^2.94.0"
47
40
  },
48
- "gitHead": "7d2288aa487ec5c8607b2079a29e2d8793fbd07f"
49
- }
41
+ "scripts": {
42
+ "build:icons": "inline-assets src/icons/*.svg --template src/icons/template.js > src/styles/mixins/_icons.scss",
43
+ "build:vite": "vite build",
44
+ "build": "pnpm run build:icons && pnpm run build:vite",
45
+ "watch": "pnpm run build:vue --mode 'development' --watch"
46
+ }
47
+ }
@@ -151,6 +151,11 @@ export default {
151
151
  },
152
152
 
153
153
  onKeyDown(event) {
154
+ if (event.key === 'Escape') {
155
+ this.showPopup = false
156
+ event.preventDefault()
157
+ return
158
+ }
154
159
  const { ver: step, enter } = getKeyNavigation(event)
155
160
  if (step || enter) {
156
161
  event.preventDefault()
@@ -1,6 +1,6 @@
1
1
  <!-- eslint-disable vue/no-template-shadow -->
2
2
  <template lang="pug">
3
- .dito-pagination
3
+ nav.dito-pagination(aria-label="Pagination")
4
4
  .dito-pagination-total(
5
5
  v-if="showTotal"
6
6
  )
@@ -14,6 +14,8 @@
14
14
  v-for="button in buttons"
15
15
  :class="getButtonClasses(button)"
16
16
  :disabled="button.disabled"
17
+ :aria-label="getButtonLabel(button)"
18
+ :aria-current="button.active ? 'page' : null"
17
19
  @click="onClickButton(button)"
18
20
  )
19
21
  span(
@@ -143,6 +145,13 @@ export default {
143
145
  }
144
146
  },
145
147
 
148
+ getButtonLabel(button) {
149
+ if (button.type === 'prev') return 'Previous page'
150
+ if (button.type === 'next') return 'Next page'
151
+ if (button.text) return `Page ${button.text}`
152
+ return null
153
+ },
154
+
146
155
  onClickButton(button) {
147
156
  if (
148
157
  button.index &&
@@ -9,7 +9,9 @@
9
9
  ref="input"
10
10
  v-bind="attributes"
11
11
  v-model="checked"
12
+ role="switch"
12
13
  type="checkbox"
14
+ :aria-checked="checked"
13
15
  :name="name"
14
16
  :disabled="disabled"
15
17
  )
@@ -271,6 +271,11 @@ export default {
271
271
  },
272
272
 
273
273
  onKeyDown(event) {
274
+ if (event.key === 'Escape') {
275
+ this.showPopup = false
276
+ event.preventDefault()
277
+ return
278
+ }
274
279
  const { input } = this
275
280
  const selection = getSelection(input)
276
281
  const { ver: step, enter } = getKeyNavigation(event)