@compas-oscd/open-scd 0.34.17 → 0.34.18

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 (250) hide show
  1. package/dist/WizardDivider.d.ts +8 -8
  2. package/dist/WizardDivider.js +26 -26
  3. package/dist/Wizarding.js +36 -36
  4. package/dist/Wizarding.js.map +1 -1
  5. package/dist/action-icon.d.ts +25 -25
  6. package/dist/action-icon.js +51 -51
  7. package/dist/action-pane.d.ts +25 -25
  8. package/dist/action-pane.js +86 -86
  9. package/dist/addons/Editor.d.ts +25 -25
  10. package/dist/addons/Editor.js +105 -105
  11. package/dist/addons/Editor.js.map +1 -1
  12. package/dist/addons/History.d.ts +86 -93
  13. package/dist/addons/History.js +301 -302
  14. package/dist/addons/History.js.map +1 -1
  15. package/dist/addons/Layout.d.ts +96 -96
  16. package/dist/addons/Layout.js +448 -448
  17. package/dist/addons/Layout.js.map +1 -1
  18. package/dist/addons/Settings.d.ts +68 -68
  19. package/dist/addons/Settings.js +272 -272
  20. package/dist/addons/Settings.js.map +1 -1
  21. package/dist/addons/Waiter.d.ts +14 -14
  22. package/dist/addons/Waiter.js +40 -40
  23. package/dist/addons/Waiter.js.map +1 -1
  24. package/dist/addons/Wizards.d.ts +15 -15
  25. package/dist/addons/Wizards.js +46 -46
  26. package/dist/addons/editor/edit-action-to-v1-converter.d.ts +3 -3
  27. package/dist/addons/editor/edit-action-to-v1-converter.js +95 -95
  28. package/dist/addons/editor/edit-action-to-v1-converter.js.map +1 -1
  29. package/dist/addons/editor/edit-v1-to-v2-converter.d.ts +2 -2
  30. package/dist/addons/editor/edit-v1-to-v2-converter.js +36 -36
  31. package/dist/addons/editor/edit-v1-to-v2-converter.js.map +1 -1
  32. package/dist/addons/history/get-log-text.d.ts +5 -5
  33. package/dist/addons/history/get-log-text.js +25 -25
  34. package/dist/addons/history/get-log-text.js.map +1 -1
  35. package/dist/addons/menu-tabs/menu-tabs.d.ts +22 -22
  36. package/dist/addons/menu-tabs/menu-tabs.js +59 -59
  37. package/dist/addons/plugin-manager/custom-plugin-dialog.d.ts +28 -28
  38. package/dist/addons/plugin-manager/custom-plugin-dialog.js +71 -71
  39. package/dist/addons/plugin-manager/plugin-manager.d.ts +20 -20
  40. package/dist/addons/plugin-manager/plugin-manager.js +77 -77
  41. package/dist/core/api/api.js +7 -0
  42. package/dist/core/api/api.js.map +1 -0
  43. package/dist/core/api/editor/subject.js +22 -0
  44. package/dist/core/api/editor/subject.js.map +1 -0
  45. package/dist/core/api/editor/xml-editor.js +82 -0
  46. package/dist/core/api/editor/xml-editor.js.map +1 -0
  47. package/dist/core/api/plugin-state-api.js +27 -0
  48. package/dist/core/api/plugin-state-api.js.map +1 -0
  49. package/dist/core/foundation/cyrb64.js +26 -0
  50. package/dist/core/foundation/cyrb64.js.map +1 -0
  51. package/dist/core/foundation/deprecated/edit-event.js +44 -0
  52. package/dist/core/foundation/deprecated/edit-event.js.map +1 -0
  53. package/dist/core/foundation/deprecated/editor.js +94 -0
  54. package/dist/core/foundation/deprecated/editor.js.map +1 -0
  55. package/dist/core/foundation/deprecated/history.js +17 -0
  56. package/dist/core/foundation/deprecated/history.js.map +1 -0
  57. package/dist/core/foundation/deprecated/open-event.js +9 -0
  58. package/dist/core/foundation/deprecated/open-event.js.map +1 -0
  59. package/dist/core/foundation/deprecated/settings.js +19 -0
  60. package/dist/core/foundation/deprecated/settings.js.map +1 -0
  61. package/dist/core/foundation/deprecated/validation.js +8 -0
  62. package/dist/core/foundation/deprecated/validation.js.map +1 -0
  63. package/dist/core/foundation/deprecated/waiter.js +12 -0
  64. package/dist/core/foundation/deprecated/waiter.js.map +1 -0
  65. package/dist/core/foundation/edit-completed-event.js +11 -0
  66. package/dist/core/foundation/edit-completed-event.js.map +1 -0
  67. package/dist/core/foundation/edit-event.js +8 -0
  68. package/dist/core/foundation/edit-event.js.map +1 -0
  69. package/dist/core/foundation/edit.js +31 -0
  70. package/dist/core/foundation/edit.js.map +1 -0
  71. package/dist/core/foundation/handle-edit.js +151 -0
  72. package/dist/core/foundation/handle-edit.js.map +1 -0
  73. package/dist/core/foundation/open-event.js +8 -0
  74. package/dist/core/foundation/open-event.js.map +1 -0
  75. package/dist/core/foundation/plugin.js +2 -0
  76. package/dist/core/foundation/plugin.js.map +1 -0
  77. package/dist/core/foundation.js +14 -0
  78. package/dist/core/foundation.js.map +1 -0
  79. package/dist/core/locales.js +21 -0
  80. package/dist/core/locales.js.map +1 -0
  81. package/dist/filtered-list.d.ts +27 -27
  82. package/dist/filtered-list.js +118 -118
  83. package/dist/finder-list.d.ts +37 -37
  84. package/dist/finder-list.js +153 -153
  85. package/dist/foundation/compare.d.ts +79 -79
  86. package/dist/foundation/compare.js +216 -216
  87. package/dist/foundation/dai.d.ts +30 -30
  88. package/dist/foundation/dai.js +126 -126
  89. package/dist/foundation/generators.d.ts +13 -13
  90. package/dist/foundation/generators.js +66 -66
  91. package/dist/foundation/ied.d.ts +22 -22
  92. package/dist/foundation/ied.js +83 -83
  93. package/dist/foundation/ied.js.map +1 -1
  94. package/dist/foundation/nsd.d.ts +4 -4
  95. package/dist/foundation/nsd.js +12 -12
  96. package/dist/foundation/nsdoc.d.ts +14 -14
  97. package/dist/foundation/nsdoc.js +178 -178
  98. package/dist/foundation/scl.d.ts +1 -1
  99. package/dist/foundation/scl.js +63 -63
  100. package/dist/foundation.d.ts +230 -230
  101. package/dist/foundation.js +1921 -1921
  102. package/dist/foundation.js.map +1 -1
  103. package/dist/icons/compare.d.ts +3 -3
  104. package/dist/icons/compare.js +4 -4
  105. package/dist/icons/icons.d.ts +41 -41
  106. package/dist/icons/icons.js +92 -92
  107. package/dist/icons/ied-icons.d.ts +3 -3
  108. package/dist/icons/ied-icons.js +4 -4
  109. package/dist/icons/lnode.d.ts +16 -16
  110. package/dist/icons/lnode.js +17 -17
  111. package/dist/open-scd.d.ts +131 -131
  112. package/dist/open-scd.js +438 -438
  113. package/dist/open-scd.js.map +1 -1
  114. package/dist/openscd/src/WizardDivider.js +37 -0
  115. package/dist/openscd/src/WizardDivider.js.map +1 -0
  116. package/dist/openscd/src/Wizarding.js +38 -0
  117. package/dist/openscd/src/Wizarding.js.map +1 -0
  118. package/dist/openscd/src/action-icon.js +220 -0
  119. package/dist/openscd/src/action-icon.js.map +1 -0
  120. package/dist/openscd/src/action-pane.js +176 -0
  121. package/dist/openscd/src/action-pane.js.map +1 -0
  122. package/dist/openscd/src/addons/Editor.js +106 -0
  123. package/dist/openscd/src/addons/Editor.js.map +1 -0
  124. package/dist/openscd/src/addons/History.js +490 -0
  125. package/dist/openscd/src/addons/History.js.map +1 -0
  126. package/dist/openscd/src/addons/Layout.js +619 -0
  127. package/dist/openscd/src/addons/Layout.js.map +1 -0
  128. package/dist/openscd/src/addons/Settings.js +465 -0
  129. package/dist/openscd/src/addons/Settings.js.map +1 -0
  130. package/dist/openscd/src/addons/Waiter.js +45 -0
  131. package/dist/openscd/src/addons/Waiter.js.map +1 -0
  132. package/dist/openscd/src/addons/Wizards.js +48 -0
  133. package/dist/openscd/src/addons/Wizards.js.map +1 -0
  134. package/dist/openscd/src/addons/editor/edit-action-to-v1-converter.js +96 -0
  135. package/dist/openscd/src/addons/editor/edit-action-to-v1-converter.js.map +1 -0
  136. package/dist/openscd/src/addons/editor/edit-v1-to-v2-converter.js +37 -0
  137. package/dist/openscd/src/addons/editor/edit-v1-to-v2-converter.js.map +1 -0
  138. package/dist/openscd/src/addons/history/get-log-text.js +26 -0
  139. package/dist/openscd/src/addons/history/get-log-text.js.map +1 -0
  140. package/dist/openscd/src/addons/menu-tabs/menu-tabs.js +74 -0
  141. package/dist/openscd/src/addons/menu-tabs/menu-tabs.js.map +1 -0
  142. package/dist/openscd/src/addons/plugin-manager/custom-plugin-dialog.js +177 -0
  143. package/dist/openscd/src/addons/plugin-manager/custom-plugin-dialog.js.map +1 -0
  144. package/dist/openscd/src/addons/plugin-manager/plugin-manager.js +165 -0
  145. package/dist/openscd/src/addons/plugin-manager/plugin-manager.js.map +1 -0
  146. package/dist/openscd/src/filtered-list.js +168 -0
  147. package/dist/openscd/src/filtered-list.js.map +1 -0
  148. package/dist/openscd/src/finder-list.js +207 -0
  149. package/dist/openscd/src/finder-list.js.map +1 -0
  150. package/dist/openscd/src/foundation/compare.js +273 -0
  151. package/dist/openscd/src/foundation/compare.js.map +1 -0
  152. package/dist/openscd/src/foundation/dai.js +127 -0
  153. package/dist/openscd/src/foundation/dai.js.map +1 -0
  154. package/dist/openscd/src/foundation/generators.js +67 -0
  155. package/dist/openscd/src/foundation/generators.js.map +1 -0
  156. package/dist/openscd/src/foundation/ied.js +84 -0
  157. package/dist/openscd/src/foundation/ied.js.map +1 -0
  158. package/dist/openscd/src/foundation/nsd.js +13 -0
  159. package/dist/openscd/src/foundation/nsd.js.map +1 -0
  160. package/dist/openscd/src/foundation/nsdoc.js +180 -0
  161. package/dist/openscd/src/foundation/nsdoc.js.map +1 -0
  162. package/dist/openscd/src/foundation/scl.js +64 -0
  163. package/dist/openscd/src/foundation/scl.js.map +1 -0
  164. package/dist/openscd/src/foundation.js +1922 -0
  165. package/dist/openscd/src/foundation.js.map +1 -0
  166. package/dist/openscd/src/icons/compare.js +11 -0
  167. package/dist/openscd/src/icons/compare.js.map +1 -0
  168. package/dist/openscd/src/icons/icons.js +611 -0
  169. package/dist/openscd/src/icons/icons.js.map +1 -0
  170. package/dist/openscd/src/icons/ied-icons.js +11 -0
  171. package/dist/openscd/src/icons/ied-icons.js.map +1 -0
  172. package/dist/openscd/src/icons/lnode.js +50 -0
  173. package/dist/openscd/src/icons/lnode.js.map +1 -0
  174. package/dist/openscd/src/open-scd.js +483 -0
  175. package/dist/openscd/src/open-scd.js.map +1 -0
  176. package/dist/openscd/src/oscd-filter-button.js +89 -0
  177. package/dist/openscd/src/oscd-filter-button.js.map +1 -0
  178. package/dist/openscd/src/plain-compare-list.js +132 -0
  179. package/dist/openscd/src/plain-compare-list.js.map +1 -0
  180. package/dist/openscd/src/plugin-tag.js +23 -0
  181. package/dist/openscd/src/plugin-tag.js.map +1 -0
  182. package/dist/openscd/src/plugin.events.js +12 -0
  183. package/dist/openscd/src/plugin.events.js.map +1 -0
  184. package/dist/openscd/src/plugin.js +2 -0
  185. package/dist/openscd/src/plugin.js.map +1 -0
  186. package/dist/openscd/src/plugins.js +256 -0
  187. package/dist/openscd/src/plugins.js.map +1 -0
  188. package/dist/openscd/src/schemas.js +9325 -0
  189. package/dist/openscd/src/schemas.js.map +1 -0
  190. package/dist/openscd/src/themes.js +122 -0
  191. package/dist/openscd/src/themes.js.map +1 -0
  192. package/dist/openscd/src/translations/de.js +954 -0
  193. package/dist/openscd/src/translations/de.js.map +1 -0
  194. package/dist/openscd/src/translations/en.js +950 -0
  195. package/dist/openscd/src/translations/en.js.map +1 -0
  196. package/dist/openscd/src/translations/loader.js +10 -0
  197. package/dist/openscd/src/translations/loader.js.map +1 -0
  198. package/dist/openscd/src/wizard-checkbox.js +152 -0
  199. package/dist/openscd/src/wizard-checkbox.js.map +1 -0
  200. package/dist/openscd/src/wizard-dialog.js +374 -0
  201. package/dist/openscd/src/wizard-dialog.js.map +1 -0
  202. package/dist/openscd/src/wizard-select.js +115 -0
  203. package/dist/openscd/src/wizard-select.js.map +1 -0
  204. package/dist/openscd/src/wizard-textfield.js +191 -0
  205. package/dist/openscd/src/wizard-textfield.js.map +1 -0
  206. package/dist/openscd/src/wizards.js +196 -0
  207. package/dist/openscd/src/wizards.js.map +1 -0
  208. package/dist/oscd-filter-button.d.ts +27 -27
  209. package/dist/oscd-filter-button.js +59 -59
  210. package/dist/plain-compare-list.d.ts +36 -36
  211. package/dist/plain-compare-list.js +70 -70
  212. package/dist/plugin-tag.d.ts +6 -6
  213. package/dist/plugin-tag.js +22 -22
  214. package/dist/plugin.d.ts +23 -23
  215. package/dist/plugin.events.d.ts +15 -15
  216. package/dist/plugin.events.js +11 -11
  217. package/dist/plugin.js +1 -1
  218. package/dist/plugin.js.map +1 -1
  219. package/dist/plugins.d.ts +3 -3
  220. package/dist/plugins.js +255 -255
  221. package/dist/schemas.d.ts +58 -58
  222. package/dist/schemas.js +59 -59
  223. package/dist/themes.d.ts +3 -3
  224. package/dist/themes.js +13 -13
  225. package/dist/themes.js.map +1 -1
  226. package/dist/translations/de.d.ts +2 -2
  227. package/dist/translations/de.js +952 -952
  228. package/dist/translations/en.d.ts +963 -963
  229. package/dist/translations/en.js +948 -948
  230. package/dist/translations/loader.d.ts +12 -12
  231. package/dist/translations/loader.js +9 -9
  232. package/dist/translations/loader.js.map +1 -1
  233. package/dist/wizard-checkbox.d.ts +37 -37
  234. package/dist/wizard-checkbox.js +130 -130
  235. package/dist/wizard-dialog.d.ts +45 -45
  236. package/dist/wizard-dialog.js +235 -235
  237. package/dist/wizard-dialog.js.map +1 -1
  238. package/dist/wizard-select.d.ts +31 -31
  239. package/dist/wizard-select.js +102 -102
  240. package/dist/wizard-textfield.d.ts +50 -50
  241. package/dist/wizard-textfield.js +162 -162
  242. package/dist/wizards.d.ts +23 -23
  243. package/dist/wizards.js +148 -148
  244. package/dist/wizards.js.map +1 -1
  245. package/dist/xml/src/foundation.js +67 -0
  246. package/dist/xml/src/foundation.js.map +1 -0
  247. package/dist/xml/src/index.js +2 -0
  248. package/dist/xml/src/index.js.map +1 -0
  249. package/package.json +29 -127
  250. package/dist/Wizarding.d.ts +0 -10
@@ -1,101 +1,101 @@
1
- import { __decorate } from "tslib";
2
- import { css, customElement, html, property, query, state, unsafeCSS, } from 'lit-element';
3
- import { get } from 'lit-translate';
4
- import '@material/mwc-checkbox';
5
- import '@material/mwc-formfield';
6
- import '@material/mwc-textfield';
7
- import { CheckListItem } from '@material/mwc-list/mwc-check-list-item';
8
- import { List } from '@material/mwc-list';
9
- import { ListBase } from '@material/mwc-list/mwc-list-base';
10
- function slotItem(item) {
11
- if (!item.closest('filtered-list') || !item.parentElement)
12
- return item;
13
- if (item.parentElement instanceof FilteredList)
14
- return item;
15
- return slotItem(item.parentElement);
16
- }
17
- function hideFiltered(item, searchText) {
18
- const itemInnerText = item.innerText + '\n';
19
- const childInnerText = Array.from(item.children)
20
- .map(child => child.innerText)
21
- .join('\n');
22
- const value = item.value;
23
- const filterTarget = (itemInnerText +
24
- childInnerText +
25
- value).toUpperCase();
26
- const terms = searchText
27
- .toUpperCase()
28
- .replace(/[.+^${}()|[\]\\]/g, '\\$&')
29
- .trim()
30
- .split(/\s+/g);
31
- (terms.length === 1 && terms[0] === '') ||
32
- terms.every(term => {
33
- // regexp escape
34
- const reTerm = new RegExp(`*${term}*`.replace(/\*/g, '.*').replace(/\?/g, '.{1}'), 'i');
35
- return reTerm.test(filterTarget);
36
- })
37
- ? slotItem(item).classList.remove('hidden')
38
- : slotItem(item).classList.add('hidden');
39
- }
40
- /**
41
- * A mwc-list with mwc-textfield that filters the list items for given or separated terms
42
- */
43
- let FilteredList = class FilteredList extends ListBase {
44
- get existCheckListItem() {
45
- return this.items.some(item => item instanceof CheckListItem);
46
- }
47
- get isAllSelected() {
48
- return this.items
49
- .filter(item => !item.disabled)
50
- .filter(item => item instanceof CheckListItem)
51
- .every(checkItem => checkItem.selected);
52
- }
53
- get isSomeSelected() {
54
- return this.items
55
- .filter(item => !item.disabled)
56
- .filter(item => item instanceof CheckListItem)
57
- .some(checkItem => checkItem.selected);
58
- }
59
- onCheckAll() {
60
- const select = !this.isAllSelected;
61
- this.items
62
- .filter(item => !item.disabled && !item.classList.contains('hidden'))
63
- .forEach(item => (item.selected = select));
64
- }
65
- onFilterInput() {
66
- Array.from(this.querySelectorAll('mwc-list-item, mwc-check-list-item, mwc-radio-list-item')).forEach(item => hideFiltered(item, this.searchField.value));
67
- }
68
- onListItemConnected(e) {
69
- super.onListItemConnected(e);
70
- this.requestUpdate();
71
- }
72
- update(changedProperties) {
73
- super.update(changedProperties);
74
- // regenerate filtering of text
75
- this.onFilterInput();
76
- }
77
- constructor() {
78
- super();
79
- /** Whether the check all option (checkbox next to search text field) is activated */
80
- this.disableCheckAll = false;
81
- this.addEventListener('selected', () => {
82
- this.requestUpdate();
83
- });
84
- }
85
- renderCheckAll() {
86
- return this.existCheckListItem && !this.disableCheckAll
1
+ import { __decorate } from "tslib";
2
+ import { css, customElement, html, property, query, state, unsafeCSS, } from 'lit-element';
3
+ import { get } from 'lit-translate';
4
+ import '@material/mwc-checkbox';
5
+ import '@material/mwc-formfield';
6
+ import '@material/mwc-textfield';
7
+ import { CheckListItem } from '@material/mwc-list/mwc-check-list-item';
8
+ import { List } from '@material/mwc-list';
9
+ import { ListBase } from '@material/mwc-list/mwc-list-base';
10
+ function slotItem(item) {
11
+ if (!item.closest('filtered-list') || !item.parentElement)
12
+ return item;
13
+ if (item.parentElement instanceof FilteredList)
14
+ return item;
15
+ return slotItem(item.parentElement);
16
+ }
17
+ function hideFiltered(item, searchText) {
18
+ const itemInnerText = item.innerText + '\n';
19
+ const childInnerText = Array.from(item.children)
20
+ .map(child => child.innerText)
21
+ .join('\n');
22
+ const value = item.value;
23
+ const filterTarget = (itemInnerText +
24
+ childInnerText +
25
+ value).toUpperCase();
26
+ const terms = searchText
27
+ .toUpperCase()
28
+ .replace(/[.+^${}()|[\]\\]/g, '\\$&')
29
+ .trim()
30
+ .split(/\s+/g);
31
+ (terms.length === 1 && terms[0] === '') ||
32
+ terms.every(term => {
33
+ // regexp escape
34
+ const reTerm = new RegExp(`*${term}*`.replace(/\*/g, '.*').replace(/\?/g, '.{1}'), 'i');
35
+ return reTerm.test(filterTarget);
36
+ })
37
+ ? slotItem(item).classList.remove('hidden')
38
+ : slotItem(item).classList.add('hidden');
39
+ }
40
+ /**
41
+ * A mwc-list with mwc-textfield that filters the list items for given or separated terms
42
+ */
43
+ let FilteredList = class FilteredList extends ListBase {
44
+ get existCheckListItem() {
45
+ return this.items.some(item => item instanceof CheckListItem);
46
+ }
47
+ get isAllSelected() {
48
+ return this.items
49
+ .filter(item => !item.disabled)
50
+ .filter(item => item instanceof CheckListItem)
51
+ .every(checkItem => checkItem.selected);
52
+ }
53
+ get isSomeSelected() {
54
+ return this.items
55
+ .filter(item => !item.disabled)
56
+ .filter(item => item instanceof CheckListItem)
57
+ .some(checkItem => checkItem.selected);
58
+ }
59
+ onCheckAll() {
60
+ const select = !this.isAllSelected;
61
+ this.items
62
+ .filter(item => !item.disabled && !item.classList.contains('hidden'))
63
+ .forEach(item => (item.selected = select));
64
+ }
65
+ onFilterInput() {
66
+ Array.from(this.querySelectorAll('mwc-list-item, mwc-check-list-item, mwc-radio-list-item')).forEach(item => hideFiltered(item, this.searchField.value));
67
+ }
68
+ onListItemConnected(e) {
69
+ super.onListItemConnected(e);
70
+ this.requestUpdate();
71
+ }
72
+ update(changedProperties) {
73
+ super.update(changedProperties);
74
+ // regenerate filtering of text
75
+ this.onFilterInput();
76
+ }
77
+ constructor() {
78
+ super();
79
+ /** Whether the check all option (checkbox next to search text field) is activated */
80
+ this.disableCheckAll = false;
81
+ this.addEventListener('selected', () => {
82
+ this.requestUpdate();
83
+ });
84
+ }
85
+ renderCheckAll() {
86
+ return this.existCheckListItem && !this.disableCheckAll
87
87
  ? html `<mwc-formfield class="checkall"
88
88
  ><mwc-checkbox
89
89
  ?indeterminate=${!this.isAllSelected && this.isSomeSelected}
90
90
  ?checked=${this.isAllSelected}
91
- @change=${() => {
92
- this.onCheckAll();
91
+ @change=${() => {
92
+ this.onCheckAll();
93
93
  }}
94
94
  ></mwc-checkbox
95
- ></mwc-formfield>`
96
- : html ``;
97
- }
98
- render() {
95
+ ></mwc-formfield>`
96
+ : html ``;
97
+ }
98
+ render() {
99
99
  return html `<div id="tfcontainer">
100
100
  <abbr title="${this.searchFieldLabel ?? get('filter')}"
101
101
  ><mwc-textfield
@@ -107,9 +107,9 @@ let FilteredList = class FilteredList extends ListBase {
107
107
  ></abbr>
108
108
  ${this.renderCheckAll()}
109
109
  </div>
110
- ${super.render()}`;
111
- }
112
- };
110
+ ${super.render()}`;
111
+ }
112
+ };
113
113
  FilteredList.styles = css `
114
114
  ${unsafeCSS(List.styles)}
115
115
 
@@ -142,27 +142,27 @@ FilteredList.styles = css `
142
142
  .mdc-list {
143
143
  padding-inline-start: 0px;
144
144
  }
145
- `;
146
- __decorate([
147
- property({ type: String })
148
- ], FilteredList.prototype, "searchFieldLabel", void 0);
149
- __decorate([
150
- property({ type: Boolean })
151
- ], FilteredList.prototype, "disableCheckAll", void 0);
152
- __decorate([
153
- state()
154
- ], FilteredList.prototype, "existCheckListItem", null);
155
- __decorate([
156
- state()
157
- ], FilteredList.prototype, "isAllSelected", null);
158
- __decorate([
159
- state()
160
- ], FilteredList.prototype, "isSomeSelected", null);
161
- __decorate([
162
- query('mwc-textfield')
163
- ], FilteredList.prototype, "searchField", void 0);
164
- FilteredList = __decorate([
165
- customElement('filtered-list')
166
- ], FilteredList);
167
- export { FilteredList };
145
+ `;
146
+ __decorate([
147
+ property({ type: String })
148
+ ], FilteredList.prototype, "searchFieldLabel", void 0);
149
+ __decorate([
150
+ property({ type: Boolean })
151
+ ], FilteredList.prototype, "disableCheckAll", void 0);
152
+ __decorate([
153
+ state()
154
+ ], FilteredList.prototype, "existCheckListItem", null);
155
+ __decorate([
156
+ state()
157
+ ], FilteredList.prototype, "isAllSelected", null);
158
+ __decorate([
159
+ state()
160
+ ], FilteredList.prototype, "isSomeSelected", null);
161
+ __decorate([
162
+ query('mwc-textfield')
163
+ ], FilteredList.prototype, "searchField", void 0);
164
+ FilteredList = __decorate([
165
+ customElement('filtered-list')
166
+ ], FilteredList);
167
+ export { FilteredList };
168
168
  //# sourceMappingURL=filtered-list.js.map
@@ -1,37 +1,37 @@
1
- import { LitElement, TemplateResult } from 'lit-element';
2
- import '@material/mwc-icon';
3
- import '@material/mwc-list';
4
- import '@material/mwc-list/mwc-list-item';
5
- import { SingleSelectedEvent } from '@material/mwc-list/mwc-list-foundation';
6
- import './filtered-list.js';
7
- export type Selection = {
8
- [name: string]: Selection;
9
- };
10
- export type Path = string[];
11
- export interface Directory {
12
- path: Path;
13
- header?: TemplateResult;
14
- entries: string[];
15
- }
16
- export declare class FinderList extends LitElement {
17
- selection: Selection;
18
- multi: boolean;
19
- get depth(): number;
20
- get paths(): Path[];
21
- set paths(paths: Path[]);
22
- get path(): Path;
23
- set path(path: Path);
24
- read: (path: Path) => Promise<Directory>;
25
- loaded: Promise<void>;
26
- getTitle(path: string[]): string;
27
- getDisplayString(entry: string, path: string[]): string;
28
- container: Element;
29
- private getPaths;
30
- multiSelect(event: SingleSelectedEvent, path: Path, clicked: string): void;
31
- singleSelect(event: SingleSelectedEvent, path: Path, clicked: string): void;
32
- select(event: SingleSelectedEvent, path: Path): Promise<void>;
33
- renderDirectory(path: Path, entries: string[]): TemplateResult;
34
- renderColumn(column: number): Promise<TemplateResult>;
35
- render(): TemplateResult;
36
- static styles: import("lit-element").CSSResult;
37
- }
1
+ import { LitElement, TemplateResult } from 'lit-element';
2
+ import '@material/mwc-icon';
3
+ import '@material/mwc-list';
4
+ import '@material/mwc-list/mwc-list-item';
5
+ import { SingleSelectedEvent } from '@material/mwc-list/mwc-list-foundation';
6
+ import './filtered-list.js';
7
+ export type Selection = {
8
+ [name: string]: Selection;
9
+ };
10
+ export type Path = string[];
11
+ export interface Directory {
12
+ path: Path;
13
+ header?: TemplateResult;
14
+ entries: string[];
15
+ }
16
+ export declare class FinderList extends LitElement {
17
+ selection: Selection;
18
+ multi: boolean;
19
+ get depth(): number;
20
+ get paths(): Path[];
21
+ set paths(paths: Path[]);
22
+ get path(): Path;
23
+ set path(path: Path);
24
+ read: (path: Path) => Promise<Directory>;
25
+ loaded: Promise<void>;
26
+ getTitle(path: string[]): string;
27
+ getDisplayString(entry: string, path: string[]): string;
28
+ container: Element;
29
+ private getPaths;
30
+ multiSelect(event: SingleSelectedEvent, path: Path, clicked: string): void;
31
+ singleSelect(event: SingleSelectedEvent, path: Path, clicked: string): void;
32
+ select(event: SingleSelectedEvent, path: Path): Promise<void>;
33
+ renderDirectory(path: Path, entries: string[]): TemplateResult;
34
+ renderColumn(column: number): Promise<TemplateResult>;
35
+ render(): TemplateResult;
36
+ static styles: import("lit-element").CSSResult;
37
+ }
@@ -1,144 +1,144 @@
1
- import { __decorate } from "tslib";
2
- import { css, customElement, html, LitElement, property, query, } from 'lit-element';
3
- import { until } from 'lit-html/directives/until';
4
- import { get } from 'lit-translate';
5
- import '@material/mwc-icon';
6
- import '@material/mwc-list';
7
- import '@material/mwc-list/mwc-list-item';
8
- import './filtered-list.js';
9
- import { depth } from './foundation.js';
10
- import { ifDefined } from 'lit-html/directives/if-defined';
1
+ import { __decorate } from "tslib";
2
+ import { css, customElement, html, LitElement, property, query, } from 'lit-element';
3
+ import { until } from 'lit-html/directives/until';
4
+ import { get } from 'lit-translate';
5
+ import '@material/mwc-icon';
6
+ import '@material/mwc-list';
7
+ import '@material/mwc-list/mwc-list-item';
8
+ import './filtered-list.js';
9
+ import { depth } from './foundation.js';
10
+ import { ifDefined } from 'lit-html/directives/if-defined';
11
11
  const waitingList = html `<div class="column">
12
12
  <mwc-list
13
13
  ><mwc-list-item noninteractive hasMeta
14
14
  >${get('loading')}<mwc-icon slot="meta">pending</mwc-icon></mwc-list-item
15
15
  ></mwc-list
16
16
  >
17
- </div>`;
18
- let FinderList = class FinderList extends LitElement {
19
- constructor() {
20
- super(...arguments);
21
- this.selection = {};
22
- this.multi = false;
23
- this.read = async (path) => {
24
- return {
25
- path,
26
- header: html `<h2>${'/' + path.join('/')}</h2>`,
27
- entries: [],
28
- };
29
- };
30
- this.loaded = Promise.resolve();
31
- }
32
- get depth() {
33
- return depth(this.selection);
34
- }
35
- get paths() {
36
- return this.getPaths();
37
- }
38
- set paths(paths) {
39
- const selection = {};
40
- for (const path of paths) {
41
- let i = selection;
42
- for (const name of path) {
43
- if (!Object.prototype.hasOwnProperty.call(i, name))
44
- i[name] = {};
45
- i = i[name];
46
- }
47
- }
48
- this.selection = selection;
49
- }
50
- get path() {
51
- return this.paths[0] ?? [];
52
- }
53
- set path(path) {
54
- this.paths = [path];
55
- }
56
- getTitle(path) {
57
- return path.join('/');
58
- }
59
- getDisplayString(entry, path) {
60
- return entry;
61
- }
62
- getPaths(depth) {
63
- let paths = Object.keys(this.selection).map(key => [key]);
64
- let i = depth ?? this.depth - 1;
65
- while (i-- > 0) {
66
- paths = paths.flatMap(path => {
67
- let dir = this.selection;
68
- for (const entry of path)
69
- dir = dir[entry]; // recursive descent
70
- const newPaths = Object.keys(dir).map(entry => path.concat(entry));
71
- return newPaths.length === 0 ? [path] : newPaths;
72
- });
73
- }
74
- return depth === undefined
75
- ? paths
76
- : paths.filter(path => path.length > depth);
77
- }
78
- multiSelect(event, path, clicked) {
79
- let dir = this.selection;
80
- for (const entry of path)
81
- dir = dir[entry]; // recursive descent
82
- if (dir && dir[clicked])
83
- delete dir[clicked];
84
- // deselect if selected
85
- else
86
- dir[clicked] = {}; // select otherwise
87
- }
88
- singleSelect(event, path, clicked) {
89
- if (this.path[path.length] === clicked)
90
- this.path = path;
91
- // deselect if selected
92
- else
93
- this.path = path.concat(clicked); // select otherwise
94
- }
95
- async select(event, path) {
96
- const clicked = event.target.selected.value;
97
- if (this.multi)
98
- this.multiSelect(event, path, clicked);
99
- else
100
- this.singleSelect(event, path, clicked);
101
- this.requestUpdate();
102
- await this.updateComplete;
103
- await new Promise(resolve => setTimeout(resolve, 250));
104
- this.container.scrollLeft = 1000 * this.depth;
105
- }
106
- renderDirectory(path, entries) {
17
+ </div>`;
18
+ let FinderList = class FinderList extends LitElement {
19
+ constructor() {
20
+ super(...arguments);
21
+ this.selection = {};
22
+ this.multi = false;
23
+ this.read = async (path) => {
24
+ return {
25
+ path,
26
+ header: html `<h2>${'/' + path.join('/')}</h2>`,
27
+ entries: [],
28
+ };
29
+ };
30
+ this.loaded = Promise.resolve();
31
+ }
32
+ get depth() {
33
+ return depth(this.selection);
34
+ }
35
+ get paths() {
36
+ return this.getPaths();
37
+ }
38
+ set paths(paths) {
39
+ const selection = {};
40
+ for (const path of paths) {
41
+ let i = selection;
42
+ for (const name of path) {
43
+ if (!Object.prototype.hasOwnProperty.call(i, name))
44
+ i[name] = {};
45
+ i = i[name];
46
+ }
47
+ }
48
+ this.selection = selection;
49
+ }
50
+ get path() {
51
+ return this.paths[0] ?? [];
52
+ }
53
+ set path(path) {
54
+ this.paths = [path];
55
+ }
56
+ getTitle(path) {
57
+ return path.join('/');
58
+ }
59
+ getDisplayString(entry, path) {
60
+ return entry;
61
+ }
62
+ getPaths(depth) {
63
+ let paths = Object.keys(this.selection).map(key => [key]);
64
+ let i = depth ?? this.depth - 1;
65
+ while (i-- > 0) {
66
+ paths = paths.flatMap(path => {
67
+ let dir = this.selection;
68
+ for (const entry of path)
69
+ dir = dir[entry]; // recursive descent
70
+ const newPaths = Object.keys(dir).map(entry => path.concat(entry));
71
+ return newPaths.length === 0 ? [path] : newPaths;
72
+ });
73
+ }
74
+ return depth === undefined
75
+ ? paths
76
+ : paths.filter(path => path.length > depth);
77
+ }
78
+ multiSelect(event, path, clicked) {
79
+ let dir = this.selection;
80
+ for (const entry of path)
81
+ dir = dir[entry]; // recursive descent
82
+ if (dir && dir[clicked])
83
+ delete dir[clicked];
84
+ // deselect if selected
85
+ else
86
+ dir[clicked] = {}; // select otherwise
87
+ }
88
+ singleSelect(event, path, clicked) {
89
+ if (this.path[path.length] === clicked)
90
+ this.path = path;
91
+ // deselect if selected
92
+ else
93
+ this.path = path.concat(clicked); // select otherwise
94
+ }
95
+ async select(event, path) {
96
+ const clicked = event.target.selected.value;
97
+ if (this.multi)
98
+ this.multiSelect(event, path, clicked);
99
+ else
100
+ this.singleSelect(event, path, clicked);
101
+ this.requestUpdate();
102
+ await this.updateComplete;
103
+ await new Promise(resolve => setTimeout(resolve, 250));
104
+ this.container.scrollLeft = 1000 * this.depth;
105
+ }
106
+ renderDirectory(path, entries) {
107
107
  return html `<filtered-list
108
108
  @selected=${(e) => this.select(e, path)}
109
109
  searchFieldLabel="${this.getTitle(path)}"
110
110
  >
111
111
  ${entries.map(entry => html `<mwc-list-item
112
112
  value="${entry}"
113
- ?activated=${this.getPaths(path.length)
114
- .map(p => JSON.stringify(p))
113
+ ?activated=${this.getPaths(path.length)
114
+ .map(p => JSON.stringify(p))
115
115
  .includes(JSON.stringify(path.concat(entry)))}
116
116
  >${this.getDisplayString(entry, path)}</mwc-list-item
117
117
  >`)}
118
- </filtered-list>`;
119
- }
120
- async renderColumn(column) {
121
- const paths = this.getPaths(column);
122
- const dirs = paths.map(path => this.read(path));
123
- const lists = [];
124
- for await (const { header, entries, path } of dirs) {
125
- if (header || entries.length > 0)
126
- lists.push(html `${ifDefined(header)} ${this.renderDirectory(path, entries)}`);
127
- }
128
- if (lists.length === 0)
129
- return html ``;
130
- return html `<div class="column">${lists}</div>`;
131
- }
132
- render() {
133
- const columns = new Array(this.depth)
134
- .fill(0)
135
- .map((_, index) => this.renderColumn(index));
136
- this.loaded = Promise.allSettled(columns).then();
118
+ </filtered-list>`;
119
+ }
120
+ async renderColumn(column) {
121
+ const paths = this.getPaths(column);
122
+ const dirs = paths.map(path => this.read(path));
123
+ const lists = [];
124
+ for await (const { header, entries, path } of dirs) {
125
+ if (header || entries.length > 0)
126
+ lists.push(html `${ifDefined(header)} ${this.renderDirectory(path, entries)}`);
127
+ }
128
+ if (lists.length === 0)
129
+ return html ``;
130
+ return html `<div class="column">${lists}</div>`;
131
+ }
132
+ render() {
133
+ const columns = new Array(this.depth)
134
+ .fill(0)
135
+ .map((_, index) => this.renderColumn(index));
136
+ this.loaded = Promise.allSettled(columns).then();
137
137
  return html `<div class="pane">
138
138
  ${columns.map(column => until(column, waitingList))}
139
- </div>`;
140
- }
141
- };
139
+ </div>`;
140
+ }
141
+ };
142
142
  FinderList.styles = css `
143
143
  div.pane {
144
144
  display: flex;
@@ -175,33 +175,33 @@ FinderList.styles = css `
175
175
  a:visited {
176
176
  color: var(--mdc-theme-secondary);
177
177
  }
178
- `;
179
- __decorate([
180
- property({ type: Object })
181
- ], FinderList.prototype, "selection", void 0);
182
- __decorate([
183
- property({ type: Boolean })
184
- ], FinderList.prototype, "multi", void 0);
185
- __decorate([
186
- property({ type: Number })
187
- ], FinderList.prototype, "depth", null);
188
- __decorate([
189
- property({ type: Array })
190
- ], FinderList.prototype, "paths", null);
191
- __decorate([
192
- property({ type: Array })
193
- ], FinderList.prototype, "path", null);
194
- __decorate([
195
- property({ attribute: false })
196
- ], FinderList.prototype, "read", void 0);
197
- __decorate([
198
- property({ attribute: false })
199
- ], FinderList.prototype, "loaded", void 0);
200
- __decorate([
201
- query('div')
202
- ], FinderList.prototype, "container", void 0);
203
- FinderList = __decorate([
204
- customElement('finder-list')
205
- ], FinderList);
206
- export { FinderList };
178
+ `;
179
+ __decorate([
180
+ property({ type: Object })
181
+ ], FinderList.prototype, "selection", void 0);
182
+ __decorate([
183
+ property({ type: Boolean })
184
+ ], FinderList.prototype, "multi", void 0);
185
+ __decorate([
186
+ property({ type: Number })
187
+ ], FinderList.prototype, "depth", null);
188
+ __decorate([
189
+ property({ type: Array })
190
+ ], FinderList.prototype, "paths", null);
191
+ __decorate([
192
+ property({ type: Array })
193
+ ], FinderList.prototype, "path", null);
194
+ __decorate([
195
+ property({ attribute: false })
196
+ ], FinderList.prototype, "read", void 0);
197
+ __decorate([
198
+ property({ attribute: false })
199
+ ], FinderList.prototype, "loaded", void 0);
200
+ __decorate([
201
+ query('div')
202
+ ], FinderList.prototype, "container", void 0);
203
+ FinderList = __decorate([
204
+ customElement('finder-list')
205
+ ], FinderList);
206
+ export { FinderList };
207
207
  //# sourceMappingURL=finder-list.js.map