@geops/rvf-mobility-web-component 0.1.54 → 0.1.56

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/CHANGELOG.md CHANGED
@@ -2,6 +2,22 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.1.56](https://github.com/geops/rvf-mobility-web-component/compare/v0.1.55...v0.1.56) (2025-09-30)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * improve doc ([cd1e470](https://github.com/geops/rvf-mobility-web-component/commit/cd1e47080c0fc05f3c702d56110ec96ff7a5bf37))
11
+ * set notification true by default ([e0f8311](https://github.com/geops/rvf-mobility-web-component/commit/e0f83114dfab729cd508c597ef00553fdd9efebc))
12
+
13
+ ### [0.1.55](https://github.com/geops/rvf-mobility-web-component/compare/v0.1.54...v0.1.55) (2025-09-26)
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * use only one sourc efor stations ([14a38ab](https://github.com/geops/rvf-mobility-web-component/commit/14a38abdf550983011d83d9974c3b5eabba6a7c1))
19
+ * set notiifcation false by default ([dae6e7b](https://github.com/geops/rvf-mobility-web-component/commit/dae6e7b2585aed52135fce36d923ab95ebfe2589))
20
+
5
21
  ### [0.1.54](https://github.com/geops/rvf-mobility-web-component/compare/v0.1.53...v0.1.54) (2025-09-25)
6
22
 
7
23
 
package/docutils.js CHANGED
@@ -66,6 +66,7 @@ function generateAttributesTable(
66
66
  booleanTrueByDefault = [],
67
67
  descriptionByAttr = {},
68
68
  defaultValueByAttr = {},
69
+ reloadAttrs = [],
69
70
  ) {
70
71
  let innerHMTL = `<table class="table-auto w-full" >
71
72
  <thead>
@@ -104,7 +105,7 @@ function generateAttributesTable(
104
105
  class="border"
105
106
  name="${key}"
106
107
  ${checked ? "checked" : ""}
107
- onchange="document.querySelector('${wc.localName}').setAttribute('${key}', this.checked);onAttributeUpdate(document.querySelector('${wc.localName}'),this.name, this.checked);"
108
+ onchange="document.querySelector('${wc.localName}').setAttribute('${key}', this.checked);onAttributeUpdate(document.querySelector('${wc.localName}'),this.name, this.checked, '${reloadAttrs.join(",")}');"
108
109
  />`
109
110
  : `
110
111
  <input
@@ -114,7 +115,7 @@ function generateAttributesTable(
114
115
  value="${wc.getAttribute(key) || ""}"
115
116
  placeholder="${defaultValueByAttr[key] || ""}"
116
117
  />
117
- <button class="border p-2 bg-black hover:bg-gray-700 text-white" onclick="document.querySelector('${wc.localName}').setAttribute('${key}', this.previousElementSibling.value);onAttributeUpdate(document.querySelector('${wc.localName}'),this.previousElementSibling.name, this.previousElementSibling.value);">Update</button>`
118
+ <button class="border p-2 bg-black hover:bg-gray-700 text-white" onclick="document.querySelector('${wc.localName}').setAttribute('${key}', this.previousElementSibling.value);onAttributeUpdate(document.querySelector('${wc.localName}'),this.previousElementSibling.name, this.previousElementSibling.value, '${reloadAttrs.join(",")}');">Update</button>`
118
119
  }
119
120
  </div>
120
121
  ${descriptionByAttr[key] ? `<div class="pt-2">${descriptionByAttr[key]}</div>` : ``}
@@ -151,7 +152,12 @@ function generateCodeText(
151
152
  (attributeValue === "true" && inputValue === true) ||
152
153
  (attributeValue === "false" && inputValue === false))
153
154
  ) {
154
- codeText += `\n\t${[key, '"' + wc.getAttribute(key) + '"'].join("=")}`;
155
+ let separator = '"';
156
+ const value = wc.getAttribute(key);
157
+ if (value.includes(separator)) {
158
+ separator = "'";
159
+ }
160
+ codeText += `\n\t${[key, separator + value + separator].join("=")}`;
155
161
  }
156
162
  });
157
163
 
@@ -221,9 +227,18 @@ function generateEventsTable(wc, events, descriptionByEvent = {}) {
221
227
  }
222
228
 
223
229
  // Update url on attributes update via inputs
224
- function onAttributeUpdate(wc, key, value) {
230
+ function onAttributeUpdate(wc, key, value, reloadAttrs) {
225
231
  const params = new URLSearchParams(window.location.search);
226
232
  params.set(key, value);
227
- wc.setAttribute(key, value);
228
- window.history.replaceState({}, "", `${window.location.pathname}?${params}`);
233
+ if (reloadAttrs.split(",").includes(key)) {
234
+ window.history.pushState({}, "", `${window.location.pathname}?${params}`);
235
+ window.location.reload();
236
+ } else {
237
+ wc.setAttribute(key, value);
238
+ window.history.replaceState(
239
+ {},
240
+ "",
241
+ `${window.location.pathname}?${params}`,
242
+ );
243
+ }
229
244
  }