@m1z23r/ngx-ui 1.1.50 → 1.1.51
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.
|
@@ -6867,6 +6867,9 @@ class TreeComponent {
|
|
|
6867
6867
|
expandOnClick = input(false, ...(ngDevMode ? [{ debugName: "expandOnClick" }] : []));
|
|
6868
6868
|
contextMenu = input(false, ...(ngDevMode ? [{ debugName: "contextMenu" }] : []));
|
|
6869
6869
|
pathSeparator = input(' / ', ...(ngDevMode ? [{ debugName: "pathSeparator" }] : []));
|
|
6870
|
+
valueFormatter = input(null, ...(ngDevMode ? [{ debugName: "valueFormatter" }] : []));
|
|
6871
|
+
pathFormatter = input(null, ...(ngDevMode ? [{ debugName: "pathFormatter" }] : []));
|
|
6872
|
+
objectFormatter = input(null, ...(ngDevMode ? [{ debugName: "objectFormatter" }] : []));
|
|
6870
6873
|
nodeClick = output();
|
|
6871
6874
|
nodeExpand = output();
|
|
6872
6875
|
nodeCollapse = output();
|
|
@@ -6962,15 +6965,22 @@ class TreeComponent {
|
|
|
6962
6965
|
if (!node)
|
|
6963
6966
|
return;
|
|
6964
6967
|
switch (action) {
|
|
6965
|
-
case 'copyValue':
|
|
6966
|
-
this.
|
|
6968
|
+
case 'copyValue': {
|
|
6969
|
+
const text = this.valueFormatter()?.(node, path) ?? node.label;
|
|
6970
|
+
this.copyToClipboard(text);
|
|
6967
6971
|
break;
|
|
6968
|
-
|
|
6969
|
-
|
|
6972
|
+
}
|
|
6973
|
+
case 'copyPath': {
|
|
6974
|
+
const text = this.pathFormatter()?.(node, path) ??
|
|
6975
|
+
path.map((n) => n.label).join(this.pathSeparator());
|
|
6976
|
+
this.copyToClipboard(text);
|
|
6970
6977
|
break;
|
|
6971
|
-
|
|
6972
|
-
|
|
6978
|
+
}
|
|
6979
|
+
case 'copyObject': {
|
|
6980
|
+
const text = this.objectFormatter()?.(node, path) ?? this.serializeNode(node);
|
|
6981
|
+
this.copyToClipboard(text);
|
|
6973
6982
|
break;
|
|
6983
|
+
}
|
|
6974
6984
|
case 'expandAll':
|
|
6975
6985
|
this.expandSubtree(node, true);
|
|
6976
6986
|
break;
|
|
@@ -7045,12 +7055,218 @@ class TreeComponent {
|
|
|
7045
7055
|
}
|
|
7046
7056
|
}
|
|
7047
7057
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TreeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7048
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: TreeComponent, isStandalone: true, selector: "ui-tree", inputs: { nodes: { classPropertyName: "nodes", publicName: "nodes", isSignal: true, isRequired: false, transformFunction: null }, indent: { classPropertyName: "indent", publicName: "indent", isSignal: true, isRequired: false, transformFunction: null }, draggable: { classPropertyName: "draggable", publicName: "draggable", isSignal: true, isRequired: false, transformFunction: null }, expandOnClick: { classPropertyName: "expandOnClick", publicName: "expandOnClick", isSignal: true, isRequired: false, transformFunction: null }, contextMenu: { classPropertyName: "contextMenu", publicName: "contextMenu", isSignal: true, isRequired: false, transformFunction: null }, pathSeparator: { classPropertyName: "pathSeparator", publicName: "pathSeparator", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { nodeClick: "nodeClick", nodeExpand: "nodeExpand", nodeCollapse: "nodeCollapse", nodeDrop: "nodeDrop", nodeContextAction: "nodeContextAction" }, providers: [{ provide: TREE_HOST, useExisting: TreeComponent }], viewQueries: [{ propertyName: "menu", first: true, predicate: ["treeMenu"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"ui-tree\">\n @for (node of nodes(); track node) {\n <ui-tree-node\n [node]=\"node\"\n [level]=\"0\"\n [indent]=\"indent()\"\n [parentPath]=\"[]\"\n (nodeClick)=\"_onNodeClick($event)\"\n (nodeExpand)=\"_onNodeExpand($event)\"\n (nodeCollapse)=\"_onNodeCollapse($event)\"\n />\n }\n</div>\n\n@if (contextMenu()) {\n <ui-dropdown #treeMenu>\n <ui-dropdown-item (clicked)=\"_runAction('copyValue')\">Copy value</ui-dropdown-item>\n <ui-dropdown-item (clicked)=\"_runAction('copyPath')\">Copy path</ui-dropdown-item>\n <ui-dropdown-item (clicked)=\"_runAction('copyObject')\">Copy object</ui-dropdown-item>\n @if (_menuHasChildren()) {\n <ui-dropdown-divider />\n <ui-dropdown-item (clicked)=\"_runAction('expandAll')\">Expand all</ui-dropdown-item>\n <ui-dropdown-item (clicked)=\"_runAction('collapseAll')\">Collapse all</ui-dropdown-item>\n }\n @if (_menuHasParent()) {\n <ui-dropdown-divider />\n <ui-dropdown-item (clicked)=\"_runAction('goToParent')\">Go to parent</ui-dropdown-item>\n <ui-dropdown-item (clicked)=\"_runAction('collapseParent')\">Collapse parent</ui-dropdown-item>\n }\n </ui-dropdown>\n}\n", styles: [":host{display:block}.ui-tree{font-size:var(--ui-font-sm);color:var(--ui-text);-webkit-user-select:none;user-select:none}\n"], dependencies: [{ kind: "component", type: TreeNodeComponent, selector: "ui-tree-node", inputs: ["node", "level", "indent", "parentPath"], outputs: ["nodeClick", "nodeExpand", "nodeCollapse"] }, { kind: "component", type: DropdownComponent, selector: "ui-dropdown", inputs: ["position", "closeOnSelect", "matchTriggerWidth"] }, { kind: "component", type: DropdownItemComponent, selector: "ui-dropdown-item", inputs: ["disabled", "icon"], outputs: ["clicked"] }, { kind: "component", type: DropdownDividerComponent, selector: "ui-dropdown-divider" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7058
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: TreeComponent, isStandalone: true, selector: "ui-tree", inputs: { nodes: { classPropertyName: "nodes", publicName: "nodes", isSignal: true, isRequired: false, transformFunction: null }, indent: { classPropertyName: "indent", publicName: "indent", isSignal: true, isRequired: false, transformFunction: null }, draggable: { classPropertyName: "draggable", publicName: "draggable", isSignal: true, isRequired: false, transformFunction: null }, expandOnClick: { classPropertyName: "expandOnClick", publicName: "expandOnClick", isSignal: true, isRequired: false, transformFunction: null }, contextMenu: { classPropertyName: "contextMenu", publicName: "contextMenu", isSignal: true, isRequired: false, transformFunction: null }, pathSeparator: { classPropertyName: "pathSeparator", publicName: "pathSeparator", isSignal: true, isRequired: false, transformFunction: null }, valueFormatter: { classPropertyName: "valueFormatter", publicName: "valueFormatter", isSignal: true, isRequired: false, transformFunction: null }, pathFormatter: { classPropertyName: "pathFormatter", publicName: "pathFormatter", isSignal: true, isRequired: false, transformFunction: null }, objectFormatter: { classPropertyName: "objectFormatter", publicName: "objectFormatter", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { nodeClick: "nodeClick", nodeExpand: "nodeExpand", nodeCollapse: "nodeCollapse", nodeDrop: "nodeDrop", nodeContextAction: "nodeContextAction" }, providers: [{ provide: TREE_HOST, useExisting: TreeComponent }], viewQueries: [{ propertyName: "menu", first: true, predicate: ["treeMenu"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"ui-tree\">\n @for (node of nodes(); track node) {\n <ui-tree-node\n [node]=\"node\"\n [level]=\"0\"\n [indent]=\"indent()\"\n [parentPath]=\"[]\"\n (nodeClick)=\"_onNodeClick($event)\"\n (nodeExpand)=\"_onNodeExpand($event)\"\n (nodeCollapse)=\"_onNodeCollapse($event)\"\n />\n }\n</div>\n\n@if (contextMenu()) {\n <ui-dropdown #treeMenu>\n <ui-dropdown-item (clicked)=\"_runAction('copyValue')\">Copy value</ui-dropdown-item>\n <ui-dropdown-item (clicked)=\"_runAction('copyPath')\">Copy path</ui-dropdown-item>\n <ui-dropdown-item (clicked)=\"_runAction('copyObject')\">Copy object</ui-dropdown-item>\n @if (_menuHasChildren()) {\n <ui-dropdown-divider />\n <ui-dropdown-item (clicked)=\"_runAction('expandAll')\">Expand all</ui-dropdown-item>\n <ui-dropdown-item (clicked)=\"_runAction('collapseAll')\">Collapse all</ui-dropdown-item>\n }\n @if (_menuHasParent()) {\n <ui-dropdown-divider />\n <ui-dropdown-item (clicked)=\"_runAction('goToParent')\">Go to parent</ui-dropdown-item>\n <ui-dropdown-item (clicked)=\"_runAction('collapseParent')\">Collapse parent</ui-dropdown-item>\n }\n </ui-dropdown>\n}\n", styles: [":host{display:block}.ui-tree{font-size:var(--ui-font-sm);color:var(--ui-text);-webkit-user-select:none;user-select:none}\n"], dependencies: [{ kind: "component", type: TreeNodeComponent, selector: "ui-tree-node", inputs: ["node", "level", "indent", "parentPath"], outputs: ["nodeClick", "nodeExpand", "nodeCollapse"] }, { kind: "component", type: DropdownComponent, selector: "ui-dropdown", inputs: ["position", "closeOnSelect", "matchTriggerWidth"] }, { kind: "component", type: DropdownItemComponent, selector: "ui-dropdown-item", inputs: ["disabled", "icon"], outputs: ["clicked"] }, { kind: "component", type: DropdownDividerComponent, selector: "ui-dropdown-divider" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7049
7059
|
}
|
|
7050
7060
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TreeComponent, decorators: [{
|
|
7051
7061
|
type: Component,
|
|
7052
7062
|
args: [{ selector: 'ui-tree', standalone: true, imports: [TreeNodeComponent, DropdownComponent, DropdownItemComponent, DropdownDividerComponent], changeDetection: ChangeDetectionStrategy.OnPush, providers: [{ provide: TREE_HOST, useExisting: TreeComponent }], template: "<div class=\"ui-tree\">\n @for (node of nodes(); track node) {\n <ui-tree-node\n [node]=\"node\"\n [level]=\"0\"\n [indent]=\"indent()\"\n [parentPath]=\"[]\"\n (nodeClick)=\"_onNodeClick($event)\"\n (nodeExpand)=\"_onNodeExpand($event)\"\n (nodeCollapse)=\"_onNodeCollapse($event)\"\n />\n }\n</div>\n\n@if (contextMenu()) {\n <ui-dropdown #treeMenu>\n <ui-dropdown-item (clicked)=\"_runAction('copyValue')\">Copy value</ui-dropdown-item>\n <ui-dropdown-item (clicked)=\"_runAction('copyPath')\">Copy path</ui-dropdown-item>\n <ui-dropdown-item (clicked)=\"_runAction('copyObject')\">Copy object</ui-dropdown-item>\n @if (_menuHasChildren()) {\n <ui-dropdown-divider />\n <ui-dropdown-item (clicked)=\"_runAction('expandAll')\">Expand all</ui-dropdown-item>\n <ui-dropdown-item (clicked)=\"_runAction('collapseAll')\">Collapse all</ui-dropdown-item>\n }\n @if (_menuHasParent()) {\n <ui-dropdown-divider />\n <ui-dropdown-item (clicked)=\"_runAction('goToParent')\">Go to parent</ui-dropdown-item>\n <ui-dropdown-item (clicked)=\"_runAction('collapseParent')\">Collapse parent</ui-dropdown-item>\n }\n </ui-dropdown>\n}\n", styles: [":host{display:block}.ui-tree{font-size:var(--ui-font-sm);color:var(--ui-text);-webkit-user-select:none;user-select:none}\n"] }]
|
|
7053
|
-
}], propDecorators: { nodes: [{ type: i0.Input, args: [{ isSignal: true, alias: "nodes", required: false }] }], indent: [{ type: i0.Input, args: [{ isSignal: true, alias: "indent", required: false }] }], draggable: [{ type: i0.Input, args: [{ isSignal: true, alias: "draggable", required: false }] }], expandOnClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandOnClick", required: false }] }], contextMenu: [{ type: i0.Input, args: [{ isSignal: true, alias: "contextMenu", required: false }] }], pathSeparator: [{ type: i0.Input, args: [{ isSignal: true, alias: "pathSeparator", required: false }] }], nodeClick: [{ type: i0.Output, args: ["nodeClick"] }], nodeExpand: [{ type: i0.Output, args: ["nodeExpand"] }], nodeCollapse: [{ type: i0.Output, args: ["nodeCollapse"] }], nodeDrop: [{ type: i0.Output, args: ["nodeDrop"] }], nodeContextAction: [{ type: i0.Output, args: ["nodeContextAction"] }], menu: [{ type: i0.ViewChild, args: ['treeMenu', { isSignal: true }] }] } });
|
|
7063
|
+
}], propDecorators: { nodes: [{ type: i0.Input, args: [{ isSignal: true, alias: "nodes", required: false }] }], indent: [{ type: i0.Input, args: [{ isSignal: true, alias: "indent", required: false }] }], draggable: [{ type: i0.Input, args: [{ isSignal: true, alias: "draggable", required: false }] }], expandOnClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandOnClick", required: false }] }], contextMenu: [{ type: i0.Input, args: [{ isSignal: true, alias: "contextMenu", required: false }] }], pathSeparator: [{ type: i0.Input, args: [{ isSignal: true, alias: "pathSeparator", required: false }] }], valueFormatter: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueFormatter", required: false }] }], pathFormatter: [{ type: i0.Input, args: [{ isSignal: true, alias: "pathFormatter", required: false }] }], objectFormatter: [{ type: i0.Input, args: [{ isSignal: true, alias: "objectFormatter", required: false }] }], nodeClick: [{ type: i0.Output, args: ["nodeClick"] }], nodeExpand: [{ type: i0.Output, args: ["nodeExpand"] }], nodeCollapse: [{ type: i0.Output, args: ["nodeCollapse"] }], nodeDrop: [{ type: i0.Output, args: ["nodeDrop"] }], nodeContextAction: [{ type: i0.Output, args: ["nodeContextAction"] }], menu: [{ type: i0.ViewChild, args: ['treeMenu', { isSignal: true }] }] } });
|
|
7064
|
+
|
|
7065
|
+
const IDENT_RE = /^[A-Za-z_$][A-Za-z0-9_$]*$/;
|
|
7066
|
+
function isIdentifier(key) {
|
|
7067
|
+
return IDENT_RE.test(key);
|
|
7068
|
+
}
|
|
7069
|
+
function appendKey(path, key) {
|
|
7070
|
+
return isIdentifier(key) ? (path ? `${path}.${key}` : key) : `${path}[${JSON.stringify(key)}]`;
|
|
7071
|
+
}
|
|
7072
|
+
function appendIndex(path, i) {
|
|
7073
|
+
return `${path}[${i}]`;
|
|
7074
|
+
}
|
|
7075
|
+
function prettyPrimitive(v) {
|
|
7076
|
+
if (v === null)
|
|
7077
|
+
return 'null';
|
|
7078
|
+
if (v === undefined)
|
|
7079
|
+
return 'undefined';
|
|
7080
|
+
if (typeof v === 'string')
|
|
7081
|
+
return JSON.stringify(v);
|
|
7082
|
+
if (typeof v === 'number' || typeof v === 'boolean' || typeof v === 'bigint')
|
|
7083
|
+
return String(v);
|
|
7084
|
+
if (v instanceof Date)
|
|
7085
|
+
return JSON.stringify(v.toISOString());
|
|
7086
|
+
return String(v);
|
|
7087
|
+
}
|
|
7088
|
+
function safeStringify(v) {
|
|
7089
|
+
try {
|
|
7090
|
+
return JSON.stringify(v, replacer(), 2);
|
|
7091
|
+
}
|
|
7092
|
+
catch {
|
|
7093
|
+
return String(v);
|
|
7094
|
+
}
|
|
7095
|
+
}
|
|
7096
|
+
function replacer() {
|
|
7097
|
+
const seen = new WeakSet();
|
|
7098
|
+
return function (_key, value) {
|
|
7099
|
+
if (typeof value === 'bigint')
|
|
7100
|
+
return value.toString();
|
|
7101
|
+
if (typeof value === 'object' && value !== null) {
|
|
7102
|
+
if (seen.has(value))
|
|
7103
|
+
return '[Circular]';
|
|
7104
|
+
seen.add(value);
|
|
7105
|
+
}
|
|
7106
|
+
return value;
|
|
7107
|
+
};
|
|
7108
|
+
}
|
|
7109
|
+
function kindOf(v) {
|
|
7110
|
+
if (Array.isArray(v))
|
|
7111
|
+
return 'array';
|
|
7112
|
+
if (v !== null && typeof v === 'object')
|
|
7113
|
+
return 'object';
|
|
7114
|
+
return 'primitive';
|
|
7115
|
+
}
|
|
7116
|
+
function sizeLabel(kind, value) {
|
|
7117
|
+
if (kind === 'array')
|
|
7118
|
+
return `[${value.length}]`;
|
|
7119
|
+
if (kind === 'object')
|
|
7120
|
+
return `{${Object.keys(value).length}}`;
|
|
7121
|
+
return prettyPrimitive(value);
|
|
7122
|
+
}
|
|
7123
|
+
function makeLabel(keyPart, kind, value, isRoot) {
|
|
7124
|
+
const size = sizeLabel(kind, value);
|
|
7125
|
+
if (kind === 'primitive') {
|
|
7126
|
+
if (isRoot)
|
|
7127
|
+
return keyPart ? `${keyPart}: ${size}` : size;
|
|
7128
|
+
return keyPart ? `${keyPart}: ${size}` : size;
|
|
7129
|
+
}
|
|
7130
|
+
// object / array
|
|
7131
|
+
return keyPart ? `${keyPart} ${size}` : size;
|
|
7132
|
+
}
|
|
7133
|
+
/**
|
|
7134
|
+
* Convert an arbitrary JSON-shaped value into a TreeNode array suitable for
|
|
7135
|
+
* `<ui-tree [nodes]>`. Each generated node carries a `data: JsonNodeMeta`.
|
|
7136
|
+
*
|
|
7137
|
+
* Returns a single-element array containing the root node.
|
|
7138
|
+
*/
|
|
7139
|
+
function jsonToTreeNodes(value, options = {}) {
|
|
7140
|
+
const rootLabel = options.rootLabel ?? '';
|
|
7141
|
+
const pathRoot = options.pathRoot ?? '';
|
|
7142
|
+
const expandDepth = options.expandDepth ?? 1;
|
|
7143
|
+
const ancestors = new WeakSet();
|
|
7144
|
+
const root = build(value, null, rootLabel, pathRoot, 0, expandDepth, ancestors, true);
|
|
7145
|
+
return [root];
|
|
7146
|
+
}
|
|
7147
|
+
function build(value, key, keyPart, path, depth, expandDepth, ancestors, isRoot) {
|
|
7148
|
+
// Detect cycles: only if `value` is one of our ancestors in this DFS path.
|
|
7149
|
+
if (value !== null && typeof value === 'object' && ancestors.has(value)) {
|
|
7150
|
+
const placeholder = '[Circular]';
|
|
7151
|
+
return {
|
|
7152
|
+
label: keyPart ? `${keyPart}: "${placeholder}"` : `"${placeholder}"`,
|
|
7153
|
+
data: {
|
|
7154
|
+
key,
|
|
7155
|
+
value: placeholder,
|
|
7156
|
+
kind: 'primitive',
|
|
7157
|
+
jsonPath: path,
|
|
7158
|
+
},
|
|
7159
|
+
};
|
|
7160
|
+
}
|
|
7161
|
+
const kind = kindOf(value);
|
|
7162
|
+
const label = makeLabel(keyPart, kind, value, isRoot);
|
|
7163
|
+
const expanded = isRoot ? true : depth <= expandDepth;
|
|
7164
|
+
const node = {
|
|
7165
|
+
label,
|
|
7166
|
+
expanded,
|
|
7167
|
+
data: { key, value, kind, jsonPath: path },
|
|
7168
|
+
};
|
|
7169
|
+
if (kind === 'object' || kind === 'array') {
|
|
7170
|
+
ancestors.add(value);
|
|
7171
|
+
if (kind === 'object') {
|
|
7172
|
+
const obj = value;
|
|
7173
|
+
const keys = Object.keys(obj);
|
|
7174
|
+
if (keys.length > 0) {
|
|
7175
|
+
node.children = keys.map((k) => build(obj[k], k, k, appendKey(path, k), depth + 1, expandDepth, ancestors, false));
|
|
7176
|
+
}
|
|
7177
|
+
}
|
|
7178
|
+
else {
|
|
7179
|
+
const arr = value;
|
|
7180
|
+
if (arr.length > 0) {
|
|
7181
|
+
node.children = arr.map((v, i) => build(v, i, `[${i}]`, appendIndex(path, i), depth + 1, expandDepth, ancestors, false));
|
|
7182
|
+
}
|
|
7183
|
+
}
|
|
7184
|
+
ancestors.delete(value);
|
|
7185
|
+
}
|
|
7186
|
+
return node;
|
|
7187
|
+
}
|
|
7188
|
+
|
|
7189
|
+
class JsonTreeComponent {
|
|
7190
|
+
json = input(undefined, ...(ngDevMode ? [{ debugName: "json" }] : []));
|
|
7191
|
+
rootLabel = input('', ...(ngDevMode ? [{ debugName: "rootLabel" }] : []));
|
|
7192
|
+
pathRoot = input('', ...(ngDevMode ? [{ debugName: "pathRoot" }] : []));
|
|
7193
|
+
expandDepth = input(1, ...(ngDevMode ? [{ debugName: "expandDepth" }] : []));
|
|
7194
|
+
indent = input(16, ...(ngDevMode ? [{ debugName: "indent" }] : []));
|
|
7195
|
+
draggable = input(false, ...(ngDevMode ? [{ debugName: "draggable" }] : []));
|
|
7196
|
+
expandOnClick = input(false, ...(ngDevMode ? [{ debugName: "expandOnClick" }] : []));
|
|
7197
|
+
contextMenu = input(true, ...(ngDevMode ? [{ debugName: "contextMenu" }] : []));
|
|
7198
|
+
nodeClick = output();
|
|
7199
|
+
nodeContextAction = output();
|
|
7200
|
+
nodes = computed(() => jsonToTreeNodes(this.json(), {
|
|
7201
|
+
rootLabel: this.rootLabel(),
|
|
7202
|
+
pathRoot: this.pathRoot(),
|
|
7203
|
+
expandDepth: this.expandDepth(),
|
|
7204
|
+
}), ...(ngDevMode ? [{ debugName: "nodes" }] : []));
|
|
7205
|
+
valueFmt = (node) => {
|
|
7206
|
+
const meta = node.data;
|
|
7207
|
+
if (!meta)
|
|
7208
|
+
return null;
|
|
7209
|
+
if (meta.kind === 'primitive') {
|
|
7210
|
+
const v = meta.value;
|
|
7211
|
+
if (v === null)
|
|
7212
|
+
return 'null';
|
|
7213
|
+
if (v === undefined)
|
|
7214
|
+
return 'undefined';
|
|
7215
|
+
if (typeof v === 'string')
|
|
7216
|
+
return v;
|
|
7217
|
+
if (typeof v === 'bigint')
|
|
7218
|
+
return v.toString();
|
|
7219
|
+
return String(v);
|
|
7220
|
+
}
|
|
7221
|
+
return safeStringify(meta.value);
|
|
7222
|
+
};
|
|
7223
|
+
pathFmt = (node) => {
|
|
7224
|
+
const meta = node.data;
|
|
7225
|
+
return meta ? meta.jsonPath : null;
|
|
7226
|
+
};
|
|
7227
|
+
objectFmt = (node) => {
|
|
7228
|
+
const meta = node.data;
|
|
7229
|
+
return meta ? safeStringify(meta.value) : null;
|
|
7230
|
+
};
|
|
7231
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: JsonTreeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7232
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.1", type: JsonTreeComponent, isStandalone: true, selector: "ui-json-tree", inputs: { json: { classPropertyName: "json", publicName: "json", isSignal: true, isRequired: false, transformFunction: null }, rootLabel: { classPropertyName: "rootLabel", publicName: "rootLabel", isSignal: true, isRequired: false, transformFunction: null }, pathRoot: { classPropertyName: "pathRoot", publicName: "pathRoot", isSignal: true, isRequired: false, transformFunction: null }, expandDepth: { classPropertyName: "expandDepth", publicName: "expandDepth", isSignal: true, isRequired: false, transformFunction: null }, indent: { classPropertyName: "indent", publicName: "indent", isSignal: true, isRequired: false, transformFunction: null }, draggable: { classPropertyName: "draggable", publicName: "draggable", isSignal: true, isRequired: false, transformFunction: null }, expandOnClick: { classPropertyName: "expandOnClick", publicName: "expandOnClick", isSignal: true, isRequired: false, transformFunction: null }, contextMenu: { classPropertyName: "contextMenu", publicName: "contextMenu", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { nodeClick: "nodeClick", nodeContextAction: "nodeContextAction" }, ngImport: i0, template: `
|
|
7233
|
+
<ui-tree
|
|
7234
|
+
[nodes]="nodes()"
|
|
7235
|
+
[indent]="indent()"
|
|
7236
|
+
[draggable]="draggable()"
|
|
7237
|
+
[expandOnClick]="expandOnClick()"
|
|
7238
|
+
[contextMenu]="contextMenu()"
|
|
7239
|
+
[valueFormatter]="valueFmt"
|
|
7240
|
+
[pathFormatter]="pathFmt"
|
|
7241
|
+
[objectFormatter]="objectFmt"
|
|
7242
|
+
(nodeClick)="nodeClick.emit($event)"
|
|
7243
|
+
(nodeContextAction)="nodeContextAction.emit($event)"
|
|
7244
|
+
/>
|
|
7245
|
+
`, isInline: true, dependencies: [{ kind: "component", type: TreeComponent, selector: "ui-tree", inputs: ["nodes", "indent", "draggable", "expandOnClick", "contextMenu", "pathSeparator", "valueFormatter", "pathFormatter", "objectFormatter"], outputs: ["nodeClick", "nodeExpand", "nodeCollapse", "nodeDrop", "nodeContextAction"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7246
|
+
}
|
|
7247
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: JsonTreeComponent, decorators: [{
|
|
7248
|
+
type: Component,
|
|
7249
|
+
args: [{
|
|
7250
|
+
selector: 'ui-json-tree',
|
|
7251
|
+
standalone: true,
|
|
7252
|
+
imports: [TreeComponent],
|
|
7253
|
+
template: `
|
|
7254
|
+
<ui-tree
|
|
7255
|
+
[nodes]="nodes()"
|
|
7256
|
+
[indent]="indent()"
|
|
7257
|
+
[draggable]="draggable()"
|
|
7258
|
+
[expandOnClick]="expandOnClick()"
|
|
7259
|
+
[contextMenu]="contextMenu()"
|
|
7260
|
+
[valueFormatter]="valueFmt"
|
|
7261
|
+
[pathFormatter]="pathFmt"
|
|
7262
|
+
[objectFormatter]="objectFmt"
|
|
7263
|
+
(nodeClick)="nodeClick.emit($event)"
|
|
7264
|
+
(nodeContextAction)="nodeContextAction.emit($event)"
|
|
7265
|
+
/>
|
|
7266
|
+
`,
|
|
7267
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
7268
|
+
}]
|
|
7269
|
+
}], propDecorators: { json: [{ type: i0.Input, args: [{ isSignal: true, alias: "json", required: false }] }], rootLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "rootLabel", required: false }] }], pathRoot: [{ type: i0.Input, args: [{ isSignal: true, alias: "pathRoot", required: false }] }], expandDepth: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandDepth", required: false }] }], indent: [{ type: i0.Input, args: [{ isSignal: true, alias: "indent", required: false }] }], draggable: [{ type: i0.Input, args: [{ isSignal: true, alias: "draggable", required: false }] }], expandOnClick: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandOnClick", required: false }] }], contextMenu: [{ type: i0.Input, args: [{ isSignal: true, alias: "contextMenu", required: false }] }], nodeClick: [{ type: i0.Output, args: ["nodeClick"] }], nodeContextAction: [{ type: i0.Output, args: ["nodeContextAction"] }] } });
|
|
7054
7270
|
|
|
7055
7271
|
/** Directive to mark a custom variable popover template */
|
|
7056
7272
|
class VariablePopoverDirective {
|
|
@@ -7451,5 +7667,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
|
|
|
7451
7667
|
* Generated bundle index. Do not edit.
|
|
7452
7668
|
*/
|
|
7453
7669
|
|
|
7454
|
-
export { AccordionComponent, AccordionHeaderDirective, AccordionItemComponent, AlertComponent, BadgeComponent, ButtonComponent, CardComponent, CellTemplateDirective, CellValuePipe, CheckboxComponent, ChipInputComponent, ChipTemplateDirective, CircularProgressComponent, ContentComponent, ContextMenuDirective, DIALOG_DATA, DIALOG_REF, DatepickerComponent, DatetimepickerComponent, DialogRef, DialogService, DropdownComponent, DropdownDividerComponent, DropdownItemComponent, DropdownTriggerDirective, DynamicTabsComponent, FileChooserComponent, FilePreviewPipe, FileSizePipe, FooterComponent, InputComponent, LOADABLE, LoadingDirective, LoadingService, ModalComponent, NavbarComponent, OptionComponent, OptionTemplateDirective, PaginationComponent, ProgressComponent, RadioComponent, RadioGroupComponent, RangeSliderComponent, SelectComponent, ShellComponent, SidebarComponent, SidebarService, SidebarToggleComponent, SliderComponent, SpinnerComponent, SplitComponent, SplitPaneComponent, SwitchComponent, TAB_DATA, TAB_REF, TREE_HOST, TabActivePipe, TabComponent, TabIconDirective, TabRef, TableComponent, TabsComponent, TabsService, TemplateInputComponent, TemplateInputSuffixDirective, TextareaComponent, TimepickerComponent, ToastRef, ToastService, TooltipDirective, TreeComponent, TreeNodeComponent, Validators, VariablePopoverDirective };
|
|
7670
|
+
export { AccordionComponent, AccordionHeaderDirective, AccordionItemComponent, AlertComponent, BadgeComponent, ButtonComponent, CardComponent, CellTemplateDirective, CellValuePipe, CheckboxComponent, ChipInputComponent, ChipTemplateDirective, CircularProgressComponent, ContentComponent, ContextMenuDirective, DIALOG_DATA, DIALOG_REF, DatepickerComponent, DatetimepickerComponent, DialogRef, DialogService, DropdownComponent, DropdownDividerComponent, DropdownItemComponent, DropdownTriggerDirective, DynamicTabsComponent, FileChooserComponent, FilePreviewPipe, FileSizePipe, FooterComponent, InputComponent, JsonTreeComponent, LOADABLE, LoadingDirective, LoadingService, ModalComponent, NavbarComponent, OptionComponent, OptionTemplateDirective, PaginationComponent, ProgressComponent, RadioComponent, RadioGroupComponent, RangeSliderComponent, SelectComponent, ShellComponent, SidebarComponent, SidebarService, SidebarToggleComponent, SliderComponent, SpinnerComponent, SplitComponent, SplitPaneComponent, SwitchComponent, TAB_DATA, TAB_REF, TREE_HOST, TabActivePipe, TabComponent, TabIconDirective, TabRef, TableComponent, TabsComponent, TabsService, TemplateInputComponent, TemplateInputSuffixDirective, TextareaComponent, TimepickerComponent, ToastRef, ToastService, TooltipDirective, TreeComponent, TreeNodeComponent, Validators, VariablePopoverDirective, jsonToTreeNodes };
|
|
7455
7671
|
//# sourceMappingURL=m1z23r-ngx-ui.mjs.map
|