@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 CHANGED
@@ -99,7 +99,7 @@ exports.api_form = {
99
99
  action: {
100
100
  title: 'Action',
101
101
  description: 'Choose a service',
102
- $ref: '/services?$action=write'
102
+ $ref: '/writes'
103
103
  },
104
104
  redirection: {
105
105
  title: 'Success',
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
- tag: 'a.ui.button',
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,
@@ -7,7 +7,7 @@ exports.pagination = {
7
7
  isolating: true,
8
8
  properties: {
9
9
  fetch: {
10
- title: 'Fetch block',
10
+ title: 'Name of fetch block',
11
11
  type: 'string',
12
12
  format: 'id',
13
13
  $filter: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pageboard/html",
3
- "version": "0.14.33",
3
+ "version": "0.14.34",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "repository": {
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/${this.dataset.fetch}"]`
12
+ `element-template[action="/.api/query/${fetch}"]`
12
13
  );
13
14
  if (!node) {
14
- console.warn("pagination does not find fetch node", this.dataset.fetch);
15
+ console.warn("pagination does not find fetch node", fetch);
15
16
  return;
16
17
  }
17
- const name = node.dataset.offsetName;
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 : (offset - 2 * limit);
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
- [name]: cur || undefined
29
+ [offsetName]: cur
29
30
  }
30
31
  }));
31
- this.disabled = sign < 0 && offset <= limit || sign > 0 && offset >= count;
32
+ this.disabled = sign < 0 && cur < 0 || sign > 0 && cur >= count;
32
33
  }
33
34
  handleClick(e) {
34
35
  if (this.disabled) {