@startinblox/core 0.18.0-beta.4 → 0.18.1

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-d2677655.js → _baseUnary-c1edb653.js} +2 -2
  2. package/dist/_snowpack/pkg/common/{_baseUnary-d2677655.js.map → _baseUnary-c1edb653.js.map} +1 -1
  3. package/dist/_snowpack/pkg/common/{_commonjsHelpers-0597c316.js → _commonjsHelpers-37fa8da4.js} +2 -2
  4. package/dist/_snowpack/pkg/common/_commonjsHelpers-37fa8da4.js.map +1 -0
  5. package/dist/_snowpack/pkg/delta-markdown-for-quill.js +2 -2
  6. package/dist/_snowpack/pkg/dialog-polyfill.js +2 -1
  7. package/dist/_snowpack/pkg/dialog-polyfill.js.map +1 -1
  8. package/dist/_snowpack/pkg/import-map.json +0 -1
  9. package/dist/_snowpack/pkg/jsonld-context-parser.js +1 -1
  10. package/dist/_snowpack/pkg/markdown-it.js +1 -1
  11. package/dist/_snowpack/pkg/quill-delta-to-markdown.js +2 -2
  12. package/dist/_snowpack/pkg/quill.js +11644 -11643
  13. package/dist/_snowpack/pkg/quill.js.map +1 -1
  14. package/dist/_snowpack/pkg/tui-calendar.js +43199 -43195
  15. package/dist/_snowpack/pkg/tui-calendar.js.map +1 -1
  16. package/dist/components/solid-form-search.js +2 -1
  17. package/dist/components/solid-form.js +4 -2
  18. package/dist/libs/ComponentFactory.js +4 -1
  19. package/dist/libs/filter.js +1 -1
  20. package/dist/libs/helpers.js +10 -4
  21. package/dist/libs/lit-helpers.js +4 -1
  22. package/dist/libs/polyfills.js +4 -2
  23. package/dist/libs/store/server-pagination.js +7 -4
  24. package/dist/libs/store/server-search.js +7 -4
  25. package/dist/libs/store/store.js +346 -92
  26. package/dist/mixins/attributeBinderMixin.js +6 -3
  27. package/dist/mixins/federationMixin.js +0 -6
  28. package/dist/mixins/filterMixin.js +16 -13
  29. package/dist/mixins/listMixin.js +9 -20
  30. package/dist/mixins/requiredMixin.js +3 -15
  31. package/dist/mixins/storeMixin.js +0 -30
  32. package/dist/mixins/widgetMixin.js +5 -12
  33. package/dist/new-widgets/templates/formTemplatesDirectory.js +15 -6
  34. package/dist/new-widgets/templatesDependencies/formDropdownMixin.js +0 -3
  35. package/dist/new-widgets/templatesDependencies/multipleFormMixin.js +3 -7
  36. package/dist/new-widgets/templatesDependencies/multipleselectFormMixin.js +2 -11
  37. package/dist/widgets/baseWidget.js +5 -4
  38. package/dist/widgets/widget-factory.js +3 -1
  39. package/package.json +4 -5
  40. package/dist/_snowpack/pkg/common/_commonjsHelpers-0597c316.js.map +0 -1
  41. package/dist/_snowpack/pkg/jsonld.js +0 -11760
  42. package/dist/_snowpack/pkg/jsonld.js.map +0 -1
  43. package/dist/libs/store/custom-getter.js +0 -344
@@ -70,7 +70,8 @@ export const SolidFormSearch = {
70
70
  });
71
71
  return values;
72
72
  },
73
- getWidget(field, isSet = false) {
73
+ getWidget(field) {
74
+ let isSet = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
74
75
  let tagName = '';
75
76
  // If auto-range-[field] exists, create range-[field] and sets its value
76
77
  if (this.element.hasAttribute('auto-range-' + field) && !this.element.hasAttribute('range-' + field)) {
@@ -87,7 +87,8 @@ export const SolidForm = {
87
87
  }
88
88
  return transformArrayToContainer(value);
89
89
  },
90
- getWidget(field, isSet = false) {
90
+ getWidget(field) {
91
+ let isSet = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
91
92
  let tagName = '';
92
93
  const widgetAttribute = this.element.getAttribute('widget-' + field);
93
94
 
@@ -162,7 +163,8 @@ export const SolidForm = {
162
163
  if (!this.isCreationForm(formValue) && this.isSavingAutomatically) this.submitForm(); // if autosave, submitForm
163
164
  },
164
165
 
165
- findErrorMessage(errors, errorFullName = '') {
166
+ findErrorMessage(errors) {
167
+ let errorFullName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
166
168
  let errorsArray = [];
167
169
  errors.forEach(member => {
168
170
  let errorNextName = Object.values(member)[0];
@@ -131,7 +131,10 @@ 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 (...args) {
134
+ value: function () {
135
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
136
+ args[_key] = arguments[_key];
137
+ }
135
138
  return Reflect.apply(method, this, args);
136
139
  }
137
140
  });
@@ -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 fieldsAttr - fields attribute of the element
119
+ * @param fields - 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,7 +7,8 @@ function stringToDom(html) {
7
7
  template.innerHTML = html;
8
8
  return template.content;
9
9
  }
10
- async function evalTemplateString(str, variables = {}) {
10
+ async function evalTemplateString(str) {
11
+ let variables = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
11
12
  const keys = Object.keys(variables);
12
13
  const values = keys.map(key => variables[key]);
13
14
  try {
@@ -19,8 +20,11 @@ async function evalTemplateString(str, variables = {}) {
19
20
  throw new SyntaxError('`' + str + '`');
20
21
  }
21
22
  }
22
- function importCSS(...stylesheets) {
23
+ function importCSS() {
23
24
  const linksElements = [];
25
+ for (var _len = arguments.length, stylesheets = new Array(_len), _key = 0; _key < _len; _key++) {
26
+ stylesheets[_key] = arguments[_key];
27
+ }
24
28
  for (let url of stylesheets) {
25
29
  url = relativeSource(url);
26
30
  let link = Array.from(document.head.querySelectorAll('link')).find(link => link.href === url);
@@ -34,7 +38,10 @@ function importCSS(...stylesheets) {
34
38
  ;
35
39
  return linksElements;
36
40
  }
37
- function importJS(...plugins) {
41
+ function importJS() {
42
+ for (var _len2 = arguments.length, plugins = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
43
+ plugins[_key2] = arguments[_key2];
44
+ }
38
45
  return plugins.map(url => {
39
46
  url = new URL(url, document.baseURI).href;
40
47
  let script = Array.from(document.querySelectorAll('script')).find(script => script.src === url);
@@ -162,7 +169,6 @@ function transformArrayToContainer(resource) {
162
169
  // iterate over all properties
163
170
  const predicateValue = newValue[predicate];
164
171
  if (!predicateValue || typeof predicateValue !== 'object') continue; // undefined or literal, do nothing
165
- if (['permissions', '@context'].includes(predicate)) continue; // do not transform permissions and context
166
172
 
167
173
  // check all keys of nested resource
168
174
  if (!Array.isArray(predicateValue) && predicateValue['@id']) {
@@ -93,9 +93,12 @@ 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, ...values) {
96
+ export function preHTML(strings) {
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
+ }
99
102
  if (cachedStrings) {
100
103
  for (let i = 0, n = cachedStrings.length; i < n; ++i) {
101
104
  const needlessValues = cachedStrings[i].needlessValues;
@@ -2,7 +2,8 @@
2
2
  if (!('flat' in Array.prototype)) {
3
3
  Object.defineProperty(Array.prototype, 'flat', {
4
4
  configurable: true,
5
- value: function flat(depth = 1) {
5
+ value: function flat() {
6
+ let depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;
6
7
  depth = isNaN(depth) ? 1 : Number(depth);
7
8
  if (depth === 0) return Array.prototype.slice.call(this);
8
9
  return Array.prototype.reduce.call(this, function (acc, cur) {
@@ -20,7 +21,8 @@ if (!('flat' in Array.prototype)) {
20
21
 
21
22
  // Element.prototype.toggleAttribute
22
23
  if (!Element.prototype.toggleAttribute) {
23
- Element.prototype.toggleAttribute = function (name, force = undefined) {
24
+ Element.prototype.toggleAttribute = function (name) {
25
+ let force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
24
26
  if (force !== undefined) force = !!force;
25
27
  if (this.hasAttribute(name)) {
26
28
  if (force) return true;
@@ -1,8 +1,11 @@
1
1
  export function formatAttributesToServerPaginationOptions(elementAttributes) {
2
- const attributes = new Map(Array.from(elementAttributes).map(({
3
- name,
4
- value
5
- }) => [name, value]));
2
+ const attributes = new Map(Array.from(elementAttributes).map(_ref => {
3
+ let {
4
+ name,
5
+ value
6
+ } = _ref;
7
+ return [name, value];
8
+ }));
6
9
  const limit = attributes.get('limit');
7
10
  const offset = attributes.get('offset');
8
11
  if (!offset || !limit) return;
@@ -1,8 +1,11 @@
1
1
  export function formatAttributesToServerSearchOptions(elementAttributes) {
2
- const attributes = new Map(Array.from(elementAttributes).map(({
3
- name,
4
- value
5
- }) => [name, value]));
2
+ const attributes = new Map(Array.from(elementAttributes).map(_ref => {
3
+ let {
4
+ name,
5
+ value
6
+ } = _ref;
7
+ return [name, value];
8
+ }));
6
9
  const fields = attributes.get('server-search-fields')?.split(",").map(field => field.trim());
7
10
  const value = attributes.get('server-search-value')?.trim();
8
11
  const method = attributes.get('server-search-method')?.trim();