@startinblox/core 0.17.31 → 0.18.0-beta.2

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 +243 -234
  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
@@ -1,95 +1,3 @@
1
- function _templateObject9() {
2
- const data = _taggedTemplateLiteral(["\n ", "\n "]);
3
-
4
- _templateObject9 = function () {
5
- return data;
6
- };
7
-
8
- return data;
9
- }
10
-
11
- function _templateObject8() {
12
- const data = _taggedTemplateLiteral(["<input type=\"reset\" />"]);
13
-
14
- _templateObject8 = function () {
15
- return data;
16
- };
17
-
18
- return data;
19
- }
20
-
21
- function _templateObject7() {
22
- const data = _taggedTemplateLiteral(["\n <form\n @submit=", "\n @reset=", "\n >\n ", "\n ", "\n ", "\n </form>\n "]);
23
-
24
- _templateObject7 = function () {
25
- return data;
26
- };
27
-
28
- return data;
29
- }
30
-
31
- function _templateObject6() {
32
- const data = _taggedTemplateLiteral(["\n <div data-id=\"error\"></div>\n ", "\n ", "\n "]);
33
-
34
- _templateObject6 = function () {
35
- return data;
36
- };
37
-
38
- return data;
39
- }
40
-
41
- function _templateObject5() {
42
- const data = _taggedTemplateLiteral(["\n <input type=\"submit\" value=", ">\n "]);
43
-
44
- _templateObject5 = function () {
45
- return data;
46
- };
47
-
48
- return data;
49
- }
50
-
51
- function _templateObject4() {
52
- const data = _taggedTemplateLiteral(["\n <button type=\"submit\">", "</button>\n "]);
53
-
54
- _templateObject4 = function () {
55
- return data;
56
- };
57
-
58
- return data;
59
- }
60
-
61
- function _templateObject3() {
62
- const data = _taggedTemplateLiteral(["\n <div class=", ">\n ", "\n </div>\n "]);
63
-
64
- _templateObject3 = function () {
65
- return data;
66
- };
67
-
68
- return data;
69
- }
70
-
71
- function _templateObject2() {
72
- const data = _taggedTemplateLiteral(["\n <li>", "</li>\n "]);
73
-
74
- _templateObject2 = function () {
75
- return data;
76
- };
77
-
78
- return data;
79
- }
80
-
81
- function _templateObject() {
82
- const data = _taggedTemplateLiteral(["\n <p>A validation error occurred.</p>\n <ul>\n ", "\n </ul>\n "]);
83
-
84
- _templateObject = function () {
85
- return data;
86
- };
87
-
88
- return data;
89
- }
90
-
91
- function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
92
-
93
1
  import { Sib } from '../libs/Sib.js';
94
2
  import { WidgetMixin } from '../mixins/widgetMixin.js';
95
3
  import { StoreMixin } from '../mixins/storeMixin.js';
@@ -138,75 +46,63 @@ export const SolidForm = {
138
46
  initialState: {
139
47
  error: ''
140
48
  },
141
-
142
49
  get defaultMultipleWidget() {
143
50
  return 'solid-multiple-form';
144
51
  },
145
-
146
52
  get defaultSetWidget() {
147
53
  return 'solid-set-default';
148
54
  },
149
-
150
55
  get value() {
151
56
  const values = {};
152
57
  this.widgets.forEach(widget => {
153
58
  const name = (widget.component || widget).name;
154
59
  if (name == null) return;
155
60
  let value = widget.component ? widget.component.getValue() : widget.value;
156
-
157
61
  try {
158
62
  value = JSON.parse(value);
159
63
  } catch (e) {}
160
-
161
64
  setDeepProperty(values, name.split('.'), value);
162
- }); // add @id if edition
163
-
164
- if (this.resource && !this.resource.isContainer()) values['@id'] = this.resourceId;
65
+ });
66
+ // add @id if edition
67
+ if (this.resource && !this.resource.isContainer?.()) values['@id'] = this.resourceId;
165
68
  return values;
166
69
  },
167
-
168
70
  get isNaked() {
169
71
  return this.element.hasAttribute('naked');
170
72
  },
171
-
172
73
  get isSavingAutomatically() {
173
74
  return this.autosave !== null;
174
75
  },
175
-
176
76
  isCreationForm(formValue) {
177
77
  return !('@id' in formValue);
178
78
  },
179
-
180
79
  async getFormValue() {
181
80
  let value = this.value;
182
-
183
- if (this.resource && !this.resource.isContainer()) {
81
+ if (this.resource && !this.resource.isContainer?.()) {
184
82
  for (let predicate of Object.keys(this.value)) {
185
83
  // add @id for nested resources
186
84
  const object = await this.resource[predicate];
187
85
  if (object && object['@id'] && !value[predicate]['@id']) value[predicate]['@id'] = object['@id'];
188
86
  }
189
87
  }
190
-
191
88
  return transformArrayToContainer(value);
192
89
  },
193
-
194
- getWidget(field, isSet = false) {
90
+ getWidget(field) {
91
+ let isSet = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
195
92
  let tagName = '';
196
- const widgetAttribute = this.element.getAttribute('widget-' + field); // Choose widget
93
+ const widgetAttribute = this.element.getAttribute('widget-' + field);
197
94
 
95
+ // Choose widget
198
96
  if (!widgetAttribute && this.element.hasAttribute('upload-url-' + field)) {
199
97
  tagName = 'solid-form-file';
200
98
  } else if (!widgetAttribute && (this.element.hasAttribute('range-' + field) || this.element.hasAttribute('enum-' + field))) {
201
99
  tagName = 'solid-form-dropdown';
202
100
  } else {
203
101
  tagName = widgetAttribute || (!isSet ? this.defaultWidget : this.defaultSetWidget);
204
- } // Create widget
205
-
206
-
102
+ }
103
+ // Create widget
207
104
  return this.widgetFromTagName(tagName);
208
105
  },
209
-
210
106
  change(resource) {
211
107
  this.element.dispatchEvent(new CustomEvent('formChange', {
212
108
  bubbles: true,
@@ -215,14 +111,12 @@ export const SolidForm = {
215
111
  }
216
112
  }));
217
113
  },
218
-
219
114
  async save() {
220
115
  this.toggleLoaderHidden(false);
221
116
  this.hideError();
222
117
  const resource = await this.getFormValue();
223
118
  resource['@context'] = this.context;
224
119
  let saved;
225
-
226
120
  try {
227
121
  if (this.partial == null) {
228
122
  saved = resource['@id'] ? await store.put(resource, this.resourceId) : await store.post(resource, this.resourceId);
@@ -231,13 +125,11 @@ export const SolidForm = {
231
125
  }
232
126
  } catch (e) {
233
127
  this.toggleLoaderHidden(true);
234
-
235
128
  if (e) {
236
129
  // if server error
237
130
  e.json().then(error => this.showError(error));
238
131
  throw e;
239
132
  } // else, ldpframework error, we continue
240
-
241
133
  }
242
134
 
243
135
  this.element.dispatchEvent(new CustomEvent('save', {
@@ -250,38 +142,33 @@ export const SolidForm = {
250
142
  this.toggleLoaderHidden(true);
251
143
  return saved;
252
144
  },
253
-
254
145
  async submitForm() {
255
146
  let id;
256
-
257
147
  try {
258
148
  id = (await this.save()) || this.getFormValue()['@id'];
259
149
  } catch (e) {
260
150
  return;
261
151
  }
262
-
263
152
  this.reset();
264
153
  this.goToNext({
265
154
  '@id': id
266
155
  });
267
156
  },
268
-
269
157
  async onInput() {
270
158
  const formValue = await this.getFormValue();
271
159
  this.change(formValue);
272
160
  },
273
-
274
161
  async onChange() {
275
162
  const formValue = await this.getFormValue();
276
163
  if (!this.isCreationForm(formValue) && this.isSavingAutomatically) this.submitForm(); // if autosave, submitForm
277
164
  },
278
165
 
279
- findErrorMessage(errors, errorFullName = '') {
166
+ findErrorMessage(errors) {
167
+ let errorFullName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
280
168
  let errorsArray = [];
281
169
  errors.forEach(member => {
282
170
  let errorNextName = Object.values(member)[0];
283
171
  let errorAddName = errorFullName === "" ? errorNextName : errorFullName.concat(' - ', errorNextName);
284
-
285
172
  if (Array.isArray(Object.values(member)[1]) === true) {
286
173
  let errorMessage = Object.values(member)[1];
287
174
  let errorGlobal = errorAddName.concat(': ', errorMessage.join(', '));
@@ -294,29 +181,32 @@ export const SolidForm = {
294
181
  });
295
182
  return errorsArray;
296
183
  },
297
-
298
184
  empty() {},
299
-
300
185
  showError(e) {
301
186
  let errors = Object.entries(e).filter(field => !field[0].startsWith('@context'));
302
- const errorTemplate = html(_templateObject(), this.findErrorMessage(errors).map(field => html(_templateObject2(), field))); // If field exists pick its label (unsure if that's easily possible)
187
+ const errorTemplate = html`
188
+ <p>A validation error occurred.</p>
189
+ <ul>
190
+ ${this.findErrorMessage(errors).map(field => html`
191
+ <li>${field}</li>
192
+ `)}
193
+ </ul>
194
+ `;
195
+ // If field exists pick its label (unsure if that's easily possible)
303
196
  // In this.getFields() map with each field and get label
304
197
  // If it does not just add a notice as we do that it's missing that field
305
- // Validation message in english ?
306
198
 
199
+ // Validation message in english ?
307
200
  const parentElement = this.element.querySelector('[data-id=error]');
308
201
  if (parentElement) render(errorTemplate, parentElement);
309
202
  },
310
-
311
203
  hideError() {
312
204
  const parentElement = this.element.querySelector('[data-id=error]');
313
205
  if (parentElement) render('', parentElement);
314
206
  },
315
-
316
207
  reset() {
317
208
  if (!this.isNaked) this.element.querySelector('form').reset();
318
209
  },
319
-
320
210
  onSubmit(event) {
321
211
  if (!this.isNaked) {
322
212
  event.preventDefault();
@@ -328,27 +218,42 @@ export const SolidForm = {
328
218
  //send method to validationMixin, used by the dialog modal and performAction method
329
219
  return this.submitForm();
330
220
  },
331
-
332
221
  onReset() {
333
222
  if (!this.isNaked) setTimeout(() => this.onInput());
334
223
  },
335
-
336
224
  getSubmitTemplate() {
337
- return html(_templateObject3(), ifDefined(this.classSubmitButton), this.submitWidget === 'button' ? html(_templateObject4(), this.submitButton || this.t("solid-form.submit-button")) : html(_templateObject5(), this.submitButton || this.t("solid-form.submit-button")));
225
+ return html`
226
+ <div class=${ifDefined(this.classSubmitButton)}>
227
+ ${this.submitWidget === 'button' ? html`
228
+ <button type="submit">${this.submitButton || this.t("solid-form.submit-button")}</button>
229
+ ` : html`
230
+ <input type="submit" value=${this.submitButton || this.t("solid-form.submit-button")}>
231
+ `}
232
+ </div>
233
+ `;
338
234
  },
339
-
340
235
  async populate() {
341
236
  this.element.oninput = () => this.onInput(); // prevent from firing change multiple times
342
-
343
-
344
237
  this.element.onchange = () => this.onChange();
345
-
346
238
  const fields = await this.getFields();
347
239
  const widgetTemplates = await Promise.all(fields.map(field => this.createWidgetTemplate(field)));
348
- const template = html(_templateObject6(), !this.isNaked ? html(_templateObject7(), this.onSubmit.bind(this), this.onReset.bind(this), widgetTemplates, !this.isSavingAutomatically ? this.getSubmitTemplate() : '', this.element.hasAttribute('reset') ? html(_templateObject8()) : '') : html(_templateObject9(), widgetTemplates), this.getModalDialog());
240
+ const template = html`
241
+ <div data-id="error"></div>
242
+ ${!this.isNaked ? html`
243
+ <form
244
+ @submit=${this.onSubmit.bind(this)}
245
+ @reset=${this.onReset.bind(this)}
246
+ >
247
+ ${widgetTemplates}
248
+ ${!this.isSavingAutomatically ? this.getSubmitTemplate() : ''}
249
+ ${this.element.hasAttribute('reset') ? html`<input type="reset" />` : ''}
250
+ </form>
251
+ ` : html`
252
+ ${widgetTemplates}
253
+ `}
254
+ ${this.getModalDialog()}
255
+ `;
349
256
  render(template, this.element);
350
257
  }
351
-
352
258
  };
353
- Sib.register(SolidForm);
354
- //# sourceMappingURL=solid-form.js.map
259
+ Sib.register(SolidForm);
@@ -1,15 +1,3 @@
1
- function _templateObject() {
2
- const data = _taggedTemplateLiteral(["\n <button\n @click=", "\n >\n ", "\n </button>\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 { store } from '../libs/store/store.js';
15
3
  import { html, render } from '../_snowpack/pkg/lit-html.js';
@@ -26,21 +14,22 @@ export const SolidLang = {
26
14
  default: null
27
15
  }
28
16
  },
29
-
30
17
  created() {
31
18
  this.render();
32
19
  },
33
-
34
20
  languageLoader() {
35
21
  store.selectLanguage(this.lang);
36
22
  location.reload();
37
23
  },
38
-
39
24
  render() {
40
- let template = html(_templateObject(), this.languageLoader.bind(this), this.dataLabel);
25
+ let template = html`
26
+ <button
27
+ @click=${this.languageLoader.bind(this)}
28
+ >
29
+ ${this.dataLabel}
30
+ </button>
31
+ `;
41
32
  render(template, this.element);
42
33
  }
43
-
44
34
  };
45
- Sib.register(SolidLang);
46
- //# sourceMappingURL=solid-lang.js.map
35
+ Sib.register(SolidLang);
@@ -1,25 +1,3 @@
1
- function _templateObject2() {
2
- const data = _taggedTemplateLiteral(["\n <solid-display\n fields=\"", "\"\n data-src=\"", "\"\n ...=", "\n ></solid-display>\n "]);
3
-
4
- _templateObject2 = function () {
5
- return data;
6
- };
7
-
8
- return data;
9
- }
10
-
11
- function _templateObject() {
12
- const data = _taggedTemplateLiteral(["\n <div id=", " style=\"width:100%;height:100%;\"></div>\n "]);
13
-
14
- _templateObject = function () {
15
- return data;
16
- };
17
-
18
- return data;
19
- }
20
-
21
- function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
22
-
23
1
  import { Sib } from '../libs/Sib.js';
24
2
  import { ListMixin } from '../mixins/listMixin.js';
25
3
  import { StoreMixin } from '../mixins/storeMixin.js';
@@ -31,11 +9,11 @@ import { GrouperMixin } from '../mixins/grouperMixin.js';
31
9
  import { NextMixin } from '../mixins/nextMixin.js';
32
10
  import { store } from '../libs/store/store.js';
33
11
  import { uniqID } from '../libs/helpers.js';
34
- import { spread } from '../libs/lit-helpers.js'; //@ts-ignore
35
-
36
- import L from 'https://cdn.skypack.dev/leaflet@1.7.1'; // TODO : revert to "leaflet" when apps up to date
12
+ import { spread } from '../libs/lit-helpers.js';
37
13
 
38
- import 'https://cdn.skypack.dev/leaflet.markercluster@1.4.1'; // TODO : revert to "leaflet.markercluster" when apps up to date
14
+ //@ts-ignore
15
+ import L from 'https://cdn.skypack.dev/leaflet'; // TODO : revert to "leaflet" when apps up to date
16
+ import 'https://cdn.skypack.dev/leaflet.markercluster'; // TODO : revert to "leaflet.markercluster" when apps up to date
39
17
 
40
18
  import { html, render } from '../_snowpack/pkg/lit-html.js';
41
19
  import { ifDefined } from '../_snowpack/pkg/lit-html/directives/if-defined.js';
@@ -56,45 +34,42 @@ export const SolidMap = {
56
34
  resetPlanned: false,
57
35
  hasBeenResetOnce: false
58
36
  },
59
-
60
37
  created() {
61
38
  //@ts-ignore
62
- import("../_snowpack/pkg/leaflet/dist/leaflet.css.proxy.js"); //@ts-ignore
63
-
64
- import("../style/default-theme.css.proxy.js"); //@ts-ignore
65
-
66
- import("../_snowpack/pkg/leaflet.markercluster/dist/MarkerCluster.css.proxy.js"); //@ts-ignore
67
-
68
- import("../_snowpack/pkg/leaflet.markercluster/dist/MarkerCluster.Default.css.proxy.js"); // reset when it becomes visible to prevent bug https://git.startinblox.com/framework/sib-core/issues/661
39
+ import("../_snowpack/pkg/leaflet/dist/leaflet.css.proxy.js");
40
+ //@ts-ignore
41
+ import("../style/default-theme.css.proxy.js");
42
+ //@ts-ignore
43
+ import("../_snowpack/pkg/leaflet.markercluster/dist/MarkerCluster.css.proxy.js");
44
+ //@ts-ignore
45
+ import("../_snowpack/pkg/leaflet.markercluster/dist/MarkerCluster.Default.css.proxy.js");
69
46
 
47
+ // reset when it becomes visible to prevent bug https://git.startinblox.com/framework/sib-core/issues/661
70
48
  document.body.addEventListener('navigate', () => setTimeout(() => this.isVisible && !this.hasBeenResetOnce && this.reset()));
71
49
  this.markers = [];
72
50
  this.subscriptions = new Map();
73
51
  },
74
-
75
52
  get isVisible() {
76
53
  return this.element.offsetParent !== null;
77
54
  },
78
-
79
55
  attached() {
80
56
  const id = uniqID();
81
- const template = html(_templateObject(), id);
57
+ const template = html`
58
+ <div id=${id} style="width:100%;height:100%;"></div>
59
+ `;
82
60
  render(template, this.element);
83
- const div = this.element.querySelector("#".concat(id));
61
+ const div = this.element.querySelector(`#${id}`);
84
62
  this.map = L.map(div);
85
63
  L.tileLayer('https://{s}.basemaps.cartocdn.com/rastertiles/voyager/{z}/{x}/{y}{r}.png').addTo(this.map);
86
-
87
64
  if (this.clustering !== null) {
88
65
  this.markersCluster = L.markerClusterGroup();
89
66
  this.map.addLayer(this.markersCluster);
90
67
  }
91
68
  },
92
-
93
69
  reset() {
94
70
  if (this.isVisible) {
95
71
  // reset only if visible
96
72
  this.map.invalidateSize();
97
-
98
73
  if (this.markers.length) {
99
74
  this.map.fitBounds(L.featureGroup(this.markers).getBounds()); // Center map on markers if some available
100
75
  } else {
@@ -104,7 +79,6 @@ export const SolidMap = {
104
79
  this.hasBeenResetOnce = true;
105
80
  }
106
81
  },
107
-
108
82
  /**
109
83
  * Execute a reset only if none is planned already
110
84
  */
@@ -117,7 +91,6 @@ export const SolidMap = {
117
91
  });
118
92
  }
119
93
  },
120
-
121
94
  dispatchSelect(event) {
122
95
  const target = event.target;
123
96
  const resource = target['options'].resource;
@@ -128,7 +101,6 @@ export const SolidMap = {
128
101
  }));
129
102
  this.goToNext(resource);
130
103
  },
131
-
132
104
  /**
133
105
  * Override listMixin method: initialize a marker on the map
134
106
  * @param resourceId: id of the resource to display
@@ -136,15 +108,12 @@ export const SolidMap = {
136
108
  */
137
109
  async appendChildElt(resourceId, groupClass) {
138
110
  const resource = await store.getData(resourceId, this.context);
139
-
140
111
  if (!this.subscriptions.get(resourceId)) {
141
112
  this.subscriptions.set(resourceId, PubSub.subscribe(resourceId, () => this.updateDOM()));
142
113
  }
143
-
144
114
  if (!resource) return;
145
115
  const lat = await resource['lat'];
146
116
  const lng = await resource['lng'];
147
-
148
117
  if (lat && lng) {
149
118
  const icon = L.divIcon({
150
119
  // create the icon, doc here: https://leafletjs.com/reference-1.6.0.html#icon
@@ -153,15 +122,15 @@ export const SolidMap = {
153
122
  iconSize: [8, 8],
154
123
  iconAnchor: [12, 34],
155
124
  popupAnchor: [0, -34]
156
- }); // create a marker, doc here: https://leafletjs.com/reference-1.6.0.html#marker
125
+ });
157
126
 
127
+ // create a marker, doc here: https://leafletjs.com/reference-1.6.0.html#marker
158
128
  const marker = L.marker([lat.toString(), lng.toString()], {
159
129
  resource,
160
130
  icon
161
131
  });
162
132
  if (this.clustering === null) marker.addTo(this.map);else this.markersCluster.addLayer(marker);
163
133
  marker.on('click', this.dispatchSelect.bind(this));
164
-
165
134
  if (this.fields !== null) {
166
135
  // show popups only if fields attribute
167
136
  marker.bindPopup(() => this.getPopupContent(resourceId), {
@@ -172,43 +141,41 @@ export const SolidMap = {
172
141
  this.markers.push(marker);
173
142
  }
174
143
  },
175
-
176
144
  /**
177
145
  * Generate the solid-display of the popup
178
146
  * @param resourceId: id of the popup clicked
179
147
  */
180
148
  getPopupContent(resourceId) {
181
149
  const attributes = {};
182
-
183
150
  for (let attr of this.element.attributes) {
184
151
  //copy widget and value attributes
185
152
  if (attr.name.startsWith('value-') || attr.name.startsWith('label-') || 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;
186
153
  if (attr.name.startsWith('child-')) attributes[attr.name.replace(/^child-/, '')] = attr.value;
187
154
  }
188
-
189
155
  const div = document.createElement('div');
190
- const template = html(_templateObject2(), ifDefined(this.fields), resourceId, spread(attributes));
156
+ const template = html`
157
+ <solid-display
158
+ fields="${ifDefined(this.fields)}"
159
+ data-src="${resourceId}"
160
+ ...=${spread(attributes)}
161
+ ></solid-display>
162
+ `;
191
163
  render(template, div);
192
164
  return div.querySelector('solid-display');
193
165
  },
194
-
195
166
  /**
196
167
  * Override widgetMixin method: empty the map
197
168
  */
198
169
  empty() {
199
170
  if (!this.map) return;
200
171
  if (this.markersCluster) this.map.removeLayer(this.markersCluster);
201
-
202
172
  for (let marker of this.markers) this.map.removeLayer(marker);
203
-
204
173
  if (this.clustering !== null) {
205
174
  this.markersCluster = L.markerClusterGroup();
206
175
  this.map.addLayer(this.markersCluster);
207
176
  }
208
-
209
177
  this.markers = [];
210
178
  },
211
-
212
179
  /**
213
180
  * Override groupMixin method
214
181
  * @param groupName: value of the group
@@ -216,11 +183,9 @@ export const SolidMap = {
216
183
  renderGroup(groupName) {
217
184
  const sanitizedGroupName = encodeURIComponent(groupName.toLowerCase()).replace(/%[0-9A-F]{2}/gi, '');
218
185
  const div = document.createElement('div'); // used to pass group info to renderDOM
219
-
220
186
  div.dataset.groupClass = 'group-' + sanitizedGroupName;
221
187
  return div;
222
188
  },
223
-
224
189
  /**
225
190
  * Override listMixin method: display all the resources
226
191
  * @param resources
@@ -230,13 +195,10 @@ export const SolidMap = {
230
195
  */
231
196
  async renderDOM(resources, listPostProcessors, div, context) {
232
197
  const groupClass = div.dataset.groupClass || ''; // get the group class from the useless div element
233
-
234
198
  await Promise.all(resources.map(resource => this.appendChildElt(resource['@id'], groupClass)));
235
199
  this.planReset();
236
200
  const nextProcessor = listPostProcessors.shift();
237
201
  if (nextProcessor) await nextProcessor(resources, listPostProcessors, div, context);
238
202
  }
239
-
240
203
  };
241
- Sib.register(SolidMap);
242
- //# sourceMappingURL=solid-map.js.map
204
+ Sib.register(SolidMap);