ngx-sfc-common 0.0.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.
Files changed (114) hide show
  1. package/README.md +460 -0
  2. package/esm2020/lib/components/button/button-type.enum.mjs +9 -0
  3. package/esm2020/lib/components/button/button.component.mjs +38 -0
  4. package/esm2020/lib/components/checkmark/checkmark.component.mjs +27 -0
  5. package/esm2020/lib/components/delimeter/delimeter.component.mjs +11 -0
  6. package/esm2020/lib/components/dots/dots.component.mjs +30 -0
  7. package/esm2020/lib/components/hamburger/hamburger.component.mjs +24 -0
  8. package/esm2020/lib/components/index.mjs +20 -0
  9. package/esm2020/lib/components/loader/bounce/bounce-loader.component.mjs +13 -0
  10. package/esm2020/lib/components/loader/circle/circle-loader-type.enum.mjs +6 -0
  11. package/esm2020/lib/components/loader/circle/circle-loader.component.mjs +20 -0
  12. package/esm2020/lib/components/loader/loader-base.component.mjs +51 -0
  13. package/esm2020/lib/components/loader/loader.constants.mjs +6 -0
  14. package/esm2020/lib/components/loader/loader.event.mjs +2 -0
  15. package/esm2020/lib/components/loader/service/loader.service.mjs +76 -0
  16. package/esm2020/lib/components/modal/directive/modal-open-on-click.directive.mjs +50 -0
  17. package/esm2020/lib/components/modal/footer/default/default-modal-footer.component.mjs +48 -0
  18. package/esm2020/lib/components/modal/footer/default/default-modal-footer.model.mjs +2 -0
  19. package/esm2020/lib/components/modal/header/default/default-modal-header.component.mjs +31 -0
  20. package/esm2020/lib/components/modal/header/default/default-modal-header.model.mjs +2 -0
  21. package/esm2020/lib/components/modal/modal-template.enum.mjs +7 -0
  22. package/esm2020/lib/components/modal/modal.component.mjs +107 -0
  23. package/esm2020/lib/components/modal/service/modal.service.mjs +26 -0
  24. package/esm2020/lib/components/toggle-switcher/toggle-switcher.component.mjs +31 -0
  25. package/esm2020/lib/components/toggle-switcher/toggle-switcher.model.mjs +2 -0
  26. package/esm2020/lib/components/tooltip/tooltip-type.enum.mjs +6 -0
  27. package/esm2020/lib/components/tooltip/tooltip.component.mjs +69 -0
  28. package/esm2020/lib/constants/common.constants.mjs +6 -0
  29. package/esm2020/lib/constants/date-time.constants.mjs +8 -0
  30. package/esm2020/lib/constants/index.mjs +4 -0
  31. package/esm2020/lib/constants/ui.constants.mjs +16 -0
  32. package/esm2020/lib/directives/click-outside/click-outside.directive.mjs +65 -0
  33. package/esm2020/lib/directives/click-outside/click-outside.event.mjs +2 -0
  34. package/esm2020/lib/directives/component-size/component-size.directive.mjs +46 -0
  35. package/esm2020/lib/directives/index.mjs +7 -0
  36. package/esm2020/lib/directives/mouse-down/mouse-down.directive.mjs +37 -0
  37. package/esm2020/lib/directives/show-hide-element/show-hide-element.directive.mjs +42 -0
  38. package/esm2020/lib/directives/template-reference/template-reference.directive.mjs +21 -0
  39. package/esm2020/lib/directives/throw-element-on-hover/throw-element-on-hover.directive.mjs +38 -0
  40. package/esm2020/lib/enums/common.enums.mjs +69 -0
  41. package/esm2020/lib/enums/index.mjs +2 -0
  42. package/esm2020/lib/ngx-sfc-common.module.mjs +135 -0
  43. package/esm2020/lib/services/document-ref.service.mjs +70 -0
  44. package/esm2020/lib/services/index.mjs +4 -0
  45. package/esm2020/lib/services/resize.service.mjs +42 -0
  46. package/esm2020/lib/services/window-ref.service.mjs +70 -0
  47. package/esm2020/lib/utils/collections.utils.mjs +244 -0
  48. package/esm2020/lib/utils/common.utils.mjs +86 -0
  49. package/esm2020/lib/utils/date-time.utils.mjs +208 -0
  50. package/esm2020/lib/utils/file.utils.mjs +52 -0
  51. package/esm2020/lib/utils/index.mjs +7 -0
  52. package/esm2020/lib/utils/string.utils.mjs +31 -0
  53. package/esm2020/lib/utils/ui.utils.mjs +39 -0
  54. package/esm2020/ngx-sfc-common.mjs +5 -0
  55. package/esm2020/public-api.mjs +11 -0
  56. package/fesm2015/ngx-sfc-common.mjs +1908 -0
  57. package/fesm2015/ngx-sfc-common.mjs.map +1 -0
  58. package/fesm2020/ngx-sfc-common.mjs +1900 -0
  59. package/fesm2020/ngx-sfc-common.mjs.map +1 -0
  60. package/lib/components/button/button-type.enum.d.ts +7 -0
  61. package/lib/components/button/button.component.d.ts +13 -0
  62. package/lib/components/checkmark/checkmark.component.d.ts +8 -0
  63. package/lib/components/delimeter/delimeter.component.d.ts +5 -0
  64. package/lib/components/dots/dots.component.d.ts +9 -0
  65. package/lib/components/hamburger/hamburger.component.d.ts +7 -0
  66. package/lib/components/index.d.ts +21 -0
  67. package/lib/components/loader/bounce/bounce-loader.component.d.ts +6 -0
  68. package/lib/components/loader/circle/circle-loader-type.enum.d.ts +4 -0
  69. package/lib/components/loader/circle/circle-loader.component.d.ts +8 -0
  70. package/lib/components/loader/loader-base.component.d.ts +27 -0
  71. package/lib/components/loader/loader.constants.d.ts +5 -0
  72. package/lib/components/loader/loader.event.d.ts +4 -0
  73. package/lib/components/loader/service/loader.service.d.ts +33 -0
  74. package/lib/components/modal/directive/modal-open-on-click.directive.d.ts +17 -0
  75. package/lib/components/modal/footer/default/default-modal-footer.component.d.ts +19 -0
  76. package/lib/components/modal/footer/default/default-modal-footer.model.d.ts +6 -0
  77. package/lib/components/modal/header/default/default-modal-header.component.d.ts +14 -0
  78. package/lib/components/modal/header/default/default-modal-header.model.d.ts +5 -0
  79. package/lib/components/modal/modal-template.enum.d.ts +5 -0
  80. package/lib/components/modal/modal.component.d.ts +25 -0
  81. package/lib/components/modal/service/modal.service.d.ts +12 -0
  82. package/lib/components/toggle-switcher/toggle-switcher.component.d.ts +11 -0
  83. package/lib/components/toggle-switcher/toggle-switcher.model.d.ts +4 -0
  84. package/lib/components/tooltip/tooltip-type.enum.d.ts +4 -0
  85. package/lib/components/tooltip/tooltip.component.d.ts +22 -0
  86. package/lib/constants/common.constants.d.ts +5 -0
  87. package/lib/constants/date-time.constants.d.ts +7 -0
  88. package/lib/constants/index.d.ts +3 -0
  89. package/lib/constants/ui.constants.d.ts +15 -0
  90. package/lib/directives/click-outside/click-outside.directive.d.ts +23 -0
  91. package/lib/directives/click-outside/click-outside.event.d.ts +4 -0
  92. package/lib/directives/component-size/component-size.directive.d.ts +13 -0
  93. package/lib/directives/index.d.ts +7 -0
  94. package/lib/directives/mouse-down/mouse-down.directive.d.ts +12 -0
  95. package/lib/directives/show-hide-element/show-hide-element.directive.d.ts +13 -0
  96. package/lib/directives/template-reference/template-reference.directive.d.ts +9 -0
  97. package/lib/directives/throw-element-on-hover/throw-element-on-hover.directive.d.ts +13 -0
  98. package/lib/enums/common.enums.d.ts +61 -0
  99. package/lib/enums/index.d.ts +1 -0
  100. package/lib/ngx-sfc-common.module.d.ts +27 -0
  101. package/lib/services/document-ref.service.d.ts +43 -0
  102. package/lib/services/index.d.ts +3 -0
  103. package/lib/services/resize.service.d.ts +32 -0
  104. package/lib/services/window-ref.service.d.ts +43 -0
  105. package/lib/utils/collections.utils.d.ts +135 -0
  106. package/lib/utils/common.utils.d.ts +50 -0
  107. package/lib/utils/date-time.utils.d.ts +131 -0
  108. package/lib/utils/file.utils.d.ts +25 -0
  109. package/lib/utils/index.d.ts +6 -0
  110. package/lib/utils/string.utils.d.ts +19 -0
  111. package/lib/utils/ui.utils.d.ts +24 -0
  112. package/ngx-sfc-common.d.ts +5 -0
  113. package/package.json +53 -0
  114. package/public-api.d.ts +7 -0
@@ -0,0 +1,131 @@
1
+ /**
2
+ * Set minutes for date
3
+ * @param date Date value
4
+ * @param minute Minute value
5
+ * @returns Date with minute value
6
+ */
7
+ export declare function setMinutes(date: Date, minute: number): Date;
8
+ /**
9
+ * Set hours for date
10
+ * @param date Date value
11
+ * @param hour Hour value
12
+ * @returns Date with hour value
13
+ */
14
+ export declare function setHours(date: Date, hour: number): Date;
15
+ /**
16
+ * Set day for date value
17
+ * @param date Date value
18
+ * @param dayNumber Day number
19
+ * @returns Date with day number
20
+ */
21
+ export declare function setDay(date: Date, dayNumber: number): Date;
22
+ /**
23
+ * Set year for date
24
+ * @param date Date value
25
+ * @param year Year value
26
+ * @returns Date with year value
27
+ */
28
+ export declare function setYear(date: Date, year: number): Date;
29
+ /**
30
+ * Get next month as date
31
+ * @param date Date value
32
+ * @returns Next month as date
33
+ */
34
+ export declare function getNextMonth(date: Date): Date;
35
+ /**
36
+ * Get previous month as date
37
+ * @param date Date value
38
+ * @returns Previous month as date
39
+ */
40
+ export declare function getPreviousMonth(date: Date): Date;
41
+ /**
42
+ * Get next year as date
43
+ * @param date Date value
44
+ * @returns Next year as date
45
+ */
46
+ export declare function getNextYear(date: Date): Date;
47
+ /**
48
+ * Get previous year as date
49
+ * @param date Date value
50
+ * @returns Previous year as date
51
+ */
52
+ export declare function getPreviousYear(date: Date): Date;
53
+ /**
54
+ * Return first day of month as date from date value
55
+ * @param date Date value
56
+ * @returns First day of month as date
57
+ */
58
+ export declare function getFirstDayOfMonth(date: Date): Date;
59
+ /**
60
+ * Return last day of month as date from date value
61
+ * @param date Date value
62
+ * @returns Last day of month as date
63
+ */
64
+ export declare function getLastDayOfMonth(date: Date): Date;
65
+ /**
66
+ * Return first day of year as date from date value
67
+ * @param date Date value
68
+ * @returns First day of year as date
69
+ */
70
+ export declare function getFirstDayOfYear(date: Date): Date;
71
+ /**
72
+ * Return last day of year as date from date value
73
+ * @param date Date value
74
+ * @returns Last day of year as date
75
+ */
76
+ export declare function getLastDayOfYear(date: Date): Date;
77
+ /**
78
+ * Return first day of month as date
79
+ * @param year Year value
80
+ * @param month Month value
81
+ * @returns First day of month
82
+ */
83
+ export declare function getFirstDayOfMonthByYearAndMonth(year: number, month: number): Date;
84
+ /**
85
+ * Return last day of month as date
86
+ * @param year Year value
87
+ * @param month Month value
88
+ * @returns Last day of month
89
+ */
90
+ export declare function getLastDayOfMonthByYearAndMonth(year: number, month: number): Date;
91
+ /**
92
+ * Return week number in month from date value
93
+ * @param date Date value
94
+ * @returns Week number
95
+ */
96
+ export declare function getWeeksNumberInMonth(date: Date): number;
97
+ /**
98
+ * Return true if first and second date are equal
99
+ * @param date1 First date value
100
+ * @param date2 Second date value
101
+ * @returns True if first and second date are equal
102
+ */
103
+ export declare function isEqualDates(date1: Date, date2: Date): boolean;
104
+ /**
105
+ * Return true if first date greater than second date
106
+ * @param date1 First date value
107
+ * @param date2 Second date value
108
+ * @returns True if first date greater than second date
109
+ */
110
+ export declare function isDateGreat(date1: Date, date2: Date): boolean;
111
+ /**
112
+ * Return true if first date greater or equal to second date
113
+ * @param date1 First date value
114
+ * @param date2 Second date value
115
+ * @returns True if first date greater or equal to second date
116
+ */
117
+ export declare function isDateGreatOrEqual(date1: Date, date2: Date): boolean;
118
+ /**
119
+ * Return true if first date time greater than second date time
120
+ * @param date1 First date time value
121
+ * @param date2 Second date time value
122
+ * @returns True if first date time greater than second date time
123
+ */
124
+ export declare function isDateTimeGreat(date1: Date, date2: Date): boolean;
125
+ /**
126
+ * Return true if first date time greater or equal to second date time
127
+ * @param date1 First date time value
128
+ * @param date2 Second date time value
129
+ * @returns True if first date time greater or equal to second date time
130
+ */
131
+ export declare function isDateTimeGreatOrEqual(date1: Date, date2: Date): boolean;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Return parsed file size as string
3
+ * @param bytes Bytes count
4
+ * @param decimals Value after dot
5
+ * @returns Parsed file size
6
+ */
7
+ export declare function parseFileSize(bytes: number, decimals?: number): string;
8
+ /**
9
+ * Return file extension
10
+ * @param file File value
11
+ * @returns File extension
12
+ */
13
+ export declare function getFileExtension(file: File): string;
14
+ /**
15
+ * Read file as data URL
16
+ * @param file File value
17
+ * @param onLoad On load action
18
+ */
19
+ export declare function readAsDataURL(file: File, onLoad: (result: string | ArrayBuffer | null) => void): void;
20
+ /**
21
+ * Return true if file is image
22
+ * @param file File value
23
+ * @returns True if file is image
24
+ */
25
+ export declare function isImage(file: File): boolean;
@@ -0,0 +1,6 @@
1
+ export { isDefined, isObject, isAsyncData, addPropertyToObject, removePropertyFromObject, mergeDeep, nameof } from './common.utils';
2
+ export { isNullOrEmptyString, contains, trim } from './string.utils';
3
+ export { setMinutes, setHours, setDay, setYear, getNextMonth, getPreviousMonth, getNextYear, getPreviousYear, getFirstDayOfMonth, getLastDayOfMonth, getFirstDayOfYear, getLastDayOfYear, getFirstDayOfMonthByYearAndMonth, getLastDayOfMonthByYearAndMonth, getWeeksNumberInMonth, isEqualDates, isDateGreat, isDateGreatOrEqual, isDateTimeGreat, isDateTimeGreatOrEqual } from './date-time.utils';
4
+ export { parseFileSize, getFileExtension, readAsDataURL, isImage } from './file.utils';
5
+ export { getCssLikeValue, getValueFromCssLikeValue, addClasses, removeClasses } from './ui.utils';
6
+ export { any, hasItem, hasItemBy, hasObjectItem, firstOrDefault, firstItem, lastItem, all, where, skip, sortBy, sortByPath, distinct, sum, max, remove, addItem, removeItem, updateItem, getCollectionOrEmpty } from './collections.utils';
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Return true if string has value(not empty string)
3
+ * @param value String value to check
4
+ * @returns True if string is not null and defined(not empty string)
5
+ */
6
+ export declare function isNullOrEmptyString(value: string | undefined | null): boolean;
7
+ /**
8
+ * Return true if value contains includeValue
9
+ * @param value String value to check
10
+ * @param includeValue Value to check if it include
11
+ * @returns True if value contains includeValue
12
+ */
13
+ export declare function contains(value: string | undefined | null, includeValue: string): boolean;
14
+ /**
15
+ * Return trimed value
16
+ * @param value Value for trim modification
17
+ * @returns Trimed value
18
+ */
19
+ export declare function trim(value: string): string;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Return CSS like value
3
+ * @param value Value as number
4
+ * @returns Value as '1px'
5
+ */
6
+ export declare function getCssLikeValue(value: number, type?: string): string;
7
+ /**
8
+ * Parse CSS like value to number
9
+ * @param value CSS like value
10
+ * @returns Number value
11
+ */
12
+ export declare function getValueFromCssLikeValue(value: string, type?: string): number;
13
+ /**
14
+ * Add classes to HTML element
15
+ * @param element HTML element
16
+ * @param classNames Array of CSS classes
17
+ */
18
+ export declare function addClasses(element: HTMLElement, ...classNames: Array<string>): void;
19
+ /**
20
+ * Remove classes to HTML element
21
+ * @param element HTML element
22
+ * @param classNames Array of CSS classes
23
+ */
24
+ export declare function removeClasses(element: HTMLElement, ...classNames: Array<string>): void;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="ngx-sfc-common" />
5
+ export * from './public-api';
package/package.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "ngx-sfc-common",
3
+ "version": "0.0.1",
4
+ "description": "Angular common(shared) library for SFC project",
5
+ "keywords": [
6
+ "Street Football Club",
7
+ "SFC",
8
+ "angular",
9
+ "components",
10
+ "directives",
11
+ "services",
12
+ "utils",
13
+ "responsive",
14
+ "common",
15
+ "shared"
16
+ ],
17
+ "author": "Andrii Kryvoruk",
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "https://github.com/1kriva1/ngx-sfc"
21
+ },
22
+ "bugs": {
23
+ "url": "https://github.com/1kriva1/ngx-sfc/issues"
24
+ },
25
+ "license": "MIT",
26
+ "peerDependencies": {
27
+ "@angular/common": "^13.2.0",
28
+ "@angular/core": "^13.2.0"
29
+ },
30
+ "dependencies": {
31
+ "tslib": "^2.3.0"
32
+ },
33
+ "module": "fesm2015/ngx-sfc-common.mjs",
34
+ "es2020": "fesm2020/ngx-sfc-common.mjs",
35
+ "esm2020": "esm2020/ngx-sfc-common.mjs",
36
+ "fesm2020": "fesm2020/ngx-sfc-common.mjs",
37
+ "fesm2015": "fesm2015/ngx-sfc-common.mjs",
38
+ "typings": "ngx-sfc-common.d.ts",
39
+ "exports": {
40
+ "./package.json": {
41
+ "default": "./package.json"
42
+ },
43
+ ".": {
44
+ "types": "./ngx-sfc-common.d.ts",
45
+ "esm2020": "./esm2020/ngx-sfc-common.mjs",
46
+ "es2020": "./fesm2020/ngx-sfc-common.mjs",
47
+ "es2015": "./fesm2015/ngx-sfc-common.mjs",
48
+ "node": "./fesm2015/ngx-sfc-common.mjs",
49
+ "default": "./fesm2020/ngx-sfc-common.mjs"
50
+ }
51
+ },
52
+ "sideEffects": false
53
+ }
@@ -0,0 +1,7 @@
1
+ export * from './lib/ngx-sfc-common.module';
2
+ export * from './lib/constants';
3
+ export * from './lib/enums';
4
+ export * from './lib/utils';
5
+ export * from './lib/services';
6
+ export * from './lib/directives';
7
+ export * from './lib/components';