@ng-atomic/components 20.69.4 → 20.74.3
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/fesm2022/ng-atomic-components-atoms-icon.mjs +2 -2
- package/fesm2022/ng-atomic-components-atoms-value-cell.mjs +2 -2
- package/fesm2022/ng-atomic-components-frames-app.mjs +2 -2
- package/fesm2022/ng-atomic-components-frames-auto-layout.mjs +2 -2
- package/fesm2022/ng-atomic-components-frames-breadcrumb-navbar.mjs +2 -2
- package/fesm2022/ng-atomic-components-frames-card.mjs +2 -2
- package/fesm2022/ng-atomic-components-frames-columns.mjs +2 -2
- package/fesm2022/ng-atomic-components-frames-divider.mjs +2 -2
- package/fesm2022/ng-atomic-components-frames-drawer.mjs +2 -2
- package/fesm2022/ng-atomic-components-frames-entrance.mjs +2 -2
- package/fesm2022/ng-atomic-components-frames-fab.mjs +2 -2
- package/fesm2022/ng-atomic-components-frames-horizontal-divider.mjs +2 -2
- package/fesm2022/ng-atomic-components-frames-line-up.mjs +2 -2
- package/fesm2022/ng-atomic-components-frames-loading.mjs +2 -2
- package/fesm2022/ng-atomic-components-frames-router-outlet.mjs +2 -2
- package/fesm2022/ng-atomic-components-frames-scroll.mjs +2 -2
- package/fesm2022/ng-atomic-components-frames-side-nav.mjs +2 -2
- package/fesm2022/ng-atomic-components-frames-smart-menu.mjs +2 -2
- package/fesm2022/ng-atomic-components-frames-vertical-hide.mjs +2 -2
- package/fesm2022/ng-atomic-components-molecules-date-input-field.mjs +2 -2
- package/fesm2022/ng-atomic-components-molecules-date-range-input-field.mjs +2 -2
- package/fesm2022/ng-atomic-components-molecules-grid-item.mjs +2 -2
- package/fesm2022/ng-atomic-components-molecules-loading-box.mjs +2 -2
- package/fesm2022/ng-atomic-components-molecules-navigation-list-item.mjs +2 -2
- package/fesm2022/ng-atomic-components-molecules-select-input-field.mjs +2 -2
- package/fesm2022/ng-atomic-components-molecules-thread-message.mjs +2 -2
- package/fesm2022/ng-atomic-components-organisms-action-buttons-section.mjs +2 -2
- package/fesm2022/ng-atomic-components-organisms-action-input-section.mjs +2 -2
- package/fesm2022/ng-atomic-components-organisms-breadcrumb-navbar.mjs +2 -2
- package/fesm2022/ng-atomic-components-organisms-card-input-section.mjs +2 -2
- package/fesm2022/ng-atomic-components-organisms-cvc-and-exp-input-section.mjs +2 -2
- package/fesm2022/ng-atomic-components-organisms-date-input-section.mjs +2 -2
- package/fesm2022/ng-atomic-components-organisms-date-range-input-section.mjs +2 -2
- package/fesm2022/ng-atomic-components-organisms-definition-list.mjs +2 -2
- package/fesm2022/ng-atomic-components-organisms-file-input-section.mjs +2 -2
- package/fesm2022/ng-atomic-components-organisms-grid-cards-section.mjs +2 -2
- package/fesm2022/ng-atomic-components-organisms-heading.mjs +2 -2
- package/fesm2022/ng-atomic-components-organisms-menu-footer.mjs +2 -2
- package/fesm2022/ng-atomic-components-organisms-menu-header.mjs +2 -2
- package/fesm2022/ng-atomic-components-organisms-messages-section.mjs +2 -2
- package/fesm2022/ng-atomic-components-organisms-navigation-list.mjs +2 -2
- package/fesm2022/ng-atomic-components-organisms-navigator.mjs +2 -2
- package/fesm2022/ng-atomic-components-organisms-number-input-section.mjs +2 -2
- package/fesm2022/ng-atomic-components-organisms-paginator.mjs +2 -2
- package/fesm2022/ng-atomic-components-organisms-password-input-section.mjs +2 -2
- package/fesm2022/ng-atomic-components-organisms-select-input-section.mjs +2 -2
- package/fesm2022/ng-atomic-components-organisms-slider-input-section.mjs +2 -2
- package/fesm2022/ng-atomic-components-organisms-social-login-section.mjs +2 -2
- package/fesm2022/ng-atomic-components-organisms-table.mjs +2 -2
- package/fesm2022/ng-atomic-components-organisms-text-input-section.mjs +2 -2
- package/fesm2022/ng-atomic-components-organisms-textarea-section.mjs +2 -2
- package/fesm2022/ng-atomic-components-organisms-thread-messages-section.mjs +2 -2
- package/fesm2022/ng-atomic-components-pages-_index.mjs +2 -2
- package/fesm2022/ng-atomic-components-pages-columns.mjs +2 -2
- package/fesm2022/ng-atomic-components-pages-form.mjs +2 -2
- package/fesm2022/ng-atomic-components-templates-_index.mjs +2 -2
- package/fesm2022/ng-atomic-components-templates-background.mjs +2 -2
- package/fesm2022/ng-atomic-components-templates-code-editor.mjs +2 -2
- package/fesm2022/ng-atomic-components-templates-columns.mjs +2 -2
- package/fesm2022/ng-atomic-components-templates-entrance.mjs +2 -2
- package/fesm2022/ng-atomic-components-templates-form.mjs +4 -4
- package/fesm2022/ng-atomic-components-templates-icon-button-menu.mjs +2 -2
- package/fesm2022/ng-atomic-components-templates-menu.mjs +2 -2
- package/fesm2022/ng-atomic-components-templates-selection.mjs +2 -2
- package/fesm2022/ng-atomic-components-templates-settings.mjs +2 -2
- package/package.json +3 -15
- package/fesm2022/ng-atomic-components-organisms-graphql-editor.mjs +0 -114
- package/fesm2022/ng-atomic-components-organisms-tree-section.mjs +0 -208
- package/fesm2022/ng-atomic-components-templates-file-tree.mjs +0 -99
- package/types/ng-atomic-components-organisms-graphql-editor.d.ts +0 -31
- package/types/ng-atomic-components-organisms-tree-section.d.ts +0 -50
- package/types/ng-atomic-components-templates-file-tree.d.ts +0 -27
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter, Output, Input, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
-
import { lineNumbers, keymap } from '@codemirror/view';
|
|
4
|
-
import { history, indentWithTab } from '@codemirror/commands';
|
|
5
|
-
import { closeBrackets, autocompletion } from '@codemirror/autocomplete';
|
|
6
|
-
import { bracketMatching, syntaxHighlighting } from '@codemirror/language';
|
|
7
|
-
import { oneDark, oneDarkHighlightStyle } from '@codemirror/theme-one-dark';
|
|
8
|
-
import { EditorState } from '@codemirror/state';
|
|
9
|
-
import { graphql } from 'cm6-graphql';
|
|
10
|
-
import { EditorView, basicSetup } from 'codemirror';
|
|
11
|
-
import { ReplaySubject, combineLatest, startWith, filter, distinctUntilChanged } from 'rxjs';
|
|
12
|
-
import { FormControl } from '@angular/forms';
|
|
13
|
-
import * as i1 from '@angular/common';
|
|
14
|
-
import { CommonModule } from '@angular/common';
|
|
15
|
-
import { EditorComponent } from '@ng-atomic/components/extras/editor';
|
|
16
|
-
import { NgAtomicComponent } from '@ng-atomic/core';
|
|
17
|
-
|
|
18
|
-
class GraphqlExtractor {
|
|
19
|
-
extract(output) {
|
|
20
|
-
return output.split('```')?.[1]?.replace(/^graphql/, '')?.replace(/^\n/, '') ?? '';
|
|
21
|
-
}
|
|
22
|
-
insert(query) {
|
|
23
|
-
return `\`\`\`graphql\n${query}\`\`\``;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
var ActionId;
|
|
27
|
-
(function (ActionId) {
|
|
28
|
-
ActionId["EXECUTE"] = "execute";
|
|
29
|
-
ActionId["SAVE"] = "save";
|
|
30
|
-
})(ActionId || (ActionId = {}));
|
|
31
|
-
class GraphqlEditorOrganism extends NgAtomicComponent {
|
|
32
|
-
constructor() {
|
|
33
|
-
super(...arguments);
|
|
34
|
-
this.schema$ = new ReplaySubject(1);
|
|
35
|
-
this.control = new FormControl('');
|
|
36
|
-
this.keyActions = [];
|
|
37
|
-
this.action = new EventEmitter();
|
|
38
|
-
}
|
|
39
|
-
set schema(value) {
|
|
40
|
-
this.schema$.next(value);
|
|
41
|
-
}
|
|
42
|
-
ngOnInit() {
|
|
43
|
-
combineLatest({
|
|
44
|
-
schema: this.schema$,
|
|
45
|
-
value: this.control.valueChanges.pipe(startWith(this.control.value), filter(value => value !== this.state?.doc?.toString())),
|
|
46
|
-
}).pipe(filter(({ schema }) => !!schema), distinctUntilChanged()).subscribe(params => {
|
|
47
|
-
console.debug('params:', params);
|
|
48
|
-
this.state = this.makeEditorState({ schema: params.schema, value: params.value ?? '' });
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
makeEditorState({ schema, value }) {
|
|
52
|
-
return EditorState.create({
|
|
53
|
-
doc: value,
|
|
54
|
-
extensions: [
|
|
55
|
-
makeKeymapExtension(this.keyActions, action => this.dispatch(action)),
|
|
56
|
-
EditorView.updateListener.of((update) => {
|
|
57
|
-
if (update.docChanged)
|
|
58
|
-
return;
|
|
59
|
-
this.control.setValue(update.state.doc.toString());
|
|
60
|
-
}),
|
|
61
|
-
...CODEMIRROR_EXTENSIONS,
|
|
62
|
-
makeGraphqlExtension(schema),
|
|
63
|
-
],
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: GraphqlEditorOrganism, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
67
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.25", type: GraphqlEditorOrganism, isStandalone: true, selector: "organisms-graphql-editor", inputs: { control: "control", schema: "schema", keyActions: "keyActions" }, outputs: { action: "action" }, usesInheritance: true, ngImport: i0, template: `<extras-editor *ngIf="state" [state]="state"></extras-editor>`, isInline: true, styles: [":host{display:block}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: EditorComponent, selector: "extras-editor" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
68
|
-
}
|
|
69
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: GraphqlEditorOrganism, decorators: [{
|
|
70
|
-
type: Component,
|
|
71
|
-
args: [{ imports: [
|
|
72
|
-
CommonModule,
|
|
73
|
-
EditorComponent,
|
|
74
|
-
], selector: 'organisms-graphql-editor', template: `<extras-editor *ngIf="state" [state]="state"></extras-editor>`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block}\n"] }]
|
|
75
|
-
}], propDecorators: { control: [{
|
|
76
|
-
type: Input
|
|
77
|
-
}], schema: [{
|
|
78
|
-
type: Input
|
|
79
|
-
}], keyActions: [{
|
|
80
|
-
type: Input
|
|
81
|
-
}], action: [{
|
|
82
|
-
type: Output
|
|
83
|
-
}] } });
|
|
84
|
-
const CODEMIRROR_EXTENSIONS = [
|
|
85
|
-
basicSetup,
|
|
86
|
-
bracketMatching(),
|
|
87
|
-
closeBrackets(),
|
|
88
|
-
history(),
|
|
89
|
-
autocompletion(),
|
|
90
|
-
lineNumbers(),
|
|
91
|
-
oneDark,
|
|
92
|
-
syntaxHighlighting(oneDarkHighlightStyle),
|
|
93
|
-
];
|
|
94
|
-
function makeKeymapExtension(keyActions, callback) {
|
|
95
|
-
return keymap.of([
|
|
96
|
-
...keyActions.map(({ key, actionId }) => ({
|
|
97
|
-
key,
|
|
98
|
-
run: () => (callback({ id: actionId, payload: { key } }), true),
|
|
99
|
-
})),
|
|
100
|
-
indentWithTab,
|
|
101
|
-
]);
|
|
102
|
-
}
|
|
103
|
-
function makeGraphqlExtension(schema) {
|
|
104
|
-
return graphql(schema, {
|
|
105
|
-
onShowInDocs: (field, type, parentType) => alert(`Showing in docs.: Field: ${field}, Type: ${type}, ParentType: ${parentType}`),
|
|
106
|
-
onFillAllFields: (view, schema, _query, cursor, token) => alert(`Filling all fields. Token: ${token}`),
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* Generated bundle index. Do not edit.
|
|
112
|
-
*/
|
|
113
|
-
|
|
114
|
-
export { ActionId, GraphqlEditorOrganism, GraphqlExtractor };
|
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter, Output, Input, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
-
import { CommonModule } from '@angular/common';
|
|
4
|
-
import * as i1 from '@angular/material/tree';
|
|
5
|
-
import { MatTreeFlattener, MatTreeFlatDataSource, MatTreeModule } from '@angular/material/tree';
|
|
6
|
-
import { FlatTreeControl } from '@angular/cdk/tree';
|
|
7
|
-
import { MatIconModule } from '@angular/material/icon';
|
|
8
|
-
import { MatButtonModule } from '@angular/material/button';
|
|
9
|
-
import * as i2 from '@angular/material/checkbox';
|
|
10
|
-
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
11
|
-
import { SelectionModel } from '@angular/cdk/collections';
|
|
12
|
-
import * as gql from 'gql-query-builder';
|
|
13
|
-
import { print, parse } from 'graphql';
|
|
14
|
-
|
|
15
|
-
function format(query) {
|
|
16
|
-
return print(parse(query));
|
|
17
|
-
}
|
|
18
|
-
class Node {
|
|
19
|
-
}
|
|
20
|
-
class FlatNode {
|
|
21
|
-
}
|
|
22
|
-
var ActionId;
|
|
23
|
-
(function (ActionId) {
|
|
24
|
-
ActionId["CHANGE_QUERY"] = "[@ng-atomic/components/organisms/tree-section] Change Query";
|
|
25
|
-
})(ActionId || (ActionId = {}));
|
|
26
|
-
class TreeSectionOrganism {
|
|
27
|
-
constructor() {
|
|
28
|
-
this.flatNodeMap = new Map();
|
|
29
|
-
this.nestedNodeMap = new Map();
|
|
30
|
-
this.getLevel = (node) => node.level;
|
|
31
|
-
this.isExpandable = (node) => node.expandable;
|
|
32
|
-
this.treeControl = new FlatTreeControl(this.getLevel, this.isExpandable);
|
|
33
|
-
this.hasChild = (_, _nodeData) => _nodeData.expandable;
|
|
34
|
-
this.getChildren = (node) => node.children;
|
|
35
|
-
this.transformer = (node, level) => {
|
|
36
|
-
const existingNode = this.nestedNodeMap.get(node);
|
|
37
|
-
const flatNode = existingNode && existingNode.item === node.item ? existingNode : new FlatNode();
|
|
38
|
-
flatNode.item = node.item;
|
|
39
|
-
flatNode.level = level;
|
|
40
|
-
flatNode.expandable = !!node.children?.length;
|
|
41
|
-
this.flatNodeMap.set(flatNode, node);
|
|
42
|
-
this.nestedNodeMap.set(node, flatNode);
|
|
43
|
-
return flatNode;
|
|
44
|
-
};
|
|
45
|
-
this.treeFlattener = new MatTreeFlattener(this.transformer, this.getLevel, this.isExpandable, this.getChildren);
|
|
46
|
-
this.dataSource = new MatTreeFlatDataSource(this.treeControl, this.treeFlattener);
|
|
47
|
-
this.selection = new SelectionModel(true);
|
|
48
|
-
this.data = {};
|
|
49
|
-
this.action = new EventEmitter();
|
|
50
|
-
}
|
|
51
|
-
buildNode(obj, level) {
|
|
52
|
-
return Object.keys(obj).reduce((accumulator, key) => {
|
|
53
|
-
const value = obj[key];
|
|
54
|
-
const node = new Node();
|
|
55
|
-
node.item = key;
|
|
56
|
-
if (value != null) {
|
|
57
|
-
if (typeof value === 'object') {
|
|
58
|
-
node.children = this.buildNode(value, level + 1);
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
node.item = value;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
return accumulator.concat(node);
|
|
65
|
-
}, []);
|
|
66
|
-
}
|
|
67
|
-
buildValueNode(nodes) {
|
|
68
|
-
return (nodes ?? []).map(node => {
|
|
69
|
-
const flatNode = this.nestedNodeMap.get(node);
|
|
70
|
-
node.value = this.selection.isSelected(flatNode);
|
|
71
|
-
node.children = this.buildValueNode(node.children);
|
|
72
|
-
return node;
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
buildFields(nodes) {
|
|
76
|
-
return nodes.reduce((acc, node) => {
|
|
77
|
-
if (node.value) {
|
|
78
|
-
if (node?.children?.length) {
|
|
79
|
-
return [...acc, { [node.item]: this.buildFields(node.children) }];
|
|
80
|
-
}
|
|
81
|
-
else {
|
|
82
|
-
return [...acc, node.item];
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
86
|
-
return [...acc];
|
|
87
|
-
}
|
|
88
|
-
}, []);
|
|
89
|
-
}
|
|
90
|
-
onChange() {
|
|
91
|
-
const nodes = this.buildValueNode(this.dataSource.data ?? []);
|
|
92
|
-
const fields = this.buildFields(nodes);
|
|
93
|
-
const options = fields.map(field => ({
|
|
94
|
-
operation: Object.keys(field)[0],
|
|
95
|
-
fields: Object.values(field)[0],
|
|
96
|
-
variables: {
|
|
97
|
-
take: {
|
|
98
|
-
value: 10,
|
|
99
|
-
required: false,
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
}));
|
|
103
|
-
const query = gql.query(options);
|
|
104
|
-
console.debug('parsed:', parse(query.query));
|
|
105
|
-
this.action.emit({
|
|
106
|
-
id: ActionId.CHANGE_QUERY,
|
|
107
|
-
payload: { query: format(query.query), variables: query.variables },
|
|
108
|
-
});
|
|
109
|
-
console.debug('query:', format(query.query));
|
|
110
|
-
}
|
|
111
|
-
ngOnInit() {
|
|
112
|
-
this.dataSource.data = this.buildNode(this.data, 0);
|
|
113
|
-
}
|
|
114
|
-
todoLeafItemSelectionToggle(node) {
|
|
115
|
-
console.debug('todoItemSelectionToggle', node);
|
|
116
|
-
if (this.selection.isSelected(node)) {
|
|
117
|
-
this.selection.deselect(node);
|
|
118
|
-
this.treeControl.collapse(node);
|
|
119
|
-
}
|
|
120
|
-
else {
|
|
121
|
-
this.selection.select(node);
|
|
122
|
-
this.treeControl.expand(node);
|
|
123
|
-
}
|
|
124
|
-
this.onChange();
|
|
125
|
-
}
|
|
126
|
-
descendantsAllSelected(node) {
|
|
127
|
-
const descendants = this.treeControl.getDescendants(node);
|
|
128
|
-
const descAllSelected = descendants.length > 0 &&
|
|
129
|
-
descendants.every(child => {
|
|
130
|
-
return this.selection.isSelected(child);
|
|
131
|
-
});
|
|
132
|
-
return descAllSelected;
|
|
133
|
-
}
|
|
134
|
-
descendantsPartiallySelected(node) {
|
|
135
|
-
const descendants = this.treeControl.getDescendants(node);
|
|
136
|
-
const result = descendants.some(child => this.selection.isSelected(child));
|
|
137
|
-
return result && !this.descendantsAllSelected(node);
|
|
138
|
-
}
|
|
139
|
-
nodeSelectionToggle(node) {
|
|
140
|
-
console.debug('todoItemSelectionToggle', this.selection.isSelected(node));
|
|
141
|
-
if (this.selection.isSelected(node)) {
|
|
142
|
-
this.selection.deselect(node);
|
|
143
|
-
this.treeControl.collapse(node);
|
|
144
|
-
}
|
|
145
|
-
else {
|
|
146
|
-
this.selection.select(node);
|
|
147
|
-
this.treeControl.expand(node);
|
|
148
|
-
}
|
|
149
|
-
console.debug('todoItemSelectionToggle', node);
|
|
150
|
-
this.onChange();
|
|
151
|
-
}
|
|
152
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: TreeSectionOrganism, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
153
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.25", type: TreeSectionOrganism, isStandalone: true, selector: "organisms-tree-section", inputs: { data: "data" }, outputs: { action: "action" }, ngImport: i0, template: `
|
|
154
|
-
<mat-tree [dataSource]="dataSource" [treeControl]="treeControl">
|
|
155
|
-
<mat-tree-node *matTreeNodeDef="let node" matTreeNodeToggle matTreeNodePadding>
|
|
156
|
-
<mat-checkbox
|
|
157
|
-
class="checklist-leaf-node"
|
|
158
|
-
[checked]="selection.isSelected(node)"
|
|
159
|
-
(change)="todoLeafItemSelectionToggle(node)"
|
|
160
|
-
>{{ node.item }} (a)</mat-checkbox>
|
|
161
|
-
</mat-tree-node>
|
|
162
|
-
<mat-tree-node *matTreeNodeDef="let node; when: hasChild" matTreeNodePadding>
|
|
163
|
-
<mat-checkbox
|
|
164
|
-
[checked]="descendantsAllSelected(node)"
|
|
165
|
-
[indeterminate]="descendantsPartiallySelected(node)"
|
|
166
|
-
(change)="nodeSelectionToggle(node)"
|
|
167
|
-
>{{ node.item }} (b)</mat-checkbox>
|
|
168
|
-
</mat-tree-node>
|
|
169
|
-
</mat-tree>
|
|
170
|
-
`, isInline: true, styles: [":host{display:block}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatTreeModule }, { kind: "directive", type: i1.MatTreeNodeDef, selector: "[matTreeNodeDef]", inputs: ["matTreeNodeDefWhen", "matTreeNode"] }, { kind: "directive", type: i1.MatTreeNodePadding, selector: "[matTreeNodePadding]", inputs: ["matTreeNodePadding", "matTreeNodePaddingIndent"] }, { kind: "directive", type: i1.MatTreeNodeToggle, selector: "[matTreeNodeToggle]", inputs: ["matTreeNodeToggleRecursive"] }, { kind: "component", type: i1.MatTree, selector: "mat-tree", exportAs: ["matTree"] }, { kind: "directive", type: i1.MatTreeNode, selector: "mat-tree-node", inputs: ["tabIndex", "disabled"], outputs: ["activation", "expandedChange"], exportAs: ["matTreeNode"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "ngmodule", type: MatCheckboxModule }, { kind: "component", type: i2.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "aria-expanded", "aria-controls", "aria-owns", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
171
|
-
}
|
|
172
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: TreeSectionOrganism, decorators: [{
|
|
173
|
-
type: Component,
|
|
174
|
-
args: [{ selector: 'organisms-tree-section', standalone: true, imports: [
|
|
175
|
-
CommonModule,
|
|
176
|
-
MatTreeModule,
|
|
177
|
-
MatButtonModule,
|
|
178
|
-
MatIconModule,
|
|
179
|
-
MatCheckboxModule,
|
|
180
|
-
], template: `
|
|
181
|
-
<mat-tree [dataSource]="dataSource" [treeControl]="treeControl">
|
|
182
|
-
<mat-tree-node *matTreeNodeDef="let node" matTreeNodeToggle matTreeNodePadding>
|
|
183
|
-
<mat-checkbox
|
|
184
|
-
class="checklist-leaf-node"
|
|
185
|
-
[checked]="selection.isSelected(node)"
|
|
186
|
-
(change)="todoLeafItemSelectionToggle(node)"
|
|
187
|
-
>{{ node.item }} (a)</mat-checkbox>
|
|
188
|
-
</mat-tree-node>
|
|
189
|
-
<mat-tree-node *matTreeNodeDef="let node; when: hasChild" matTreeNodePadding>
|
|
190
|
-
<mat-checkbox
|
|
191
|
-
[checked]="descendantsAllSelected(node)"
|
|
192
|
-
[indeterminate]="descendantsPartiallySelected(node)"
|
|
193
|
-
(change)="nodeSelectionToggle(node)"
|
|
194
|
-
>{{ node.item }} (b)</mat-checkbox>
|
|
195
|
-
</mat-tree-node>
|
|
196
|
-
</mat-tree>
|
|
197
|
-
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block}\n"] }]
|
|
198
|
-
}], propDecorators: { data: [{
|
|
199
|
-
type: Input
|
|
200
|
-
}], action: [{
|
|
201
|
-
type: Output
|
|
202
|
-
}] } });
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* Generated bundle index. Do not edit.
|
|
206
|
-
*/
|
|
207
|
-
|
|
208
|
-
export { ActionId, FlatNode, Node, TreeSectionOrganism };
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { Input, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
-
import { CommonModule } from '@angular/common';
|
|
4
|
-
import { NestedTreeControl } from '@angular/cdk/tree';
|
|
5
|
-
import * as i1 from '@angular/material/tree';
|
|
6
|
-
import { MatTreeNestedDataSource, MatTreeModule } from '@angular/material/tree';
|
|
7
|
-
import * as i2 from '@angular/material/icon';
|
|
8
|
-
import { MatIconModule } from '@angular/material/icon';
|
|
9
|
-
import * as i3 from '@angular/material/button';
|
|
10
|
-
import { MatButtonModule } from '@angular/material/button';
|
|
11
|
-
import { NgAtomicComponent } from '@ng-atomic/core';
|
|
12
|
-
|
|
13
|
-
var ActionId;
|
|
14
|
-
(function (ActionId) {
|
|
15
|
-
ActionId["OPEN_FILE"] = "[@ng-atomic/components/templates/file-tree] Open File";
|
|
16
|
-
})(ActionId || (ActionId = {}));
|
|
17
|
-
class FileTreeTemplate extends NgAtomicComponent {
|
|
18
|
-
constructor() {
|
|
19
|
-
super(...arguments);
|
|
20
|
-
this.treeControl = new NestedTreeControl(node => node.children);
|
|
21
|
-
this.dataSource = new MatTreeNestedDataSource();
|
|
22
|
-
this.hasChild = (_, node) => !!node.children && node.children.length > 0;
|
|
23
|
-
}
|
|
24
|
-
static { this.ActionId = ActionId; }
|
|
25
|
-
set treeNode(treeNode) {
|
|
26
|
-
this.dataSource.data = treeNode;
|
|
27
|
-
}
|
|
28
|
-
test(node) {
|
|
29
|
-
console.debug('test');
|
|
30
|
-
this.dispatch({ id: ActionId.OPEN_FILE, payload: node });
|
|
31
|
-
}
|
|
32
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FileTreeTemplate, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
33
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.25", type: FileTreeTemplate, isStandalone: true, selector: "templates-file-tree", inputs: { treeNode: "treeNode" }, usesInheritance: true, ngImport: i0, template: `
|
|
34
|
-
<mat-tree [dataSource]="dataSource" [treeControl]="treeControl" class="example-tree">
|
|
35
|
-
<mat-tree-node *matTreeNodeDef="let node" matTreeNodeToggle>
|
|
36
|
-
<a style="color: red" (click)="test(node)">1. {{ node.name }}</a>
|
|
37
|
-
</mat-tree-node>
|
|
38
|
-
<mat-nested-tree-node *matTreeNodeDef="let node; when: hasChild">
|
|
39
|
-
<div class="mat-tree-node">
|
|
40
|
-
<button
|
|
41
|
-
mat-icon-button
|
|
42
|
-
matTreeNodeToggle
|
|
43
|
-
[attr.aria-label]="'Toggle ' + node.name"
|
|
44
|
-
>
|
|
45
|
-
<mat-icon class="mat-icon-rtl-mirror">
|
|
46
|
-
{{treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}}
|
|
47
|
-
</mat-icon>
|
|
48
|
-
</button>
|
|
49
|
-
<span>{{ node.name }}</span>
|
|
50
|
-
</div>
|
|
51
|
-
<div [class.example-tree-invisible]="!treeControl.isExpanded(node)"
|
|
52
|
-
role="group">
|
|
53
|
-
<ng-container matTreeNodeOutlet></ng-container>
|
|
54
|
-
</div>
|
|
55
|
-
</mat-nested-tree-node>
|
|
56
|
-
</mat-tree>
|
|
57
|
-
`, isInline: true, styles: [":host{width:100%;height:100%;background:#fff;display:block}:host .example-tree-invisible{display:none}:host .example-tree ul,:host .example-tree li{margin-top:0;margin-bottom:0;list-style-type:none}:host .example-tree .mat-nested-tree-node div[role=group]{padding-left:40px}:host .example-tree div[role=group]>.mat-tree-node{padding-left:40px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatTreeModule }, { kind: "directive", type: i1.MatNestedTreeNode, selector: "mat-nested-tree-node", inputs: ["matNestedTreeNode", "disabled", "tabIndex"], outputs: ["activation", "expandedChange"], exportAs: ["matNestedTreeNode"] }, { kind: "directive", type: i1.MatTreeNodeDef, selector: "[matTreeNodeDef]", inputs: ["matTreeNodeDefWhen", "matTreeNode"] }, { kind: "directive", type: i1.MatTreeNodeToggle, selector: "[matTreeNodeToggle]", inputs: ["matTreeNodeToggleRecursive"] }, { kind: "component", type: i1.MatTree, selector: "mat-tree", exportAs: ["matTree"] }, { kind: "directive", type: i1.MatTreeNode, selector: "mat-tree-node", inputs: ["tabIndex", "disabled"], outputs: ["activation", "expandedChange"], exportAs: ["matTreeNode"] }, { kind: "directive", type: i1.MatTreeNodeOutlet, selector: "[matTreeNodeOutlet]" }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button], a[mat-icon-button], button[matIconButton], a[matIconButton]", exportAs: ["matButton", "matAnchor"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
58
|
-
}
|
|
59
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FileTreeTemplate, decorators: [{
|
|
60
|
-
type: Component,
|
|
61
|
-
args: [{ selector: 'templates-file-tree', imports: [
|
|
62
|
-
CommonModule,
|
|
63
|
-
MatTreeModule,
|
|
64
|
-
MatIconModule,
|
|
65
|
-
MatButtonModule,
|
|
66
|
-
], template: `
|
|
67
|
-
<mat-tree [dataSource]="dataSource" [treeControl]="treeControl" class="example-tree">
|
|
68
|
-
<mat-tree-node *matTreeNodeDef="let node" matTreeNodeToggle>
|
|
69
|
-
<a style="color: red" (click)="test(node)">1. {{ node.name }}</a>
|
|
70
|
-
</mat-tree-node>
|
|
71
|
-
<mat-nested-tree-node *matTreeNodeDef="let node; when: hasChild">
|
|
72
|
-
<div class="mat-tree-node">
|
|
73
|
-
<button
|
|
74
|
-
mat-icon-button
|
|
75
|
-
matTreeNodeToggle
|
|
76
|
-
[attr.aria-label]="'Toggle ' + node.name"
|
|
77
|
-
>
|
|
78
|
-
<mat-icon class="mat-icon-rtl-mirror">
|
|
79
|
-
{{treeControl.isExpanded(node) ? 'expand_more' : 'chevron_right'}}
|
|
80
|
-
</mat-icon>
|
|
81
|
-
</button>
|
|
82
|
-
<span>{{ node.name }}</span>
|
|
83
|
-
</div>
|
|
84
|
-
<div [class.example-tree-invisible]="!treeControl.isExpanded(node)"
|
|
85
|
-
role="group">
|
|
86
|
-
<ng-container matTreeNodeOutlet></ng-container>
|
|
87
|
-
</div>
|
|
88
|
-
</mat-nested-tree-node>
|
|
89
|
-
</mat-tree>
|
|
90
|
-
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{width:100%;height:100%;background:#fff;display:block}:host .example-tree-invisible{display:none}:host .example-tree ul,:host .example-tree li{margin-top:0;margin-bottom:0;list-style-type:none}:host .example-tree .mat-nested-tree-node div[role=group]{padding-left:40px}:host .example-tree div[role=group]>.mat-tree-node{padding-left:40px}\n"] }]
|
|
91
|
-
}], propDecorators: { treeNode: [{
|
|
92
|
-
type: Input
|
|
93
|
-
}] } });
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Generated bundle index. Do not edit.
|
|
97
|
-
*/
|
|
98
|
-
|
|
99
|
-
export { FileTreeTemplate };
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { OnInit, EventEmitter } from '@angular/core';
|
|
3
|
-
import { EditorState } from '@codemirror/state';
|
|
4
|
-
import { FormControl } from '@angular/forms';
|
|
5
|
-
import { NgAtomicComponent, Action } from '@ng-atomic/core';
|
|
6
|
-
|
|
7
|
-
declare class GraphqlExtractor {
|
|
8
|
-
extract(output: string): string;
|
|
9
|
-
insert(query: string): string;
|
|
10
|
-
}
|
|
11
|
-
declare enum ActionId {
|
|
12
|
-
EXECUTE = "execute",
|
|
13
|
-
SAVE = "save"
|
|
14
|
-
}
|
|
15
|
-
declare class GraphqlEditorOrganism extends NgAtomicComponent implements OnInit {
|
|
16
|
-
private readonly schema$;
|
|
17
|
-
control: FormControl<string | null>;
|
|
18
|
-
state: EditorState;
|
|
19
|
-
set schema(value: any);
|
|
20
|
-
keyActions: {
|
|
21
|
-
key: string;
|
|
22
|
-
actionId: string;
|
|
23
|
-
}[];
|
|
24
|
-
action: EventEmitter<Action<any>>;
|
|
25
|
-
ngOnInit(): void;
|
|
26
|
-
private makeEditorState;
|
|
27
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<GraphqlEditorOrganism, never>;
|
|
28
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<GraphqlEditorOrganism, "organisms-graphql-editor", never, { "control": { "alias": "control"; "required": false; }; "schema": { "alias": "schema"; "required": false; }; "keyActions": { "alias": "keyActions"; "required": false; }; }, { "action": "action"; }, never, never, true, never>;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export { ActionId, GraphqlEditorOrganism, GraphqlExtractor };
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { OnInit, EventEmitter } from '@angular/core';
|
|
3
|
-
import { MatTreeFlattener, MatTreeFlatDataSource } from '@angular/material/tree';
|
|
4
|
-
import { FlatTreeControl } from '@angular/cdk/tree';
|
|
5
|
-
import { SelectionModel } from '@angular/cdk/collections';
|
|
6
|
-
import { Action } from '@ng-atomic/core';
|
|
7
|
-
|
|
8
|
-
declare class Node {
|
|
9
|
-
children: Node[];
|
|
10
|
-
item: string;
|
|
11
|
-
value?: boolean | string;
|
|
12
|
-
}
|
|
13
|
-
declare class FlatNode {
|
|
14
|
-
item: string;
|
|
15
|
-
level: number;
|
|
16
|
-
expandable: boolean;
|
|
17
|
-
}
|
|
18
|
-
declare enum ActionId {
|
|
19
|
-
CHANGE_QUERY = "[@ng-atomic/components/organisms/tree-section] Change Query"
|
|
20
|
-
}
|
|
21
|
-
declare class TreeSectionOrganism implements OnInit {
|
|
22
|
-
flatNodeMap: Map<FlatNode, Node>;
|
|
23
|
-
nestedNodeMap: Map<Node, FlatNode>;
|
|
24
|
-
getLevel: (node: FlatNode) => number;
|
|
25
|
-
isExpandable: (node: FlatNode) => boolean;
|
|
26
|
-
treeControl: FlatTreeControl<FlatNode, FlatNode>;
|
|
27
|
-
hasChild: (_: number, _nodeData: FlatNode) => boolean;
|
|
28
|
-
getChildren: (node: Node) => Node[];
|
|
29
|
-
transformer: (node: Node, level: number) => FlatNode;
|
|
30
|
-
treeFlattener: MatTreeFlattener<Node, FlatNode, FlatNode>;
|
|
31
|
-
dataSource: MatTreeFlatDataSource<Node, FlatNode, FlatNode>;
|
|
32
|
-
selection: SelectionModel<FlatNode>;
|
|
33
|
-
buildNode(obj: {
|
|
34
|
-
[key: string]: any;
|
|
35
|
-
}, level: number): Node[];
|
|
36
|
-
buildValueNode(nodes: Node[]): Node[];
|
|
37
|
-
buildFields(nodes: Node[]): (string | object)[];
|
|
38
|
-
onChange(): void;
|
|
39
|
-
data: any;
|
|
40
|
-
action: EventEmitter<Action<any>>;
|
|
41
|
-
ngOnInit(): void;
|
|
42
|
-
todoLeafItemSelectionToggle(node: FlatNode): void;
|
|
43
|
-
descendantsAllSelected(node: FlatNode): boolean;
|
|
44
|
-
descendantsPartiallySelected(node: FlatNode): boolean;
|
|
45
|
-
nodeSelectionToggle(node: FlatNode): void;
|
|
46
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TreeSectionOrganism, never>;
|
|
47
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TreeSectionOrganism, "organisms-tree-section", never, { "data": { "alias": "data"; "required": false; }; }, { "action": "action"; }, never, never, true, never>;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export { ActionId, FlatNode, Node, TreeSectionOrganism };
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { NestedTreeControl } from '@angular/cdk/tree';
|
|
2
|
-
import { MatTreeNestedDataSource } from '@angular/material/tree';
|
|
3
|
-
import { NgAtomicComponent } from '@ng-atomic/core';
|
|
4
|
-
import * as i0 from '@angular/core';
|
|
5
|
-
|
|
6
|
-
interface TreeNode {
|
|
7
|
-
name: string;
|
|
8
|
-
type: string;
|
|
9
|
-
parent?: TreeNode;
|
|
10
|
-
children: TreeNode[];
|
|
11
|
-
}
|
|
12
|
-
declare enum ActionId {
|
|
13
|
-
OPEN_FILE = "[@ng-atomic/components/templates/file-tree] Open File"
|
|
14
|
-
}
|
|
15
|
-
declare class FileTreeTemplate extends NgAtomicComponent {
|
|
16
|
-
static ActionId: typeof ActionId;
|
|
17
|
-
set treeNode(treeNode: TreeNode[]);
|
|
18
|
-
treeControl: NestedTreeControl<TreeNode, TreeNode>;
|
|
19
|
-
dataSource: MatTreeNestedDataSource<TreeNode>;
|
|
20
|
-
protected test(node: TreeNode): void;
|
|
21
|
-
hasChild: (_: number, node: TreeNode) => boolean;
|
|
22
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<FileTreeTemplate, never>;
|
|
23
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<FileTreeTemplate, "templates-file-tree", never, { "treeNode": { "alias": "treeNode"; "required": false; }; }, {}, never, never, true, never>;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export { FileTreeTemplate };
|
|
27
|
-
export type { TreeNode };
|