@startinblox/core 0.18.0-beta.3 → 0.18.0-beta.4

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.
Files changed (43) hide show
  1. package/dist/_snowpack/pkg/common/{_baseUnary-c1edb653.js → _baseUnary-d2677655.js} +2 -2
  2. package/dist/_snowpack/pkg/common/{_baseUnary-c1edb653.js.map → _baseUnary-d2677655.js.map} +1 -1
  3. package/dist/_snowpack/pkg/common/{_commonjsHelpers-37fa8da4.js → _commonjsHelpers-0597c316.js} +2 -2
  4. package/dist/_snowpack/pkg/common/_commonjsHelpers-0597c316.js.map +1 -0
  5. package/dist/_snowpack/pkg/delta-markdown-for-quill.js +2 -2
  6. package/dist/_snowpack/pkg/dialog-polyfill.js +1 -2
  7. package/dist/_snowpack/pkg/dialog-polyfill.js.map +1 -1
  8. package/dist/_snowpack/pkg/import-map.json +1 -0
  9. package/dist/_snowpack/pkg/jsonld-context-parser.js +1 -1
  10. package/dist/_snowpack/pkg/jsonld.js +11760 -0
  11. package/dist/_snowpack/pkg/jsonld.js.map +1 -0
  12. package/dist/_snowpack/pkg/markdown-it.js +1 -1
  13. package/dist/_snowpack/pkg/quill-delta-to-markdown.js +2 -2
  14. package/dist/_snowpack/pkg/quill.js +11626 -11627
  15. package/dist/_snowpack/pkg/quill.js.map +1 -1
  16. package/dist/_snowpack/pkg/tui-calendar.js +43101 -43105
  17. package/dist/_snowpack/pkg/tui-calendar.js.map +1 -1
  18. package/dist/components/solid-form-search.js +1 -2
  19. package/dist/components/solid-form.js +2 -4
  20. package/dist/libs/ComponentFactory.js +1 -4
  21. package/dist/libs/filter.js +1 -1
  22. package/dist/libs/helpers.js +4 -10
  23. package/dist/libs/lit-helpers.js +1 -4
  24. package/dist/libs/polyfills.js +2 -4
  25. package/dist/libs/store/custom-getter.js +344 -0
  26. package/dist/libs/store/server-pagination.js +4 -7
  27. package/dist/libs/store/server-search.js +4 -7
  28. package/dist/libs/store/store.js +92 -343
  29. package/dist/mixins/attributeBinderMixin.js +3 -6
  30. package/dist/mixins/federationMixin.js +6 -0
  31. package/dist/mixins/filterMixin.js +13 -16
  32. package/dist/mixins/listMixin.js +20 -9
  33. package/dist/mixins/requiredMixin.js +15 -3
  34. package/dist/mixins/storeMixin.js +30 -0
  35. package/dist/mixins/widgetMixin.js +12 -5
  36. package/dist/new-widgets/templates/formTemplatesDirectory.js +6 -15
  37. package/dist/new-widgets/templatesDependencies/formDropdownMixin.js +3 -0
  38. package/dist/new-widgets/templatesDependencies/multipleFormMixin.js +7 -3
  39. package/dist/new-widgets/templatesDependencies/multipleselectFormMixin.js +11 -2
  40. package/dist/widgets/baseWidget.js +4 -5
  41. package/dist/widgets/widget-factory.js +1 -3
  42. package/package.json +4 -2
  43. package/dist/_snowpack/pkg/common/_commonjsHelpers-37fa8da4.js.map +0 -1
@@ -70,8 +70,7 @@ export const SolidFormSearch = {
70
70
  });
71
71
  return values;
72
72
  },
73
- getWidget(field) {
74
- let isSet = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
73
+ getWidget(field, isSet = false) {
75
74
  let tagName = '';
76
75
  // If auto-range-[field] exists, create range-[field] and sets its value
77
76
  if (this.element.hasAttribute('auto-range-' + field) && !this.element.hasAttribute('range-' + field)) {
@@ -87,8 +87,7 @@ export const SolidForm = {
87
87
  }
88
88
  return transformArrayToContainer(value);
89
89
  },
90
- getWidget(field) {
91
- let isSet = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
90
+ getWidget(field, isSet = false) {
92
91
  let tagName = '';
93
92
  const widgetAttribute = this.element.getAttribute('widget-' + field);
94
93
 
@@ -163,8 +162,7 @@ export const SolidForm = {
163
162
  if (!this.isCreationForm(formValue) && this.isSavingAutomatically) this.submitForm(); // if autosave, submitForm
164
163
  },
165
164
 
166
- findErrorMessage(errors) {
167
- let errorFullName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
165
+ findErrorMessage(errors, errorFullName = '') {
168
166
  let errorsArray = [];
169
167
  errors.forEach(member => {
170
168
  let errorNextName = Object.values(member)[0];
@@ -131,10 +131,7 @@ export class ComponentFactory {
131
131
  static bindMethods(componentConstructor, methods) {
132
132
  methods.forEach((method, methodName) => {
133
133
  Reflect.defineProperty(componentConstructor.prototype, methodName, {
134
- value: function () {
135
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
136
- args[_key] = arguments[_key];
137
- }
134
+ value: function (...args) {
138
135
  return Reflect.apply(method, this, args);
139
136
  }
140
137
  });
@@ -116,7 +116,7 @@ const cacheFieldsProps = (cacheKey, filter, fields, searchForm) => {
116
116
  * @param resource - resource to test
117
117
  * @param filter - name of the property tested
118
118
  * @param query - query object to know how to compare values
119
- * @param fields - fields attribute of the element
119
+ * @param fieldsAttr - fields attribute of the element
120
120
  * @param searchForm - searchForm component
121
121
  * @param filterId - uniqId used to fill the cache
122
122
  * @param throwOn - should function throw error on True or False
@@ -7,8 +7,7 @@ function stringToDom(html) {
7
7
  template.innerHTML = html;
8
8
  return template.content;
9
9
  }
10
- async function evalTemplateString(str) {
11
- let variables = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
10
+ async function evalTemplateString(str, variables = {}) {
12
11
  const keys = Object.keys(variables);
13
12
  const values = keys.map(key => variables[key]);
14
13
  try {
@@ -20,11 +19,8 @@ async function evalTemplateString(str) {
20
19
  throw new SyntaxError('`' + str + '`');
21
20
  }
22
21
  }
23
- function importCSS() {
22
+ function importCSS(...stylesheets) {
24
23
  const linksElements = [];
25
- for (var _len = arguments.length, stylesheets = new Array(_len), _key = 0; _key < _len; _key++) {
26
- stylesheets[_key] = arguments[_key];
27
- }
28
24
  for (let url of stylesheets) {
29
25
  url = relativeSource(url);
30
26
  let link = Array.from(document.head.querySelectorAll('link')).find(link => link.href === url);
@@ -38,10 +34,7 @@ function importCSS() {
38
34
  ;
39
35
  return linksElements;
40
36
  }
41
- function importJS() {
42
- for (var _len2 = arguments.length, plugins = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
43
- plugins[_key2] = arguments[_key2];
44
- }
37
+ function importJS(...plugins) {
45
38
  return plugins.map(url => {
46
39
  url = new URL(url, document.baseURI).href;
47
40
  let script = Array.from(document.querySelectorAll('script')).find(script => script.src === url);
@@ -169,6 +162,7 @@ function transformArrayToContainer(resource) {
169
162
  // iterate over all properties
170
163
  const predicateValue = newValue[predicate];
171
164
  if (!predicateValue || typeof predicateValue !== 'object') continue; // undefined or literal, do nothing
165
+ if (['permissions', '@context'].includes(predicate)) continue; // do not transform permissions and context
172
166
 
173
167
  // check all keys of nested resource
174
168
  if (!Array.isArray(predicateValue) && predicateValue['@id']) {
@@ -93,12 +93,9 @@ const templateStringsCache = new WeakMap();
93
93
 
94
94
  // Convert dynamic tags to template strings
95
95
  // example: <${'div'}>${'this is example'}</${'div'}> => <div>${'this is example'}</div>
96
- export function preHTML(strings) {
96
+ export function preHTML(strings, ...values) {
97
97
  // check cache !important return equal link at first argument
98
98
  let cachedStrings = templateStringsCache.get(strings);
99
- for (var _len = arguments.length, values = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
100
- values[_key - 1] = arguments[_key];
101
- }
102
99
  if (cachedStrings) {
103
100
  for (let i = 0, n = cachedStrings.length; i < n; ++i) {
104
101
  const needlessValues = cachedStrings[i].needlessValues;
@@ -2,8 +2,7 @@
2
2
  if (!('flat' in Array.prototype)) {
3
3
  Object.defineProperty(Array.prototype, 'flat', {
4
4
  configurable: true,
5
- value: function flat() {
6
- let depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
5
+ value: function flat(depth = 1) {
7
6
  depth = isNaN(depth) ? 1 : Number(depth);
8
7
  if (depth === 0) return Array.prototype.slice.call(this);
9
8
  return Array.prototype.reduce.call(this, function (acc, cur) {
@@ -21,8 +20,7 @@ if (!('flat' in Array.prototype)) {
21
20
 
22
21
  // Element.prototype.toggleAttribute
23
22
  if (!Element.prototype.toggleAttribute) {
24
- Element.prototype.toggleAttribute = function (name) {
25
- let force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
23
+ Element.prototype.toggleAttribute = function (name, force = undefined) {
26
24
  if (force !== undefined) force = !!force;
27
25
  if (this.hasAttribute(name)) {
28
26
  if (force) return true;
@@ -0,0 +1,344 @@
1
+ let _Symbol$toPrimitive;
2
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
3
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
4
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
5
+ import JSONLDContextParser from '../../_snowpack/pkg/jsonld-context-parser.js';
6
+ import { store } from './store.js';
7
+ const ContextParser = JSONLDContextParser.ContextParser;
8
+ _Symbol$toPrimitive = Symbol.toPrimitive;
9
+ export class CustomGetter {
10
+ // search attributes to give to server
11
+
12
+ constructor(resourceId, resource, clientContext, serverContext, parentId = "", serverPagination = {}, serverSearch = {}) {
13
+ _defineProperty(this, "resource", void 0);
14
+ // content of the requested resource
15
+ _defineProperty(this, "resourceId", void 0);
16
+ _defineProperty(this, "clientContext", void 0);
17
+ // context given by the app
18
+ _defineProperty(this, "serverContext", void 0);
19
+ // context given by the server
20
+ _defineProperty(this, "parentId", void 0);
21
+ // id of the parent resource, used to get the absolute url of the current resource
22
+ _defineProperty(this, "containerTypes", void 0);
23
+ // types of resources interpreted as containers
24
+ _defineProperty(this, "serverPagination", void 0);
25
+ // pagination attributes to give to server
26
+ _defineProperty(this, "serverSearch", void 0);
27
+ this.clientContext = clientContext;
28
+ this.serverContext = serverContext;
29
+ this.parentId = parentId;
30
+ this.resource = resource;
31
+ // this.resource = this.expandProperties({ ...resource }, serverContext);
32
+ this.resourceId = resourceId;
33
+ this.serverPagination = serverPagination;
34
+ this.serverSearch = serverSearch;
35
+ this.containerTypes = [this.getExpandedPredicate("ldp:Container"), this.getExpandedPredicate("ldp:BasicContainer"), this.getExpandedPredicate("ldp:DirectContainer"), this.getExpandedPredicate("ldp:IndirectContainer"), "sib:federatedContainer"];
36
+ }
37
+
38
+ // /**
39
+ // * Expand all predicates of a resource with a given context
40
+ // * @param resource: object
41
+ // * @param context: object
42
+ // */
43
+ // expandProperties(resource: object, context: object | string) {
44
+ // for (let prop of Object.keys(resource)) {
45
+ // if (!prop) continue;
46
+ // this.objectReplaceProperty(resource, prop, ContextParser.expandTerm(prop, context as JSONLDContextParser.IJsonLdContextNormalized, true));
47
+ // }
48
+ // return resource
49
+ // }
50
+
51
+ // /**
52
+ // * Change the key of an object
53
+ // * @param object: object
54
+ // * @param oldProp: string - current key
55
+ // * @param newProp: string - new key to set
56
+ // */
57
+ // objectReplaceProperty(object: object, oldProp: string, newProp: string) {
58
+ // if (newProp !== oldProp) {
59
+ // Object.defineProperty(
60
+ // object,
61
+ // newProp,
62
+ // Object.getOwnPropertyDescriptor(object, oldProp) || ''
63
+ // );
64
+ // delete object[oldProp];
65
+ // }
66
+ // }
67
+
68
+ /**
69
+ * Get the property of a resource for a given path
70
+ * Which means that if the resource is not complete, it will fetch it
71
+ * And that we handle the `.` notation, traversing the path recursively
72
+ * @param path: string
73
+ */
74
+ async get(path) {
75
+ if (!path) return;
76
+
77
+ // Specific case where the predicates is a full IRI, avoid splitting it on the dot notation
78
+ try {
79
+ let isUrl = new URL(path);
80
+ // If the path is an absolute url, we need to fetch the resource
81
+ if (isUrl) {
82
+ let value = this.resource[this.getExpandedPredicate(path)];
83
+ return value ? value : undefined;
84
+ }
85
+ } catch (e) {
86
+ // Split the path on each dots
87
+ const path1 = path.split('.');
88
+
89
+ // Intermediate path var to request each resource individually until the path traversal is completed
90
+ const path2 = [];
91
+
92
+ // Actual value found from the store, if any
93
+ let value;
94
+ if (!this.isFullResource()) {
95
+ // if resource is not complete, fetch it first
96
+ await this.getResource(this.resourceId, {
97
+ ...this.clientContext,
98
+ ...this.serverContext
99
+ }, this.parentId);
100
+ }
101
+
102
+ // If the path contains dot, we need to traverse the path recursively
103
+ // We do that by poping one element from path1 at each step and affecting it to path2
104
+ // Trying to get the value from it
105
+ while (true) {
106
+ try {
107
+ value = this.resource[this.getExpandedPredicate(path1[0])];
108
+ } catch (e) {
109
+ break;
110
+ }
111
+ if (path1.length <= 1) break; // no dot path
112
+ const lastPath1El = path1.pop();
113
+ if (lastPath1El) path2.unshift(lastPath1El);
114
+ }
115
+ if (path2.length === 0) {
116
+ // end of the path
117
+ if (!value || !value['@id']) return this.getLiteralValue(value); // no value or not a resource
118
+ return await this.getResource(value['@id'], {
119
+ ...this.clientContext,
120
+ ...this.serverContext
121
+ }, this.parentId || this.resourceId); // return complete resource
122
+ }
123
+
124
+ if (!value) return undefined;
125
+ let resource = await this.getResource(value['@id'], {
126
+ ...this.clientContext,
127
+ ...this.serverContext
128
+ }, this.parentId || this.resourceId);
129
+ store.subscribeResourceTo(this.resourceId, value['@id']);
130
+ return resource ? await resource[path2.join('.')] : undefined; // return value
131
+ }
132
+ }
133
+
134
+ /**
135
+ * Return value depending of the current language
136
+ * @param value
137
+ * @returns
138
+ */
139
+ getLiteralValue(value) {
140
+ if (typeof value === "object") {
141
+ // value object: https://www.w3.org/TR/json-ld11/#value-objects
142
+ if (value['@value']) {
143
+ // 1 language
144
+ return value['@value'];
145
+ } else if (Array.isArray(value)) {
146
+ // multiple languages
147
+ if (value.length === 0) return null;
148
+ const ln = store._getLanguage();
149
+ let translatedValue = value.find(v => v['@language'] && v['@language'] === ln); // find current language
150
+ if (!translatedValue) translatedValue = value.find(v => v['@language'] && v['@language'] === 'en'); // default to en
151
+ return translatedValue ? translatedValue['@value'] || null : null;
152
+ }
153
+ }
154
+ return value; // simple value
155
+ }
156
+
157
+ /**
158
+ * Cache resource in the store, and return the created proxy
159
+ * @param id
160
+ * @param context
161
+ * @param iriParent
162
+ */
163
+ async getResource(id, context, iriParent, forceFetch = false) {
164
+ if (id.startsWith('_:b')) return store.get(id + iriParent); // anonymous node = get from cache
165
+ return store.getData(id, context, iriParent, undefined, forceFetch);
166
+ }
167
+
168
+ /**
169
+ * Return true if the resource is a container
170
+ */
171
+ isContainer() {
172
+ if (this.resource["@type"]) {
173
+ // @type is an array
174
+ if (Array.isArray(this.resource["@type"])) return this.containerTypes.some(type => this.resource["@type"].includes(type));
175
+ return this.containerTypes.includes(this.resource["@type"]);
176
+ } else if (this.resource["type"]) {
177
+ if (Array.isArray(this.resource["type"])) return this.containerTypes.some(type => this.resource["type"].includes(type));
178
+ return this.containerTypes.includes(this.resource["type"]);
179
+ }
180
+ return false;
181
+ }
182
+
183
+ /**
184
+ * Return true if the given key in the current resource in an array
185
+ */
186
+ isArray() {
187
+ if (Array.isArray(this.resource)) return true;
188
+ return false;
189
+ }
190
+
191
+ /**
192
+ * Get all properties of a resource
193
+ */
194
+ getProperties() {
195
+ return Object.keys(this.resource).map(prop => this.getCompactedPredicate(prop));
196
+ }
197
+
198
+ /**
199
+ * Get children of container as objects
200
+ */
201
+ getChildren(predicateName) {
202
+ return this.resource[this.getExpandedPredicate(predicateName)] || [];
203
+ }
204
+
205
+ /**
206
+ * Get children of container as Proxys
207
+ */
208
+ getLdpContains() {
209
+ let children = this.resource[this.getExpandedPredicate("ldp:contains")];
210
+ if (!children) return null;
211
+ if (!Array.isArray(children)) children = [children]; // convert to array if compacted to 1 resource
212
+
213
+ let result = children ? children.map(res => {
214
+ let resource = store.get(res['@id']);
215
+ if (resource) return resource;
216
+
217
+ // if not in cache, generate the basic resource
218
+ resource = new CustomGetter(res['@id'], {
219
+ '@id': res['@id']
220
+ }, this.clientContext, this.serverContext, this.parentId).getProxy();
221
+ store.cacheResource(res['@id'], resource); // put it in cache
222
+ return resource; // and return it
223
+ }) : [];
224
+ return result;
225
+ }
226
+ merge(resource) {
227
+ this.resource = {
228
+ ...this.getResourceData(),
229
+ ...resource.getResourceData()
230
+ };
231
+ }
232
+ getResourceData() {
233
+ return this.resource;
234
+ }
235
+
236
+ /**
237
+ * return true resource seems complete
238
+ * @param prop
239
+ */
240
+ isFullResource() {
241
+ return Object.keys(this.resource).filter(p => !p.startsWith('@')).length > 0 // has some properties
242
+ || this.resource['@id'].startsWith('_:b'); // anonymous node = always full resource
243
+ }
244
+
245
+ /**
246
+ * Get permissions of a resource
247
+ * @param resourceId
248
+ * @returns
249
+ */
250
+ async getPermissions() {
251
+ let permissionsIds = this.resource[this.getExpandedPredicate("permissions")];
252
+ if (!permissionsIds) {
253
+ // if no permission, re-fetch data from store
254
+ await this.getResource(this.resourceId, {
255
+ ...this.clientContext,
256
+ ...this.serverContext
257
+ }, this.parentId, true);
258
+ permissionsIds = this.resource[this.getExpandedPredicate("permissions")];
259
+ }
260
+ if (!permissionsIds) return [];
261
+ if (!Array.isArray(permissionsIds)) permissionsIds = [permissionsIds]; // convert to array if compacted to 1 resource
262
+ const permissions = await Promise.all(permissionsIds.map(p => store.get(p['@id'] + this.parentId)) // get anonymous node from store
263
+ .map(p => p ? p['mode.@type'] : ''));
264
+ return permissions ? permissions.map(perm => ContextParser.expandTerm(perm, this.serverContext, true)) : [];
265
+ }
266
+
267
+ /**
268
+ * returns compacted @type of resource
269
+ */
270
+ getType() {
271
+ return this.resource['@type'] ? this.getCompactedIri(this.resource['@type']) : '';
272
+ }
273
+
274
+ /**
275
+ * Remove the resource from the cache
276
+ */
277
+ clearCache() {
278
+ store.clearCache(this.resourceId);
279
+ }
280
+ getExpandedPredicate(property) {
281
+ return ContextParser.expandTerm(property, {
282
+ ...this.clientContext,
283
+ ...this.serverContext
284
+ }, true);
285
+ }
286
+ getCompactedPredicate(property) {
287
+ return ContextParser.compactIri(property, {
288
+ ...this.clientContext,
289
+ ...this.serverContext
290
+ }, true);
291
+ }
292
+ getCompactedIri(id) {
293
+ return ContextParser.compactIri(id, {
294
+ ...this.clientContext,
295
+ ...this.serverContext
296
+ });
297
+ }
298
+ toString() {
299
+ return this.getCompactedIri(this.resource['@id']);
300
+ }
301
+ [_Symbol$toPrimitive]() {
302
+ return this.getCompactedIri(this.resource['@id']);
303
+ }
304
+
305
+ /**
306
+ * Returns a Proxy which handles the different get requests
307
+ */
308
+ getProxy() {
309
+ return new Proxy(this, {
310
+ get: (resource, property) => {
311
+ if (!this.resource) return undefined;
312
+ if (typeof resource[property] === 'function') return resource[property].bind(resource);
313
+ switch (property) {
314
+ case '@id':
315
+ if (this.resource['@id']) return this.getCompactedIri(this.resource['@id']); // Compact @id if possible
316
+ else console.log(this.resource, this.resource['@id']);
317
+ return;
318
+ case '@type':
319
+ return this.resource['@type'];
320
+ // return synchronously
321
+ case 'properties':
322
+ return this.getProperties();
323
+ case 'ldp:contains':
324
+ return this.getLdpContains();
325
+ // returns standard arrays synchronously
326
+ case 'permissions':
327
+ return this.getPermissions();
328
+ // get expanded permissions
329
+ case 'clientContext':
330
+ return this.clientContext;
331
+ // get saved client context to re-fetch easily a resource
332
+ case 'serverContext':
333
+ return this.serverContext;
334
+ // get saved client context to re-fetch easily a resource
335
+ case 'then':
336
+ return;
337
+ default:
338
+ // FIXME: missing 'await'
339
+ return resource.get(property);
340
+ }
341
+ }
342
+ });
343
+ }
344
+ }
@@ -1,11 +1,8 @@
1
1
  export function formatAttributesToServerPaginationOptions(elementAttributes) {
2
- const attributes = new Map(Array.from(elementAttributes).map(_ref => {
3
- let {
4
- name,
5
- value
6
- } = _ref;
7
- return [name, value];
8
- }));
2
+ const attributes = new Map(Array.from(elementAttributes).map(({
3
+ name,
4
+ value
5
+ }) => [name, value]));
9
6
  const limit = attributes.get('limit');
10
7
  const offset = attributes.get('offset');
11
8
  if (!offset || !limit) return;
@@ -1,11 +1,8 @@
1
1
  export function formatAttributesToServerSearchOptions(elementAttributes) {
2
- const attributes = new Map(Array.from(elementAttributes).map(_ref => {
3
- let {
4
- name,
5
- value
6
- } = _ref;
7
- return [name, value];
8
- }));
2
+ const attributes = new Map(Array.from(elementAttributes).map(({
3
+ name,
4
+ value
5
+ }) => [name, value]));
9
6
  const fields = attributes.get('server-search-fields')?.split(",").map(field => field.trim());
10
7
  const value = attributes.get('server-search-value')?.trim();
11
8
  const method = attributes.get('server-search-method')?.trim();