@massimo-cassandro/minimo 0.12.14 → 0.12.15
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
|
@@ -29,7 +29,7 @@ export function parseDomString(domString) {
|
|
|
29
29
|
|
|
30
30
|
// versione con groups
|
|
31
31
|
// const regex = new RegExp(
|
|
32
|
-
// /^(?<tag>[a-zA-Z]
|
|
32
|
+
// /^(?<tag>[a-zA-Z][a-zA-Z0-9-]*)?/.source + // tag
|
|
33
33
|
// /(?:#(?<id>[a-zA-Z0-9_-]+))?/.source + // id
|
|
34
34
|
// /(?<classes>(?:\.[a-zA-Z0-9_-]+)*)?/.source + // classi
|
|
35
35
|
// /(?<attrs>[([{].*?[)\]}])?/.source + // attrs
|
|
@@ -37,11 +37,11 @@ export function parseDomString(domString) {
|
|
|
37
37
|
// );
|
|
38
38
|
|
|
39
39
|
const regex = new RegExp(
|
|
40
|
-
/^([a-zA-Z]
|
|
41
|
-
/(?:#([a-zA-Z0-9_-]+))?/.source +
|
|
42
|
-
/((?:\.[a-zA-Z0-9_-]+)*)?/.source +
|
|
43
|
-
/([([{].*?[)\]}])?/.source +
|
|
44
|
-
/(?: +(.*))?$/.source
|
|
40
|
+
/^([a-zA-Z][a-zA-Z0-9-]*)?/.source + // tag (accetta anche nomi di web components)
|
|
41
|
+
/(?:#([a-zA-Z0-9_-]+))?/.source + // id
|
|
42
|
+
/((?:\.[a-zA-Z0-9_-]+)*)?/.source + // classi
|
|
43
|
+
/([([{].*?[)\]}])?/.source + // attrs
|
|
44
|
+
/(?: +(.*))?$/.source // content
|
|
45
45
|
);
|
|
46
46
|
|
|
47
47
|
const matches = domString.match(regex);
|
|
@@ -94,7 +94,16 @@ import caretRightIcon from '../../icons/caret-right.svg?inline';
|
|
|
94
94
|
* di sessione `sd-pag`. Se il referrer non è tra
|
|
95
95
|
* quelli indicati, il cookie viene eliminato.
|
|
96
96
|
* Confronto su `pathname` (query string e hash ignorati).
|
|
97
|
-
* Esempio: `['/utenti'
|
|
97
|
+
* Esempio: `['/utenti']`
|
|
98
|
+
* NB: il match è positivo anche se il referrer è parte di una delle stringhe permesse
|
|
99
|
+
* quindi, ad esempio, `['/utenti']` intercetta sia `/utenti` che `/utenti/1234`
|
|
100
|
+
*
|
|
101
|
+
|
|
102
|
+
------------ DA VALUTARE NON IMPLEMENTATO -----------
|
|
103
|
+
* @param {string[]} refsCallback callback da eseguire in seguito al match di refs.
|
|
104
|
+
* È invocato con l'argomento isRef (true | false) che indica se la pagina referrer
|
|
105
|
+
* è tra quelle mappate in refs, quindi `['/utenti']`.
|
|
106
|
+
* Utilizzabile solo nella configurazione via script
|
|
98
107
|
*/
|
|
99
108
|
|
|
100
109
|
|
|
@@ -738,6 +747,8 @@ class SimpleDatatableAdapter extends HTMLElement {
|
|
|
738
747
|
.forEach(btn => btn.classList.add(styles.hasSvg));
|
|
739
748
|
|
|
740
749
|
// Ripristino pagina dal cookie di sessione (se referrer autorizzato)
|
|
750
|
+
// const isRefUrl = this._isReferrer(), refsCallback = this._getParam('refsCallback', null);
|
|
751
|
+
// if (isRefUrl) {
|
|
741
752
|
if (this._isReferrer()) {
|
|
742
753
|
const savedPage = this._readPageCookie();
|
|
743
754
|
if (savedPage !== null) {
|
|
@@ -747,6 +758,10 @@ class SimpleDatatableAdapter extends HTMLElement {
|
|
|
747
758
|
this._deletePageCookie();
|
|
748
759
|
}
|
|
749
760
|
|
|
761
|
+
// if(refsCallback && typeof refsCallback === 'function') {
|
|
762
|
+
// refsCallback(isRefUrl);
|
|
763
|
+
// }
|
|
764
|
+
|
|
750
765
|
// Applica eventuale filtro contestuale passato via reload({ search: … })
|
|
751
766
|
// Lo facciamo qui, dentro datatable.init, per essere certi che
|
|
752
767
|
// simple-datatables abbia completato il render dei nuovi dati.
|