@net7/components 4.0.0 → 4.1.0

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.
@@ -1,5 +1,57 @@
1
+ /**
2
+ * The bubble chart is drawn using d3js, a library to create and update anything in svg.
3
+ *
4
+ * LEGEND:
5
+ * - svg -> the canvas/<svg> element where everything will be drawn on (appended).
6
+ * - g -> <g> is a group of svg elements.
7
+ * - leaf -> this is the svg circle, the bubble.
8
+ * - text -> this is all the text inside the circle.
9
+ * - tspan -> this is just one line of text.
10
+ *
11
+ * What are "join, enter, update, exit?"
12
+ * https://observablehq.com/@d3/learn-d3-joins?collection=@d3/learn-d3
13
+ * https://observablehq.com/@thetylerwolf/day-18-join-enter-update-exit
14
+ *
15
+ * Each line can have a different width, but all of the text inside a circle
16
+ * needs to be scaled by a constant factor.
17
+ * https://observablehq.com/@mbostock/fit-text-to-circle
18
+ */
1
19
  import { AfterContentChecked } from '@angular/core';
2
20
  import * as i0 from "@angular/core";
21
+ /**
22
+ * Interface for D3Chart's "data"
23
+ *
24
+ * @property entity (required)
25
+ * - id (required)
26
+ * - label (optional)
27
+ * - typeOfEntity (optional)
28
+ * @property count (required)
29
+ */
30
+ export interface BubbleChartDataItem {
31
+ entity: {
32
+ id: string;
33
+ label?: string;
34
+ typeOfEntity?: string;
35
+ };
36
+ count: number;
37
+ }
38
+ /**
39
+ * Interface for a Circle's node data
40
+ */
41
+ export interface CircleNode {
42
+ clipUid: string;
43
+ data: BubbleChartDataItem;
44
+ depth: number;
45
+ height: number;
46
+ leafUid: string;
47
+ parent: Node;
48
+ x: number;
49
+ y: number;
50
+ r: number;
51
+ value: number;
52
+ /** Dynamic data for internal logic */
53
+ _meta?: any;
54
+ }
3
55
  /**
4
56
  * Interface for BubbleChartComponent's "data"
5
57
  *
@@ -78,23 +130,6 @@ export interface BubbleChartData {
78
130
  */
79
131
  setDraw?: any;
80
132
  }
81
- /**
82
- * Interface for D3Chart's "data"
83
- *
84
- * @property entity (required)
85
- * - id (required)
86
- * - label (optional)
87
- * - typeOfEntity (optional)
88
- * @property count (required)
89
- */
90
- export interface BubbleChartDataItem {
91
- entity: {
92
- id: string;
93
- label?: string;
94
- typeOfEntity?: string;
95
- };
96
- count: number;
97
- }
98
133
  export declare class BubbleChartComponent implements AfterContentChecked {
99
134
  data: BubbleChartData;
100
135
  emit: any;
@@ -102,6 +137,13 @@ export declare class BubbleChartComponent implements AfterContentChecked {
102
137
  private _loaded;
103
138
  ngAfterContentChecked(): void;
104
139
  onClick(payload: any): void;
140
+ /**
141
+ * Reference for much of the new text scaling code comes from:
142
+ * https://observablehq.com/@mbostock/fit-text-to-circle
143
+ */
144
+ measureWidth: (text: any) => number;
145
+ isValidNumber: (value: any) => boolean;
146
+ removeUnneededNodes(svg: any): void;
105
147
  draw: () => void;
106
148
  static ɵfac: i0.ɵɵFactoryDeclaration<BubbleChartComponent, never>;
107
149
  static ɵcmp: i0.ɵɵComponentDeclaration<BubbleChartComponent, "n7-bubble-chart", never, { "data": "data"; "emit": "emit"; }, {}, never, never, false>;
@@ -0,0 +1,29 @@
1
+ import * as i0 from "@angular/core";
2
+ /**
3
+ * Interface for FileSelectorComponent's "data"
4
+ */
5
+ export interface FileSelectorData {
6
+ /**
7
+ * Accepted file types
8
+ * @example '.jpg,.png' 'image/*'
9
+ */
10
+ accept?: string;
11
+ /** Allow selection of multiple files */
12
+ multiple?: boolean;
13
+ /** Additional classes for the wrapping element */
14
+ classes?: string;
15
+ }
16
+ export interface FileSelectorPayload {
17
+ target: HTMLInputElement;
18
+ files: FileList;
19
+ base64: Array<string | ArrayBuffer>;
20
+ }
21
+ export declare class FileSelectorComponent {
22
+ data: FileSelectorData;
23
+ emit: (type: string, payload: FileSelectorPayload) => void;
24
+ onFileSelected(eventTarget: any): void;
25
+ /** Obtain base64 string for upload and storage */
26
+ toBase64(file: File): Promise<FileReader['result']>;
27
+ static ɵfac: i0.ɵɵFactoryDeclaration<FileSelectorComponent, never>;
28
+ static ɵcmp: i0.ɵɵComponentDeclaration<FileSelectorComponent, "n7-file-selector", never, { "data": "data"; "emit": "emit"; }, {}, never, ["*"], false>;
29
+ }
@@ -0,0 +1,2 @@
1
+ import { FileSelectorData } from './file-selector';
2
+ export declare const FILE_SELECTOR_MOCK: FileSelectorData;
@@ -94,6 +94,8 @@ export declare class InputTextComponent {
94
94
  data: InputTextData;
95
95
  emit: any;
96
96
  onChange(inputPayload: any, value?: any): void;
97
+ onBlur(): void;
98
+ onFocus(): void;
97
99
  static ɵfac: i0.ɵɵFactoryDeclaration<InputTextComponent, never>;
98
100
  static ɵcmp: i0.ɵɵComponentDeclaration<InputTextComponent, "n7-input-text", never, { "data": "data"; "emit": "emit"; }, {}, never, never, false>;
99
101
  }
@@ -14,41 +14,42 @@ import * as i12 from "./components/datepicker/datepicker";
14
14
  import * as i13 from "./components/facet/facet";
15
15
  import * as i14 from "./components/facet-header/facet-header";
16
16
  import * as i15 from "./components/facet-year-range/facet-year-range";
17
- import * as i16 from "./components/footer/footer";
18
- import * as i17 from "./components/header/header";
19
- import * as i18 from "./components/hero/hero";
20
- import * as i19 from "./components/icon/icon";
21
- import * as i20 from "./components/histogram-range/histogram-range";
22
- import * as i21 from "./components/image-viewer/image-viewer";
23
- import * as i22 from "./components/image-viewer-tools/image-viewer-tools";
24
- import * as i23 from "./components/inner-title/inner-title";
25
- import * as i24 from "./components/input-checkbox/input-checkbox";
26
- import * as i25 from "./components/input-link/input-link";
27
- import * as i26 from "./components/input-select/input-select";
28
- import * as i27 from "./components/input-text/input-text";
29
- import * as i28 from "./components/item-preview/item-preview";
30
- import * as i29 from "./components/loader/loader";
31
- import * as i30 from "./components/map/map";
32
- import * as i31 from "./components/metadata-viewer/metadata-viewer";
33
- import * as i32 from "./components/nav/nav";
34
- import * as i33 from "./components/pagination/pagination";
35
- import * as i34 from "./components/sidebar-header/sidebar-header";
36
- import * as i35 from "./components/signup/signup";
37
- import * as i36 from "./components/simple-autocomplete/simple-autocomplete";
38
- import * as i37 from "./components/table/table";
39
- import * as i38 from "./components/tag/tag";
40
- import * as i39 from "./components/input-textarea/input-textarea";
41
- import * as i40 from "./components/text-viewer/text-viewer";
42
- import * as i41 from "./components/timeline/timeline";
43
- import * as i42 from "./components/toast/toast";
44
- import * as i43 from "./components/tooltip-content/tooltip-content";
45
- import * as i44 from "./components/tree/tree";
46
- import * as i45 from "./components/wizard/wizard";
47
- import * as i46 from "./components/progress-line/progress-line";
48
- import * as i47 from "@angular/common";
49
- import * as i48 from "@angular/router";
17
+ import * as i16 from "./components/file-selector/file-selector";
18
+ import * as i17 from "./components/footer/footer";
19
+ import * as i18 from "./components/header/header";
20
+ import * as i19 from "./components/hero/hero";
21
+ import * as i20 from "./components/icon/icon";
22
+ import * as i21 from "./components/histogram-range/histogram-range";
23
+ import * as i22 from "./components/image-viewer/image-viewer";
24
+ import * as i23 from "./components/image-viewer-tools/image-viewer-tools";
25
+ import * as i24 from "./components/inner-title/inner-title";
26
+ import * as i25 from "./components/input-checkbox/input-checkbox";
27
+ import * as i26 from "./components/input-link/input-link";
28
+ import * as i27 from "./components/input-select/input-select";
29
+ import * as i28 from "./components/input-text/input-text";
30
+ import * as i29 from "./components/item-preview/item-preview";
31
+ import * as i30 from "./components/loader/loader";
32
+ import * as i31 from "./components/map/map";
33
+ import * as i32 from "./components/metadata-viewer/metadata-viewer";
34
+ import * as i33 from "./components/nav/nav";
35
+ import * as i34 from "./components/pagination/pagination";
36
+ import * as i35 from "./components/sidebar-header/sidebar-header";
37
+ import * as i36 from "./components/signup/signup";
38
+ import * as i37 from "./components/simple-autocomplete/simple-autocomplete";
39
+ import * as i38 from "./components/table/table";
40
+ import * as i39 from "./components/tag/tag";
41
+ import * as i40 from "./components/input-textarea/input-textarea";
42
+ import * as i41 from "./components/text-viewer/text-viewer";
43
+ import * as i42 from "./components/timeline/timeline";
44
+ import * as i43 from "./components/toast/toast";
45
+ import * as i44 from "./components/tooltip-content/tooltip-content";
46
+ import * as i45 from "./components/tree/tree";
47
+ import * as i46 from "./components/wizard/wizard";
48
+ import * as i47 from "./components/progress-line/progress-line";
49
+ import * as i48 from "@angular/common";
50
+ import * as i49 from "@angular/router";
50
51
  export declare class DvComponentsLibModule {
51
52
  static ɵfac: i0.ɵɵFactoryDeclaration<DvComponentsLibModule, never>;
52
- static ɵmod: i0.ɵɵNgModuleDeclaration<DvComponentsLibModule, [typeof i1.AdvancedAutocompleteComponent, typeof i2.AlertComponent, typeof i3.AnchorWrapperComponent, typeof i4.AvatarComponent, typeof i5.BreadcrumbsComponent, typeof i6.BubbleChartComponent, typeof i7.ButtonComponent, typeof i8.CarouselComponent, typeof i9.ChartComponent, typeof i10.ContentPlaceholderComponent, typeof i11.DataWidgetComponent, typeof i12.DatepickerComponent, typeof i13.FacetComponent, typeof i14.FacetHeaderComponent, typeof i15.FacetYearRangeComponent, typeof i16.FooterComponent, typeof i17.HeaderComponent, typeof i18.HeroComponent, typeof i19.IconComponent, typeof i20.HistogramRangeComponent, typeof i21.ImageViewerComponent, typeof i22.ImageViewerToolsComponent, typeof i23.InnerTitleComponent, typeof i24.InputCheckboxComponent, typeof i25.InputLinkComponent, typeof i26.InputSelectComponent, typeof i27.InputTextComponent, typeof i28.ItemPreviewComponent, typeof i29.LoaderComponent, typeof i30.MapComponent, typeof i31.MetadataViewerComponent, typeof i32.NavComponent, typeof i33.PaginationComponent, typeof i34.SidebarHeaderComponent, typeof i35.SignupComponent, typeof i36.SimpleAutocompleteComponent, typeof i37.TableComponent, typeof i38.TagComponent, typeof i39.InputTextareaComponent, typeof i40.TextViewerComponent, typeof i41.TimelineComponent, typeof i42.ToastComponent, typeof i43.TooltipContentComponent, typeof i44.TreeComponent, typeof i45.WizardComponent, typeof i46.ProgressLineComponent], [typeof i47.CommonModule, typeof i48.RouterModule], [typeof i1.AdvancedAutocompleteComponent, typeof i2.AlertComponent, typeof i3.AnchorWrapperComponent, typeof i4.AvatarComponent, typeof i5.BreadcrumbsComponent, typeof i6.BubbleChartComponent, typeof i7.ButtonComponent, typeof i8.CarouselComponent, typeof i9.ChartComponent, typeof i10.ContentPlaceholderComponent, typeof i11.DataWidgetComponent, typeof i12.DatepickerComponent, typeof i13.FacetComponent, typeof i14.FacetHeaderComponent, typeof i15.FacetYearRangeComponent, typeof i16.FooterComponent, typeof i17.HeaderComponent, typeof i18.HeroComponent, typeof i19.IconComponent, typeof i20.HistogramRangeComponent, typeof i21.ImageViewerComponent, typeof i22.ImageViewerToolsComponent, typeof i23.InnerTitleComponent, typeof i24.InputCheckboxComponent, typeof i25.InputLinkComponent, typeof i26.InputSelectComponent, typeof i27.InputTextComponent, typeof i28.ItemPreviewComponent, typeof i29.LoaderComponent, typeof i30.MapComponent, typeof i31.MetadataViewerComponent, typeof i32.NavComponent, typeof i33.PaginationComponent, typeof i34.SidebarHeaderComponent, typeof i35.SignupComponent, typeof i36.SimpleAutocompleteComponent, typeof i37.TableComponent, typeof i38.TagComponent, typeof i39.InputTextareaComponent, typeof i40.TextViewerComponent, typeof i41.TimelineComponent, typeof i42.ToastComponent, typeof i43.TooltipContentComponent, typeof i44.TreeComponent, typeof i45.WizardComponent, typeof i46.ProgressLineComponent]>;
53
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DvComponentsLibModule, [typeof i1.AdvancedAutocompleteComponent, typeof i2.AlertComponent, typeof i3.AnchorWrapperComponent, typeof i4.AvatarComponent, typeof i5.BreadcrumbsComponent, typeof i6.BubbleChartComponent, typeof i7.ButtonComponent, typeof i8.CarouselComponent, typeof i9.ChartComponent, typeof i10.ContentPlaceholderComponent, typeof i11.DataWidgetComponent, typeof i12.DatepickerComponent, typeof i13.FacetComponent, typeof i14.FacetHeaderComponent, typeof i15.FacetYearRangeComponent, typeof i16.FileSelectorComponent, typeof i17.FooterComponent, typeof i18.HeaderComponent, typeof i19.HeroComponent, typeof i20.IconComponent, typeof i21.HistogramRangeComponent, typeof i22.ImageViewerComponent, typeof i23.ImageViewerToolsComponent, typeof i24.InnerTitleComponent, typeof i25.InputCheckboxComponent, typeof i26.InputLinkComponent, typeof i27.InputSelectComponent, typeof i28.InputTextComponent, typeof i29.ItemPreviewComponent, typeof i30.LoaderComponent, typeof i31.MapComponent, typeof i32.MetadataViewerComponent, typeof i33.NavComponent, typeof i34.PaginationComponent, typeof i35.SidebarHeaderComponent, typeof i36.SignupComponent, typeof i37.SimpleAutocompleteComponent, typeof i38.TableComponent, typeof i39.TagComponent, typeof i40.InputTextareaComponent, typeof i41.TextViewerComponent, typeof i42.TimelineComponent, typeof i43.ToastComponent, typeof i44.TooltipContentComponent, typeof i45.TreeComponent, typeof i46.WizardComponent, typeof i47.ProgressLineComponent], [typeof i48.CommonModule, typeof i49.RouterModule], [typeof i1.AdvancedAutocompleteComponent, typeof i2.AlertComponent, typeof i3.AnchorWrapperComponent, typeof i4.AvatarComponent, typeof i5.BreadcrumbsComponent, typeof i6.BubbleChartComponent, typeof i7.ButtonComponent, typeof i8.CarouselComponent, typeof i9.ChartComponent, typeof i10.ContentPlaceholderComponent, typeof i11.DataWidgetComponent, typeof i12.DatepickerComponent, typeof i13.FacetComponent, typeof i14.FacetHeaderComponent, typeof i15.FacetYearRangeComponent, typeof i16.FileSelectorComponent, typeof i17.FooterComponent, typeof i18.HeaderComponent, typeof i19.HeroComponent, typeof i20.IconComponent, typeof i21.HistogramRangeComponent, typeof i22.ImageViewerComponent, typeof i23.ImageViewerToolsComponent, typeof i24.InnerTitleComponent, typeof i25.InputCheckboxComponent, typeof i26.InputLinkComponent, typeof i27.InputSelectComponent, typeof i28.InputTextComponent, typeof i29.ItemPreviewComponent, typeof i30.LoaderComponent, typeof i31.MapComponent, typeof i32.MetadataViewerComponent, typeof i33.NavComponent, typeof i34.PaginationComponent, typeof i35.SidebarHeaderComponent, typeof i36.SignupComponent, typeof i37.SimpleAutocompleteComponent, typeof i38.TableComponent, typeof i39.TagComponent, typeof i40.InputTextareaComponent, typeof i41.TextViewerComponent, typeof i42.TimelineComponent, typeof i43.ToastComponent, typeof i44.TooltipContentComponent, typeof i45.TreeComponent, typeof i46.WizardComponent, typeof i47.ProgressLineComponent]>;
53
54
  static ɵinj: i0.ɵɵInjectorDeclaration<DvComponentsLibModule>;
54
55
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@net7/components",
3
- "version": "4.0.0",
3
+ "version": "4.1.0",
4
4
  "dependencies": {
5
5
  "apexcharts": "^3.8.5",
6
6
  "d3": "^7.1.1",
package/public-api.d.ts CHANGED
@@ -15,6 +15,7 @@ export * from './lib/components/datepicker/datepicker';
15
15
  export * from './lib/components/facet-header/facet-header';
16
16
  export * from './lib/components/facet-year-range/facet-year-range';
17
17
  export * from './lib/components/facet/facet';
18
+ export * from './lib/components/file-selector/file-selector';
18
19
  export * from './lib/components/footer/footer';
19
20
  export * from './lib/components/header/header';
20
21
  export * from './lib/components/hero/hero';
@@ -60,6 +61,7 @@ export * from './lib/components/datepicker/datepicker.mock';
60
61
  export * from './lib/components/facet-header/facet-header.mock';
61
62
  export * from './lib/components/facet-year-range/facet-year-range.mock';
62
63
  export * from './lib/components/facet/facet.mock';
64
+ export * from './lib/components/file-selector/file-selector.mock';
63
65
  export * from './lib/components/footer/footer.mock';
64
66
  export * from './lib/components/header/header.mock';
65
67
  export * from './lib/components/hero/hero.mock';
@@ -0,0 +1,29 @@
1
+ /**
2
+ * FILE-SELECTOR
3
+ *
4
+ * Brief description of the component here.
5
+ */
6
+
7
+ /* ------------------------------------ *\
8
+ #FILE-SELECTOR
9
+ \* ------------------------------------ */
10
+ .n7-file-selector {
11
+ // TODO
12
+ }
13
+
14
+
15
+ /* ------------------------------------ *\
16
+ #MEDIA-QUERIES
17
+ \* ------------------------------------ */
18
+ @media all and (max-width: $breakpoint-laptop) {
19
+ }
20
+
21
+ @media all and (max-width: $breakpoint-ipad-portrait) {
22
+ }
23
+
24
+ @media all and (max-width: $breakpoint-smartphone-landscape) {
25
+ }
26
+
27
+ /* Retina */
28
+ @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
29
+ }