solid-panes 3.5.27 → 3.5.28-38b5cde0

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 (309) hide show
  1. package/.babelrc +0 -0
  2. package/.eslintignore +0 -0
  3. package/.eslintrc +0 -0
  4. package/.github/workflows/ci.yml +0 -0
  5. package/.nvmrc +0 -0
  6. package/Documentation/VisualLanguage.html +0 -0
  7. package/Documentation/conventions.md +0 -0
  8. package/LICENSE.md +0 -0
  9. package/README.md +0 -2
  10. package/dev/index.html +0 -0
  11. package/dev/loader.ts +0 -0
  12. package/dev/pane/index.ts +0 -0
  13. package/doc/images/panes-for-classes.epgz +0 -0
  14. package/doc/images/panes-for-classes.svg +0 -0
  15. package/jest.config.js +0 -0
  16. package/jest.setup.ts +0 -0
  17. package/lib/RDFXMLPane.js +15 -9
  18. package/lib/RDFXMLPane.js.map +1 -1
  19. package/lib/argument/argumentPane.js +12 -11
  20. package/lib/argument/argumentPane.js.map +1 -1
  21. package/lib/attach/attachPane.js +58 -90
  22. package/lib/attach/attachPane.js.map +1 -1
  23. package/lib/audio/audioPane.js +19 -37
  24. package/lib/audio/audioPane.js.map +1 -1
  25. package/lib/classInstancePane.js +21 -22
  26. package/lib/classInstancePane.js.map +1 -1
  27. package/lib/dashboard/basicPreferences.d.ts +0 -0
  28. package/lib/dashboard/basicPreferences.d.ts.map +0 -0
  29. package/lib/dashboard/basicPreferences.js +96 -154
  30. package/lib/dashboard/basicPreferences.js.map +1 -1
  31. package/lib/dashboard/dashboardPane.d.ts +0 -0
  32. package/lib/dashboard/dashboardPane.d.ts.map +0 -0
  33. package/lib/dashboard/dashboardPane.js +2 -18
  34. package/lib/dashboard/dashboardPane.js.map +1 -1
  35. package/lib/dashboard/homepage.d.ts +0 -0
  36. package/lib/dashboard/homepage.d.ts.map +0 -0
  37. package/lib/dashboard/homepage.js +27 -49
  38. package/lib/dashboard/homepage.js.map +1 -1
  39. package/lib/dataContentPane.js +26 -61
  40. package/lib/dataContentPane.js.map +1 -1
  41. package/lib/defaultPane.js +23 -23
  42. package/lib/defaultPane.js.map +1 -1
  43. package/lib/dokieli/dokieliPane.js +29 -34
  44. package/lib/dokieli/dokieliPane.js.map +1 -1
  45. package/lib/dokieli/new.js +6 -1
  46. package/lib/dokieli/new.js.map +1 -1
  47. package/lib/form/pane.js +34 -45
  48. package/lib/form/pane.js.map +1 -1
  49. package/lib/global.d.js +0 -0
  50. package/lib/global.d.js.map +0 -0
  51. package/lib/home/homePane.d.ts +0 -0
  52. package/lib/home/homePane.d.ts.map +1 -1
  53. package/lib/home/homePane.js +38 -68
  54. package/lib/home/homePane.js.map +1 -1
  55. package/lib/humanReadablePane.js +14 -28
  56. package/lib/humanReadablePane.js.map +1 -1
  57. package/lib/imagePane.js +19 -14
  58. package/lib/imagePane.js.map +1 -1
  59. package/lib/index.d.ts +0 -0
  60. package/lib/index.d.ts.map +0 -0
  61. package/lib/index.js +6 -20
  62. package/lib/index.js.map +1 -1
  63. package/lib/internal/internalPane.d.ts +0 -0
  64. package/lib/internal/internalPane.d.ts.map +0 -0
  65. package/lib/internal/internalPane.js +10 -41
  66. package/lib/internal/internalPane.js.map +1 -1
  67. package/lib/mainPage/footer.d.ts +0 -0
  68. package/lib/mainPage/footer.d.ts.map +0 -0
  69. package/lib/mainPage/footer.js +0 -4
  70. package/lib/mainPage/footer.js.map +1 -1
  71. package/lib/mainPage/header.d.ts +0 -0
  72. package/lib/mainPage/header.d.ts.map +0 -0
  73. package/lib/mainPage/header.js +66 -100
  74. package/lib/mainPage/header.js.map +1 -1
  75. package/lib/mainPage/index.d.ts +0 -0
  76. package/lib/mainPage/index.d.ts.map +0 -0
  77. package/lib/mainPage/index.js +17 -30
  78. package/lib/mainPage/index.js.map +1 -1
  79. package/lib/microblogPane/microblogPane.js +182 -321
  80. package/lib/microblogPane/microblogPane.js.map +1 -1
  81. package/lib/n3Pane.js +12 -8
  82. package/lib/n3Pane.js.map +1 -1
  83. package/lib/outline/context.d.ts +0 -0
  84. package/lib/outline/context.d.ts.map +0 -0
  85. package/lib/outline/context.js +0 -2
  86. package/lib/outline/context.js.map +1 -1
  87. package/lib/outline/licenseOptions.js +21 -35
  88. package/lib/outline/licenseOptions.js.map +1 -1
  89. package/lib/outline/manager.js +740 -1176
  90. package/lib/outline/manager.js.map +1 -1
  91. package/lib/outline/manager.test.js +16 -25
  92. package/lib/outline/manager.test.js.map +1 -1
  93. package/lib/outline/outlineIcons.js +39 -26
  94. package/lib/outline/outlineIcons.js.map +1 -1
  95. package/lib/outline/propertyViews.d.ts +3 -2
  96. package/lib/outline/propertyViews.d.ts.map +1 -1
  97. package/lib/outline/propertyViews.js +7 -15
  98. package/lib/outline/propertyViews.js.map +1 -1
  99. package/lib/outline/propertyViews.test.js +7 -7
  100. package/lib/outline/propertyViews.test.js.map +1 -1
  101. package/lib/outline/queryByExample.js +28 -80
  102. package/lib/outline/queryByExample.js.map +1 -1
  103. package/lib/outline/userInput.js +221 -459
  104. package/lib/outline/userInput.js.map +1 -1
  105. package/lib/outline/viewAsImage.d.ts +0 -0
  106. package/lib/outline/viewAsImage.d.ts.map +0 -0
  107. package/lib/outline/viewAsImage.js +0 -6
  108. package/lib/outline/viewAsImage.js.map +1 -1
  109. package/lib/outline/viewAsMbox.d.ts +0 -0
  110. package/lib/outline/viewAsMbox.d.ts.map +0 -0
  111. package/lib/outline/viewAsMbox.js +3 -4
  112. package/lib/outline/viewAsMbox.js.map +1 -1
  113. package/lib/pad/padPane.d.ts +0 -0
  114. package/lib/pad/padPane.d.ts.map +0 -0
  115. package/lib/pad/padPane.js +45 -93
  116. package/lib/pad/padPane.js.map +1 -1
  117. package/lib/playlist/playlistPane.js +11 -21
  118. package/lib/playlist/playlistPane.js.map +1 -1
  119. package/lib/profile/editProfile.view.d.ts +0 -0
  120. package/lib/profile/editProfile.view.d.ts.map +1 -1
  121. package/lib/profile/editProfile.view.js +22 -23
  122. package/lib/profile/editProfile.view.js.map +1 -1
  123. package/lib/profile/profile.dom.d.ts +0 -0
  124. package/lib/profile/profile.dom.d.ts.map +0 -0
  125. package/lib/profile/profile.dom.js +0 -3
  126. package/lib/profile/profile.dom.js.map +1 -1
  127. package/lib/registerPanes.js +99 -54
  128. package/lib/registerPanes.js.map +1 -1
  129. package/lib/schedule/formsForSchedule.js +6 -1
  130. package/lib/schedule/formsForSchedule.js.map +1 -1
  131. package/lib/schedule/schedulePane.js +71 -126
  132. package/lib/schedule/schedulePane.js.map +1 -1
  133. package/lib/sharing/sharingPane.d.ts +0 -0
  134. package/lib/sharing/sharingPane.d.ts.map +0 -0
  135. package/lib/sharing/sharingPane.js +2 -10
  136. package/lib/sharing/sharingPane.js.map +1 -1
  137. package/lib/slideshow/slideshowPane.js +21 -21
  138. package/lib/slideshow/slideshowPane.js.map +1 -1
  139. package/lib/socialPane.js +58 -135
  140. package/lib/socialPane.js.map +1 -1
  141. package/lib/tabbed/tabbedPane.d.ts +0 -0
  142. package/lib/tabbed/tabbedPane.d.ts.map +0 -0
  143. package/lib/tabbed/tabbedPane.js +32 -48
  144. package/lib/tabbed/tabbedPane.js.map +1 -1
  145. package/lib/tableViewPane.js +15 -9
  146. package/lib/tableViewPane.js.map +1 -1
  147. package/lib/test-import-export/common.js +8 -3
  148. package/lib/test-import-export/common.js.map +1 -1
  149. package/lib/test-import-export/edit-importer.js +10 -14
  150. package/lib/test-import-export/edit-importer.js.map +1 -1
  151. package/lib/test-import-export/testImportExport.js +0 -0
  152. package/lib/test-import-export/testImportExport.js.map +0 -0
  153. package/lib/transaction/pane.js +38 -91
  154. package/lib/transaction/pane.js.map +1 -1
  155. package/lib/transaction/period.js +27 -71
  156. package/lib/transaction/period.js.map +1 -1
  157. package/lib/trip/tripPane.js +38 -35
  158. package/lib/trip/tripPane.js.map +1 -1
  159. package/lib/trustedApplications/trustedApplications.dom.d.ts +0 -0
  160. package/lib/trustedApplications/trustedApplications.dom.d.ts.map +0 -0
  161. package/lib/trustedApplications/trustedApplications.dom.js +12 -35
  162. package/lib/trustedApplications/trustedApplications.dom.js.map +1 -1
  163. package/lib/trustedApplications/trustedApplications.test.js +6 -8
  164. package/lib/trustedApplications/trustedApplications.test.js.map +1 -1
  165. package/lib/trustedApplications/trustedApplications.utils.d.ts +0 -0
  166. package/lib/trustedApplications/trustedApplications.utils.d.ts.map +0 -0
  167. package/lib/trustedApplications/trustedApplications.utils.js +1 -11
  168. package/lib/trustedApplications/trustedApplications.utils.js.map +1 -1
  169. package/lib/trustedApplications/trustedApplications.view.d.ts +0 -0
  170. package/lib/trustedApplications/trustedApplications.view.d.ts.map +0 -0
  171. package/lib/trustedApplications/trustedApplications.view.js +38 -61
  172. package/lib/trustedApplications/trustedApplications.view.js.map +1 -1
  173. package/lib/types.d.ts +0 -0
  174. package/lib/types.d.ts.map +0 -0
  175. package/lib/types.js +0 -0
  176. package/lib/types.js.map +0 -0
  177. package/lib/ui/pane.js +30 -29
  178. package/lib/ui/pane.js.map +1 -1
  179. package/lib/versionInfo.d.ts +0 -0
  180. package/lib/versionInfo.d.ts.map +0 -0
  181. package/lib/versionInfo.js +14 -14
  182. package/lib/versionInfo.js.map +1 -1
  183. package/lib/video/videoPane.js +11 -7
  184. package/lib/video/videoPane.js.map +1 -1
  185. package/package.json +26 -26
  186. package/src/RDFXMLPane.js +2 -2
  187. package/src/argument/argumentPane.js +1 -1
  188. package/src/argument/argument_icon_v04.jpg +0 -0
  189. package/src/argument/icon_argument.png +0 -0
  190. package/src/argument/transparentyingyang.png +0 -0
  191. package/src/attach/attachPane.js +3 -3
  192. package/src/attach/tbl-paperclip-128.png +0 -0
  193. package/src/attach/tbl-paperclip-22.png +0 -0
  194. package/src/attach/tbl-paperclip-22a.png +0 -0
  195. package/src/audio/audioPane.js +3 -3
  196. package/src/chatPreferencesForm.ttl +0 -0
  197. package/src/classInstancePane.js +3 -3
  198. package/src/dashboard/basicPreferences.ts +0 -0
  199. package/src/dashboard/dashboardPane.ts +0 -0
  200. package/src/dashboard/homepage.ts +0 -0
  201. package/src/dashboard/languages/codes.html +0 -0
  202. package/src/dashboard/languages/codes.xml +0 -0
  203. package/src/dashboard/languages/codes2.txt +0 -0
  204. package/src/dashboard/languages/foo +0 -0
  205. package/src/dashboard/languages/foo.ttl +0 -0
  206. package/src/dashboard/languages/get-language-names.sh +0 -0
  207. package/src/dashboard/ontologyData.ttl +0 -0
  208. package/src/dashboard/preferencesFormText.ttl +0 -0
  209. package/src/dataContentPane.js +3 -4
  210. package/src/defaultPane.js +3 -3
  211. package/src/dokieli/Makefile +0 -0
  212. package/src/dokieli/dokieliPane.js +5 -5
  213. package/src/dokieli/new.html +0 -0
  214. package/src/dokieli/new.js +1 -1
  215. package/src/form/form-22.png +0 -0
  216. package/src/form/form-b-22.png +0 -0
  217. package/src/form/form.graffle +0 -0
  218. package/src/form/form.png +0 -0
  219. package/src/form/pane.js +2 -2
  220. package/src/form/psuedocode-notes.txt +0 -0
  221. package/src/global.d.ts +0 -0
  222. package/src/home/homePane.ts +1 -14
  223. package/src/humanReadablePane.js +0 -0
  224. package/src/imagePane.js +2 -2
  225. package/src/index.ts +1 -1
  226. package/src/internal/internalPane.ts +0 -0
  227. package/src/mainPage/footer.ts +0 -0
  228. package/src/mainPage/header.ts +0 -0
  229. package/src/mainPage/index.ts +0 -0
  230. package/src/meeting/Makefile +0 -0
  231. package/src/meeting/test/meeting1/Actions/actions.ttl +0 -0
  232. package/src/meeting/test/meeting1/Actions/config.ttl +0 -0
  233. package/src/meeting/test/meeting1/Actions/state.ttl +0 -0
  234. package/src/meeting/test/meeting1/Schedule/details.ttl +0 -0
  235. package/src/meeting/test/meeting1/Schedule/details.ttl.acl +0 -0
  236. package/src/meeting/test/meeting1/Schedule/forms.ttl +0 -0
  237. package/src/meeting/test/meeting1/Schedule/forms.ttl.acl +0 -0
  238. package/src/meeting/test/meeting1/Schedule/index.html +0 -0
  239. package/src/meeting/test/meeting1/Schedule/index.html.acl +0 -0
  240. package/src/meeting/test/meeting1/Schedule/results.ttl +0 -0
  241. package/src/meeting/test/meeting1/Schedule/results.ttl.acl +0 -0
  242. package/src/meeting/test/meeting1/SharedNotes/pad.ttl +0 -0
  243. package/src/meeting/test/meeting1/chat/chat.ttl +0 -0
  244. package/src/meeting/test/meeting1/details.ttl +0 -0
  245. package/src/meeting/test/meeting1/pad/pad.ttl +0 -0
  246. package/src/microblogPane/mbStyle.css +0 -0
  247. package/src/microblogPane/microblogPane.js +1 -1
  248. package/src/n3Pane.js +2 -2
  249. package/src/outline/context.ts +0 -0
  250. package/src/outline/licenseOptions.js +9 -8
  251. package/src/outline/manager.js +18 -20
  252. package/src/outline/manager.test.ts +6 -0
  253. package/src/outline/outlineIcons.js +4 -2
  254. package/src/outline/propertyViews.test.ts +7 -1
  255. package/src/outline/propertyViews.ts +3 -3
  256. package/src/outline/queryByExample.js +3 -9
  257. package/src/outline/userInput.js +1 -1
  258. package/src/outline/viewAsImage.ts +0 -0
  259. package/src/outline/viewAsMbox.ts +0 -0
  260. package/src/pad/images/ColourOff.ai +0 -0
  261. package/src/pad/images/ColourOff.png +0 -0
  262. package/src/pad/images/ColourOn.ai +0 -0
  263. package/src/pad/images/ColourOn.png +0 -0
  264. package/src/pad/padPane.ts +0 -0
  265. package/src/playlist/playlistPane.js +3 -3
  266. package/src/profile/editProfile.view.ts +20 -0
  267. package/src/profile/profile.dom.ts +0 -0
  268. package/src/profile/profileFormText.ttl +0 -0
  269. package/src/registerPanes.js +92 -52
  270. package/src/schedule/Makefile +0 -0
  271. package/src/schedule/formsForSchedule.js +1 -1
  272. package/src/schedule/formsForSchedule.ttl +0 -0
  273. package/src/schedule/schedulePane.js +6 -2
  274. package/src/sharing/sharingPane.ts +0 -0
  275. package/src/slideshow/slideshowPane.js +3 -6
  276. package/src/socialPane.js +4 -5
  277. package/src/style/tabbedtab.css +0 -0
  278. package/src/tabbed/tabbedPane.ts +0 -0
  279. package/src/tableViewPane.js +3 -3
  280. package/src/test-import-export/common.js +1 -1
  281. package/src/test-import-export/edit-importer.js +5 -10
  282. package/src/test-import-export/testImportExport.js +0 -0
  283. package/src/transaction/068010-3d-transparent-glass-icon-alphanumeric-dollar-sign.png +0 -0
  284. package/src/transaction/075988-3d-transparent-glass-icon-business-currency-british-pound-sc35.png +0 -0
  285. package/src/transaction/22-pixel-068010-3d-transparent-glass-icon-alphanumeric-dollar-sign.png +0 -0
  286. package/src/transaction/pane.js +3 -3
  287. package/src/transaction/period.js +2 -2
  288. package/src/transaction/thumbs_075987-3d-transparent-glass-icon-business-creditcard2.png +0 -0
  289. package/src/transaction/thumbs_075989-3d-transparent-glass-icon-business-currency-cent-sc35.png +0 -0
  290. package/src/trip/tripPane.js +3 -3
  291. package/src/trustedApplications/__snapshots__/trustedApplications.test.ts.snap +0 -0
  292. package/src/trustedApplications/trustedApplications.dom.ts +0 -0
  293. package/src/trustedApplications/trustedApplications.test.ts +4 -0
  294. package/src/trustedApplications/trustedApplications.utils.ts +0 -0
  295. package/src/trustedApplications/trustedApplications.view.ts +0 -0
  296. package/src/types.ts +0 -0
  297. package/src/ui/22-builder.png +0 -0
  298. package/src/ui/builder.graffle +0 -0
  299. package/src/ui/builder.png +0 -0
  300. package/src/ui/builder2.png +0 -0
  301. package/src/ui/pane.js +3 -3
  302. package/src/versionInfo.ts +14 -14
  303. package/src/video/videoPane.js +3 -3
  304. package/timestamp.sh +0 -0
  305. package/travis/bumpversion.js +0 -0
  306. package/tsconfig.json +0 -0
  307. package/typings/raw-loader.d.ts +0 -0
  308. package/typings/solid-namespace/index.d.ts +0 -0
  309. package/webpack.config.js +0 -0
@@ -1,17 +1,23 @@
1
1
  "use strict";
2
2
 
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports["default"] = void 0;
8
+ var UI = _interopRequireWildcard(require("solid-ui"));
9
+ var $rdf = _interopRequireWildcard(require("rdflib"));
10
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
11
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
3
12
  /* Financial Transaction Pane
4
13
  **
5
14
  ** This outline pane allows a user to interact with a transaction
6
15
  ** downloaded from a bank statement, annotting it with classes and comments,
7
16
  ** trips, etc
8
17
  */
9
- var UI = require('solid-ui');
10
-
11
- var $rdf = require('rdflib');
12
18
 
13
19
  var ns = UI.ns;
14
- module.exports = {
20
+ var _default = {
15
21
  // icon: (module.__dirname || __dirname) + '22-pixel-068010-3d-transparent-glass-icon-alphanumeric-dollar-sign.png',
16
22
  icon: UI.icons.iconBase + 'noun_106746.svg',
17
23
  name: 'transaction',
@@ -22,11 +28,13 @@ module.exports = {
22
28
  var t = kb.findTypeURIs(subject);
23
29
  if (t['http://www.w3.org/2000/10/swap/pim/qif#Transaction']) return '$$';
24
30
  if (kb.any(subject, UI.ns.qu('amount'))) return '$$$'; // In case schema not picked up
31
+
25
32
  // if (t['http://www.w3.org/2000/10/swap/pim/qif#Period']) return "period $"
26
33
 
27
34
  if (t['http://www.w3.org/ns/pim/trip#Trip']) return 'Trip $';
28
35
  return null; // No under other circumstances (while testing at least!)
29
36
  },
37
+
30
38
  render: function render(subject, context) {
31
39
  var dom = context.dom;
32
40
  var kb = context.session.store;
@@ -35,7 +43,6 @@ module.exports = {
35
43
  var TRIP = $rdf.Namespace('http://www.w3.org/ns/pim/trip#');
36
44
  var div = dom.createElement('div');
37
45
  div.setAttribute('class', 'transactionPane');
38
-
39
46
  var mention = function mention(message, style) {
40
47
  if (style === undefined) style = 'color: grey';
41
48
  var pre = dom.createElement('pre');
@@ -43,10 +50,10 @@ module.exports = {
43
50
  div.appendChild(pre);
44
51
  pre.appendChild(dom.createTextNode(message));
45
52
  };
46
-
47
53
  var complain = function complain(message) {
48
54
  return mention(message, 'color: #100; background-color: #fee');
49
55
  };
56
+
50
57
  /*
51
58
  var thisPane = this
52
59
  var rerender = function (div) {
@@ -57,89 +64,72 @@ module.exports = {
57
64
  */
58
65
  // //////////////////////////////////////////////////////////////////////////////
59
66
 
60
-
61
67
  var plist = kb.statementsMatching(subject);
62
68
  var qlist = kb.statementsMatching(undefined, undefined, subject);
63
- var t = kb.findTypeURIs(subject); // var me = authn.currentUser()
69
+ var t = kb.findTypeURIs(subject);
64
70
 
71
+ // var me = authn.currentUser()
65
72
  var predicateURIsDone = {};
66
-
67
73
  var donePredicate = function donePredicate(pred) {
68
74
  predicateURIsDone[pred.uri] = true;
69
75
  };
70
-
71
76
  var setPaneStyle = function setPaneStyle(account) {
72
77
  var mystyle = 'padding: 0.5em 1.5em 1em 1.5em; ';
73
-
74
78
  if (account) {
75
79
  var backgroundColor = kb.any(account, UI.ns.ui('backgroundColor'));
76
-
77
80
  if (backgroundColor) {
78
81
  mystyle += 'background-color: ' + backgroundColor.value + '; ';
79
82
  }
80
83
  }
81
-
82
84
  div.setAttribute('style', mystyle);
83
- }; // setPaneStyle()
85
+ };
86
+ // setPaneStyle()
87
+
84
88
  // Functions for displaying lists of transactions
85
89
  // Click on the transaction line to expand it into a pane
86
90
  // Shift-click to expand without collapsing others
87
91
 
88
-
89
92
  var d2 = function d2(n) {
90
93
  if (n === undefined) return '';
91
94
  var s = '' + n;
92
-
93
95
  if (s.indexOf('.') >= 0) {
94
96
  return s.split('.')[0] + '.' + (s.split('.')[1] + '00').slice(0, 2);
95
97
  }
96
-
97
98
  return s + '.00';
98
99
  };
99
-
100
100
  var numericCell = function numericCell(amount, suppressZero) {
101
101
  var td = dom.createElement('td');
102
-
103
102
  if (!(0.0 + amount === 0.0 && suppressZero)) {
104
103
  td.textContent = d2(amount);
105
104
  }
106
-
107
105
  td.setAttribute('style', 'width: 6em; text-align: right; ');
108
106
  return td;
109
107
  };
110
-
111
108
  var headerCell = function headerCell(str) {
112
109
  var td = dom.createElement('th');
113
110
  td.textContent = str;
114
111
  td.setAttribute('style', 'text-align: right; ');
115
112
  return td;
116
113
  };
117
-
118
114
  var oderByDate = function oderByDate(x, y) {
119
115
  var dx = kb.any(x, ns.qu('date'));
120
116
  var dy = kb.any(y, ns.qu('date'));
121
-
122
117
  if (dx !== undefined && dy !== undefined) {
123
118
  if (dx.value < dy.value) return -1;
124
119
  if (dx.value > dy.value) return 1;
125
120
  }
126
-
127
121
  if (x.uri < y.uri) return -1; // Arbitrary but repeatable
128
-
129
122
  if (x.uri > y.uri) return 1;
130
123
  return 0;
131
124
  };
132
-
133
125
  var insertedPane = function insertedPane(context, subject, paneName) {
134
126
  var p = context.session.paneRegistry.byName(paneName);
135
127
  var d = p.render(subject, context);
136
128
  d.setAttribute('style', 'border: 0.1em solid green;');
137
129
  return d;
138
130
  };
139
-
140
131
  var expandAfterRow = function expandAfterRow(dom, row, subject, paneName, solo) {
141
132
  var siblings = row.parentNode.children;
142
-
143
133
  if (solo) {
144
134
  for (var j = siblings.length - 1; j >= 0; j--) {
145
135
  if (siblings[j].expanded) {
@@ -148,23 +138,19 @@ module.exports = {
148
138
  }
149
139
  }
150
140
  }
151
-
152
141
  var tr = dom.createElement('tr');
153
142
  var td = tr.appendChild(dom.createElement('td'));
154
143
  td.setAttribute('style', 'width: 98%; padding: 1em; border: 0.1em solid grey;');
155
144
  var cols = row.children.length;
156
-
157
145
  if (row.nextSibling) {
158
146
  row.parentNode.insertBefore(tr, row.nextSibling);
159
147
  } else {
160
148
  row.parentNode.appendChild(tr);
161
149
  }
162
-
163
150
  row.expanded = tr;
164
151
  td.setAttribute('colspan', '' + cols);
165
152
  td.appendChild(insertedPane(context, subject, paneName));
166
153
  };
167
-
168
154
  var expandAfterRowOrCollapse = function expandAfterRowOrCollapse(dom, row, subject, paneName, solo) {
169
155
  if (row.expanded) {
170
156
  row.parentNode.removeChild(row.expanded);
@@ -173,29 +159,22 @@ module.exports = {
173
159
  expandAfterRow(dom, row, subject, paneName, solo);
174
160
  }
175
161
  };
176
-
177
162
  var transactionTable = function transactionTable(dom, list, filter) {
178
163
  var table = dom.createElement('table');
179
164
  table.setAttribute('style', 'padding-left: 0.5em; padding-right: 0.5em; font-size: 9pt; width: 85%;');
180
-
181
165
  var transactionRow = function transactionRow(dom, x) {
182
166
  var tr = dom.createElement('tr');
183
-
184
167
  var setTRStyle = function setTRStyle(tr, account) {
185
168
  // var mystyle = "padding: 0.5em 1.5em 1em 1.5em; "
186
169
  var mystyle = "'padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.1em;";
187
-
188
170
  if (account) {
189
171
  var backgroundColor = kb.any(account, UI.ns.ui('backgroundColor'));
190
-
191
172
  if (backgroundColor) {
192
173
  mystyle += 'background-color: ' + backgroundColor.value + '; ';
193
174
  }
194
175
  }
195
-
196
176
  tr.setAttribute('style', mystyle);
197
177
  };
198
-
199
178
  var account = kb.any(x, ns.qu('toAccount'));
200
179
  setTRStyle(tr, account);
201
180
  var c0 = tr.appendChild(dom.createElement('td'));
@@ -213,55 +192,45 @@ module.exports = {
213
192
  var amount = kb.any(x, ns.qu('in_USD'));
214
193
  c3.textContent = amount ? d2(amount.value) : '???';
215
194
  c3.setAttribute('style', 'width: 6em; text-align: right; '); // @@ decimal alignment?
216
-
217
195
  tr.addEventListener('click', function (e) {
218
196
  // solo unless shift key
219
197
  expandAfterRowOrCollapse(dom, tr, x, 'transaction', !e.shiftKey);
220
198
  }, false);
221
199
  return tr;
222
200
  };
223
-
224
201
  var list2 = filter ? list.filter(filter) : list.slice(); // don't sort a paramater passed in place
225
-
226
202
  list2.sort(oderByDate);
227
-
228
203
  for (var i = 0; i < list2.length; i++) {
229
204
  table.appendChild(transactionRow(dom, list2[i]));
230
205
  }
231
-
232
206
  return table;
233
- }; // Render a single transaction
234
- // This works only if enough metadata about the properties can drive the RDFS
235
- // (or actual type statements whichtypically are NOT there on)
207
+ };
236
208
 
209
+ // Render a single transaction
237
210
 
211
+ // This works only if enough metadata about the properties can drive the RDFS
212
+ // (or actual type statements whichtypically are NOT there on)
238
213
  if (t['http://www.w3.org/2000/10/swap/pim/qif#Transaction'] || kb.any(subject, ns.qu('toAccount'))) {
239
214
  // var trip = kb.any(subject, WF('trip'))
240
215
  donePredicate(ns.rdf('type'));
241
216
  var account = kb.any(subject, UI.ns.qu('toAccount'));
242
217
  setPaneStyle(account);
243
-
244
218
  if (!account) {
245
219
  complain('(Error: There is no bank account known for this transaction <' + subject.uri + '>,\n -- every transaction needs one.)');
246
220
  }
247
-
248
221
  var store = null;
249
222
  var statement = kb.any(subject, UI.ns.qu('accordingTo'));
250
-
251
223
  if (statement === undefined) {
252
224
  complain('(Error: There is no back link to the original data source foir this transaction <' + subject.uri + ">,\nso I can't tell how to annotate it.)");
253
225
  } else {
254
226
  store = statement !== undefined ? kb.any(statement, UI.ns.qu('annotationStore')) : null;
255
-
256
227
  if (store === undefined) {
257
228
  complain('(There is no annotation document for this statement\n<' + statement.uri + '>,\nso you cannot classify this transaction.)');
258
229
  }
259
230
  }
260
-
261
231
  var nav = dom.createElement('div');
262
232
  nav.setAttribute('style', 'float:right');
263
233
  div.appendChild(nav);
264
-
265
234
  var navLink = function navLink(pred, label) {
266
235
  donePredicate(pred);
267
236
  var obj = kb.any(subject, pred);
@@ -272,11 +241,11 @@ module.exports = {
272
241
  nav.appendChild(a).textContent = label || UI.utils.label(obj);
273
242
  nav.appendChild(dom.createElement('br'));
274
243
  };
275
-
276
244
  navLink(UI.ns.qu('toAccount'));
277
245
  navLink(UI.ns.qu('accordingTo'), 'Statement');
278
- navLink(TRIP('trip')); // Basic data:
246
+ navLink(TRIP('trip'));
279
247
 
248
+ // Basic data:
280
249
  var table = dom.createElement('table');
281
250
  div.appendChild(table);
282
251
  var preds = ['date', 'payee', 'amount', 'in_USD', 'currency'].map(Q);
@@ -287,24 +256,23 @@ module.exports = {
287
256
  return '<tr><td style="text-align: right; padding-right: 0.6em">' + UI.utils.labelForXML(p) + '</td><td style="font-weight: bold;">' + s + '</td></tr>';
288
257
  }).join('\n');
289
258
  table.innerHTML = inner;
290
-
291
259
  var complainIfBad = function complainIfBad(ok, body) {
292
- if (ok) {// setModifiedDate(store, kb, store)
260
+ if (ok) {
261
+ // setModifiedDate(store, kb, store)
293
262
  // rerender(div) // deletes the new trip form
294
263
  } else complain('Sorry, failed to save your change:\n' + body);
295
- }; // What trips do we know about?
296
- // Classify:
264
+ };
297
265
 
266
+ // What trips do we know about?
298
267
 
268
+ // Classify:
299
269
  if (store) {
300
270
  kb.fetcher.nowOrWhenFetched(store.uri, subject, function (ok, body) {
301
271
  if (!ok) complain('Cannot load store ' + store + ' ' + body);
302
272
  var calendarYear = kb.any(store, ns.qu('calendarYear'));
303
-
304
273
  var renderCatgorySelectors = function renderCatgorySelectors() {
305
274
  div.insertBefore(UI.widgets.makeSelectForNestedCategory(dom, kb, subject, UI.ns.qu('Classified'), store, complainIfBad), table.nextSibling);
306
275
  };
307
-
308
276
  if (kb.any(undefined, ns.rdfs('subClassOf'), ns.qu.Classified)) {
309
277
  renderCatgorySelectors();
310
278
  } else if (calendarYear) {
@@ -320,12 +288,10 @@ module.exports = {
320
288
  } else {
321
289
  console.log("Can't get categories, because no calendarYear");
322
290
  }
323
-
324
291
  div.appendChild(UI.widgets.makeDescription(dom, kb, subject, UI.ns.rdfs('comment'), store, complainIfBad));
325
292
  var trips = kb.statementsMatching(undefined, TRIP('trip'), undefined, store).map(function (st) {
326
293
  return st.object;
327
294
  }); // @@ Use rdfs
328
-
329
295
  var trips2 = kb.each(undefined, UI.ns.rdf('type'), TRIP('Trip'));
330
296
  trips = trips.concat(trips2).sort(); // @@ Unique
331
297
 
@@ -341,7 +307,6 @@ module.exports = {
341
307
  return pair[1];
342
308
  });
343
309
  };
344
-
345
310
  trips = sortedBy(kb, trips, UI.ns.cal('dtstart'), true); // Reverse chron
346
311
 
347
312
  if (trips.length > 1) {
@@ -357,8 +322,9 @@ module.exports = {
357
322
  }
358
323
  }, store, complainIfBad));
359
324
  }
325
+ div.appendChild(dom.createElement('br'));
360
326
 
361
- div.appendChild(dom.createElement('br')); // Add in simple comments about the transaction
327
+ // Add in simple comments about the transaction
362
328
 
363
329
  var outliner = context.getOutliner(dom);
364
330
  donePredicate(ns.rdfs('comment')); // Done above
@@ -366,8 +332,8 @@ module.exports = {
366
332
  UI.widgets.attachmentList(dom, subject, div);
367
333
  donePredicate(ns.wf('attachment'));
368
334
  div.appendChild(dom.createElement('tr')).setAttribute('style', 'height: 1em'); // spacer
369
- // Remaining properties
370
335
 
336
+ // Remaining properties
371
337
  outliner.appendPropertyTRs(div, plist, false, function (pred, _inverse) {
372
338
  return !(pred.uri in predicateURIsDone);
373
339
  });
@@ -375,12 +341,13 @@ module.exports = {
375
341
  return !(pred.uri in predicateURIsDone);
376
342
  });
377
343
  }); // fetch
378
- } // end of render tranasaction instance
344
+ }
345
+ // end of render tranasaction instance
346
+
379
347
  // ////////////////////////////////////////////////////////////////////
380
348
  //
381
349
  // Render the transactions in a Trip
382
350
  //
383
-
384
351
  } else if (t['http://www.w3.org/ns/pim/trip#Trip']) {
385
352
  /*
386
353
  var query = new $rdf.Query(UI.utils.label(subject))
@@ -415,25 +382,19 @@ module.exports = {
415
382
  var year = date ? ('' + date.value).slice(0, 4) : '????';
416
383
  var ty = kb.the(t, ns.rdf('type')); // @@ find most specific type
417
384
  // complain(" -- one trans: "+t.uri + ' -> '+kb.any(t, UI.ns.qu('in_USD')))
418
-
419
385
  if (!ty) ty = UI.ns.qu('ErrorNoType');
420
-
421
386
  if (ty && ty.uri) {
422
387
  var tyuri = ty.uri;
423
388
  if (!yearTotal[year]) yearTotal[year] = 0.0;
424
389
  if (!yearCategoryTotal[year]) yearCategoryTotal[year] = {};
425
390
  if (!total[tyuri]) total[tyuri] = 0.0;
426
-
427
391
  if (!yearCategoryTotal[year][tyuri]) {
428
392
  yearCategoryTotal[year][tyuri] = 0.0;
429
393
  }
430
-
431
394
  var lit = kb.any(t, UI.ns.qu('in_USD'));
432
-
433
395
  if (!lit) {
434
396
  complain('@@ No amount in USD: ' + lit + ' for ' + t);
435
397
  }
436
-
437
398
  if (lit) {
438
399
  var amount = parseFloat(lit.value);
439
400
  total[tyuri] += amount;
@@ -446,7 +407,6 @@ module.exports = {
446
407
  var grandTotal = 0.0;
447
408
  var years = [];
448
409
  var i;
449
-
450
410
  for (var y in yearCategoryTotal) {
451
411
  // @@ TODO: Write away the need for exception on next line
452
412
  // eslint-disable-next-line no-prototype-builtins
@@ -454,24 +414,19 @@ module.exports = {
454
414
  years.push(y);
455
415
  }
456
416
  }
457
-
458
417
  years.sort();
459
418
  var ny = years.length;
460
419
  var cell;
461
420
  var table = div.appendChild(dom.createElement('table'));
462
421
  table.setAttribute('style', 'font-size: 120%; margin-left:auto; margin-right:1em; margin-top: 1em; border: 0.05em solid gray; padding: 1em;');
463
-
464
422
  if (ny > 1) {
465
423
  var header = table.appendChild(dom.createElement('tr'));
466
424
  header.appendChild(headerCell(''));
467
-
468
425
  for (i = 0; i < ny; i++) {
469
426
  header.appendChild(headerCell(years[i]));
470
427
  }
471
-
472
428
  header.appendChild(headerCell('total'));
473
429
  }
474
-
475
430
  for (var uri in total) {
476
431
  // @@ TODO: Write away the need for exception on next line
477
432
  // eslint-disable-next-line no-prototype-builtins
@@ -480,42 +435,35 @@ module.exports = {
480
435
  grandTotal += total[uri];
481
436
  }
482
437
  }
483
-
484
438
  types.sort();
485
439
  var row, label, z;
486
-
487
440
  for (var j = 0; j < types.length; j++) {
488
441
  var cat = kb.sym(types[j]);
489
442
  row = table.appendChild(dom.createElement('tr'));
490
443
  label = row.appendChild(dom.createElement('td'));
491
444
  label.textContent = UI.utils.label(cat);
492
-
493
445
  if (ny > 1) {
494
446
  for (i = 0; i < ny; i++) {
495
447
  z = yearCategoryTotal[years[i]][types[j]];
496
448
  cell = row.appendChild(numericCell(z, true));
497
449
  }
498
450
  }
499
-
500
451
  row.appendChild(numericCell(total[types[j]], true));
501
- } // Trailing totals
502
-
452
+ }
503
453
 
454
+ // Trailing totals
504
455
  if (types.length > 1) {
505
456
  row = table.appendChild(dom.createElement('tr'));
506
457
  row.appendChild(headerCell('total'));
507
-
508
458
  if (ny > 1) {
509
459
  for (i = 0; i < ny; i++) {
510
460
  z = yearTotal[years[i]];
511
461
  cell = row.appendChild(numericCell(z ? d2(z) : ''));
512
462
  }
513
463
  }
514
-
515
464
  cell = row.appendChild(numericCell(grandTotal));
516
465
  cell.setAttribute('style', 'font-weight: bold; text-align: right;');
517
466
  }
518
-
519
467
  var tab = transactionTable(dom, trans);
520
468
  tab.setAttribute('style', 'margin-left:auto; margin-right:1em; margin-top: 1em; border: padding: 1em;');
521
469
  div.appendChild(tab);
@@ -524,12 +472,11 @@ module.exports = {
524
472
  complain('Error loading transactions: ' + e);
525
473
  });
526
474
  };
527
-
528
475
  calculations();
529
476
  } // if
530
477
 
531
-
532
478
  return div;
533
479
  }
534
480
  }; // ends
481
+ exports["default"] = _default;
535
482
  //# sourceMappingURL=pane.js.map