@startinblox/core 0.17.31 → 0.18.0-beta.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 (255) hide show
  1. package/dist/_snowpack/pkg/autolinker.js +3515 -3367
  2. package/dist/_snowpack/pkg/autolinker.js.map +1 -1
  3. package/dist/_snowpack/pkg/common/{_baseUnary-217dffb2.js → _baseUnary-c1edb653.js} +16 -40
  4. package/dist/_snowpack/pkg/common/{_baseUnary-217dffb2.js.map → _baseUnary-c1edb653.js.map} +1 -1
  5. package/dist/_snowpack/pkg/common/{_commonjsHelpers-8c19dec8.js → _commonjsHelpers-37fa8da4.js} +6 -2
  6. package/dist/_snowpack/pkg/common/_commonjsHelpers-37fa8da4.js.map +1 -0
  7. package/dist/_snowpack/pkg/common/{decode-a4c334cf.js → decode-26fbf385.js} +38 -69
  8. package/dist/_snowpack/pkg/common/decode-26fbf385.js.map +1 -0
  9. package/dist/_snowpack/pkg/common/lit-html-3647afce.js +1104 -0
  10. package/dist/_snowpack/pkg/common/lit-html-3647afce.js.map +1 -0
  11. package/dist/_snowpack/pkg/delta-markdown-for-quill.js +4767 -4246
  12. package/dist/_snowpack/pkg/delta-markdown-for-quill.js.map +1 -1
  13. package/dist/_snowpack/pkg/dialog-polyfill.js +107 -139
  14. package/dist/_snowpack/pkg/dialog-polyfill.js.map +1 -1
  15. package/dist/_snowpack/pkg/fusejs.js +411 -601
  16. package/dist/_snowpack/pkg/fusejs.js.map +1 -1
  17. package/dist/_snowpack/pkg/jsonld-context-parser.js +718 -686
  18. package/dist/_snowpack/pkg/jsonld-context-parser.js.map +1 -1
  19. package/dist/_snowpack/pkg/leaflet.markercluster/dist/MarkerCluster.Default.css +59 -59
  20. package/dist/_snowpack/pkg/leaflet.markercluster/dist/MarkerCluster.Default.css.proxy.js +1 -1
  21. package/dist/_snowpack/pkg/leaflet.markercluster/dist/MarkerCluster.css +14 -14
  22. package/dist/_snowpack/pkg/leaflet.markercluster/dist/MarkerCluster.css.proxy.js +1 -1
  23. package/dist/_snowpack/pkg/lit-html/directives/if-defined.js +13 -14
  24. package/dist/_snowpack/pkg/lit-html/directives/if-defined.js.map +1 -1
  25. package/dist/_snowpack/pkg/lit-html/directives/unsafe-html.js +17 -15
  26. package/dist/_snowpack/pkg/lit-html/directives/unsafe-html.js.map +1 -1
  27. package/dist/_snowpack/pkg/lit-html/directives/until.js +45 -46
  28. package/dist/_snowpack/pkg/lit-html/directives/until.js.map +1 -1
  29. package/dist/_snowpack/pkg/lit-html.js +37 -35
  30. package/dist/_snowpack/pkg/lit-html.js.map +1 -1
  31. package/dist/_snowpack/pkg/markdown-it-link-attributes.js +1 -20
  32. package/dist/_snowpack/pkg/markdown-it-link-attributes.js.map +1 -1
  33. package/dist/_snowpack/pkg/markdown-it.js +1731 -2284
  34. package/dist/_snowpack/pkg/markdown-it.js.map +1 -1
  35. package/dist/_snowpack/pkg/quill-delta-to-markdown.js +236 -294
  36. package/dist/_snowpack/pkg/quill-delta-to-markdown.js.map +1 -1
  37. package/dist/_snowpack/pkg/quill.js +12077 -11017
  38. package/dist/_snowpack/pkg/quill.js.map +1 -1
  39. package/dist/_snowpack/pkg/slim-select.js +711 -1
  40. package/dist/_snowpack/pkg/slim-select.js.map +1 -1
  41. package/dist/_snowpack/pkg/tui-calendar/dist/tui-calendar.css +1 -16
  42. package/dist/_snowpack/pkg/tui-calendar/dist/tui-calendar.css.proxy.js +1 -1
  43. package/dist/_snowpack/pkg/tui-calendar.js +44297 -40075
  44. package/dist/_snowpack/pkg/tui-calendar.js.map +1 -1
  45. package/dist/components/solid-ac-checker.js +4 -17
  46. package/dist/components/solid-calendar.js +5 -26
  47. package/dist/components/solid-delete.js +9 -24
  48. package/dist/components/solid-display.js +15 -59
  49. package/dist/components/solid-form-search.js +27 -79
  50. package/dist/components/solid-form.js +48 -143
  51. package/dist/components/solid-lang.js +8 -19
  52. package/dist/components/solid-map.js +26 -64
  53. package/dist/components/solid-table.js +51 -133
  54. package/dist/components/solid-widget.js +2 -24
  55. package/dist/index.js +17 -11
  56. package/dist/libs/Component.js +4 -10
  57. package/dist/libs/ComponentFactory.js +6 -34
  58. package/dist/libs/Compositor.js +8 -15
  59. package/dist/libs/Sib.js +7 -21
  60. package/dist/libs/filter.js +184 -0
  61. package/dist/libs/helpers.js +19 -47
  62. package/dist/libs/interfaces.js +1 -1
  63. package/dist/libs/lit-helpers.js +7 -34
  64. package/dist/libs/polyfills.js +7 -10
  65. package/dist/libs/store/server-pagination.js +22 -0
  66. package/dist/libs/store/server-search.js +35 -0
  67. package/dist/libs/store/store.js +212 -227
  68. package/dist/mixins/attributeBinderMixin.js +17 -25
  69. package/dist/mixins/contextMixin.js +5 -7
  70. package/dist/mixins/counterMixin.js +2 -23
  71. package/dist/mixins/federationMixin.js +2 -14
  72. package/dist/mixins/filterMixin.js +60 -100
  73. package/dist/mixins/grouperMixin.js +11 -18
  74. package/dist/mixins/highlighterMixin.js +2 -8
  75. package/dist/mixins/interfaces.js +3 -5
  76. package/dist/mixins/listMixin.js +12 -43
  77. package/dist/mixins/nextMixin.js +1 -4
  78. package/dist/mixins/paginateMixin.js +17 -30
  79. package/dist/mixins/requiredMixin.js +1 -9
  80. package/dist/mixins/serverPaginationMixin.js +122 -0
  81. package/dist/mixins/sorterMixin.js +26 -44
  82. package/dist/mixins/storeMixin.js +28 -21
  83. package/dist/mixins/translationMixin.js +2 -12
  84. package/dist/mixins/validationMixin.js +28 -46
  85. package/dist/mixins/widgetMixin.js +58 -154
  86. package/dist/new-widgets/attributeMixins/actionMixin.js +1 -2
  87. package/dist/new-widgets/attributeMixins/blankMixin.js +1 -4
  88. package/dist/new-widgets/attributeMixins/booleanMixin.js +1 -4
  89. package/dist/new-widgets/attributeMixins/index.js +1 -2
  90. package/dist/new-widgets/attributeMixins/mailtoMixin.js +1 -4
  91. package/dist/new-widgets/attributeMixins/multipleMixin.js +1 -2
  92. package/dist/new-widgets/attributeMixins/numberMixin.js +1 -4
  93. package/dist/new-widgets/attributeMixins/placeholderMixin.js +1 -4
  94. package/dist/new-widgets/attributeMixins/telMixin.js +1 -4
  95. package/dist/new-widgets/baseWidgetMixin.js +5 -18
  96. package/dist/new-widgets/callbackMixins/autocompletionMixin.js +3 -11
  97. package/dist/new-widgets/callbackMixins/index.js +1 -2
  98. package/dist/new-widgets/callbackMixins/richtextMixin.js +1 -6
  99. package/dist/new-widgets/interfaces.js +1 -0
  100. package/dist/new-widgets/new-widget-factory.js +14 -19
  101. package/dist/new-widgets/templateAdditionMixins/addableMixin.js +6 -21
  102. package/dist/new-widgets/templateAdditionMixins/index.js +2 -3
  103. package/dist/new-widgets/templateAdditionMixins/labelLastMixin.js +5 -18
  104. package/dist/new-widgets/templateAdditionMixins/labelMixin.js +5 -18
  105. package/dist/new-widgets/templates/defaultTemplatesDirectory.js +21 -27
  106. package/dist/new-widgets/templates/displayTemplatesDirectory.js +35 -70
  107. package/dist/new-widgets/templates/formTemplatesDirectory.js +350 -315
  108. package/dist/new-widgets/templates/groupTemplatesDirectory.js +5 -15
  109. package/dist/new-widgets/templates/index.js +1 -2
  110. package/dist/new-widgets/templates/setTemplatesDirectory.js +4 -37
  111. package/dist/new-widgets/templatesDependencies/altMixin.js +1 -2
  112. package/dist/new-widgets/templatesDependencies/editableMixin.js +9 -26
  113. package/dist/new-widgets/templatesDependencies/filterRangeFormMixin.js +3 -7
  114. package/dist/new-widgets/templatesDependencies/formCheckboxMixin.js +1 -5
  115. package/dist/new-widgets/templatesDependencies/formCheckboxesMixin.js +1 -11
  116. package/dist/new-widgets/templatesDependencies/formDropdownMixin.js +3 -13
  117. package/dist/new-widgets/templatesDependencies/formFileMixin.js +1 -13
  118. package/dist/new-widgets/templatesDependencies/formLengthMixin.js +1 -2
  119. package/dist/new-widgets/templatesDependencies/formMinMaxMixin.js +1 -2
  120. package/dist/new-widgets/templatesDependencies/formMixin.js +4 -14
  121. package/dist/new-widgets/templatesDependencies/formNumberMixin.js +1 -5
  122. package/dist/new-widgets/templatesDependencies/formRadioMixin.js +1 -5
  123. package/dist/new-widgets/templatesDependencies/formStepMixin.js +1 -2
  124. package/dist/new-widgets/templatesDependencies/linkTextMixin.js +13 -0
  125. package/dist/new-widgets/templatesDependencies/multipleFormMixin.js +23 -18
  126. package/dist/new-widgets/templatesDependencies/multipleselectFormMixin.js +1 -10
  127. package/dist/new-widgets/templatesDependencies/patternMixin.js +1 -2
  128. package/dist/new-widgets/templatesDependencies/rangeMixin.js +5 -15
  129. package/dist/new-widgets/templatesDependencies/setMixin.js +1 -4
  130. package/dist/new-widgets/templatesDependencies/valueRichtextMixin.js +1 -4
  131. package/dist/new-widgets/valueTransformationMixins/autolinkMixin.js +1 -5
  132. package/dist/new-widgets/valueTransformationMixins/dateMixin.js +5 -11
  133. package/dist/new-widgets/valueTransformationMixins/dateTimeMixin.js +1 -5
  134. package/dist/new-widgets/valueTransformationMixins/index.js +1 -2
  135. package/dist/new-widgets/valueTransformationMixins/markdownMixin.js +1 -7
  136. package/dist/new-widgets/valueTransformationMixins/multilineMixin.js +1 -5
  137. package/dist/new-widgets/valueTransformationMixins/oembedMixin.js +1 -7
  138. package/dist/solid-template-element.js +24 -44
  139. package/dist/widgets/baseWidget.js +21 -85
  140. package/dist/widgets/widget-factory.js +4 -6
  141. package/package.json +8 -6
  142. package/dist/_snowpack/env.js +0 -3
  143. package/dist/_snowpack/pkg/autolinker.js.map.proxy.js +0 -1
  144. package/dist/_snowpack/pkg/common/_baseUnary-217dffb2.js.map.proxy.js +0 -1
  145. package/dist/_snowpack/pkg/common/_commonjsHelpers-8c19dec8.js.map +0 -1
  146. package/dist/_snowpack/pkg/common/_commonjsHelpers-8c19dec8.js.map.proxy.js +0 -1
  147. package/dist/_snowpack/pkg/common/decode-a4c334cf.js.map +0 -1
  148. package/dist/_snowpack/pkg/common/decode-a4c334cf.js.map.proxy.js +0 -1
  149. package/dist/_snowpack/pkg/common/lit-html-babd44cd.js +0 -1119
  150. package/dist/_snowpack/pkg/common/lit-html-babd44cd.js.map +0 -1
  151. package/dist/_snowpack/pkg/common/lit-html-babd44cd.js.map.proxy.js +0 -1
  152. package/dist/_snowpack/pkg/delta-markdown-for-quill.js.map.proxy.js +0 -1
  153. package/dist/_snowpack/pkg/dialog-polyfill.js.map.proxy.js +0 -1
  154. package/dist/_snowpack/pkg/fusejs.js.map.proxy.js +0 -1
  155. package/dist/_snowpack/pkg/jsonld-context-parser.js.map.proxy.js +0 -1
  156. package/dist/_snowpack/pkg/lit-html/directives/if-defined.js.map.proxy.js +0 -1
  157. package/dist/_snowpack/pkg/lit-html/directives/unsafe-html.js.map.proxy.js +0 -1
  158. package/dist/_snowpack/pkg/lit-html/directives/until.js.map.proxy.js +0 -1
  159. package/dist/_snowpack/pkg/lit-html.js.map.proxy.js +0 -1
  160. package/dist/_snowpack/pkg/markdown-it-link-attributes.js.map.proxy.js +0 -1
  161. package/dist/_snowpack/pkg/markdown-it.js.map.proxy.js +0 -1
  162. package/dist/_snowpack/pkg/quill-delta-to-markdown.js.map.proxy.js +0 -1
  163. package/dist/_snowpack/pkg/quill.js.map.proxy.js +0 -1
  164. package/dist/_snowpack/pkg/slim-select.js.map.proxy.js +0 -1
  165. package/dist/_snowpack/pkg/tui-calendar.js.map.proxy.js +0 -1
  166. package/dist/components/solid-ac-checker.js.map +0 -1
  167. package/dist/components/solid-calendar.js.map +0 -1
  168. package/dist/components/solid-delete.js.map +0 -1
  169. package/dist/components/solid-display.js.map +0 -1
  170. package/dist/components/solid-form-search.js.map +0 -1
  171. package/dist/components/solid-form.js.map +0 -1
  172. package/dist/components/solid-lang.js.map +0 -1
  173. package/dist/components/solid-map.js.map +0 -1
  174. package/dist/components/solid-table.js.map +0 -1
  175. package/dist/components/solid-widget.js.map +0 -1
  176. package/dist/index.js.map +0 -1
  177. package/dist/libs/Component.js.map +0 -1
  178. package/dist/libs/ComponentFactory.js.map +0 -1
  179. package/dist/libs/Compositor.js.map +0 -1
  180. package/dist/libs/Sib.js.map +0 -1
  181. package/dist/libs/helpers.js.map +0 -1
  182. package/dist/libs/interfaces.js.map +0 -1
  183. package/dist/libs/lit-helpers.js.map +0 -1
  184. package/dist/libs/polyfills.js.map +0 -1
  185. package/dist/libs/store/store.js.map +0 -1
  186. package/dist/mixins/attributeBinderMixin.js.map +0 -1
  187. package/dist/mixins/contextMixin.js.map +0 -1
  188. package/dist/mixins/counterMixin.js.map +0 -1
  189. package/dist/mixins/federationMixin.js.map +0 -1
  190. package/dist/mixins/filterMixin.js.map +0 -1
  191. package/dist/mixins/grouperMixin.js.map +0 -1
  192. package/dist/mixins/highlighterMixin.js.map +0 -1
  193. package/dist/mixins/interfaces.js.map +0 -1
  194. package/dist/mixins/listMixin.js.map +0 -1
  195. package/dist/mixins/nextMixin.js.map +0 -1
  196. package/dist/mixins/paginateMixin.js.map +0 -1
  197. package/dist/mixins/requiredMixin.js.map +0 -1
  198. package/dist/mixins/sorterMixin.js.map +0 -1
  199. package/dist/mixins/storeMixin.js.map +0 -1
  200. package/dist/mixins/translationMixin.js.map +0 -1
  201. package/dist/mixins/validationMixin.js.map +0 -1
  202. package/dist/mixins/widgetMixin.js.map +0 -1
  203. package/dist/new-widgets/attributeMixins/actionMixin.js.map +0 -1
  204. package/dist/new-widgets/attributeMixins/blankMixin.js.map +0 -1
  205. package/dist/new-widgets/attributeMixins/booleanMixin.js.map +0 -1
  206. package/dist/new-widgets/attributeMixins/index.js.map +0 -1
  207. package/dist/new-widgets/attributeMixins/mailtoMixin.js.map +0 -1
  208. package/dist/new-widgets/attributeMixins/multipleMixin.js.map +0 -1
  209. package/dist/new-widgets/attributeMixins/numberMixin.js.map +0 -1
  210. package/dist/new-widgets/attributeMixins/placeholderMixin.js.map +0 -1
  211. package/dist/new-widgets/attributeMixins/telMixin.js.map +0 -1
  212. package/dist/new-widgets/baseWidgetMixin.js.map +0 -1
  213. package/dist/new-widgets/callbackMixins/autocompletionMixin.js.map +0 -1
  214. package/dist/new-widgets/callbackMixins/index.js.map +0 -1
  215. package/dist/new-widgets/callbackMixins/richtextMixin.js.map +0 -1
  216. package/dist/new-widgets/new-widget-factory.js.map +0 -1
  217. package/dist/new-widgets/templateAdditionMixins/addableMixin.js.map +0 -1
  218. package/dist/new-widgets/templateAdditionMixins/index.js.map +0 -1
  219. package/dist/new-widgets/templateAdditionMixins/labelLastMixin.js.map +0 -1
  220. package/dist/new-widgets/templateAdditionMixins/labelMixin.js.map +0 -1
  221. package/dist/new-widgets/templates/defaultTemplatesDirectory.js.map +0 -1
  222. package/dist/new-widgets/templates/displayTemplatesDirectory.js.map +0 -1
  223. package/dist/new-widgets/templates/formTemplatesDirectory.js.map +0 -1
  224. package/dist/new-widgets/templates/groupTemplatesDirectory.js.map +0 -1
  225. package/dist/new-widgets/templates/index.js.map +0 -1
  226. package/dist/new-widgets/templates/setTemplatesDirectory.js.map +0 -1
  227. package/dist/new-widgets/templatesDependencies/altMixin.js.map +0 -1
  228. package/dist/new-widgets/templatesDependencies/editableMixin.js.map +0 -1
  229. package/dist/new-widgets/templatesDependencies/filterRangeFormMixin.js.map +0 -1
  230. package/dist/new-widgets/templatesDependencies/formCheckboxMixin.js.map +0 -1
  231. package/dist/new-widgets/templatesDependencies/formCheckboxesMixin.js.map +0 -1
  232. package/dist/new-widgets/templatesDependencies/formDropdownMixin.js.map +0 -1
  233. package/dist/new-widgets/templatesDependencies/formFileMixin.js.map +0 -1
  234. package/dist/new-widgets/templatesDependencies/formLengthMixin.js.map +0 -1
  235. package/dist/new-widgets/templatesDependencies/formMinMaxMixin.js.map +0 -1
  236. package/dist/new-widgets/templatesDependencies/formMixin.js.map +0 -1
  237. package/dist/new-widgets/templatesDependencies/formNumberMixin.js.map +0 -1
  238. package/dist/new-widgets/templatesDependencies/formRadioMixin.js.map +0 -1
  239. package/dist/new-widgets/templatesDependencies/formStepMixin.js.map +0 -1
  240. package/dist/new-widgets/templatesDependencies/multipleFormMixin.js.map +0 -1
  241. package/dist/new-widgets/templatesDependencies/multipleselectFormMixin.js.map +0 -1
  242. package/dist/new-widgets/templatesDependencies/patternMixin.js.map +0 -1
  243. package/dist/new-widgets/templatesDependencies/rangeMixin.js.map +0 -1
  244. package/dist/new-widgets/templatesDependencies/setMixin.js.map +0 -1
  245. package/dist/new-widgets/templatesDependencies/valueRichtextMixin.js.map +0 -1
  246. package/dist/new-widgets/valueTransformationMixins/autolinkMixin.js.map +0 -1
  247. package/dist/new-widgets/valueTransformationMixins/dateMixin.js.map +0 -1
  248. package/dist/new-widgets/valueTransformationMixins/dateTimeMixin.js.map +0 -1
  249. package/dist/new-widgets/valueTransformationMixins/index.js.map +0 -1
  250. package/dist/new-widgets/valueTransformationMixins/markdownMixin.js.map +0 -1
  251. package/dist/new-widgets/valueTransformationMixins/multilineMixin.js.map +0 -1
  252. package/dist/new-widgets/valueTransformationMixins/oembedMixin.js.map +0 -1
  253. package/dist/solid-template-element.js.map +0 -1
  254. package/dist/widgets/baseWidget.js.map +0 -1
  255. package/dist/widgets/widget-factory.js.map +0 -1
@@ -14,45 +14,32 @@ export const SolidAcChecker = {
14
14
  default: ''
15
15
  }
16
16
  },
17
-
18
17
  async populate() {
19
18
  if (!this.resource) return;
20
19
  let displayElement;
21
20
  const ContextParser = JSONLDContextParser.ContextParser;
22
21
  const myParser = new ContextParser();
23
22
  const context = await myParser.parse(this.context);
24
-
23
+ const permissions = await this.resource.permissions;
25
24
  if (this.permission) {
26
25
  // User has permission of ...
27
- displayElement = this.resource.permissions.some(p => {
26
+ displayElement = permissions.some(p => {
28
27
  return ContextParser.compactIri(p, context) === this.permission;
29
28
  });
30
- /* displayElement = await asyncSome(
31
- (permission: object) => ContextParser.compactIri(permission.toString(), context) === this.permission,
32
- this.resource.permissions.mode['@type']
33
- )*/
34
29
  } else if (this.noPermission) {
35
30
  // User has no permission of ...
36
- displayElement = this.resource.permissions.every(p => {
31
+ displayElement = permissions.every(p => {
37
32
  return ContextParser.compactIri(p, context) !== this.noPermission;
38
33
  });
39
- /*displayElement = await asyncEvery(
40
- (permission: object) => ContextParser.compactIri(permission.toString(), context) !== this.noPermission,
41
- this.resource.permissions.mode['@type']
42
- )*/
43
34
  } else {
44
35
  // No parameter provided
45
36
  console.warn('solid-ac-checker: you should define at least one of "permission" or "no-permission" attribute.');
46
37
  return;
47
38
  }
48
-
49
39
  if (displayElement) this.element.removeAttribute('hidden');
50
40
  },
51
-
52
41
  empty() {
53
42
  this.element.setAttribute('hidden', '');
54
43
  }
55
-
56
44
  };
57
- Sib.register(SolidAcChecker);
58
- //# sourceMappingURL=solid-ac-checker.js.map
45
+ Sib.register(SolidAcChecker);
@@ -1,15 +1,3 @@
1
- function _templateObject() {
2
- const data = _taggedTemplateLiteral(["\n <div id=", " style=\"width:100%;height:100%;\"></div>\n "]);
3
-
4
- _templateObject = function () {
5
- return data;
6
- };
7
-
8
- return data;
9
- }
10
-
11
- function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
12
-
13
1
  import { Sib } from '../libs/Sib.js';
14
2
  import { ListMixin } from '../mixins/listMixin.js';
15
3
  import { StoreMixin } from '../mixins/storeMixin.js';
@@ -24,26 +12,25 @@ export const SolidCalendar = {
24
12
  initialState: {
25
13
  subscriptions: null
26
14
  },
27
-
28
15
  created() {
29
16
  //@ts-ignore
30
17
  import("../_snowpack/pkg/tui-calendar/dist/tui-calendar.css.proxy.js");
31
18
  const id = uniqID();
32
- const template = html(_templateObject(), id);
19
+ const template = html`
20
+ <div id=${id} style="width:100%;height:100%;"></div>
21
+ `;
33
22
  render(template, this.element);
34
- this.calendar = new Calendar(this.element.querySelector("#".concat(id)), {
23
+ this.calendar = new Calendar(this.element.querySelector(`#${id}`), {
35
24
  defaultView: 'month'
36
25
  });
37
26
  this.calendar.on('clickSchedule', this.dispatchSelect.bind(this));
38
27
  this.subscriptions = new Map();
39
28
  },
40
-
41
29
  get extra_context() {
42
30
  return {
43
31
  date: "http://www.w3.org/2001/XMLSchema#dateTime"
44
32
  };
45
33
  },
46
-
47
34
  dispatchSelect(event) {
48
35
  const resource = {
49
36
  '@id': event['schedule'].id
@@ -55,19 +42,14 @@ export const SolidCalendar = {
55
42
  }));
56
43
  this.goToNext(resource);
57
44
  },
58
-
59
45
  async appendChildElt(resourceId) {
60
46
  const resource = await store.getData(resourceId, this.context);
61
47
  if (!resource) return;
62
-
63
48
  if (!this.subscriptions.get(resourceId)) {
64
49
  this.subscriptions.set(resourceId, PubSub.subscribe(resourceId, () => this.updateDOM()));
65
50
  } // TODO : mixin gestion des enfants
66
-
67
-
68
51
  const date = await resource['date'];
69
52
  const name = await resource['name'];
70
-
71
53
  if (name && date) {
72
54
  this.calendar.createSchedules([{
73
55
  id: resource['@id'],
@@ -77,11 +59,8 @@ export const SolidCalendar = {
77
59
  }]);
78
60
  }
79
61
  },
80
-
81
62
  empty() {
82
63
  this.calendar.clear();
83
64
  }
84
-
85
65
  };
86
- Sib.register(SolidCalendar);
87
- //# sourceMappingURL=solid-calendar.js.map
66
+ Sib.register(SolidCalendar);
@@ -1,15 +1,3 @@
1
- function _templateObject() {
2
- const data = _taggedTemplateLiteral(["\n <button @click=", ">", "</button>\n ", "\n "]);
3
-
4
- _templateObject = function () {
5
- return data;
6
- };
7
-
8
- return data;
9
- }
10
-
11
- function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
12
-
13
1
  import { Sib } from '../libs/Sib.js';
14
2
  import { base_context, store } from '../libs/store/store.js';
15
3
  import { NextMixin } from '../mixins/nextMixin.js';
@@ -42,11 +30,9 @@ export const SolidDelete = {
42
30
  initialState: {
43
31
  renderPlanned: false
44
32
  },
45
-
46
33
  created() {
47
34
  this.planRender();
48
35
  },
49
-
50
36
  planRender() {
51
37
  if (!this.renderPlanned) {
52
38
  this.renderPlanned = true;
@@ -56,18 +42,18 @@ export const SolidDelete = {
56
42
  });
57
43
  }
58
44
  },
59
-
60
45
  get context() {
61
- let extraContextElement = this.extraContext ? document.getElementById(this.extraContext) : // take element extra context first
46
+ let extraContextElement = this.extraContext ? document.getElementById(this.extraContext) :
47
+ // take element extra context first
62
48
  document.querySelector('[data-default-context]'); // ... or look for a default extra context
63
49
 
64
50
  let extraContext = {};
65
51
  if (extraContextElement) extraContext = JSON.parse(extraContextElement.textContent || "{}");
66
- return { ...base_context,
52
+ return {
53
+ ...base_context,
67
54
  ...extraContext
68
55
  };
69
56
  },
70
-
71
57
  async delete(e) {
72
58
  e.stopPropagation();
73
59
  if (!this.dataSrc) return;
@@ -95,17 +81,16 @@ export const SolidDelete = {
95
81
  // Send method to validationMixin, used by the dialog modal and performAction method
96
82
  return this.deletion();
97
83
  },
98
-
99
84
  update() {
100
85
  this.render();
101
86
  },
102
-
103
87
  async render() {
104
88
  await this.replaceAttributesData(false);
105
- const button = html(_templateObject(), this.delete.bind(this), this.dataLabel || this.t("solid-delete.button"), this.getModalDialog());
89
+ const button = html`
90
+ <button @click=${this.delete.bind(this)}>${this.dataLabel || this.t("solid-delete.button")}</button>
91
+ ${this.getModalDialog()}
92
+ `;
106
93
  render(button, this.element);
107
94
  }
108
-
109
95
  };
110
- Sib.register(SolidDelete);
111
- //# sourceMappingURL=solid-delete.js.map
96
+ Sib.register(SolidDelete);
@@ -1,35 +1,3 @@
1
- function _templateObject3() {
2
- const data = _taggedTemplateLiteral(["", ""]);
3
-
4
- _templateObject3 = function () {
5
- return data;
6
- };
7
-
8
- return data;
9
- }
10
-
11
- function _templateObject2() {
12
- const data = _taggedTemplateLiteral(["", ""]);
13
-
14
- _templateObject2 = function () {
15
- return data;
16
- };
17
-
18
- return data;
19
- }
20
-
21
- function _templateObject() {
22
- const data = _taggedTemplateLiteral(["\n <solid-display\n data-src=", "\n @click=", "\n @keydown=", "\n fields=", "\n ...=", "\n ></solid-display>\n "]);
23
-
24
- _templateObject = function () {
25
- return data;
26
- };
27
-
28
- return data;
29
- }
30
-
31
- function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
32
-
33
1
  import { Sib } from '../libs/Sib.js';
34
2
  import { WidgetMixin } from '../mixins/widgetMixin.js';
35
3
  import { ListMixin } from '../mixins/listMixin.js';
@@ -59,7 +27,6 @@ export const SolidDisplay = {
59
27
  activeSubscription: null,
60
28
  removeActiveSubscription: null
61
29
  },
62
-
63
30
  created() {
64
31
  // Set route active at initialization
65
32
  const route = document.querySelector('solid-route[active]');
@@ -68,43 +35,34 @@ export const SolidDisplay = {
68
35
  if (route['resourceId'] === this.resourceId) this.addActiveCallback();
69
36
  });
70
37
  },
71
-
72
38
  detached() {
73
39
  if (this.activeSubscription) PubSub.unsubscribe(this.activeSubscription);
74
40
  if (this.removeActiveSubscription) PubSub.unsubscribe(this.removeActiveSubscription);
75
41
  },
76
-
77
42
  // Update subscription when id changes
78
43
  updateNavigateSubscription() {
79
44
  if (this.activeSubscription) PubSub.unsubscribe(this.activeSubscription);
80
-
81
45
  if (this.resourceId) {
82
46
  this.activeSubscription = PubSub.subscribe('enterRoute.' + this.resourceId, this.addActiveCallback.bind(this));
83
47
  }
84
48
  },
85
-
86
49
  addActiveCallback() {
87
50
  this.element.setAttribute('active', '');
88
51
  this.removeActiveSubscription = PubSub.subscribe('leaveRoute', this.removeActiveCallback.bind(this));
89
52
  },
90
-
91
53
  removeActiveCallback() {
92
54
  this.element.removeAttribute('active');
93
55
  PubSub.unsubscribe(this.removeActiveSubscription);
94
56
  },
95
-
96
57
  get childTag() {
97
58
  return this.element.dataset.child || this.element.tagName;
98
59
  },
99
-
100
60
  get defaultMultipleWidget() {
101
61
  return 'solid-multiple';
102
62
  },
103
-
104
63
  get defaultSetWidget() {
105
64
  return 'solid-set-default';
106
65
  },
107
-
108
66
  // Here "even.target" points to the content of the widgets of the children of solid-display
109
67
  dispatchSelect(event, resourceId) {
110
68
  const linkTarget = event.target.closest('a');
@@ -119,7 +77,6 @@ export const SolidDisplay = {
119
77
  }));
120
78
  this.goToNext(resource);
121
79
  },
122
-
123
80
  enterKeydownAction(event, resourceId) {
124
81
  if (event.keyCode === 13) {
125
82
  const resource = {
@@ -128,28 +85,34 @@ export const SolidDisplay = {
128
85
  this.goToNext(resource);
129
86
  }
130
87
  },
131
-
132
88
  /**
133
89
  * Returns template of a child element (resource)
134
90
  * @param resourceId
135
91
  * @param attributes
136
92
  */
137
93
  getChildTemplate(resourceId, attributes) {
138
- let template = html(_templateObject(), resourceId, event => this.dispatchSelect(event, resourceId), event => this.enterKeydownAction(event, resourceId), ifDefined(this.fields), spread(attributes));
94
+ let template = html`
95
+ <solid-display
96
+ data-src=${resourceId}
97
+ @click=${event => this.dispatchSelect(event, resourceId)}
98
+ @keydown=${event => this.enterKeydownAction(event, resourceId)}
99
+ fields=${ifDefined(this.fields)}
100
+ ...=${spread(attributes)}
101
+ ></solid-display>
102
+ `;
139
103
  return template;
140
104
  },
141
-
142
105
  /**
143
106
  * Creates and render the content of a single element (resource)
144
107
  * @param parent
145
108
  */
146
109
  async appendSingleElt(parent) {
147
110
  const fields = await this.getFields();
148
- const widgetTemplates = await Promise.all( // generate all widget templates
111
+ const widgetTemplates = await Promise.all(
112
+ // generate all widget templates
149
113
  fields.map(field => this.createWidgetTemplate(field)));
150
- render(html(_templateObject2(), widgetTemplates), parent);
114
+ render(html`${widgetTemplates}`, parent);
151
115
  },
152
-
153
116
  /**
154
117
  * @override listMixin method to use litHtml
155
118
  *
@@ -162,33 +125,26 @@ export const SolidDisplay = {
162
125
  async renderDOM(resources, listPostProcessors, div, context) {
163
126
  const attributes = this.getChildAttributes(); // get attributes of children only once
164
127
  // and create a child template for each resource
165
-
166
- const template = html(_templateObject3(), resources.map(r => r ? this.getChildTemplate(r['@id'], attributes) : null));
128
+ const template = html`${resources.map(r => r ? this.getChildTemplate(r['@id'], attributes) : null)}`;
167
129
  render(template, div);
168
130
  const nextProcessor = listPostProcessors.shift();
169
131
  if (nextProcessor) await nextProcessor(resources, listPostProcessors, div, context);
170
132
  },
171
-
172
133
  /**
173
134
  * Get attributes to dispatch to children from current element
174
135
  */
175
136
  getChildAttributes() {
176
137
  const attributes = {};
177
-
178
138
  for (let attr of this.element.attributes) {
179
139
  //copy widget and value attributes
180
- if (attr.name.startsWith('value-') || attr.name.startsWith('label-') || attr.name.startsWith('placeholder-') || attr.name.startsWith('widget-') || attr.name.startsWith('class-') || attr.name.startsWith('multiple-') || attr.name.startsWith('editable-') || attr.name.startsWith('action-') || attr.name.startsWith('default-') || attr.name == 'extra-context') attributes[attr.name] = attr.value;
140
+ if (attr.name.startsWith('value-') || attr.name.startsWith('label-') || attr.name.startsWith('placeholder-') || attr.name.startsWith('widget-') || attr.name.startsWith('class-') || attr.name.startsWith('multiple-') || attr.name.startsWith('editable-') || attr.name.startsWith('action-') || attr.name.startsWith('default-') || attr.name.startsWith('link-text-') || attr.name == 'extra-context') attributes[attr.name] = attr.value;
181
141
  if (attr.name.startsWith('child-')) attributes[attr.name.replace(/^child-/, '')] = attr.value;
182
-
183
142
  if (attr.name == 'next') {
184
143
  attributes['role'] = 'button';
185
144
  attributes['tabindex'] = '0';
186
145
  }
187
146
  }
188
-
189
147
  return attributes;
190
148
  }
191
-
192
149
  };
193
- Sib.register(SolidDisplay);
194
- //# sourceMappingURL=solid-display.js.map
150
+ Sib.register(SolidDisplay);
@@ -1,45 +1,3 @@
1
- function _templateObject4() {
2
- const data = _taggedTemplateLiteral(["\n <form>\n ", "\n ", "\n </form>\n "]);
3
-
4
- _templateObject4 = function () {
5
- return data;
6
- };
7
-
8
- return data;
9
- }
10
-
11
- function _templateObject3() {
12
- const data = _taggedTemplateLiteral(["\n <input type=\"submit\" value=", ">\n "]);
13
-
14
- _templateObject3 = function () {
15
- return data;
16
- };
17
-
18
- return data;
19
- }
20
-
21
- function _templateObject2() {
22
- const data = _taggedTemplateLiteral(["\n <button type=\"submit\">", "</button>\n "]);
23
-
24
- _templateObject2 = function () {
25
- return data;
26
- };
27
-
28
- return data;
29
- }
30
-
31
- function _templateObject() {
32
- const data = _taggedTemplateLiteral(["\n <div class=", ">\n ", "\n </div>\n "]);
33
-
34
- _templateObject = function () {
35
- return data;
36
- };
37
-
38
- return data;
39
- }
40
-
41
- function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
42
-
43
1
  import { Sib } from '../libs/Sib.js';
44
2
  import { WidgetMixin } from '../mixins/widgetMixin.js';
45
3
  import { AttributeBinderMixin } from '../mixins/attributeBinderMixin.js';
@@ -82,34 +40,27 @@ export const SolidFormSearch = {
82
40
  initialState: {
83
41
  error: ''
84
42
  },
85
-
86
43
  created() {
87
44
  if (this.element.closest('[no-render]')) this.noRender = ''; // if embedded in no-render, apply no-render to himself
88
-
89
45
  this.autoRangeValues = {};
90
46
  this.rangeId = uniqID();
91
47
  this.attachedElements = new Set();
92
48
  },
93
-
94
49
  get defaultMultipleWidget() {
95
50
  return 'solid-multiple-form';
96
51
  },
97
-
98
52
  get defaultSetWidget() {
99
53
  return 'solid-set-default';
100
54
  },
101
-
102
55
  get value() {
103
56
  const values = {};
104
57
  this.widgets.forEach(widget => {
105
58
  const name = (widget.component || widget).name;
106
59
  if (name == null) return;
107
60
  let value = widget.component ? widget.component.getValue() : widget.value;
108
-
109
61
  try {
110
62
  value = JSON.parse(value);
111
63
  } catch {}
112
-
113
64
  value = {
114
65
  type: widget.component.type,
115
66
  list: !!widget.component.multiple,
@@ -119,25 +70,23 @@ export const SolidFormSearch = {
119
70
  });
120
71
  return values;
121
72
  },
122
-
123
- getWidget(field, isSet = false) {
124
- let tagName = ''; // If auto-range-[field] exists, create range-[field] and sets its value
125
-
73
+ getWidget(field) {
74
+ let isSet = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
75
+ let tagName = '';
76
+ // If auto-range-[field] exists, create range-[field] and sets its value
126
77
  if (this.element.hasAttribute('auto-range-' + field) && !this.element.hasAttribute('range-' + field)) {
127
- const idField = "".concat(this.rangeId, "_").concat(field);
78
+ const idField = `${this.rangeId}_${field}`;
128
79
  this.element.setAttribute('range-' + field, 'store://local.' + idField);
129
80
  this.populate();
130
81
  }
131
-
132
- const widgetAttribute = this.element.getAttribute('widget-' + field); // Choose widget
133
-
82
+ const widgetAttribute = this.element.getAttribute('widget-' + field);
83
+ // Choose widget
134
84
  if (!widgetAttribute && (this.element.hasAttribute('range-' + field) || this.element.hasAttribute('enum-' + field))) {
135
85
  tagName = 'solid-form-dropdown';
136
86
  } else {
137
87
  tagName = widgetAttribute || (!isSet ? this.defaultWidget : this.defaultSetWidget);
138
- } // Create widget
139
-
140
-
88
+ }
89
+ // Create widget
141
90
  if (!customElements.get(tagName)) {
142
91
  // component does not exist
143
92
  if (tagName.startsWith('solid')) newWidgetFactory(tagName); // solid- -> create it
@@ -145,33 +94,28 @@ export const SolidFormSearch = {
145
94
 
146
95
  return this.widgetFromTagName(tagName);
147
96
  },
148
-
149
97
  async attach(elm) {
150
98
  if (this.attachedElements.has(elm)) return;
151
99
  this.attachedElements.add(elm);
152
100
  await this.updateAutoRanges();
153
101
  },
154
-
155
102
  async detach(elm) {
156
103
  if (!this.attachedElements.has(elm)) return;
157
104
  this.attachedElements.delete(elm);
158
105
  await this.updateAutoRanges();
159
106
  },
160
-
161
107
  async updateAutoRanges() {
162
108
  for (const attr of this.element.attributes) {
163
109
  if (!attr['name'].startsWith('auto-range-')) continue;
164
110
  const field = attr['name'].replace('auto-range-', '');
165
111
  const autoRangeValues = new Set();
166
-
167
112
  for (const elm of this.attachedElements) {
168
113
  for (const value of await elm.getValuesOfField(field)) {
169
114
  autoRangeValues.add(value);
170
115
  }
171
116
  }
172
-
173
- const idField = "".concat(this.rangeId, "_").concat(field);
174
- const id = "store://local.".concat(idField);
117
+ const idField = `${this.rangeId}_${field}`;
118
+ const id = `store://local.${idField}`;
175
119
  const ldpContains = Array.from(autoRangeValues).map(id => ({
176
120
  '@id': id
177
121
  }));
@@ -183,7 +127,6 @@ export const SolidFormSearch = {
183
127
  sibStore.setLocalData(data, id);
184
128
  }
185
129
  },
186
-
187
130
  change(resource) {
188
131
  this.element.dispatchEvent(new CustomEvent('formChange', {
189
132
  bubbles: true,
@@ -192,20 +135,23 @@ export const SolidFormSearch = {
192
135
  }
193
136
  }));
194
137
  },
195
-
196
138
  async inputChange() {
197
139
  this.change(this.value);
198
140
  },
199
-
200
141
  getSubmitTemplate() {
201
- return html(_templateObject(), ifDefined(this.classSubmitButton), this.submitWidget === 'button' ? html(_templateObject2(), this.submitButton || '') : html(_templateObject3(), ifDefined(this.submitButton || undefined)));
142
+ return html`
143
+ <div class=${ifDefined(this.classSubmitButton)}>
144
+ ${this.submitWidget === 'button' ? html`
145
+ <button type="submit">${this.submitButton || ''}</button>
146
+ ` : html`
147
+ <input type="submit" value=${ifDefined(this.submitButton || undefined)}>
148
+ `}
149
+ </div>
150
+ `;
202
151
  },
203
-
204
152
  empty() {},
205
-
206
153
  async populate() {
207
154
  await this.replaceAttributesData();
208
-
209
155
  if (this.submitButton == null) {
210
156
  this.element.addEventListener('input', () => this.inputChange());
211
157
  } else {
@@ -214,13 +160,15 @@ export const SolidFormSearch = {
214
160
  this.inputChange();
215
161
  });
216
162
  }
217
-
218
163
  const fields = await this.getFields();
219
164
  const widgetTemplates = await Promise.all(fields.map(field => this.createWidgetTemplate(field)));
220
- const template = html(_templateObject4(), widgetTemplates, this.submitButton == null ? '' : this.getSubmitTemplate());
165
+ const template = html`
166
+ <form>
167
+ ${widgetTemplates}
168
+ ${this.submitButton == null ? '' : this.getSubmitTemplate()}
169
+ </form>
170
+ `;
221
171
  render(template, this.element);
222
172
  }
223
-
224
173
  };
225
- Sib.register(SolidFormSearch);
226
- //# sourceMappingURL=solid-form-search.js.map
174
+ Sib.register(SolidFormSearch);