@pageboard/html 0.14.33 → 0.14.34
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/elements/form.js +1 -1
- package/elements/link.js +2 -3
- package/elements/menu.js +1 -1
- package/elements/pagination.js +1 -1
- package/package.json +1 -1
- package/ui/pagination.js +7 -6
package/elements/form.js
CHANGED
package/elements/link.js
CHANGED
|
@@ -44,7 +44,7 @@ exports.link = {
|
|
|
44
44
|
inline: true,
|
|
45
45
|
group: "inline",
|
|
46
46
|
tag: 'a:not([block-type]),a[block-type="link"]',
|
|
47
|
-
html: '<a href="[url]" hreflang="[lang]" class="[button|alt:ui button]" id="[id]"></a>',
|
|
47
|
+
html: '<a href="[url|lang:[lang]]" hreflang="[lang]" class="[button|alt:ui button]" id="[id]"></a>',
|
|
48
48
|
stylesheets: [
|
|
49
49
|
'../ui/components/button.css'
|
|
50
50
|
]
|
|
@@ -110,8 +110,7 @@ exports.link_button = {
|
|
|
110
110
|
},
|
|
111
111
|
contents: "text*",
|
|
112
112
|
group: "block",
|
|
113
|
-
|
|
114
|
-
html: '<a href="[url]" hreflang="[lang]" class="ui [full|alt:fluid:] [icon] [compact] [float|post:%20floated] button"></a>',
|
|
113
|
+
html: '<a href="[url|lang:[lang]]" hreflang="[lang]" class="ui [full|alt:fluid:] [icon] [compact] [float|post:%20floated] button"></a>',
|
|
115
114
|
stylesheets: [
|
|
116
115
|
'../ui/components/button.css'
|
|
117
116
|
]
|
package/elements/menu.js
CHANGED
|
@@ -120,7 +120,7 @@ exports.menu_item_link = {
|
|
|
120
120
|
marks: "nolink"
|
|
121
121
|
},
|
|
122
122
|
group: 'menu_item',
|
|
123
|
-
html: '<a class="[labeled] item" href="[url]" hreflang="[lang]">Link</a>'
|
|
123
|
+
html: '<a class="[labeled] item" href="[url|lang:[lang]]" hreflang="[lang]">Link</a>'
|
|
124
124
|
};
|
|
125
125
|
|
|
126
126
|
exports.menu_item_block = { ...exports.menu_item_link,
|
package/elements/pagination.js
CHANGED
package/package.json
CHANGED
package/ui/pagination.js
CHANGED
|
@@ -7,28 +7,29 @@ class HTMLElementPagination extends Page.create(HTMLAnchorElement) {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
#update(state) {
|
|
10
|
+
const { fetch } = this.dataset;
|
|
10
11
|
const node = this.ownerDocument.querySelector(
|
|
11
|
-
`element-template[action="/.api/query/${
|
|
12
|
+
`element-template[action="/.api/query/${fetch}"]`
|
|
12
13
|
);
|
|
13
14
|
if (!node) {
|
|
14
|
-
console.warn("pagination does not find fetch node",
|
|
15
|
+
console.warn("pagination does not find fetch node", fetch);
|
|
15
16
|
return;
|
|
16
17
|
}
|
|
17
|
-
const
|
|
18
|
+
const { offsetName } = node.dataset;
|
|
18
19
|
const offset = parseInt(node.dataset.offset) || 0;
|
|
19
20
|
const limit = parseInt(node.dataset.limit) || 10;
|
|
20
21
|
const count = parseInt(node.dataset.count) || 0;
|
|
21
22
|
const sign = this.dataset.dir == "-" ? -1 : +1;
|
|
22
|
-
const cur = sign > 0 ? offset :
|
|
23
|
+
const cur = sign > 0 ? offset + limit : offset - limit;
|
|
23
24
|
|
|
24
25
|
this.setAttribute('href', Page.format({
|
|
25
26
|
pathname: state.pathname,
|
|
26
27
|
query: {
|
|
27
28
|
...state.query,
|
|
28
|
-
[
|
|
29
|
+
[offsetName]: cur
|
|
29
30
|
}
|
|
30
31
|
}));
|
|
31
|
-
this.disabled = sign < 0 &&
|
|
32
|
+
this.disabled = sign < 0 && cur < 0 || sign > 0 && cur >= count;
|
|
32
33
|
}
|
|
33
34
|
handleClick(e) {
|
|
34
35
|
if (this.disabled) {
|