wj-elements 0.1.56 → 0.1.58

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.
@@ -11,7 +11,7 @@ class h extends m {
11
11
  * */
12
12
  constructor() {
13
13
  super();
14
- o(this, "depandencies", {
14
+ o(this, "dependencies", {
15
15
  "wje-popup": w
16
16
  });
17
17
  o(this, "className", "Dropdown");
@@ -1,37 +1,37 @@
1
1
  var v = Object.defineProperty;
2
- var A = (h, e, t) => e in h ? v(h, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : h[e] = t;
3
- var a = (h, e, t) => (A(h, typeof e != "symbol" ? e + "" : e, t), t), P = (h, e, t) => {
4
- if (!e.has(h))
5
- throw TypeError("Cannot " + t);
2
+ var A = (h, t, e) => t in h ? v(h, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[t] = e;
3
+ var a = (h, t, e) => (A(h, typeof t != "symbol" ? t + "" : t, e), e), P = (h, t, e) => {
4
+ if (!t.has(h))
5
+ throw TypeError("Cannot " + e);
6
6
  };
7
- var y = (h, e, t) => {
8
- if (e.has(h))
7
+ var y = (h, t, e) => {
8
+ if (t.has(h))
9
9
  throw TypeError("Cannot add the same private member more than once");
10
- e instanceof WeakSet ? e.add(h) : e.set(h, t);
10
+ t instanceof WeakSet ? t.add(h) : t.set(h, e);
11
11
  };
12
- var p = (h, e, t) => (P(h, e, "access private method"), t);
12
+ var p = (h, t, e) => (P(h, t, "access private method"), e);
13
13
  import { store as w, defaultStoreActions as j } from "./wje-store.js";
14
14
  class C {
15
- constructor(e = {}) {
16
- a(this, "findByKey", (e, t, s) => {
17
- if (this._store.getState()[e] instanceof Array)
18
- return this._store.getState()[e].find((r) => r[t] == s);
19
- console.warn(` Attribute ${e} is not array`);
15
+ constructor(t = {}) {
16
+ a(this, "findByKey", (t, e, s) => {
17
+ if (this._store.getState()[t] instanceof Array)
18
+ return this._store.getState()[t].find((r) => r[e] == s);
19
+ console.warn(` Attribute ${t} is not array`);
20
20
  });
21
- a(this, "findById", (e, t) => {
22
- if (this._store.getState()[e] instanceof Array)
23
- return this._store.getState()[e].find((i) => i.id == t);
24
- console.warn(` Attribute ${e} is not array`);
21
+ a(this, "findById", (t, e) => {
22
+ if (this._store.getState()[t] instanceof Array)
23
+ return this._store.getState()[t].find((i) => i.id == e);
24
+ console.warn(` Attribute ${t} is not array`);
25
25
  });
26
- a(this, "findAttributeValue", (e) => this._store.getState()[e]);
27
- a(this, "update", (e, t) => {
28
- this._store.dispatch(t(e));
26
+ a(this, "findAttributeValue", (t) => this._store.getState()[t]);
27
+ a(this, "update", (t, e) => {
28
+ this._store.dispatch(e(t));
29
29
  });
30
- a(this, "add", (e, t) => {
31
- this._store.dispatch(t(e));
30
+ a(this, "add", (t, e) => {
31
+ this._store.dispatch(e(t));
32
32
  });
33
- a(this, "loadPromise", (e, t, s = "GET", i, r = () => {
34
- }) => fetch(e, {
33
+ a(this, "loadPromise", (t, e, s = "GET", i, r = () => {
34
+ }) => fetch(t, {
35
35
  method: s,
36
36
  body: i,
37
37
  cache: "no-cache",
@@ -46,26 +46,26 @@ class C {
46
46
  if (r(m), n.ok)
47
47
  return n.json();
48
48
  throw n.json();
49
- }).then((n) => (this._store.dispatch(t(n)), n)));
50
- a(this, "loadOnePromise", (e, t) => fetch(e, {
49
+ }).then((n) => (this._store.dispatch(e(n)), n)));
50
+ a(this, "loadOnePromise", (t, e) => fetch(t, {
51
51
  cache: "no-cache",
52
52
  headers: {
53
53
  "Content-Type": "application/json"
54
54
  },
55
55
  referrerPolicy: "same-origin"
56
- }).then((s) => (s = s.json(), t && this._store.dispatch(t(s)), s)));
57
- a(this, "load", (e, t = !1) => $.ajax({
56
+ }).then((s) => (s = s.json(), e && this._store.dispatch(e(s)), s)));
57
+ a(this, "load", (t, e = !1) => $.ajax({
58
58
  method: "GET",
59
- url: e,
60
- async: t,
59
+ url: t,
60
+ async: e,
61
61
  dataType: "json"
62
62
  }));
63
- this._store = e.store, this.premenna = null;
63
+ this._store = t.store, this.premenna = null;
64
64
  }
65
- _save(e, t, s, i, r) {
66
- let n = fetch(e, {
65
+ _save(t, e, s, i, r) {
66
+ let n = fetch(t, {
67
67
  method: r,
68
- body: JSON.stringify(t),
68
+ body: JSON.stringify(e),
69
69
  cache: "no-cache",
70
70
  headers: {
71
71
  "Content-Type": "application/json"
@@ -74,8 +74,8 @@ class C {
74
74
  }).then((o) => (o.ok, o.json()));
75
75
  return this.dispatch(n, i, s);
76
76
  }
77
- _get(e, t, s) {
78
- let i = fetch(e, {
77
+ _get(t, e, s) {
78
+ let i = fetch(t, {
79
79
  method: "GET",
80
80
  cache: "no-cache",
81
81
  headers: {
@@ -91,24 +91,24 @@ class C {
91
91
  return n;
92
92
  }
93
93
  });
94
- return this.dispatch(i, s, t);
94
+ return this.dispatch(i, s, e);
95
95
  }
96
- put(e, t, s, i = !0) {
97
- return this._save(e, t, s, i, "PUT");
96
+ put(t, e, s, i = !0) {
97
+ return this._save(t, e, s, i, "PUT");
98
98
  }
99
- post(e, t, s, i = !0) {
100
- return this._save(e, t, s, i, "POST");
99
+ post(t, e, s, i = !0) {
100
+ return this._save(t, e, s, i, "POST");
101
101
  }
102
- delete(e, t, s, i = !0) {
103
- return this._save(e, t, s, i, "DELETE");
102
+ delete(t, e, s, i = !0) {
103
+ return this._save(t, e, s, i, "DELETE");
104
104
  }
105
- get(e, t, s = !0) {
106
- return this._get(e, t, s);
105
+ get(t, e, s = !0) {
106
+ return this._get(t, e, s);
107
107
  }
108
- dispatch(e, t, s) {
109
- return t ? e.then((i) => (this._store.dispatch(s(i.data)), i)).catch((i) => {
108
+ dispatch(t, e, s) {
109
+ return e ? t.then((i) => (this._store.dispatch(s(i.data)), i)).catch((i) => {
110
110
  console.error(i);
111
- }) : e;
111
+ }) : t;
112
112
  }
113
113
  }
114
114
  class c {
@@ -120,18 +120,18 @@ class c {
120
120
  ...intranet.storage().getItem("globalPermissions", "settings") || []
121
121
  ];
122
122
  }
123
- static includesKey(e) {
124
- return c.permissions.includes(e);
123
+ static includesKey(t) {
124
+ return c.permissions.includes(t);
125
125
  }
126
126
  static getKeys() {
127
- let e = [];
128
- return this.hasAttribute("permission-check") && (e = this.getAttribute("permission-check").split(",")), e;
127
+ let t = [];
128
+ return this.hasAttribute("permission-check") && (t = this.getAttribute("permission-check").split(",")), t;
129
129
  }
130
130
  static shouldShow() {
131
131
  return this.hasAttribute("show") && JSON.parse(this.getAttribute("show"));
132
132
  }
133
133
  static isPermissionFulfilled() {
134
- return c.getKeys.bind(this)().some((e) => c.permissions.includes(e)) || c.shouldShow.bind(this)();
134
+ return c.getKeys.bind(this)().some((t) => c.permissions.includes(t)) || c.shouldShow.bind(this)();
135
135
  }
136
136
  }
137
137
  class u {
@@ -142,30 +142,30 @@ class u {
142
142
  * @param element : HTMLElement
143
143
  * @param object : Object
144
144
  */
145
- static setAttributesToElement(e, t) {
146
- Object.entries(t).forEach(([s, i]) => {
147
- e.setAttribute(s, i);
145
+ static setAttributesToElement(t, e) {
146
+ Object.entries(e).forEach(([s, i]) => {
147
+ t.setAttribute(s, i);
148
148
  });
149
149
  }
150
150
  /** @function getAttributes
151
151
  * @description Vráti všetky atributy elementu v poli
152
152
  * @return (array)
153
153
  */
154
- static getAttributes(e) {
155
- return typeof e == "string" && (e = document.querySelector(e)), Array.from(e.attributes).filter((t) => !t.name.startsWith("@")).map((t) => [t.name.split("-").map((s, i) => i != 0 ? s.charAt(0).toUpperCase() + s.slice(1) : s).join(""), t.value]).reduce((t, s) => (t[s[0]] = s[1], t), {});
154
+ static getAttributes(t) {
155
+ return typeof t == "string" && (t = document.querySelector(t)), Array.from(t.attributes).filter((e) => !e.name.startsWith("@")).map((e) => [e.name.split("-").map((s, i) => i != 0 ? s.charAt(0).toUpperCase() + s.slice(1) : s).join(""), e.value]).reduce((e, s) => (e[s[0]] = s[1], e), {});
156
156
  }
157
- static getEvents(e) {
158
- return typeof e == "string" && (e = document.querySelector(e)), Array.from(e.attributes).filter((t) => t.name.startsWith("@wje")).map((t) => [t.name.substring(3).split("-").join(""), t.value]).reduce((t, s) => (t.set(s[0], s[1]), t), /* @__PURE__ */ new Map());
157
+ static getEvents(t) {
158
+ return typeof t == "string" && (t = document.querySelector(t)), Array.from(t.attributes).filter((e) => e.name.startsWith("@wje")).map((e) => [e.name.substring(3).split("-").join(""), e.value]).reduce((e, s) => (e.set(s[0], s[1]), e), /* @__PURE__ */ new Map());
159
159
  }
160
- static attributesToString(e) {
161
- return Object.entries(e).map(([t, s]) => `${t}="${s}"`).join(" ");
160
+ static attributesToString(t) {
161
+ return Object.entries(t).map(([e, s]) => `${e}="${s}"`).join(" ");
162
162
  }
163
- static hasSlot(e, t = null) {
164
- let s = t ? `[slot="${t}"]` : "[slot]";
165
- return e.querySelectorAll(s).length > 0;
163
+ static hasSlot(t, e = null) {
164
+ let s = e ? `[slot="${e}"]` : "[slot]";
165
+ return t.querySelectorAll(s).length > 0;
166
166
  }
167
- static stringToBoolean(e) {
168
- return !["false", "0", 0].includes(e);
167
+ static stringToBoolean(t) {
168
+ return !["false", "0", 0].includes(t);
169
169
  }
170
170
  }
171
171
  var l, d, g;
@@ -174,11 +174,11 @@ class T {
174
174
  y(this, d);
175
175
  this.customEventStorage = [], l = this;
176
176
  }
177
- dispatchCustomEvent(e, t, s) {
178
- e.dispatchEvent(
179
- new CustomEvent(t, {
177
+ dispatchCustomEvent(t, e, s) {
178
+ t.dispatchEvent(
179
+ new CustomEvent(e, {
180
180
  detail: s || {
181
- context: e,
181
+ context: t,
182
182
  event: l
183
183
  },
184
184
  bubbles: !0,
@@ -186,31 +186,31 @@ class T {
186
186
  })
187
187
  );
188
188
  }
189
- findRecordByElement(e) {
190
- for (var t = 0, s = this.customEventStorage.length; t < s; t++) {
191
- var i = this.customEventStorage[t];
192
- if (e == i.element)
189
+ findRecordByElement(t) {
190
+ for (var e = 0, s = this.customEventStorage.length; e < s; e++) {
191
+ var i = this.customEventStorage[e];
192
+ if (t == i.element)
193
193
  return i;
194
194
  }
195
195
  return !1;
196
196
  }
197
- addListener(e, t, s, i, r) {
198
- e && (Array.isArray(e) || (e = [e]), e.forEach((n) => {
199
- this.writeRecord(n, t, s, i, r);
197
+ addListener(t, e, s, i, r) {
198
+ t && (Array.isArray(t) || (t = [t]), t.forEach((n) => {
199
+ this.writeRecord(n, e, s, i, r);
200
200
  }));
201
201
  }
202
- writeRecord(e, t, s, i, r) {
203
- let n = this.findRecordByElement(e);
204
- n ? n.listeners[t] = n.listeners[t] || [] : (n = {
205
- element: e,
202
+ writeRecord(t, e, s, i, r) {
203
+ let n = this.findRecordByElement(t);
204
+ n ? n.listeners[e] = n.listeners[e] || [] : (n = {
205
+ element: t,
206
206
  listeners: {}
207
- }, n.listeners[t] = [], this.customEventStorage.push(n)), i = i || p(this, d, g);
207
+ }, n.listeners[e] = [], this.customEventStorage.push(n)), i = i || p(this, d, g);
208
208
  let o = {
209
209
  listener: i,
210
210
  options: r,
211
211
  event: s
212
212
  };
213
- this.listenerExists(e, t, o) ? console.warn("Listener already exists", e, t, i) : (n.listeners[t].push(o), e.addEventListener(t, i, r));
213
+ this.listenerExists(t, e, o) ? console.warn("Listener already exists", t, e, i) : (n.listeners[e].push(o), t.addEventListener(e, i, r));
214
214
  }
215
215
  /**
216
216
  * Performs a deep equality check between two objects.
@@ -219,63 +219,63 @@ class T {
219
219
  * @param {any} y - The second object to compare.
220
220
  * @returns {boolean} - Returns `true` if the objects are deeply equal, `false` otherwise.
221
221
  */
222
- deepEqual(e, t) {
223
- return e && t && typeof e == "object" && typeof e == typeof t ? Object.keys(e).length === Object.keys(t).length && Object.keys(e).every((s) => this.deepEqual(e[s], t[s])) : e === t;
222
+ deepEqual(t, e) {
223
+ return t && e && typeof t == "object" && typeof t == typeof e ? Object.keys(t).length === Object.keys(e).length && Object.keys(t).every((s) => this.deepEqual(t[s], e[s])) : t === e;
224
224
  }
225
- listenerExists(e, t, s) {
226
- return this.findRecordByElement(e).listeners[t].some((r) => this.deepEqual(r, s));
225
+ listenerExists(t, e, s) {
226
+ return this.findRecordByElement(t).listeners[e].some((r) => this.deepEqual(r, s));
227
227
  }
228
- removeListener(e, t, s, i, r) {
229
- let n = this.findRecordByElement(e);
230
- if (n && t in n.listeners) {
231
- var o = n.listeners[t].indexOf(i);
232
- ~o && n.listeners[t].splice(o, 1), n.listeners[t].length || delete n.listeners[t];
228
+ removeListener(t, e, s, i, r) {
229
+ let n = this.findRecordByElement(t);
230
+ if (n && e in n.listeners) {
231
+ var o = n.listeners[e].indexOf(i);
232
+ ~o && n.listeners[e].splice(o, 1), n.listeners[e].length || delete n.listeners[e];
233
233
  }
234
- i = i || p(this, d, g), e.removeEventListener(t, i, r);
234
+ i = i || p(this, d, g), t.removeEventListener(e, i, r);
235
235
  }
236
- removeElement(e) {
237
- this.customEventStorage = this.customEventStorage.filter((t) => {
238
- if (t.element !== e)
239
- return t;
236
+ removeElement(t) {
237
+ this.customEventStorage = this.customEventStorage.filter((e) => {
238
+ if (e.element !== t)
239
+ return e;
240
240
  });
241
241
  }
242
242
  // TODO
243
- createPromiseFromEvent(e, t) {
243
+ createPromiseFromEvent(t, e) {
244
244
  return new Promise((s) => {
245
245
  let i = () => {
246
- e.removeEventListener(t, i), s();
246
+ t.removeEventListener(e, i), s();
247
247
  };
248
- e.addEventListener(t, i);
248
+ t.addEventListener(e, i);
249
249
  });
250
250
  }
251
251
  }
252
- d = new WeakSet(), g = function(e) {
253
- let t = this;
254
- l.findRecordByElement(t).listeners[e.type].forEach((r, n) => {
255
- l.dispatchCustomEvent(t, r.event, {
256
- originalEvent: (e == null ? void 0 : e.type) || null,
257
- context: t,
252
+ d = new WeakSet(), g = function(t) {
253
+ let e = this;
254
+ l.findRecordByElement(e).listeners[t.type].forEach((r, n) => {
255
+ l.dispatchCustomEvent(e, r.event, {
256
+ originalEvent: (t == null ? void 0 : t.type) || null,
257
+ context: e,
258
258
  event: l
259
- }), r.options && r.options.stopPropagation === !0 && e.stopPropagation();
259
+ }), r.options && r.options.stopPropagation === !0 && t.stopPropagation();
260
260
  });
261
261
  };
262
262
  let _ = new T();
263
263
  const S = document.createElement("template");
264
264
  S.innerHTML = "";
265
265
  const f = class f extends HTMLElement {
266
- constructor(t) {
266
+ constructor(e) {
267
267
  super();
268
- a(this, "initWjElement", async (t = !1) => {
268
+ a(this, "initWjElement", async (e = !1) => {
269
269
  var r;
270
270
  this.functionStack = [];
271
271
  const s = Date.now();
272
- this.functionStack.push(s), (r = this.setupAttributes) == null || r.call(this), this.isShadowRoot && !this.shadowRoot && this.attachShadow({ mode: this.shadowType || "open" }), this.setUpAccessors(), this.drawingStatus = "BEGINING", this.display(t, s);
272
+ this.functionStack.push(s), (r = this.setupAttributes) == null || r.call(this), this.isShadowRoot && !this.shadowRoot && this.attachShadow({ mode: this.shadowType || "open" }), this.setUpAccessors(), this.drawingStatus = "BEGINING", this.display(e, s);
273
273
  const i = new CSSStyleSheet();
274
274
  i.replaceSync(this.constructor.cssStyleSheet), this.context.adoptedStyleSheets = [i];
275
275
  });
276
- this.template = t || S, this.isAttached = !1, this.service = new C({
276
+ this.template = e || S, this.isAttached = !1, this.service = new C({
277
277
  store: w
278
- }), this.defineDepandencies(), this.rendering = !1, this.runtimeTimeout = null, this.count = 0, this.functionStack = [], this.scheludedRefresh = !1, this._depandencies = {};
278
+ }), this.definedependencies(), this.rendering = !1, this.runtimeTimeout = null, this.count = 0, this.functionStack = [], this.scheludedRefresh = !1, this._dependencies = {};
279
279
  }
280
280
  get permission() {
281
281
  return this.getAttribute("permission-check");
@@ -283,7 +283,7 @@ const f = class f extends HTMLElement {
283
283
  get isPermissionCheck() {
284
284
  return this.hasAttribute("permission-check");
285
285
  }
286
- set isPermissionCheck(t) {
286
+ set isPermissionCheck(e) {
287
287
  return this.setAttribute("permission-check", "permission-check");
288
288
  }
289
289
  get isShow() {
@@ -292,8 +292,8 @@ const f = class f extends HTMLElement {
292
292
  get isShadowRoot() {
293
293
  return this.hasAttribute("shadow");
294
294
  }
295
- set isShadowRoot(t) {
296
- return this.setAttribute("shadow", t);
295
+ set isShadowRoot(e) {
296
+ return this.setAttribute("shadow", e);
297
297
  }
298
298
  get shadowType() {
299
299
  return this.getAttribute("shadow") || "open";
@@ -329,38 +329,38 @@ const f = class f extends HTMLElement {
329
329
  return j;
330
330
  }
331
331
  get removeClassAfterConnect() {
332
- var t;
333
- return (t = this.getAttribute("remove-class-after-connect")) == null ? void 0 : t.split(" ");
332
+ var e;
333
+ return (e = this.getAttribute("remove-class-after-connect")) == null ? void 0 : e.split(" ");
334
334
  }
335
- get depandencies() {
336
- return this._depandencies;
335
+ get dependencies() {
336
+ return this._dependencies;
337
337
  }
338
- set depandencies(t) {
339
- this._depandencies = t;
338
+ set dependencies(e) {
339
+ this._dependencies = e;
340
340
  }
341
- static define(t, s = this, i = {}) {
342
- if (!customElements.get(t)) {
343
- customElements.define(t, s, i);
341
+ static define(e, s = this, i = {}) {
342
+ if (!customElements.get(e)) {
343
+ customElements.define(e, s, i);
344
344
  return;
345
345
  }
346
346
  }
347
- defineDepandencies() {
348
- this.depandencies && Object.entries(depandencies).forEach((t, s) => f.define(t, s));
347
+ definedependencies() {
348
+ this.dependencies && Object.entries(dependencies).forEach((e, s) => f.define(e, s));
349
349
  }
350
350
  beforeDraw() {
351
351
  }
352
352
  afterDraw() {
353
353
  }
354
354
  refreshUpdatePromise() {
355
- this.updateComplete = new Promise((t, s) => {
356
- this.finisPromise = t, this.rejectPromise = s;
355
+ this.updateComplete = new Promise((e, s) => {
356
+ this.finisPromise = e, this.rejectPromise = s;
357
357
  });
358
358
  }
359
359
  async connectedCallback() {
360
- this.finisPromise = (t) => {
361
- t();
362
- }, this.rejectPromise = (t) => {
363
- t();
360
+ this.finisPromise = (e) => {
361
+ e();
362
+ }, this.rejectPromise = (e) => {
363
+ e();
364
364
  }, this.refreshUpdatePromise(), await this.initWjElement(!0);
365
365
  }
366
366
  setupAttributes() {
@@ -374,13 +374,13 @@ const f = class f extends HTMLElement {
374
374
  beforeDisconnect() {
375
375
  }
376
376
  disconnectedCallback() {
377
- var t, s;
378
- (t = this.beforeDisconnect) == null || t.call(this), this.isAttached && (this.context.innerHTML = ""), this.drawingStatus = "DISCONNECTED", this.isAttached = !1, (s = this.afterDisconnect) == null || s.call(this);
377
+ var e, s;
378
+ (e = this.beforeDisconnect) == null || e.call(this), this.isAttached && (this.context.innerHTML = ""), this.drawingStatus = "DISCONNECTED", this.isAttached = !1, (s = this.afterDisconnect) == null || s.call(this);
379
379
  }
380
380
  /**
381
381
  * Lifecycle method, called whenever an observed property changes
382
382
  */
383
- attributeChangedCallback(t, s, i) {
383
+ attributeChangedCallback(e, s, i) {
384
384
  if (!this.isAttached && s !== i) {
385
385
  this.scheludedRefresh = !0;
386
386
  return;
@@ -388,20 +388,20 @@ const f = class f extends HTMLElement {
388
388
  s !== i && this.refresh();
389
389
  }
390
390
  async refresh() {
391
- var t, s;
392
- this.refreshUpdatePromise(), this.drawingStatus != "AFTER" ? ((t = this.afterDisconnect) == null || t.call(this), await this.initWjElement(!0)) : ((s = this.unregister) == null || s.call(this), await this.initWjElement(!0));
391
+ var e, s;
392
+ this.refreshUpdatePromise(), this.drawingStatus != "AFTER" ? ((e = this.afterDisconnect) == null || e.call(this), await this.initWjElement(!0)) : ((s = this.unregister) == null || s.call(this), await this.initWjElement(!0));
393
393
  }
394
394
  /**
395
395
  * To be implemented by the child class
396
396
  */
397
- draw(t, s, i) {
397
+ draw(e, s, i) {
398
398
  return null;
399
399
  }
400
- display(t = !1, s) {
401
- this.isProcessingFlow(s) || (t && ([...this.context.childNodes].forEach(this.context.removeChild.bind(this.context)), this.isAttached = !1), this.context.append(this.template.content.cloneNode(!0)), this.isPermissionCheck || this.isShow ? c.isPermissionFulfilled.bind(this)(this.permission) ? this._resolveRender(s) : this.remove() : this._resolveRender(s));
400
+ display(e = !1, s) {
401
+ this.isProcessingFlow(s) || (e && ([...this.context.childNodes].forEach(this.context.removeChild.bind(this.context)), this.isAttached = !1), this.context.append(this.template.content.cloneNode(!0)), this.isPermissionCheck || this.isShow ? c.isPermissionFulfilled.bind(this)(this.permission) ? this._resolveRender(s) : this.remove() : this._resolveRender(s));
402
402
  }
403
- async render(t) {
404
- this.drawingStatus = "DRAWING", !this.isProcessingFlow(t) && await Promise.resolve(this.draw(this.context, this.store, u.getAttributes(this))).then((s) => {
403
+ async render(e) {
404
+ this.drawingStatus = "DRAWING", !this.isProcessingFlow(e) && await Promise.resolve(this.draw(this.context, this.store, u.getAttributes(this))).then((s) => {
405
405
  let i = s || "", r;
406
406
  if (i instanceof HTMLElement || i instanceof DocumentFragment)
407
407
  r = i;
@@ -410,14 +410,14 @@ const f = class f extends HTMLElement {
410
410
  o.innerHTML = i, r = o.content.cloneNode(!0);
411
411
  }
412
412
  let n = r;
413
- this.isProcessingFlow(t) || this.context.appendChild(n);
413
+ this.isProcessingFlow(e) || this.context.appendChild(n);
414
414
  });
415
415
  }
416
416
  /**
417
417
  * Turns a string split with "-" into camel case notation
418
418
  */
419
- sanitizeName(t) {
420
- let s = t.split("-");
419
+ sanitizeName(e) {
420
+ let s = e.split("-");
421
421
  return [s.shift(), ...s.map((i) => i[0].toUpperCase() + i.slice(1))].join("");
422
422
  }
423
423
  /**
@@ -433,14 +433,14 @@ const f = class f extends HTMLElement {
433
433
  });
434
434
  });
435
435
  }
436
- isProcessingFlow(t) {
437
- return !this.functionStack.find((s) => s == t);
436
+ isProcessingFlow(e) {
437
+ return !this.functionStack.find((s) => s == e);
438
438
  }
439
- _resolveRender(t) {
440
- this.isProcessingFlow(t) || (this.params = u.getAttributes(this), Promise.resolve(this.beforeDraw(this.context, this.store, u.getAttributes(this))).then((s) => {
441
- this.drawingStatus = "BEFORE", Promise.resolve(this.render(t)).then((i) => {
439
+ _resolveRender(e) {
440
+ this.isProcessingFlow(e) || (this.params = u.getAttributes(this), Promise.resolve(this.beforeDraw(this.context, this.store, u.getAttributes(this))).then((s) => {
441
+ this.drawingStatus = "BEFORE", Promise.resolve(this.render(e)).then((i) => {
442
442
  var r;
443
- this.isProcessingFlow(t) || Promise.resolve((r = this.afterDraw) == null ? void 0 : r.call(this, this.context, this.store, u.getAttributes(this))).then(
443
+ this.isProcessingFlow(e) || Promise.resolve((r = this.afterDraw) == null ? void 0 : r.call(this, this.context, this.store, u.getAttributes(this))).then(
444
444
  (n, o, m) => {
445
445
  this.drawingStatus = "AFTER", this.finisPromise(), this.rendering = !1, this.isAttached = !0, this.removeClassAfterConnect && this.classList.remove(...this.removeClassAfterConnect), this.scheludedRefresh && (this.refresh(), this.scheludedRefresh = !1);
446
446
  }
@@ -449,9 +449,9 @@ const f = class f extends HTMLElement {
449
449
  }));
450
450
  }
451
451
  };
452
- a(f, "processTemplates", (t, s) => {
452
+ a(f, "processTemplates", (e, s) => {
453
453
  const i = document.createElement("template");
454
- return i.innerHTML = [s.innerHTML, (t == null ? void 0 : t.innerHTML) || ""].join(""), i;
454
+ return i.innerHTML = [s.innerHTML, (e == null ? void 0 : e.innerHTML) || ""].join(""), i;
455
455
  });
456
456
  let E = f, L = "true";
457
457
  export {
@@ -20,7 +20,7 @@ class g extends v {
20
20
  * Dependencies
21
21
  * @type {Object}
22
22
  */
23
- m(this, "depandencies", {
23
+ m(this, "dependencies", {
24
24
  "wje-format-digital": E,
25
25
  "wje-button": z,
26
26
  "wje-slider": A,
@@ -98,7 +98,7 @@ class f extends x {
98
98
  * Dependencies
99
99
  * @type {Object}
100
100
  */
101
- h(this, "depandencies", {
101
+ h(this, "dependencies", {
102
102
  "wje-button": A
103
103
  });
104
104
  h(this, "className", "FileUpload");
@@ -19,9 +19,9 @@ class m extends b {
19
19
  /**
20
20
  * Dependencies of the IconPicker component.
21
21
  *
22
- * @property {Object} depandencies
22
+ * @property {Object} dependencies
23
23
  */
24
- p(this, "depandencies", {
24
+ p(this, "dependencies", {
25
25
  "wje-input": v,
26
26
  "wje-infinite-scroll": u,
27
27
  "wje-tooltip": f,
@@ -25,9 +25,9 @@ class u extends w {
25
25
  /**
26
26
  * Dependencies of the ImgComparer component.
27
27
  *
28
- * @property {Object} depandencies
28
+ * @property {Object} dependencies
29
29
  */
30
- c(this, "depandencies", {
30
+ c(this, "dependencies", {
31
31
  "wje-icon": g
32
32
  });
33
33
  c(this, "className", "ImgComparer");
@@ -15,7 +15,7 @@ class d extends u {
15
15
  /**
16
16
  * Dependencies of the Option component.
17
17
  */
18
- o(this, "depandencies", {
18
+ o(this, "dependencies", {
19
19
  "wje-icon": g
20
20
  });
21
21
  o(this, "className", "Option");
@@ -1,9 +1,9 @@
1
1
  var p = Object.defineProperty;
2
- var c = (o, e, t) => e in o ? p(o, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : o[e] = t;
3
- var a = (o, e, t) => (c(o, typeof e != "symbol" ? e + "" : e, t), t);
2
+ var c = (o, t, e) => t in o ? p(o, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : o[t] = e;
3
+ var r = (o, t, e) => (c(o, typeof t != "symbol" ? t + "" : t, e), e);
4
4
  import d, { event as u } from "./wje-element.js";
5
5
  import h from "./wje-option.js";
6
- class r extends d {
6
+ class a extends d {
7
7
  /**
8
8
  * Creates an instance of Options.
9
9
  *
@@ -11,10 +11,10 @@ class r extends d {
11
11
  */
12
12
  constructor() {
13
13
  super();
14
- a(this, "depandencies", {
14
+ r(this, "dependencies", {
15
15
  "wje-option": h
16
16
  });
17
- a(this, "className", "Options");
17
+ r(this, "className", "Options");
18
18
  }
19
19
  /**
20
20
  * Returns the list of attributes to observe for changes.
@@ -37,11 +37,11 @@ class r extends d {
37
37
  */
38
38
  async beforeDraw() {
39
39
  this.response = await this.getPages();
40
- let t = document.createDocumentFragment();
40
+ let e = document.createDocumentFragment();
41
41
  this.response.forEach((s, i) => {
42
42
  let n = document.createElement("wje-option");
43
- n.setAttribute("value", s[this.itemValue] || s.value), n.innerText = s[this.itemText] || s.text, t.appendChild(n);
44
- }), this.parentElement.appendChild(t), u.dispatchCustomEvent(this, "wje-options:load", {});
43
+ n.setAttribute("value", s[this.itemValue] || s.value), n.innerText = s[this.itemText] || s.text, e.appendChild(n);
44
+ }), this.parentElement.appendChild(e), u.dispatchCustomEvent(this, "wje-options:load", {});
45
45
  }
46
46
  /**
47
47
  * Fetches the pages from the provided URL.
@@ -50,14 +50,14 @@ class r extends d {
50
50
  * @returns {Promise<Object>} The fetched data.
51
51
  * @throws Will throw an error if the response is not ok.
52
52
  */
53
- async getPages(t) {
53
+ async getPages(e) {
54
54
  const s = await fetch(this.url);
55
55
  if (!s.ok)
56
56
  throw new Error(`An error occurred: ${s.status}`);
57
57
  return await s.json();
58
58
  }
59
59
  }
60
- r.define("wje-options", r);
60
+ a.define("wje-options", a);
61
61
  export {
62
- r as default
62
+ a as default
63
63
  };
@@ -20,7 +20,7 @@ class j extends y {
20
20
  */
21
21
  constructor() {
22
22
  super();
23
- m(this, "depandencies", {
23
+ m(this, "dependencies", {
24
24
  "wje-button": L,
25
25
  "wje-popup": M,
26
26
  "wje-icon": O,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "wj-elements",
3
3
  "description": "WebJET Elements is a modern set of user interface tools harnessing the power of web components designed to simplify web application development.",
4
- "version": "0.1.56",
4
+ "version": "0.1.58",
5
5
  "homepage": "https://github.com/lencys/wj-elements",
6
6
  "author": "Lukáš Ondrejček <lukas.ondrejcek@gmail.com>",
7
7
  "license": "MIT",