@memberjunction/ng-shared-generic 5.51.0 → 6.1.0-edge.1

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/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ ISC License
2
+
3
+ Copyright (c) 2023 MemberJunction
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
@@ -161,6 +161,7 @@
161
161
  --mj-brand-primary-active: var(--mj-color-brand-700);
162
162
  --mj-brand-primary-light: var(--mj-color-brand-350);
163
163
  --mj-brand-secondary: var(--mj-color-brand-900);
164
+ --mj-brand-secondary-hover: var(--mj-color-brand-800);
164
165
  --mj-brand-on-primary: var(--mj-color-neutral-0);
165
166
  --mj-brand-on-secondary: var(--mj-color-neutral-0);
166
167
 
@@ -216,6 +217,29 @@
216
217
  --mj-viz-9: #FF5722; /* deep orange */
217
218
  --mj-viz-10: #3F51B5; /* indigo */
218
219
 
220
+ /* Data-Visualization Sequential Ramp
221
+ Single-hue intensity ramp for heatmaps, choropleths and density shading,
222
+ ordered light-to-dark. Built from the brand ramp (not literals) so an org
223
+ overlay re-tints intensity shading along with everything else. Exposed to
224
+ interactive components as `styles.sequentialScale`. Dark mode re-anchors
225
+ these (see the dark block) because a light-to-dark ramp inverts its reading
226
+ on a dark surface. */
227
+ --mj-viz-seq-1: var(--mj-color-brand-100);
228
+ --mj-viz-seq-2: var(--mj-color-brand-200);
229
+ --mj-viz-seq-3: var(--mj-color-brand-300);
230
+ --mj-viz-seq-4: var(--mj-color-brand-400);
231
+ --mj-viz-seq-5: var(--mj-color-brand-500);
232
+ --mj-viz-seq-6: var(--mj-color-brand-600);
233
+ --mj-viz-seq-7: var(--mj-color-brand-700);
234
+
235
+ /* Data-Visualization Diverging Ramp
236
+ For measures with a meaningful midpoint (variance vs target, gain/loss,
237
+ sentiment). Anchored on the status hues so the default reads "bad → neutral
238
+ → good"; exposed as `styles.divergingScale`. */
239
+ --mj-viz-div-low: var(--mj-color-error-500);
240
+ --mj-viz-div-mid: var(--mj-color-neutral-200);
241
+ --mj-viz-div-high: var(--mj-color-success-500);
242
+
219
243
  /* Application Accent (set per-application from metadata)
220
244
  Default uses amber accent, but apps can override to use primary/tertiary/custom */
221
245
  --mj-app-accent: var(--mj-brand-accent);
@@ -474,6 +498,26 @@
474
498
  --mj-login-wave-2: var(--mj-color-tertiary-400);
475
499
  --mj-login-wave-3: var(--mj-color-brand-400);
476
500
 
501
+ /* Data-Visualization Sequential Ramp (dark-mode re-anchor)
502
+ On a dark surface, "more ink" means brighter rather than darker, so the ramp
503
+ runs from a step that sits close to the page background up to a light,
504
+ saturated brand step. Order is preserved (index 1 = lowest intensity), only
505
+ the anchoring flips. */
506
+ --mj-viz-seq-1: var(--mj-color-brand-900);
507
+ --mj-viz-seq-2: var(--mj-color-brand-800);
508
+ --mj-viz-seq-3: var(--mj-color-brand-700);
509
+ --mj-viz-seq-4: var(--mj-color-brand-600);
510
+ --mj-viz-seq-5: var(--mj-color-brand-500);
511
+ --mj-viz-seq-6: var(--mj-color-brand-400);
512
+ --mj-viz-seq-7: var(--mj-color-brand-300);
513
+
514
+ /* Data-Visualization Diverging Ramp (dark-mode re-anchor)
515
+ Endpoints lighten so they stay legible against the dark surface; the neutral
516
+ center darkens so "no deviation" recedes rather than glares. */
517
+ --mj-viz-div-low: var(--mj-color-error-400);
518
+ --mj-viz-div-mid: var(--mj-color-neutral-700);
519
+ --mj-viz-div-high: var(--mj-color-success-400);
520
+
477
521
  /* Logo — lighter mark for dark header backgrounds */
478
522
  --mj-logo-mark: url('/assets/mj-mark-dark.svg');
479
523
  --mj-logo-color: #4dabd5;
@@ -0,0 +1,18 @@
1
+ import { ElementRef } from '@angular/core';
2
+ /**
3
+ * Is `child` inside `parent` in the DOM tree?
4
+ *
5
+ * A pure DOM predicate with no MJ, Explorer or routing coupling — which is why it lives here in a
6
+ * Generic package rather than on `SharedService`. It was previously reachable only as
7
+ * `SharedService.IsDescendant`, which meant a widget wanting this three-line tree walk had to take
8
+ * a dependency on MJ Explorer to get it. That is exactly the accidental coupling the UI layering
9
+ * rules exist to prevent (see `guides/UI_LAYERING_GUIDE.md`).
10
+ *
11
+ * `SharedService.IsDescendant` delegates here, so existing Explorer callers are unaffected.
12
+ *
13
+ * @param parent the candidate ancestor
14
+ * @param child the candidate descendant
15
+ * @returns true when `child` is a descendant of `parent`; false when either is missing or unrelated
16
+ */
17
+ export declare function IsDescendantElement(parent: ElementRef | null | undefined, child: ElementRef | null | undefined): boolean;
18
+ //# sourceMappingURL=dom-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dom-utils.d.ts","sourceRoot":"","sources":["../../src/lib/dom-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,GAAG,SAAS,EAAE,KAAK,EAAE,UAAU,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAQxH"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Is `child` inside `parent` in the DOM tree?
3
+ *
4
+ * A pure DOM predicate with no MJ, Explorer or routing coupling — which is why it lives here in a
5
+ * Generic package rather than on `SharedService`. It was previously reachable only as
6
+ * `SharedService.IsDescendant`, which meant a widget wanting this three-line tree walk had to take
7
+ * a dependency on MJ Explorer to get it. That is exactly the accidental coupling the UI layering
8
+ * rules exist to prevent (see `guides/UI_LAYERING_GUIDE.md`).
9
+ *
10
+ * `SharedService.IsDescendant` delegates here, so existing Explorer callers are unaffected.
11
+ *
12
+ * @param parent the candidate ancestor
13
+ * @param child the candidate descendant
14
+ * @returns true when `child` is a descendant of `parent`; false when either is missing or unrelated
15
+ */
16
+ export function IsDescendantElement(parent, child) {
17
+ if (!parent?.nativeElement || !child?.nativeElement)
18
+ return false;
19
+ let node = child.nativeElement.parentNode;
20
+ while (node != null) {
21
+ if (node === parent.nativeElement)
22
+ return true;
23
+ node = node.parentNode;
24
+ }
25
+ return false;
26
+ }
27
+ //# sourceMappingURL=dom-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dom-utils.js","sourceRoot":"","sources":["../../src/lib/dom-utils.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAqC,EAAE,KAAoC;IAC3G,IAAI,CAAC,MAAM,EAAE,aAAa,IAAI,CAAC,KAAK,EAAE,aAAa;QAAE,OAAO,KAAK,CAAC;IAClE,IAAI,IAAI,GAAG,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC;IAC1C,OAAO,IAAI,IAAI,IAAI,EAAE,CAAC;QAClB,IAAI,IAAI,KAAK,MAAM,CAAC,aAAa;YAAE,OAAO,IAAI,CAAC;QAC/C,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;IACD,OAAO,KAAK,CAAC;AACjB,CAAC","sourcesContent":["import { ElementRef } from '@angular/core';\n\n/**\n * Is `child` inside `parent` in the DOM tree?\n *\n * A pure DOM predicate with no MJ, Explorer or routing coupling — which is why it lives here in a\n * Generic package rather than on `SharedService`. It was previously reachable only as\n * `SharedService.IsDescendant`, which meant a widget wanting this three-line tree walk had to take\n * a dependency on MJ Explorer to get it. That is exactly the accidental coupling the UI layering\n * rules exist to prevent (see `guides/UI_LAYERING_GUIDE.md`).\n *\n * `SharedService.IsDescendant` delegates here, so existing Explorer callers are unaffected.\n *\n * @param parent the candidate ancestor\n * @param child the candidate descendant\n * @returns true when `child` is a descendant of `parent`; false when either is missing or unrelated\n */\nexport function IsDescendantElement(parent: ElementRef | null | undefined, child: ElementRef | null | undefined): boolean {\n if (!parent?.nativeElement || !child?.nativeElement) return false;\n let node = child.nativeElement.parentNode;\n while (node != null) {\n if (node === parent.nativeElement) return true;\n node = node.parentNode;\n }\n return false;\n}\n"]}
@@ -1,6 +1,7 @@
1
1
  export * from './lib/module';
2
2
  export * from './lib/recent-access.service';
3
3
  export * from './lib/theme.service';
4
+ export * from './lib/dom-utils';
4
5
  export * from './lib/ag-grid-theme-params';
5
6
  export * from './lib/loading/loading.component';
6
7
  export * from './lib/rich-text/rich-text-sanitize';
@@ -1 +1 @@
1
- {"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAKA,cAAc,cAAc,CAAC;AAG7B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AAGpC,cAAc,4BAA4B,CAAC;AAG3C,cAAc,iCAAiC,CAAC;AAGhD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC"}
1
+ {"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAKA,cAAc,cAAc,CAAC;AAG7B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AAGpC,cAAc,iBAAiB,CAAC;AAGhC,cAAc,4BAA4B,CAAC;AAG3C,cAAc,iCAAiC,CAAC;AAGhD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC"}
@@ -6,6 +6,8 @@ export * from './lib/module';
6
6
  // Services
7
7
  export * from './lib/recent-access.service';
8
8
  export * from './lib/theme.service';
9
+ // DOM helpers
10
+ export * from './lib/dom-utils';
9
11
  // Theming constants
10
12
  export * from './lib/ag-grid-theme-params';
11
13
  // Components
@@ -1 +1 @@
1
- {"version":3,"file":"public-api.js","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,SAAS;AACT,cAAc,cAAc,CAAC;AAE7B,WAAW;AACX,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AAEpC,oBAAoB;AACpB,cAAc,4BAA4B,CAAC;AAE3C,aAAa;AACb,cAAc,iCAAiC,CAAC;AAEhD,mDAAmD;AACnD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC","sourcesContent":["/*\n * Public API Surface for @memberjunction/ng-shared-generic\n */\n\n// Module\nexport * from './lib/module';\n\n// Services\nexport * from './lib/recent-access.service';\nexport * from './lib/theme.service';\n\n// Theming constants\nexport * from './lib/ag-grid-theme-params';\n\n// Components\nexport * from './lib/loading/loading.component';\n\n// Rich-text rendering (safe HTML/SVG sanitization)\nexport * from './lib/rich-text/rich-text-sanitize';\nexport * from './lib/rich-text/safe-rich-html.pipe';\n"]}
1
+ {"version":3,"file":"public-api.js","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,SAAS;AACT,cAAc,cAAc,CAAC;AAE7B,WAAW;AACX,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AAEpC,cAAc;AACd,cAAc,iBAAiB,CAAC;AAEhC,oBAAoB;AACpB,cAAc,4BAA4B,CAAC;AAE3C,aAAa;AACb,cAAc,iCAAiC,CAAC;AAEhD,mDAAmD;AACnD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC","sourcesContent":["/*\n * Public API Surface for @memberjunction/ng-shared-generic\n */\n\n// Module\nexport * from './lib/module';\n\n// Services\nexport * from './lib/recent-access.service';\nexport * from './lib/theme.service';\n\n// DOM helpers\nexport * from './lib/dom-utils';\n\n// Theming constants\nexport * from './lib/ag-grid-theme-params';\n\n// Components\nexport * from './lib/loading/loading.component';\n\n// Rich-text rendering (safe HTML/SVG sanitization)\nexport * from './lib/rich-text/rich-text-sanitize';\nexport * from './lib/rich-text/safe-rich-html.pipe';\n"]}
package/package.json CHANGED
@@ -1,19 +1,12 @@
1
1
  {
2
2
  "name": "@memberjunction/ng-shared-generic",
3
- "version": "5.51.0",
3
+ "version": "6.1.0-edge.1",
4
4
  "description": "MemberJunction: Generic Angular Shared Package - utility services and reusable elements used in any Angular application.",
5
5
  "main": "./dist/public-api.js",
6
6
  "typings": "./dist/public-api.d.ts",
7
7
  "files": [
8
8
  "/dist"
9
9
  ],
10
- "scripts": {
11
- "test": "vitest run",
12
- "build": "npm run clean && ngc && npm run copy-assets",
13
- "copy-assets": "cpy 'src/lib/_tokens.scss' dist/lib --flat",
14
- "clean": "rimraf dist",
15
- "test:watch": "vitest"
16
- },
17
10
  "keywords": [
18
11
  "MemberJunction",
19
12
  "Angular"
@@ -23,21 +16,21 @@
23
16
  "devDependencies": {
24
17
  "@angular/compiler": "21.1.3",
25
18
  "@angular/compiler-cli": "21.1.3",
26
- "@memberjunction/ng-test-utils": "5.51.0",
19
+ "@memberjunction/ng-test-utils": "6.1.0-edge.1",
27
20
  "vitest": "^4.0.18"
28
21
  },
29
22
  "peerDependencies": {
30
- "@angular/common": "21.1.3",
31
- "@angular/core": "21.1.3",
32
- "@angular/platform-browser": "21.1.3",
23
+ "@angular/common": "^21.1.3",
24
+ "@angular/core": "^21.1.3",
25
+ "@angular/platform-browser": "^21.1.3",
33
26
  "rxjs": "^7.8.2"
34
27
  },
35
28
  "dependencies": {
36
- "@memberjunction/core": "5.51.0",
37
- "@memberjunction/ng-base-types": "5.51.0",
38
- "@memberjunction/core-entities": "5.51.0",
39
- "@memberjunction/global": "5.51.0",
40
- "@memberjunction/theme-engine": "5.51.0",
29
+ "@memberjunction/core": "6.1.0-edge.1",
30
+ "@memberjunction/ng-base-types": "6.1.0-edge.1",
31
+ "@memberjunction/core-entities": "6.1.0-edge.1",
32
+ "@memberjunction/global": "6.1.0-edge.1",
33
+ "@memberjunction/theme-engine": "6.1.0-edge.1",
41
34
  "dompurify": "^3.3.0",
42
35
  "tslib": "^2.8.1"
43
36
  },
@@ -45,5 +38,14 @@
45
38
  "repository": {
46
39
  "type": "git",
47
40
  "url": "https://github.com/MemberJunction/MJ"
41
+ },
42
+ "mjUILayer": "widgets",
43
+ "scripts": {
44
+ "test": "vitest run",
45
+ "test:types": "tsc --noEmit -p tsconfig.spec.json",
46
+ "build": "npm run clean && ngc && npm run copy-assets",
47
+ "copy-assets": "cpy 'src/lib/_tokens.scss' dist/lib --flat",
48
+ "clean": "rimraf dist",
49
+ "test:watch": "vitest"
48
50
  }
49
- }
51
+ }