solid-panes 3.7.2-f743b265 → 3.7.3-125af630
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.
- package/dist/dashboard/basicPreferences.js +155 -0
- package/dist/dashboard/basicPreferences.js.map +1 -0
- package/dist/dashboard/dashboardPane.js +63 -0
- package/dist/dashboard/dashboardPane.js.map +1 -0
- package/dist/dashboard/homepage.js +63 -0
- package/dist/dashboard/homepage.js.map +1 -0
- package/dist/home/homePane.js +68 -0
- package/dist/home/homePane.js.map +1 -0
- package/dist/index.js +48 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/internalPane.js +195 -0
- package/dist/internal/internalPane.js.map +1 -0
- package/dist/mainPage/footer.js +16 -0
- package/dist/mainPage/footer.js.map +1 -0
- package/dist/mainPage/header.js +84 -0
- package/dist/mainPage/header.js.map +1 -0
- package/{lib → dist}/mainPage/index.d.ts.map +1 -1
- package/dist/mainPage/index.js +30 -0
- package/dist/mainPage/index.js.map +1 -0
- package/dist/outline/context.js +13 -0
- package/dist/outline/context.js.map +1 -0
- package/dist/outline/propertyViews.js +33 -0
- package/dist/outline/propertyViews.js.map +1 -0
- package/dist/outline/viewAsImage.js +7 -0
- package/dist/outline/viewAsImage.js.map +1 -0
- package/{lib → dist}/outline/viewAsMbox.js +4 -14
- package/dist/outline/viewAsMbox.js.map +1 -0
- package/dist/pad/padPane.js +420 -0
- package/dist/pad/padPane.js.map +1 -0
- package/dist/sharing/sharingPane.js +45 -0
- package/dist/sharing/sharingPane.js.map +1 -0
- package/dist/tabbed/tabbedPane.js +55 -0
- package/dist/tabbed/tabbedPane.js.map +1 -0
- package/dist/trustedApplications/trustedApplications.dom.js +158 -0
- package/dist/trustedApplications/trustedApplications.dom.js.map +1 -0
- package/dist/trustedApplications/trustedApplications.utils.js +24 -0
- package/dist/trustedApplications/trustedApplications.utils.js.map +1 -0
- package/dist/trustedApplications/trustedApplications.view.js +62 -0
- package/dist/trustedApplications/trustedApplications.view.js.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/versionInfo.js +31 -0
- package/dist/versionInfo.js.map +1 -0
- package/package.json +34 -22
- package/Documentation/VisualLanguage.html +0 -538
- package/Documentation/conventions.md +0 -333
- package/coverage/clover.xml +0 -152
- package/coverage/coverage-final.json +0 -6
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -131
- package/coverage/lcov-report/outline/index.html +0 -161
- package/coverage/lcov-report/outline/outlineIcons.js.html +0 -565
- package/coverage/lcov-report/outline/propertyViews.ts.html +0 -196
- package/coverage/lcov-report/outline/viewAsImage.ts.html +0 -121
- package/coverage/lcov-report/outline/viewAsMbox.ts.html +0 -127
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -210
- package/coverage/lcov-report/trustedApplications/index.html +0 -116
- package/coverage/lcov-report/trustedApplications/trustedApplications.utils.ts.html +0 -238
- package/coverage/lcov.info +0 -204
- package/dev/index.html +0 -28
- package/dev/loader.ts +0 -91
- package/dev/pane/index.ts +0 -10
- package/doc/images/panes-for-classes.epgz +0 -0
- package/doc/images/panes-for-classes.svg +0 -609
- package/eslint.config.mjs +0 -34
- package/jest.config.js +0 -27
- package/jest.setup.ts +0 -4
- package/lib/RDFXMLPane.js +0 -59
- package/lib/RDFXMLPane.js.map +0 -1
- package/lib/argument/argumentPane.js +0 -62
- package/lib/argument/argumentPane.js.map +0 -1
- package/lib/attach/attachPane.js +0 -404
- package/lib/attach/attachPane.js.map +0 -1
- package/lib/audio/audioPane.js +0 -183
- package/lib/audio/audioPane.js.map +0 -1
- package/lib/classInstancePane.js +0 -93
- package/lib/classInstancePane.js.map +0 -1
- package/lib/dashboard/basicPreferences.js +0 -229
- package/lib/dashboard/basicPreferences.js.map +0 -1
- package/lib/dashboard/dashboardPane.js +0 -73
- package/lib/dashboard/dashboardPane.js.map +0 -1
- package/lib/dashboard/homepage.js +0 -86
- package/lib/dashboard/homepage.js.map +0 -1
- package/lib/dataContentPane.js +0 -259
- package/lib/dataContentPane.js.map +0 -1
- package/lib/defaultPane.js +0 -76
- package/lib/defaultPane.js.map +0 -1
- package/lib/dokieli/dokieliPane.js +0 -173
- package/lib/dokieli/dokieliPane.js.map +0 -1
- package/lib/dokieli/new.js +0 -9
- package/lib/dokieli/new.js.map +0 -1
- package/lib/form/pane.js +0 -186
- package/lib/form/pane.js.map +0 -1
- package/lib/global.d.js +0 -2
- package/lib/global.d.js.map +0 -1
- package/lib/home/homePane.js +0 -91
- package/lib/home/homePane.js.map +0 -1
- package/lib/humanReadablePane.js +0 -138
- package/lib/humanReadablePane.js.map +0 -1
- package/lib/imagePane.js +0 -71
- package/lib/imagePane.js.map +0 -1
- package/lib/index.js +0 -112
- package/lib/index.js.map +0 -1
- package/lib/internal/internalPane.js +0 -184
- package/lib/internal/internalPane.js.map +0 -1
- package/lib/mainPage/footer.js +0 -22
- package/lib/mainPage/footer.js.map +0 -1
- package/lib/mainPage/header.js +0 -152
- package/lib/mainPage/header.js.map +0 -1
- package/lib/mainPage/index.js +0 -42
- package/lib/mainPage/index.js.map +0 -1
- package/lib/microblogPane/microblogPane.js +0 -1032
- package/lib/microblogPane/microblogPane.js.map +0 -1
- package/lib/n3Pane.js +0 -57
- package/lib/n3Pane.js.map +0 -1
- package/lib/outline/context.js +0 -19
- package/lib/outline/context.js.map +0 -1
- package/lib/outline/manager.js +0 -2264
- package/lib/outline/manager.js.map +0 -1
- package/lib/outline/manager.test.d.ts +0 -2
- package/lib/outline/manager.test.d.ts.map +0 -1
- package/lib/outline/manager.test.js +0 -210
- package/lib/outline/manager.test.js.map +0 -1
- package/lib/outline/outlineIcons.js +0 -128
- package/lib/outline/outlineIcons.js.map +0 -1
- package/lib/outline/propertyViews.js +0 -44
- package/lib/outline/propertyViews.js.map +0 -1
- package/lib/outline/propertyViews.test.d.ts +0 -2
- package/lib/outline/propertyViews.test.d.ts.map +0 -1
- package/lib/outline/propertyViews.test.js +0 -27
- package/lib/outline/propertyViews.test.js.map +0 -1
- package/lib/outline/queryByExample.js +0 -286
- package/lib/outline/queryByExample.js.map +0 -1
- package/lib/outline/userInput.js +0 -1817
- package/lib/outline/userInput.js.map +0 -1
- package/lib/outline/viewAsImage.js +0 -17
- package/lib/outline/viewAsImage.js.map +0 -1
- package/lib/outline/viewAsMbox.js.map +0 -1
- package/lib/pad/padPane.js +0 -417
- package/lib/pad/padPane.js.map +0 -1
- package/lib/playlist/playlistPane.js +0 -125
- package/lib/playlist/playlistPane.js.map +0 -1
- package/lib/registerPanes.js +0 -146
- package/lib/registerPanes.js.map +0 -1
- package/lib/schedule/formsForSchedule.js +0 -8
- package/lib/schedule/formsForSchedule.js.map +0 -1
- package/lib/schedule/schedulePane.js +0 -895
- package/lib/schedule/schedulePane.js.map +0 -1
- package/lib/sharing/sharingPane.js +0 -49
- package/lib/sharing/sharingPane.js.map +0 -1
- package/lib/slideshow/slideshowPane.js +0 -84
- package/lib/slideshow/slideshowPane.js.map +0 -1
- package/lib/socialPane.js +0 -431
- package/lib/socialPane.js.map +0 -1
- package/lib/tabbed/tabbedPane.js +0 -72
- package/lib/tabbed/tabbedPane.js.map +0 -1
- package/lib/tableViewPane.js +0 -58
- package/lib/tableViewPane.js.map +0 -1
- package/lib/test-import-export/common.js +0 -12
- package/lib/test-import-export/common.js.map +0 -1
- package/lib/test-import-export/edit-importer.js +0 -25
- package/lib/test-import-export/edit-importer.js.map +0 -1
- package/lib/test-import-export/testImportExport.js +0 -2
- package/lib/test-import-export/testImportExport.js.map +0 -1
- package/lib/transaction/pane.js +0 -479
- package/lib/transaction/pane.js.map +0 -1
- package/lib/transaction/period.js +0 -325
- package/lib/transaction/period.js.map +0 -1
- package/lib/trip/tripPane.js +0 -176
- package/lib/trip/tripPane.js.map +0 -1
- package/lib/trustedApplications/trustedApplications.dom.js +0 -177
- package/lib/trustedApplications/trustedApplications.dom.js.map +0 -1
- package/lib/trustedApplications/trustedApplications.test.d.ts +0 -2
- package/lib/trustedApplications/trustedApplications.test.d.ts.map +0 -1
- package/lib/trustedApplications/trustedApplications.test.js +0 -64
- package/lib/trustedApplications/trustedApplications.test.js.map +0 -1
- package/lib/trustedApplications/trustedApplications.utils.js +0 -34
- package/lib/trustedApplications/trustedApplications.utils.js.map +0 -1
- package/lib/trustedApplications/trustedApplications.view.js +0 -87
- package/lib/trustedApplications/trustedApplications.view.js.map +0 -1
- package/lib/types.js +0 -6
- package/lib/types.js.map +0 -1
- package/lib/ui/pane.js +0 -148
- package/lib/ui/pane.js.map +0 -1
- package/lib/versionInfo.d.ts +0 -34
- package/lib/versionInfo.d.ts.map +0 -1
- package/lib/versionInfo.js +0 -39
- package/lib/versionInfo.js.map +0 -1
- package/lib/video/videoPane.js +0 -44
- package/lib/video/videoPane.js.map +0 -1
- package/src/RDFXMLPane.js +0 -60
- package/src/argument/argumentPane.js +0 -65
- package/src/argument/argument_icon_v04.jpg +0 -0
- package/src/argument/icon_argument.png +0 -0
- package/src/argument/transparentyingyang.png +0 -0
- package/src/attach/attachPane.js +0 -508
- package/src/attach/tbl-paperclip-128.png +0 -0
- package/src/attach/tbl-paperclip-22.png +0 -0
- package/src/attach/tbl-paperclip-22a.png +0 -0
- package/src/audio/audioPane.js +0 -197
- package/src/chatPreferencesForm.ttl +0 -12
- package/src/classInstancePane.js +0 -110
- package/src/dashboard/basicPreferences.ts +0 -201
- package/src/dashboard/dashboardPane.ts +0 -83
- package/src/dashboard/homepage.ts +0 -72
- package/src/dashboard/languages/codes.html +0 -8611
- package/src/dashboard/languages/codes.xml +0 -3563
- package/src/dashboard/languages/codes2.txt +0 -170
- package/src/dashboard/languages/foo +0 -70
- package/src/dashboard/languages/foo.ttl +0 -0
- package/src/dashboard/languages/get-language-names.sh +0 -12
- package/src/dashboard/ontologyData.ttl +0 -35
- package/src/dashboard/preferencesFormText.ttl +0 -18
- package/src/dataContentPane.js +0 -290
- package/src/defaultPane.js +0 -102
- package/src/dokieli/Makefile +0 -6
- package/src/dokieli/dokieliPane.js +0 -190
- package/src/dokieli/new.html +0 -30
- package/src/dokieli/new.js +0 -22
- package/src/form/form-22.png +0 -0
- package/src/form/form-b-22.png +0 -0
- package/src/form/form.graffle +0 -0
- package/src/form/form.png +0 -0
- package/src/form/pane.js +0 -217
- package/src/form/psuedocode-notes.txt +0 -57
- package/src/global.d.ts +0 -4
- package/src/home/homePane.ts +0 -72
- package/src/humanReadablePane.js +0 -150
- package/src/imagePane.js +0 -75
- package/src/index.ts +0 -71
- package/src/internal/internalPane.ts +0 -263
- package/src/mainPage/footer.ts +0 -19
- package/src/mainPage/header.ts +0 -79
- package/src/mainPage/index.ts +0 -20
- package/src/meeting/Makefile +0 -3
- package/src/meeting/test/meeting1/Actions/actions.ttl +0 -14
- package/src/meeting/test/meeting1/Actions/config.ttl +0 -16
- package/src/meeting/test/meeting1/Actions/state.ttl +0 -30
- package/src/meeting/test/meeting1/Schedule/details.ttl +0 -34
- package/src/meeting/test/meeting1/Schedule/details.ttl.acl +0 -20
- package/src/meeting/test/meeting1/Schedule/forms.ttl +0 -75
- package/src/meeting/test/meeting1/Schedule/forms.ttl.acl +0 -20
- package/src/meeting/test/meeting1/Schedule/index.html +0 -72
- package/src/meeting/test/meeting1/Schedule/index.html.acl +0 -20
- package/src/meeting/test/meeting1/Schedule/results.ttl +0 -15
- package/src/meeting/test/meeting1/Schedule/results.ttl.acl +0 -20
- package/src/meeting/test/meeting1/SharedNotes/pad.ttl +0 -23
- package/src/meeting/test/meeting1/chat/chat.ttl +0 -1
- package/src/meeting/test/meeting1/details.ttl +0 -35
- package/src/meeting/test/meeting1/pad/pad.ttl +0 -16
- package/src/microblogPane/mbStyle.css +0 -267
- package/src/microblogPane/microblogPane.js +0 -1412
- package/src/n3Pane.js +0 -56
- package/src/outline/context.ts +0 -21
- package/src/outline/manager.js +0 -2384
- package/src/outline/manager.test.ts +0 -189
- package/src/outline/outlineIcons.js +0 -160
- package/src/outline/propertyViews.test.ts +0 -36
- package/src/outline/propertyViews.ts +0 -37
- package/src/outline/queryByExample.js +0 -296
- package/src/outline/userInput.js +0 -2373
- package/src/outline/viewAsImage.ts +0 -12
- package/src/outline/viewAsMbox.ts +0 -14
- package/src/pad/images/ColourOff.ai +2 -872
- package/src/pad/images/ColourOff.png +0 -0
- package/src/pad/images/ColourOn.ai +1 -935
- package/src/pad/images/ColourOn.png +0 -0
- package/src/pad/padPane.ts +0 -559
- package/src/playlist/playlistPane.js +0 -161
- package/src/registerPanes.js +0 -147
- package/src/schedule/Makefile +0 -6
- package/src/schedule/formsForSchedule.js +0 -117
- package/src/schedule/formsForSchedule.ttl +0 -115
- package/src/schedule/schedulePane.js +0 -1201
- package/src/sharing/sharingPane.ts +0 -49
- package/src/slideshow/slideshowPane.js +0 -80
- package/src/socialPane.js +0 -523
- package/src/style/tabbedtab.css +0 -1347
- package/src/tabbed/tabbedPane.ts +0 -60
- package/src/tableViewPane.js +0 -51
- package/src/test-import-export/common.js +0 -6
- package/src/test-import-export/edit-importer.js +0 -20
- package/src/test-import-export/testImportExport.js +0 -0
- package/src/transaction/068010-3d-transparent-glass-icon-alphanumeric-dollar-sign.png +0 -0
- package/src/transaction/075988-3d-transparent-glass-icon-business-currency-british-pound-sc35.png +0 -0
- package/src/transaction/22-pixel-068010-3d-transparent-glass-icon-alphanumeric-dollar-sign.png +0 -0
- package/src/transaction/pane.js +0 -629
- package/src/transaction/period.js +0 -374
- package/src/transaction/thumbs_075987-3d-transparent-glass-icon-business-creditcard2.png +0 -0
- package/src/transaction/thumbs_075989-3d-transparent-glass-icon-business-currency-cent-sc35.png +0 -0
- package/src/trip/tripPane.js +0 -176
- package/src/trustedApplications/__snapshots__/trustedApplications.test.ts.snap +0 -176
- package/src/trustedApplications/trustedApplications.dom.ts +0 -276
- package/src/trustedApplications/trustedApplications.test.ts +0 -82
- package/src/trustedApplications/trustedApplications.utils.ts +0 -51
- package/src/trustedApplications/trustedApplications.view.ts +0 -80
- package/src/types.ts +0 -34
- package/src/ui/22-builder.png +0 -0
- package/src/ui/builder.graffle +0 -0
- package/src/ui/builder.png +0 -0
- package/src/ui/builder2.png +0 -0
- package/src/ui/pane.js +0 -226
- package/src/versionInfo.ts +0 -32
- package/src/video/videoPane.js +0 -44
- package/timestamp.sh +0 -13
- package/travis/bumpversion.js +0 -29
- package/tsconfig.json +0 -78
- package/typings/raw-loader.d.ts +0 -4
- package/typings/solid-namespace/index.d.ts +0 -9
- package/webpack.config.js +0 -41
- /package/{lib → dist}/dashboard/basicPreferences.d.ts +0 -0
- /package/{lib → dist}/dashboard/basicPreferences.d.ts.map +0 -0
- /package/{lib → dist}/dashboard/dashboardPane.d.ts +0 -0
- /package/{lib → dist}/dashboard/dashboardPane.d.ts.map +0 -0
- /package/{lib → dist}/dashboard/homepage.d.ts +0 -0
- /package/{lib → dist}/dashboard/homepage.d.ts.map +0 -0
- /package/{lib → dist}/home/homePane.d.ts +0 -0
- /package/{lib → dist}/home/homePane.d.ts.map +0 -0
- /package/{lib → dist}/index.d.ts +0 -0
- /package/{lib → dist}/index.d.ts.map +0 -0
- /package/{lib → dist}/internal/internalPane.d.ts +0 -0
- /package/{lib → dist}/internal/internalPane.d.ts.map +0 -0
- /package/{lib → dist}/mainPage/footer.d.ts +0 -0
- /package/{lib → dist}/mainPage/footer.d.ts.map +0 -0
- /package/{lib → dist}/mainPage/header.d.ts +0 -0
- /package/{lib → dist}/mainPage/header.d.ts.map +0 -0
- /package/{lib → dist}/mainPage/index.d.ts +0 -0
- /package/{lib → dist}/outline/context.d.ts +0 -0
- /package/{lib → dist}/outline/context.d.ts.map +0 -0
- /package/{lib → dist}/outline/propertyViews.d.ts +0 -0
- /package/{lib → dist}/outline/propertyViews.d.ts.map +0 -0
- /package/{lib → dist}/outline/viewAsImage.d.ts +0 -0
- /package/{lib → dist}/outline/viewAsImage.d.ts.map +0 -0
- /package/{lib → dist}/outline/viewAsMbox.d.ts +0 -0
- /package/{lib → dist}/outline/viewAsMbox.d.ts.map +0 -0
- /package/{lib → dist}/pad/padPane.d.ts +0 -0
- /package/{lib → dist}/pad/padPane.d.ts.map +0 -0
- /package/{lib → dist}/sharing/sharingPane.d.ts +0 -0
- /package/{lib → dist}/sharing/sharingPane.d.ts.map +0 -0
- /package/{lib → dist}/tabbed/tabbedPane.d.ts +0 -0
- /package/{lib → dist}/tabbed/tabbedPane.d.ts.map +0 -0
- /package/{lib → dist}/trustedApplications/trustedApplications.dom.d.ts +0 -0
- /package/{lib → dist}/trustedApplications/trustedApplications.dom.d.ts.map +0 -0
- /package/{lib → dist}/trustedApplications/trustedApplications.utils.d.ts +0 -0
- /package/{lib → dist}/trustedApplications/trustedApplications.utils.d.ts.map +0 -0
- /package/{lib → dist}/trustedApplications/trustedApplications.view.d.ts +0 -0
- /package/{lib → dist}/trustedApplications/trustedApplications.view.d.ts.map +0 -0
- /package/{lib → dist}/types.d.ts +0 -0
- /package/{lib → dist}/types.d.ts.map +0 -0
package/lib/tableViewPane.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.tableViewPane = void 0;
|
|
8
|
-
var UI = _interopRequireWildcard(require("solid-ui"));
|
|
9
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
10
|
-
// Format an array of RDF statements as an HTML table.
|
|
11
|
-
//
|
|
12
|
-
// This can operate in one of three modes: when the class of object is given
|
|
13
|
-
// or when the source document from which data is taken is given,
|
|
14
|
-
// or if a prepared query object is given.
|
|
15
|
-
// (In principle it could operate with neither class nor document
|
|
16
|
-
// given but typically
|
|
17
|
-
// there would be too much data.)
|
|
18
|
-
// When the tableClass is not given, it looks for common classes in the data,
|
|
19
|
-
// and gives the user the option.
|
|
20
|
-
//
|
|
21
|
-
// 2008 Written, Ilaria Liccardi
|
|
22
|
-
// 2014 core functionality now in common/table.js -timbl
|
|
23
|
-
|
|
24
|
-
// ///////////////////////////////////////////////////////////////////
|
|
25
|
-
|
|
26
|
-
// Table view pane -- view of a class as a table of properties of class members
|
|
27
|
-
|
|
28
|
-
var tableViewPane = exports.tableViewPane = {
|
|
29
|
-
icon: UI.icons.originalIconBase + 'table.png',
|
|
30
|
-
name: 'tableOfClass',
|
|
31
|
-
label: function label(subject, context) {
|
|
32
|
-
var store = context.session.store;
|
|
33
|
-
// if (!store.holds(subject, UI.ns.rdf('type'),UI.ns.rdfs('Class'))) return null
|
|
34
|
-
if (!store.any(undefined, UI.ns.rdf('type'), subject)) {
|
|
35
|
-
return null;
|
|
36
|
-
}
|
|
37
|
-
var n = store.statementsMatching(undefined, UI.ns.rdf('type'), subject).length;
|
|
38
|
-
if (n === 0) {
|
|
39
|
-
// None, suppress pane
|
|
40
|
-
return null;
|
|
41
|
-
}
|
|
42
|
-
if (n > 15) {
|
|
43
|
-
// @@ At the moment this pane can be slow with too many @@ fixme by using limits
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
return UI.utils.label(subject) + ' table';
|
|
47
|
-
},
|
|
48
|
-
render: function render(subject, context) {
|
|
49
|
-
var myDocument = context.dom;
|
|
50
|
-
var div = myDocument.createElement('div');
|
|
51
|
-
div.setAttribute('class', 'tablePane');
|
|
52
|
-
div.appendChild(UI.table(myDocument, {
|
|
53
|
-
tableClass: subject
|
|
54
|
-
}));
|
|
55
|
-
return div;
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
//# sourceMappingURL=tableViewPane.js.map
|
package/lib/tableViewPane.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tableViewPane.js","names":["UI","_interopRequireWildcard","require","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","_typeof","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","tableViewPane","exports","icon","icons","originalIconBase","name","label","subject","context","store","session","any","undefined","ns","rdf","statementsMatching","length","utils","render","myDocument","dom","div","createElement","setAttribute","appendChild","table","tableClass"],"sources":["../src/tableViewPane.js"],"sourcesContent":["// Format an array of RDF statements as an HTML table.\n//\n// This can operate in one of three modes: when the class of object is given\n// or when the source document from which data is taken is given,\n// or if a prepared query object is given.\n// (In principle it could operate with neither class nor document\n// given but typically\n// there would be too much data.)\n// When the tableClass is not given, it looks for common classes in the data,\n// and gives the user the option.\n//\n// 2008 Written, Ilaria Liccardi\n// 2014 core functionality now in common/table.js -timbl\n\n// ///////////////////////////////////////////////////////////////////\n\n// Table view pane -- view of a class as a table of properties of class members\nimport * as UI from 'solid-ui'\n\nexport const tableViewPane = {\n icon: UI.icons.originalIconBase + 'table.png',\n\n name: 'tableOfClass',\n\n label: function (subject, context) {\n const store = context.session.store\n // if (!store.holds(subject, UI.ns.rdf('type'),UI.ns.rdfs('Class'))) return null\n if (!store.any(undefined, UI.ns.rdf('type'), subject)) {\n return null\n }\n const n = store.statementsMatching(undefined, UI.ns.rdf('type'), subject)\n .length\n if (n === 0) {\n // None, suppress pane\n return null\n }\n if (n > 15) {\n // @@ At the moment this pane can be slow with too many @@ fixme by using limits\n return null\n }\n return UI.utils.label(subject) + ' table'\n },\n\n render: function (subject, context) {\n const myDocument = context.dom\n const div = myDocument.createElement('div')\n div.setAttribute('class', 'tablePane')\n div.appendChild(UI.table(myDocument, { tableClass: subject }))\n return div\n }\n}\n"],"mappings":";;;;;;;AAiBA,IAAAA,EAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA8B,SAAAD,wBAAAE,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAJ,uBAAA,YAAAA,wBAAAE,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,mBAAAT,CAAA,iBAAAA,CAAA,gBAAAU,OAAA,CAAAV,CAAA,0BAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,cAAAM,EAAA,IAAAd,CAAA,gBAAAc,EAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,EAAA,OAAAP,CAAA,IAAAD,CAAA,GAAAW,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAnB,CAAA,EAAAc,EAAA,OAAAP,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAM,EAAA,EAAAP,CAAA,IAAAC,CAAA,CAAAM,EAAA,IAAAd,CAAA,CAAAc,EAAA,WAAAN,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAjB9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAGO,IAAMmB,aAAa,GAAAC,OAAA,CAAAD,aAAA,GAAI;EAC5BE,IAAI,EAAEzB,EAAE,CAAC0B,KAAK,CAACC,gBAAgB,GAAG,WAAW;EAE7CC,IAAI,EAAE,cAAc;EAEpBC,KAAK,EAAE,SAAPA,KAAKA,CAAYC,OAAO,EAAEC,OAAO,EAAE;IACjC,IAAMC,KAAK,GAAGD,OAAO,CAACE,OAAO,CAACD,KAAK;IACnC;IACA,IAAI,CAACA,KAAK,CAACE,GAAG,CAACC,SAAS,EAAEnC,EAAE,CAACoC,EAAE,CAACC,GAAG,CAAC,MAAM,CAAC,EAAEP,OAAO,CAAC,EAAE;MACrD,OAAO,IAAI;IACb;IACA,IAAMvB,CAAC,GAAGyB,KAAK,CAACM,kBAAkB,CAACH,SAAS,EAAEnC,EAAE,CAACoC,EAAE,CAACC,GAAG,CAAC,MAAM,CAAC,EAAEP,OAAO,CAAC,CACtES,MAAM;IACT,IAAIhC,CAAC,KAAK,CAAC,EAAE;MACX;MACA,OAAO,IAAI;IACb;IACA,IAAIA,CAAC,GAAG,EAAE,EAAE;MACV;MACA,OAAO,IAAI;IACb;IACA,OAAOP,EAAE,CAACwC,KAAK,CAACX,KAAK,CAACC,OAAO,CAAC,GAAG,QAAQ;EAC3C,CAAC;EAEDW,MAAM,EAAE,SAARA,MAAMA,CAAYX,OAAO,EAAEC,OAAO,EAAE;IAClC,IAAMW,UAAU,GAAGX,OAAO,CAACY,GAAG;IAC9B,IAAMC,GAAG,GAAGF,UAAU,CAACG,aAAa,CAAC,KAAK,CAAC;IAC3CD,GAAG,CAACE,YAAY,CAAC,OAAO,EAAE,WAAW,CAAC;IACtCF,GAAG,CAACG,WAAW,CAAC/C,EAAE,CAACgD,KAAK,CAACN,UAAU,EAAE;MAAEO,UAAU,EAAEnB;IAAQ,CAAC,CAAC,CAAC;IAC9D,OAAOc,GAAG;EACZ;AACF,CAAC","ignoreList":[]}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = void 0;
|
|
7
|
-
console.log('This is common.js');
|
|
8
|
-
// https://2ality.com/2019/04/nodejs-esm-impl.html#importing-commonjs-from-esm
|
|
9
|
-
var _default = exports["default"] = {
|
|
10
|
-
foo: 123
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=common.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"common.js","names":["console","log","_default","exports","foo"],"sources":["../../src/test-import-export/common.js"],"sourcesContent":["console.log('This is common.js')\n// https://2ality.com/2019/04/nodejs-esm-impl.html#importing-commonjs-from-esm\n\nexport default {\n foo: 123\n}\n"],"mappings":";;;;;;AAAAA,OAAO,CAACC,GAAG,CAAC,mBAAmB,CAAC;AAChC;AAAA,IAAAC,QAAA,GAAAC,OAAA,cAEe;EACbC,GAAG,EAAE;AACP,CAAC","ignoreList":[]}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
// Suspect this is unsed test code
|
|
4
|
-
|
|
5
|
-
/* Profile Editing Appp Pane
|
|
6
|
-
**
|
|
7
|
-
** Unlike view panes, this is available any place whatever the real subject,
|
|
8
|
-
** and allows the user to edit their own profile.
|
|
9
|
-
**
|
|
10
|
-
** Usage: paneRegistry.register('profile/profilePane')
|
|
11
|
-
** or standalone script adding onto existing mashlib.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
// import UI from 'solid-ui'
|
|
15
|
-
// import solidUi, { SolidUi } from 'solid-ui'
|
|
16
|
-
// @@ TODO: Write away the need for exception on next line
|
|
17
|
-
Object.defineProperty(exports, "__esModule", {
|
|
18
|
-
value: true
|
|
19
|
-
});
|
|
20
|
-
exports["default"] = void 0;
|
|
21
|
-
var thisPane = {
|
|
22
|
-
foo: 'bar'
|
|
23
|
-
};
|
|
24
|
-
var _default = exports["default"] = thisPane; // ENDS
|
|
25
|
-
//# sourceMappingURL=edit-importer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"edit-importer.js","names":["Object","defineProperty","exports","value","thisPane","foo","_default"],"sources":["../../src/test-import-export/edit-importer.js"],"sourcesContent":["'use strict'\n// Suspect this is unsed test code\n\n/* Profile Editing Appp Pane\n **\n ** Unlike view panes, this is available any place whatever the real subject,\n ** and allows the user to edit their own profile.\n **\n ** Usage: paneRegistry.register('profile/profilePane')\n ** or standalone script adding onto existing mashlib.\n */\n\n// import UI from 'solid-ui'\n// import solidUi, { SolidUi } from 'solid-ui'\n// @@ TODO: Write away the need for exception on next line\n \n\nconst thisPane = { foo: 'bar' }\nexport default thisPane\n// ENDS\n"],"mappings":"AAAA,YAAY;;AACZ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AAAAA,MAAA,CAAAC,cAAA,CAAAC,OAAA;EAAAC,KAAA;AAAA;AAAAD,OAAA;AAGA,IAAME,QAAQ,GAAG;EAAEC,GAAG,EAAE;AAAM,CAAC;AAAA,IAAAC,QAAA,GAAAJ,OAAA,cAChBE,QAAQ,EACvB","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"testImportExport.js","names":[],"sources":["../../src/test-import-export/testImportExport.js"],"sourcesContent":[""],"mappings":"","ignoreList":[]}
|
package/lib/transaction/pane.js
DELETED
|
@@ -1,479 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
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 _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
11
|
-
/* Financial Transaction Pane
|
|
12
|
-
**
|
|
13
|
-
** This outline pane allows a user to interact with a transaction
|
|
14
|
-
** downloaded from a bank statement, annotting it with classes and comments,
|
|
15
|
-
** trips, etc
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
var ns = UI.ns;
|
|
19
|
-
var _default = exports["default"] = {
|
|
20
|
-
// icon: (module.__dirname || __dirname) + '22-pixel-068010-3d-transparent-glass-icon-alphanumeric-dollar-sign.png',
|
|
21
|
-
icon: UI.icons.iconBase + 'noun_106746.svg',
|
|
22
|
-
name: 'transaction',
|
|
23
|
-
audience: [ns.solid('PowerUser')],
|
|
24
|
-
// Does the subject deserve this pane?
|
|
25
|
-
label: function label(subject, context) {
|
|
26
|
-
var kb = context.session.store;
|
|
27
|
-
var t = kb.findTypeURIs(subject);
|
|
28
|
-
if (t['http://www.w3.org/2000/10/swap/pim/qif#Transaction']) return '$$';
|
|
29
|
-
if (kb.any(subject, UI.ns.qu('amount'))) return '$$$'; // In case schema not picked up
|
|
30
|
-
|
|
31
|
-
// if (t['http://www.w3.org/2000/10/swap/pim/qif#Period']) return "period $"
|
|
32
|
-
|
|
33
|
-
if (t['http://www.w3.org/ns/pim/trip#Trip']) return 'Trip $';
|
|
34
|
-
return null; // No under other circumstances (while testing at least!)
|
|
35
|
-
},
|
|
36
|
-
render: function render(subject, context) {
|
|
37
|
-
var dom = context.dom;
|
|
38
|
-
var kb = context.session.store;
|
|
39
|
-
var fetcher = kb.fetcher;
|
|
40
|
-
var Q = $rdf.Namespace('http://www.w3.org/2000/10/swap/pim/qif#');
|
|
41
|
-
var TRIP = $rdf.Namespace('http://www.w3.org/ns/pim/trip#');
|
|
42
|
-
var div = dom.createElement('div');
|
|
43
|
-
div.setAttribute('class', 'transactionPane');
|
|
44
|
-
var mention = function mention(message, style) {
|
|
45
|
-
if (style === undefined) style = 'color: grey';
|
|
46
|
-
var pre = dom.createElement('pre');
|
|
47
|
-
pre.setAttribute('style', style);
|
|
48
|
-
div.appendChild(pre);
|
|
49
|
-
pre.appendChild(dom.createTextNode(message));
|
|
50
|
-
};
|
|
51
|
-
var complain = function complain(message) {
|
|
52
|
-
return mention(message, 'color: #100; background-color: #fee');
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
/*
|
|
56
|
-
var thisPane = this
|
|
57
|
-
var rerender = function (div) {
|
|
58
|
-
var parent = div.parentNode
|
|
59
|
-
var div2 = thisPane.render(subject, dom)
|
|
60
|
-
parent.replaceChild(div2, div)
|
|
61
|
-
}
|
|
62
|
-
*/
|
|
63
|
-
// //////////////////////////////////////////////////////////////////////////////
|
|
64
|
-
|
|
65
|
-
var plist = kb.statementsMatching(subject);
|
|
66
|
-
var qlist = kb.statementsMatching(undefined, undefined, subject);
|
|
67
|
-
var t = kb.findTypeURIs(subject);
|
|
68
|
-
|
|
69
|
-
// var me = authn.currentUser()
|
|
70
|
-
var predicateURIsDone = {};
|
|
71
|
-
var donePredicate = function donePredicate(pred) {
|
|
72
|
-
predicateURIsDone[pred.uri] = true;
|
|
73
|
-
};
|
|
74
|
-
var setPaneStyle = function setPaneStyle(account) {
|
|
75
|
-
var mystyle = 'padding: 0.5em 1.5em 1em 1.5em; ';
|
|
76
|
-
if (account) {
|
|
77
|
-
var backgroundColor = kb.any(account, UI.ns.ui('backgroundColor'));
|
|
78
|
-
if (backgroundColor) {
|
|
79
|
-
mystyle += 'background-color: ' + backgroundColor.value + '; ';
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
div.setAttribute('style', mystyle);
|
|
83
|
-
};
|
|
84
|
-
// setPaneStyle()
|
|
85
|
-
|
|
86
|
-
// Functions for displaying lists of transactions
|
|
87
|
-
// Click on the transaction line to expand it into a pane
|
|
88
|
-
// Shift-click to expand without collapsing others
|
|
89
|
-
|
|
90
|
-
var d2 = function d2(n) {
|
|
91
|
-
if (n === undefined) return '';
|
|
92
|
-
var s = '' + n;
|
|
93
|
-
if (s.indexOf('.') >= 0) {
|
|
94
|
-
return s.split('.')[0] + '.' + (s.split('.')[1] + '00').slice(0, 2);
|
|
95
|
-
}
|
|
96
|
-
return s + '.00';
|
|
97
|
-
};
|
|
98
|
-
var numericCell = function numericCell(amount, suppressZero) {
|
|
99
|
-
var td = dom.createElement('td');
|
|
100
|
-
if (!(0.0 + amount === 0.0 && suppressZero)) {
|
|
101
|
-
td.textContent = d2(amount);
|
|
102
|
-
}
|
|
103
|
-
td.setAttribute('style', 'width: 6em; text-align: right; ');
|
|
104
|
-
return td;
|
|
105
|
-
};
|
|
106
|
-
var headerCell = function headerCell(str) {
|
|
107
|
-
var td = dom.createElement('th');
|
|
108
|
-
td.textContent = str;
|
|
109
|
-
td.setAttribute('style', 'text-align: right; ');
|
|
110
|
-
return td;
|
|
111
|
-
};
|
|
112
|
-
var oderByDate = function oderByDate(x, y) {
|
|
113
|
-
var dx = kb.any(x, ns.qu('date'));
|
|
114
|
-
var dy = kb.any(y, ns.qu('date'));
|
|
115
|
-
if (dx !== undefined && dy !== undefined) {
|
|
116
|
-
if (dx.value < dy.value) return -1;
|
|
117
|
-
if (dx.value > dy.value) return 1;
|
|
118
|
-
}
|
|
119
|
-
if (x.uri < y.uri) return -1; // Arbitrary but repeatable
|
|
120
|
-
if (x.uri > y.uri) return 1;
|
|
121
|
-
return 0;
|
|
122
|
-
};
|
|
123
|
-
var insertedPane = function insertedPane(context, subject, paneName) {
|
|
124
|
-
var p = context.session.paneRegistry.byName(paneName);
|
|
125
|
-
var d = p.render(subject, context);
|
|
126
|
-
d.setAttribute('style', 'border: 0.1em solid green;');
|
|
127
|
-
return d;
|
|
128
|
-
};
|
|
129
|
-
var expandAfterRow = function expandAfterRow(dom, row, subject, paneName, solo) {
|
|
130
|
-
var siblings = row.parentNode.children;
|
|
131
|
-
if (solo) {
|
|
132
|
-
for (var j = siblings.length - 1; j >= 0; j--) {
|
|
133
|
-
if (siblings[j].expanded) {
|
|
134
|
-
siblings[j].parentNode.removeChild(siblings[j].expanded);
|
|
135
|
-
siblings[j].expanded = false;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
var tr = dom.createElement('tr');
|
|
140
|
-
var td = tr.appendChild(dom.createElement('td'));
|
|
141
|
-
td.setAttribute('style', 'width: 98%; padding: 1em; border: 0.1em solid grey;');
|
|
142
|
-
var cols = row.children.length;
|
|
143
|
-
if (row.nextSibling) {
|
|
144
|
-
row.parentNode.insertBefore(tr, row.nextSibling);
|
|
145
|
-
} else {
|
|
146
|
-
row.parentNode.appendChild(tr);
|
|
147
|
-
}
|
|
148
|
-
row.expanded = tr;
|
|
149
|
-
td.setAttribute('colspan', '' + cols);
|
|
150
|
-
td.appendChild(insertedPane(context, subject, paneName));
|
|
151
|
-
};
|
|
152
|
-
var expandAfterRowOrCollapse = function expandAfterRowOrCollapse(dom, row, subject, paneName, solo) {
|
|
153
|
-
if (row.expanded) {
|
|
154
|
-
row.parentNode.removeChild(row.expanded);
|
|
155
|
-
row.expanded = false;
|
|
156
|
-
} else {
|
|
157
|
-
expandAfterRow(dom, row, subject, paneName, solo);
|
|
158
|
-
}
|
|
159
|
-
};
|
|
160
|
-
var transactionTable = function transactionTable(dom, list, filter) {
|
|
161
|
-
var table = dom.createElement('table');
|
|
162
|
-
table.setAttribute('style', 'padding-left: 0.5em; padding-right: 0.5em; font-size: 9pt; width: 85%;');
|
|
163
|
-
var transactionRow = function transactionRow(dom, x) {
|
|
164
|
-
var tr = dom.createElement('tr');
|
|
165
|
-
var setTRStyle = function setTRStyle(tr, account) {
|
|
166
|
-
// var mystyle = "padding: 0.5em 1.5em 1em 1.5em; "
|
|
167
|
-
var mystyle = "'padding-left: 0.5em; padding-right: 0.5em; padding-top: 0.1em;";
|
|
168
|
-
if (account) {
|
|
169
|
-
var backgroundColor = kb.any(account, UI.ns.ui('backgroundColor'));
|
|
170
|
-
if (backgroundColor) {
|
|
171
|
-
mystyle += 'background-color: ' + backgroundColor.value + '; ';
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
tr.setAttribute('style', mystyle);
|
|
175
|
-
};
|
|
176
|
-
var account = kb.any(x, ns.qu('toAccount'));
|
|
177
|
-
setTRStyle(tr, account);
|
|
178
|
-
var c0 = tr.appendChild(dom.createElement('td'));
|
|
179
|
-
var date = kb.any(x, ns.qu('date'));
|
|
180
|
-
c0.textContent = date ? date.value.slice(0, 10) : '???';
|
|
181
|
-
c0.setAttribute('style', 'width: 7em;');
|
|
182
|
-
var c1 = tr.appendChild(dom.createElement('td'));
|
|
183
|
-
c1.setAttribute('style', 'width: 36em;');
|
|
184
|
-
var payee = kb.any(x, ns.qu('payee'));
|
|
185
|
-
c1.textContent = payee ? payee.value : '???';
|
|
186
|
-
var a1 = c1.appendChild(dom.createElement('a'));
|
|
187
|
-
a1.textContent = ' ➜';
|
|
188
|
-
a1.setAttribute('href', x.uri);
|
|
189
|
-
var c3 = tr.appendChild(dom.createElement('td'));
|
|
190
|
-
var amount = kb.any(x, ns.qu('in_USD'));
|
|
191
|
-
c3.textContent = amount ? d2(amount.value) : '???';
|
|
192
|
-
c3.setAttribute('style', 'width: 6em; text-align: right; '); // @@ decimal alignment?
|
|
193
|
-
tr.addEventListener('click', function (e) {
|
|
194
|
-
// solo unless shift key
|
|
195
|
-
expandAfterRowOrCollapse(dom, tr, x, 'transaction', !e.shiftKey);
|
|
196
|
-
}, false);
|
|
197
|
-
return tr;
|
|
198
|
-
};
|
|
199
|
-
var list2 = filter ? list.filter(filter) : list.slice(); // don't sort a paramater passed in place
|
|
200
|
-
list2.sort(oderByDate);
|
|
201
|
-
for (var i = 0; i < list2.length; i++) {
|
|
202
|
-
table.appendChild(transactionRow(dom, list2[i]));
|
|
203
|
-
}
|
|
204
|
-
return table;
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
// Render a single transaction
|
|
208
|
-
|
|
209
|
-
// This works only if enough metadata about the properties can drive the RDFS
|
|
210
|
-
// (or actual type statements whichtypically are NOT there on)
|
|
211
|
-
if (t['http://www.w3.org/2000/10/swap/pim/qif#Transaction'] || kb.any(subject, ns.qu('toAccount'))) {
|
|
212
|
-
// var trip = kb.any(subject, WF('trip'))
|
|
213
|
-
donePredicate(ns.rdf('type'));
|
|
214
|
-
var account = kb.any(subject, UI.ns.qu('toAccount'));
|
|
215
|
-
setPaneStyle(account);
|
|
216
|
-
if (!account) {
|
|
217
|
-
complain('(Error: There is no bank account known for this transaction <' + subject.uri + '>,\n -- every transaction needs one.)');
|
|
218
|
-
}
|
|
219
|
-
var store = null;
|
|
220
|
-
var statement = kb.any(subject, UI.ns.qu('accordingTo'));
|
|
221
|
-
if (statement === undefined) {
|
|
222
|
-
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.)");
|
|
223
|
-
} else {
|
|
224
|
-
store = statement !== undefined ? kb.any(statement, UI.ns.qu('annotationStore')) : null;
|
|
225
|
-
if (store === undefined) {
|
|
226
|
-
complain('(There is no annotation document for this statement\n<' + statement.uri + '>,\nso you cannot classify this transaction.)');
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
var nav = dom.createElement('div');
|
|
230
|
-
nav.setAttribute('style', 'float:right');
|
|
231
|
-
div.appendChild(nav);
|
|
232
|
-
var navLink = function navLink(pred, label) {
|
|
233
|
-
donePredicate(pred);
|
|
234
|
-
var obj = kb.any(subject, pred);
|
|
235
|
-
if (!obj) return;
|
|
236
|
-
var a = dom.createElement('a');
|
|
237
|
-
a.setAttribute('href', obj.uri);
|
|
238
|
-
a.setAttribute('style', 'float:right');
|
|
239
|
-
nav.appendChild(a).textContent = label || UI.utils.label(obj);
|
|
240
|
-
nav.appendChild(dom.createElement('br'));
|
|
241
|
-
};
|
|
242
|
-
navLink(UI.ns.qu('toAccount'));
|
|
243
|
-
navLink(UI.ns.qu('accordingTo'), 'Statement');
|
|
244
|
-
navLink(TRIP('trip'));
|
|
245
|
-
|
|
246
|
-
// Basic data:
|
|
247
|
-
var table = dom.createElement('table');
|
|
248
|
-
div.appendChild(table);
|
|
249
|
-
var preds = ['date', 'payee', 'amount', 'in_USD', 'currency'].map(Q);
|
|
250
|
-
var inner = preds.map(function (p) {
|
|
251
|
-
donePredicate(p);
|
|
252
|
-
var value = kb.any(subject, p);
|
|
253
|
-
var s = value ? UI.utils.labelForXML(value) : '';
|
|
254
|
-
return '<tr><td style="text-align: right; padding-right: 0.6em">' + UI.utils.labelForXML(p) + '</td><td style="font-weight: bold;">' + s + '</td></tr>';
|
|
255
|
-
}).join('\n');
|
|
256
|
-
table.innerHTML = inner;
|
|
257
|
-
var complainIfBad = function complainIfBad(ok, body) {
|
|
258
|
-
if (ok) {
|
|
259
|
-
// setModifiedDate(store, kb, store)
|
|
260
|
-
// rerender(div) // deletes the new trip form
|
|
261
|
-
} else complain('Sorry, failed to save your change:\n' + body);
|
|
262
|
-
};
|
|
263
|
-
|
|
264
|
-
// What trips do we know about?
|
|
265
|
-
|
|
266
|
-
// Classify:
|
|
267
|
-
if (store) {
|
|
268
|
-
kb.fetcher.nowOrWhenFetched(store.uri, subject, function (ok, body) {
|
|
269
|
-
if (!ok) complain('Cannot load store ' + store + ' ' + body);
|
|
270
|
-
var calendarYear = kb.any(store, ns.qu('calendarYear'));
|
|
271
|
-
var renderCatgorySelectors = function renderCatgorySelectors() {
|
|
272
|
-
div.insertBefore(UI.widgets.makeSelectForNestedCategory(dom, kb, subject, UI.ns.qu('Classified'), store, complainIfBad), table.nextSibling);
|
|
273
|
-
};
|
|
274
|
-
if (kb.any(undefined, ns.rdfs('subClassOf'), ns.qu.Classified)) {
|
|
275
|
-
renderCatgorySelectors();
|
|
276
|
-
} else if (calendarYear) {
|
|
277
|
-
fetcher.load(calendarYear).then(function (_xhrs) {
|
|
278
|
-
fetcher.load(kb.each(calendarYear, ns.rdfs('seeAlso'))).then(function () {
|
|
279
|
-
renderCatgorySelectors();
|
|
280
|
-
})["catch"](function (e) {
|
|
281
|
-
console.log('Error loading background data: ' + e);
|
|
282
|
-
});
|
|
283
|
-
})["catch"](function (e) {
|
|
284
|
-
console.log('Error loading calendarYear: ' + e);
|
|
285
|
-
});
|
|
286
|
-
} else {
|
|
287
|
-
console.log("Can't get categories, because no calendarYear");
|
|
288
|
-
}
|
|
289
|
-
div.appendChild(UI.widgets.makeDescription(dom, kb, subject, UI.ns.rdfs('comment'), store, complainIfBad));
|
|
290
|
-
var trips = kb.statementsMatching(undefined, TRIP('trip'), undefined, store).map(function (st) {
|
|
291
|
-
return st.object;
|
|
292
|
-
}); // @@ Use rdfs
|
|
293
|
-
var trips2 = kb.each(undefined, UI.ns.rdf('type'), TRIP('Trip'));
|
|
294
|
-
trips = trips.concat(trips2).sort(); // @@ Unique
|
|
295
|
-
|
|
296
|
-
var sortedBy = function sortedBy(kb, list, pred, reverse) {
|
|
297
|
-
var l2 = list.map(function (x) {
|
|
298
|
-
var key = kb.any(x, pred);
|
|
299
|
-
key = key ? key.value : '9999-12-31';
|
|
300
|
-
return [key, x];
|
|
301
|
-
});
|
|
302
|
-
l2.sort();
|
|
303
|
-
if (reverse) l2.reverse();
|
|
304
|
-
return l2.map(function (pair) {
|
|
305
|
-
return pair[1];
|
|
306
|
-
});
|
|
307
|
-
};
|
|
308
|
-
trips = sortedBy(kb, trips, UI.ns.cal('dtstart'), true); // Reverse chron
|
|
309
|
-
|
|
310
|
-
if (trips.length > 1) {
|
|
311
|
-
div.appendChild(UI.widgets.makeSelectForOptions(dom, kb, subject, TRIP('trip'), trips, {
|
|
312
|
-
multiple: false,
|
|
313
|
-
nullLabel: '-- what trip? --',
|
|
314
|
-
mint: 'New Trip *',
|
|
315
|
-
mintClass: TRIP('Trip'),
|
|
316
|
-
mintStatementsFun: function mintStatementsFun(trip) {
|
|
317
|
-
var is = [];
|
|
318
|
-
is.push($rdf.st(trip, UI.ns.rdf('type'), TRIP('Trip'), trip.doc()));
|
|
319
|
-
return is;
|
|
320
|
-
}
|
|
321
|
-
}, store, complainIfBad));
|
|
322
|
-
}
|
|
323
|
-
div.appendChild(dom.createElement('br'));
|
|
324
|
-
|
|
325
|
-
// Add in simple comments about the transaction
|
|
326
|
-
|
|
327
|
-
var outliner = context.getOutliner(dom);
|
|
328
|
-
donePredicate(ns.rdfs('comment')); // Done above
|
|
329
|
-
|
|
330
|
-
UI.widgets.attachmentList(dom, subject, div);
|
|
331
|
-
donePredicate(ns.wf('attachment'));
|
|
332
|
-
div.appendChild(dom.createElement('tr')).setAttribute('style', 'height: 1em'); // spacer
|
|
333
|
-
|
|
334
|
-
// Remaining properties
|
|
335
|
-
outliner.appendPropertyTRs(div, plist, false, function (pred, _inverse) {
|
|
336
|
-
return !(pred.uri in predicateURIsDone);
|
|
337
|
-
});
|
|
338
|
-
outliner.appendPropertyTRs(div, qlist, true, function (pred, _inverse) {
|
|
339
|
-
return !(pred.uri in predicateURIsDone);
|
|
340
|
-
});
|
|
341
|
-
}); // fetch
|
|
342
|
-
}
|
|
343
|
-
// end of render tranasaction instance
|
|
344
|
-
|
|
345
|
-
// ////////////////////////////////////////////////////////////////////
|
|
346
|
-
//
|
|
347
|
-
// Render the transactions in a Trip
|
|
348
|
-
//
|
|
349
|
-
} else if (t['http://www.w3.org/ns/pim/trip#Trip']) {
|
|
350
|
-
/*
|
|
351
|
-
var query = new $rdf.Query(UI.utils.label(subject))
|
|
352
|
-
var vars = [ 'date', 'transaction', 'comment', 'type', 'in_USD']
|
|
353
|
-
var v = {}
|
|
354
|
-
vars.map(function(x){query.vars.push(v[x]=$rdf.variable(x))}) // Only used by UI
|
|
355
|
-
query.pat.add(v['transaction'], TRIP('trip'), subject)
|
|
356
|
-
var opt = kb.formula()
|
|
357
|
-
opt.add(v['transaction'], ns.rdf('type'), v['type']); // Issue: this will get stored supertypes too
|
|
358
|
-
query.pat.optional.push(opt)
|
|
359
|
-
query.pat.add(v['transaction'], UI.ns.qu('date'), v['date'])
|
|
360
|
-
var opt = kb.formula()
|
|
361
|
-
opt.add(v['transaction'], ns.rdfs('comment'), v['comment'])
|
|
362
|
-
query.pat.optional.push(opt)
|
|
363
|
-
//opt = kb.formula()
|
|
364
|
-
query.pat.add(v['transaction'], UI.ns.qu('in_USD'), v['in_USD'])
|
|
365
|
-
//query.pat.optional.push(opt)
|
|
366
|
-
var tableDiv = UI.widgets.renderTableViewPane(dom, {'query': query, 'onDone': calculations} )
|
|
367
|
-
div.appendChild(tableDiv)
|
|
368
|
-
*/
|
|
369
|
-
var calculations = function calculations() {
|
|
370
|
-
var total = {};
|
|
371
|
-
var yearTotal = {};
|
|
372
|
-
var yearCategoryTotal = {};
|
|
373
|
-
var trans = kb.each(undefined, TRIP('trip'), subject);
|
|
374
|
-
var bankStatements = trans.map(function (t) {
|
|
375
|
-
return t.doc();
|
|
376
|
-
});
|
|
377
|
-
kb.fetcher.load(bankStatements).then(function () {
|
|
378
|
-
trans.forEach(function (t) {
|
|
379
|
-
var date = kb.the(t, ns.qu('date'));
|
|
380
|
-
var year = date ? ('' + date.value).slice(0, 4) : '????';
|
|
381
|
-
var ty = kb.the(t, ns.rdf('type')); // @@ find most specific type
|
|
382
|
-
// complain(" -- one trans: "+t.uri + ' -> '+kb.any(t, UI.ns.qu('in_USD')))
|
|
383
|
-
if (!ty) ty = UI.ns.qu('ErrorNoType');
|
|
384
|
-
if (ty && ty.uri) {
|
|
385
|
-
var tyuri = ty.uri;
|
|
386
|
-
if (!yearTotal[year]) yearTotal[year] = 0.0;
|
|
387
|
-
if (!yearCategoryTotal[year]) yearCategoryTotal[year] = {};
|
|
388
|
-
if (!total[tyuri]) total[tyuri] = 0.0;
|
|
389
|
-
if (!yearCategoryTotal[year][tyuri]) {
|
|
390
|
-
yearCategoryTotal[year][tyuri] = 0.0;
|
|
391
|
-
}
|
|
392
|
-
var lit = kb.any(t, UI.ns.qu('in_USD'));
|
|
393
|
-
if (!lit) {
|
|
394
|
-
complain('@@ No amount in USD: ' + lit + ' for ' + t);
|
|
395
|
-
}
|
|
396
|
-
if (lit) {
|
|
397
|
-
var amount = parseFloat(lit.value);
|
|
398
|
-
total[tyuri] += amount;
|
|
399
|
-
yearCategoryTotal[year][tyuri] += amount;
|
|
400
|
-
yearTotal[year] += amount;
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
});
|
|
404
|
-
var types = [];
|
|
405
|
-
var grandTotal = 0.0;
|
|
406
|
-
var years = [];
|
|
407
|
-
var i;
|
|
408
|
-
for (var y in yearCategoryTotal) {
|
|
409
|
-
// @@ TODO: Write away the need for exception on next line
|
|
410
|
-
|
|
411
|
-
if (yearCategoryTotal.hasOwnProperty(y)) {
|
|
412
|
-
years.push(y);
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
years.sort();
|
|
416
|
-
var ny = years.length;
|
|
417
|
-
var cell;
|
|
418
|
-
var table = div.appendChild(dom.createElement('table'));
|
|
419
|
-
table.setAttribute('style', 'font-size: 120%; margin-left:auto; margin-right:1em; margin-top: 1em; border: 0.05em solid gray; padding: 1em;');
|
|
420
|
-
if (ny > 1) {
|
|
421
|
-
var header = table.appendChild(dom.createElement('tr'));
|
|
422
|
-
header.appendChild(headerCell(''));
|
|
423
|
-
for (i = 0; i < ny; i++) {
|
|
424
|
-
header.appendChild(headerCell(years[i]));
|
|
425
|
-
}
|
|
426
|
-
header.appendChild(headerCell('total'));
|
|
427
|
-
}
|
|
428
|
-
for (var uri in total) {
|
|
429
|
-
// @@ TODO: Write away the need for exception on next line
|
|
430
|
-
|
|
431
|
-
if (total.hasOwnProperty(uri)) {
|
|
432
|
-
types.push(uri);
|
|
433
|
-
grandTotal += total[uri];
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
types.sort();
|
|
437
|
-
var row, label, z;
|
|
438
|
-
for (var j = 0; j < types.length; j++) {
|
|
439
|
-
var cat = kb.sym(types[j]);
|
|
440
|
-
row = table.appendChild(dom.createElement('tr'));
|
|
441
|
-
label = row.appendChild(dom.createElement('td'));
|
|
442
|
-
label.textContent = UI.utils.label(cat);
|
|
443
|
-
if (ny > 1) {
|
|
444
|
-
for (i = 0; i < ny; i++) {
|
|
445
|
-
z = yearCategoryTotal[years[i]][types[j]];
|
|
446
|
-
cell = row.appendChild(numericCell(z, true));
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
row.appendChild(numericCell(total[types[j]], true));
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
// Trailing totals
|
|
453
|
-
if (types.length > 1) {
|
|
454
|
-
row = table.appendChild(dom.createElement('tr'));
|
|
455
|
-
row.appendChild(headerCell('total'));
|
|
456
|
-
if (ny > 1) {
|
|
457
|
-
for (i = 0; i < ny; i++) {
|
|
458
|
-
z = yearTotal[years[i]];
|
|
459
|
-
cell = row.appendChild(numericCell(z ? d2(z) : ''));
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
cell = row.appendChild(numericCell(grandTotal));
|
|
463
|
-
cell.setAttribute('style', 'font-weight: bold; text-align: right;');
|
|
464
|
-
}
|
|
465
|
-
var tab = transactionTable(dom, trans);
|
|
466
|
-
tab.setAttribute('style', 'margin-left:auto; margin-right:1em; margin-top: 1em; border: padding: 1em;');
|
|
467
|
-
div.appendChild(tab);
|
|
468
|
-
UI.widgets.attachmentList(dom, subject, div);
|
|
469
|
-
})["catch"](function (e) {
|
|
470
|
-
complain('Error loading transactions: ' + e);
|
|
471
|
-
});
|
|
472
|
-
};
|
|
473
|
-
calculations();
|
|
474
|
-
} // if
|
|
475
|
-
|
|
476
|
-
return div;
|
|
477
|
-
}
|
|
478
|
-
}; // ends
|
|
479
|
-
//# sourceMappingURL=pane.js.map
|