@helpwave/hightide 0.0.8 → 0.0.11
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/README.md +1 -1
- package/dist/coloring/shading.d.ts +2 -0
- package/dist/coloring/shading.js +40 -0
- package/dist/coloring/types.d.ts +11 -0
- package/dist/coloring/types.js +1 -0
- package/dist/components/Avatar.d.ts +14 -0
- package/dist/components/Avatar.js +35 -0
- package/dist/components/AvatarGroup.d.ts +10 -0
- package/dist/components/AvatarGroup.js +13 -0
- package/dist/components/BreadCrumb.d.ts +16 -0
- package/dist/components/BreadCrumb.js +12 -0
- package/dist/components/Button.d.ts +41 -0
- package/dist/components/Button.js +84 -0
- package/dist/components/ChipList.d.ts +21 -0
- package/dist/components/ChipList.js +38 -0
- package/dist/components/Circle.d.ts +6 -0
- package/dist/components/Circle.js +10 -0
- package/dist/components/ErrorComponent.d.ts +13 -0
- package/dist/components/ErrorComponent.js +19 -0
- package/dist/components/Expandable.d.ts +30 -0
- package/dist/components/Expandable.js +16 -0
- package/dist/components/HelpwaveBadge.d.ts +11 -0
- package/dist/components/HelpwaveBadge.js +14 -0
- package/dist/components/HideableContentSection.d.ts +10 -0
- package/dist/components/HideableContentSection.js +15 -0
- package/dist/components/InputGroup.d.ts +13 -0
- package/dist/components/InputGroup.js +33 -0
- package/dist/components/LoadingAndErrorComponent.d.ts +17 -0
- package/dist/components/LoadingAndErrorComponent.js +25 -0
- package/dist/components/LoadingAnimation.d.ts +13 -0
- package/dist/components/LoadingAnimation.js +19 -0
- package/dist/components/LoadingButton.d.ts +6 -0
- package/dist/components/LoadingButton.js +10 -0
- package/dist/components/MarkdownInterpreter.d.ts +25 -0
- package/dist/components/MarkdownInterpreter.js +190 -0
- package/dist/components/Pagination.d.ts +14 -0
- package/dist/components/Pagination.js +25 -0
- package/dist/components/Profile.d.ts +28 -0
- package/dist/components/Profile.js +45 -0
- package/dist/components/ProgressIndicator.d.ts +21 -0
- package/dist/components/ProgressIndicator.js +24 -0
- package/dist/components/Ring.d.ts +31 -0
- package/dist/components/Ring.js +113 -0
- package/dist/components/SearchableList.d.ts +18 -0
- package/dist/components/SearchableList.js +27 -0
- package/dist/components/SortButton.d.ts +10 -0
- package/dist/components/SortButton.js +9 -0
- package/dist/components/Span.js +1 -0
- package/dist/components/StepperBar.d.ts +23 -0
- package/dist/components/StepperBar.js +47 -0
- package/dist/components/Table.d.ts +87 -0
- package/dist/components/Table.js +187 -0
- package/dist/components/TechRadar.d.ts +36 -0
- package/dist/components/TechRadar.js +191 -0
- package/dist/components/TextImage.d.ts +20 -0
- package/dist/components/TextImage.js +31 -0
- package/dist/components/TimeDisplay.d.ts +30 -0
- package/dist/components/TimeDisplay.js +83 -0
- package/dist/components/Tooltip.d.ts +34 -0
- package/dist/components/Tooltip.js +38 -0
- package/dist/components/VerticalDivider.d.ts +11 -0
- package/dist/components/VerticalDivider.js +7 -0
- package/dist/components/date/DatePicker.d.ts +26 -0
- package/dist/components/date/DatePicker.js +58 -0
- package/dist/components/date/DayPicker.d.ts +16 -0
- package/dist/components/date/DayPicker.js +37 -0
- package/dist/components/date/TimePicker.d.ts +12 -0
- package/dist/components/date/TimePicker.js +79 -0
- package/dist/components/date/YearMonthPicker.d.ts +11 -0
- package/dist/components/date/YearMonthPicker.js +59 -0
- package/dist/components/examples/InputGroupExample.d.ts +6 -0
- package/dist/components/examples/InputGroupExample.js +21 -0
- package/dist/components/examples/MultiSelectExample.d.ts +7 -0
- package/dist/components/examples/MultiSelectExample.js +27 -0
- package/dist/components/examples/SearchableSelectExample.d.ts +6 -0
- package/dist/components/examples/SearchableSelectExample.js +17 -0
- package/dist/components/examples/SelectExample.d.ts +4 -0
- package/dist/components/examples/SelectExample.js +15 -0
- package/dist/components/examples/StackingModals.d.ts +4 -0
- package/dist/components/examples/StackingModals.js +15 -0
- package/dist/components/examples/TableExample.d.ts +9 -0
- package/dist/components/examples/TableExample.js +92 -0
- package/dist/components/examples/TextareaExample.d.ts +6 -0
- package/dist/components/examples/TextareaExample.js +10 -0
- package/dist/components/examples/TileExample.d.ts +9 -0
- package/dist/components/examples/TileExample.js +9 -0
- package/dist/components/examples/Title.js +1 -0
- package/dist/components/examples/date/DateTimePickerExample.d.ts +10 -0
- package/dist/components/examples/date/DateTimePickerExample.js +21 -0
- package/dist/components/examples/properties/CheckboxPropertyExample.d.ts +8 -0
- package/dist/components/examples/properties/CheckboxPropertyExample.js +13 -0
- package/dist/components/examples/properties/DatePropertyExample.d.ts +8 -0
- package/dist/components/examples/properties/DatePropertyExample.js +23 -0
- package/dist/components/examples/properties/MultiSelectPropertyExample.d.ts +8 -0
- package/dist/components/examples/properties/MultiSelectPropertyExample.js +16 -0
- package/dist/components/examples/properties/NumberPropertyExample.d.ts +6 -0
- package/dist/components/examples/properties/NumberPropertyExample.js +13 -0
- package/dist/components/examples/properties/SelectPropertyExample.d.ts +6 -0
- package/dist/components/examples/properties/SelectPropertyExample.js +18 -0
- package/dist/components/examples/properties/TextPropertyExample.d.ts +8 -0
- package/dist/components/examples/properties/TextPropertyExample.js +13 -0
- package/dist/components/icons/Helpwave.d.ts +10 -0
- package/dist/components/icons/Helpwave.js +20 -0
- package/dist/components/icons/Tag.d.ts +10 -0
- package/dist/components/icons/Tag.js +12 -0
- package/dist/components/layout/Carousel.d.ts +22 -0
- package/dist/components/layout/Carousel.js +233 -0
- package/dist/components/layout/DividerInserter.d.ts +11 -0
- package/dist/components/layout/DividerInserter.js +20 -0
- package/dist/components/layout/FAQSection.d.ts +23 -0
- package/dist/components/layout/FAQSection.js +14 -0
- package/dist/components/layout/Tile.d.ts +34 -0
- package/dist/components/layout/Tile.js +18 -0
- package/dist/components/modals/ConfirmDialog.d.ts +34 -0
- package/dist/components/modals/ConfirmDialog.js +31 -0
- package/dist/components/modals/DiscardChangesDialog.d.ts +19 -0
- package/dist/components/modals/DiscardChangesDialog.js +24 -0
- package/dist/components/modals/InputModal.d.ts +9 -0
- package/dist/components/modals/InputModal.js +9 -0
- package/dist/components/modals/LanguageModal.d.ts +17 -0
- package/dist/components/modals/LanguageModal.js +35 -0
- package/dist/components/modals/Modal.d.ts +38 -0
- package/dist/components/modals/Modal.js +57 -0
- package/dist/components/modals/ModalRegister.d.ts +11 -0
- package/dist/components/modals/ModalRegister.js +28 -0
- package/dist/components/properties/CheckboxProperty.d.ts +15 -0
- package/dist/components/properties/CheckboxProperty.js +27 -0
- package/dist/components/properties/DateProperty.d.ts +11 -0
- package/dist/components/properties/DateProperty.js +22 -0
- package/dist/components/properties/MultiSelectProperty.d.ts +12 -0
- package/dist/components/properties/MultiSelectProperty.js +33 -0
- package/dist/components/properties/NumberProperty.d.ts +16 -0
- package/dist/components/properties/NumberProperty.js +42 -0
- package/dist/components/properties/PropertyBase.d.ts +23 -0
- package/dist/components/properties/PropertyBase.js +27 -0
- package/dist/components/properties/SelectProperty.d.ts +12 -0
- package/dist/components/properties/SelectProperty.js +22 -0
- package/dist/components/properties/TextProperty.d.ts +15 -0
- package/dist/components/properties/TextProperty.js +37 -0
- package/dist/components/user-input/Checkbox.d.ts +37 -0
- package/dist/components/user-input/Checkbox.js +63 -0
- package/dist/components/user-input/DateAndTimePicker.d.ts +39 -0
- package/dist/components/user-input/DateAndTimePicker.js +65 -0
- package/dist/components/user-input/Input.d.ts +61 -0
- package/dist/components/user-input/Input.js +61 -0
- package/dist/components/user-input/Label.d.ts +12 -0
- package/dist/components/user-input/Label.js +12 -0
- package/dist/components/user-input/Menu.d.ts +21 -0
- package/dist/components/user-input/Menu.js +26 -0
- package/dist/components/user-input/MultiSelect.d.ts +39 -0
- package/dist/components/user-input/MultiSelect.js +57 -0
- package/dist/components/user-input/ScrollPicker.d.ts +11 -0
- package/dist/components/user-input/ScrollPicker.js +151 -0
- package/dist/components/user-input/SearchableSelect.d.ts +8 -0
- package/dist/components/user-input/SearchableSelect.js +14 -0
- package/dist/components/user-input/Select.d.ts +32 -0
- package/dist/components/user-input/Select.js +48 -0
- package/dist/components/user-input/Textarea.d.ts +20 -0
- package/dist/components/user-input/Textarea.js +33 -0
- package/dist/components/user-input/ToggleableInput.d.ts +32 -0
- package/dist/components/user-input/ToggleableInput.js +40 -0
- package/{globals.css → dist/css/globals.css} +1 -1
- package/dist/hooks/useHoverState.d.ts +40 -0
- package/dist/hooks/useHoverState.js +46 -0
- package/dist/hooks/useLanguage.d.ts +17 -0
- package/dist/hooks/useLanguage.js +51 -0
- package/dist/hooks/useLocalStorage.d.ts +4 -0
- package/dist/hooks/useLocalStorage.js +24 -0
- package/dist/hooks/useOutsideClick.d.ts +2 -0
- package/dist/hooks/useOutsideClick.js +22 -0
- package/dist/hooks/useSaveDelay.d.ts +5 -0
- package/dist/hooks/useSaveDelay.js +41 -0
- package/dist/hooks/useTheme.d.ts +16 -0
- package/dist/hooks/useTheme.js +32 -0
- package/dist/hooks/useTranslation.d.ts +24 -0
- package/dist/hooks/useTranslation.js +11 -0
- package/dist/util/array.d.ts +23 -0
- package/dist/util/array.js +103 -0
- package/{util/builder.ts → dist/util/builder.d.ts} +1 -4
- package/dist/util/builder.js +9 -0
- package/dist/util/date.d.ts +28 -0
- package/dist/util/date.js +133 -0
- package/dist/util/easeFunctions.d.ts +9 -0
- package/dist/util/easeFunctions.js +30 -0
- package/dist/util/emailValidation.d.ts +1 -0
- package/dist/util/emailValidation.js +3 -0
- package/dist/util/loopingArray.d.ts +23 -0
- package/dist/util/loopingArray.js +67 -0
- package/dist/util/math.d.ts +1 -0
- package/dist/util/math.js +3 -0
- package/dist/util/news.d.ts +98 -0
- package/dist/util/news.js +27 -0
- package/dist/util/noop.d.ts +1 -0
- package/dist/util/noop.js +1 -0
- package/{util/simpleSearch.ts → dist/util/simpleSearch.d.ts} +4 -21
- package/dist/util/simpleSearch.js +62 -0
- package/dist/util/storage.d.ts +15 -0
- package/dist/util/storage.js +32 -0
- package/dist/util/types.d.ts +1 -0
- package/dist/util/types.js +1 -0
- package/package.json +7 -8
- package/coloring/shading.ts +0 -46
- package/coloring/types.ts +0 -13
- package/components/Avatar.tsx +0 -58
- package/components/AvatarGroup.tsx +0 -48
- package/components/BreadCrumb.tsx +0 -35
- package/components/Button.tsx +0 -236
- package/components/ChipList.tsx +0 -89
- package/components/Circle.tsx +0 -27
- package/components/ErrorComponent.tsx +0 -40
- package/components/Expandable.tsx +0 -61
- package/components/HelpwaveBadge.tsx +0 -35
- package/components/HideableContentSection.tsx +0 -43
- package/components/InputGroup.tsx +0 -72
- package/components/LoadingAndErrorComponent.tsx +0 -47
- package/components/LoadingAnimation.tsx +0 -40
- package/components/LoadingButton.tsx +0 -27
- package/components/MarkdownInterpreter.tsx +0 -278
- package/components/Pagination.tsx +0 -65
- package/components/Profile.tsx +0 -124
- package/components/ProgressIndicator.tsx +0 -58
- package/components/Ring.tsx +0 -286
- package/components/SearchableList.tsx +0 -69
- package/components/SortButton.tsx +0 -33
- package/components/StepperBar.tsx +0 -124
- package/components/Table.tsx +0 -330
- package/components/TechRadar.tsx +0 -247
- package/components/TextImage.tsx +0 -86
- package/components/TimeDisplay.tsx +0 -121
- package/components/Tooltip.tsx +0 -92
- package/components/VerticalDivider.tsx +0 -51
- package/components/date/DatePicker.tsx +0 -164
- package/components/date/DayPicker.tsx +0 -95
- package/components/date/TimePicker.tsx +0 -167
- package/components/date/YearMonthPicker.tsx +0 -130
- package/components/examples/InputGroupExample.tsx +0 -58
- package/components/examples/MultiSelectExample.tsx +0 -57
- package/components/examples/SearchableSelectExample.tsx +0 -34
- package/components/examples/SelectExample.tsx +0 -28
- package/components/examples/StackingModals.tsx +0 -54
- package/components/examples/TableExample.tsx +0 -159
- package/components/examples/TextareaExample.tsx +0 -23
- package/components/examples/TileExample.tsx +0 -25
- package/components/examples/date/DateTimePickerExample.tsx +0 -53
- package/components/examples/properties/CheckboxPropertyExample.tsx +0 -29
- package/components/examples/properties/DatePropertyExample.tsx +0 -44
- package/components/examples/properties/MultiSelectPropertyExample.tsx +0 -39
- package/components/examples/properties/NumberPropertyExample.tsx +0 -28
- package/components/examples/properties/SelectPropertyExample.tsx +0 -39
- package/components/examples/properties/TextPropertyExample.tsx +0 -30
- package/components/icons/Helpwave.tsx +0 -51
- package/components/icons/Tag.tsx +0 -29
- package/components/layout/Carousel.tsx +0 -396
- package/components/layout/DividerInserter.tsx +0 -37
- package/components/layout/FAQSection.tsx +0 -57
- package/components/layout/Tile.tsx +0 -67
- package/components/modals/ConfirmDialog.tsx +0 -105
- package/components/modals/DiscardChangesDialog.tsx +0 -71
- package/components/modals/InputModal.tsx +0 -26
- package/components/modals/LanguageModal.tsx +0 -76
- package/components/modals/Modal.tsx +0 -149
- package/components/modals/ModalRegister.tsx +0 -45
- package/components/properties/CheckboxProperty.tsx +0 -62
- package/components/properties/DateProperty.tsx +0 -58
- package/components/properties/MultiSelectProperty.tsx +0 -82
- package/components/properties/NumberProperty.tsx +0 -86
- package/components/properties/PropertyBase.tsx +0 -84
- package/components/properties/SelectProperty.tsx +0 -67
- package/components/properties/TextProperty.tsx +0 -81
- package/components/user-input/Checkbox.tsx +0 -139
- package/components/user-input/DateAndTimePicker.tsx +0 -156
- package/components/user-input/Input.tsx +0 -192
- package/components/user-input/Label.tsx +0 -32
- package/components/user-input/Menu.tsx +0 -75
- package/components/user-input/MultiSelect.tsx +0 -158
- package/components/user-input/ScrollPicker.tsx +0 -240
- package/components/user-input/SearchableSelect.tsx +0 -36
- package/components/user-input/Select.tsx +0 -132
- package/components/user-input/Textarea.tsx +0 -86
- package/components/user-input/ToggleableInput.tsx +0 -115
- package/hooks/useHoverState.ts +0 -88
- package/hooks/useLanguage.tsx +0 -78
- package/hooks/useLocalStorage.tsx +0 -33
- package/hooks/useOutsideClick.ts +0 -25
- package/hooks/useSaveDelay.ts +0 -46
- package/hooks/useTheme.tsx +0 -57
- package/hooks/useTranslation.ts +0 -43
- package/index.ts +0 -0
- package/util/array.ts +0 -115
- package/util/date.ts +0 -180
- package/util/easeFunctions.ts +0 -37
- package/util/emailValidation.ts +0 -3
- package/util/loopingArray.ts +0 -94
- package/util/math.ts +0 -3
- package/util/news.ts +0 -43
- package/util/noop.ts +0 -1
- package/util/storage.ts +0 -37
- package/util/types.ts +0 -4
- /package/{components/Span.tsx → dist/components/Span.d.ts} +0 -0
- /package/{components/examples/Title.tsx → dist/components/examples/Title.d.ts} +0 -0
package/util/loopingArray.ts
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 1 is forwards
|
|
3
|
-
*
|
|
4
|
-
* -1 is backwards
|
|
5
|
-
*/
|
|
6
|
-
export type Direction = 1 | -1
|
|
7
|
-
|
|
8
|
-
export class LoopingArrayCalculator {
|
|
9
|
-
length: number
|
|
10
|
-
isLooping: boolean
|
|
11
|
-
allowedOverScroll: number
|
|
12
|
-
|
|
13
|
-
constructor(length: number, isLooping: boolean = true, allowedOverScroll: number = 0.1) {
|
|
14
|
-
if (allowedOverScroll < 0 || length < 1) {
|
|
15
|
-
throw new Error('Invalid parameters: allowedOverScroll >= 0 and length >= 1 must be true')
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
this.length = length
|
|
19
|
-
this.isLooping = isLooping
|
|
20
|
-
this.allowedOverScroll = allowedOverScroll
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
getCorrectedPosition(position: number): number {
|
|
24
|
-
if (!this.isLooping) {
|
|
25
|
-
return Math.max(-this.allowedOverScroll, Math.min(this.allowedOverScroll + this.length - 1, position))
|
|
26
|
-
}
|
|
27
|
-
if (position >= this.length) {
|
|
28
|
-
return position % this.length
|
|
29
|
-
}
|
|
30
|
-
if (position < 0) {
|
|
31
|
-
return this.length - (Math.abs(position) % this.length)
|
|
32
|
-
}
|
|
33
|
-
return position
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
static withoutOffset(position: number): number {
|
|
37
|
-
return position + LoopingArrayCalculator.getOffset(position)
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
static getOffset(position: number): number {
|
|
41
|
-
return Math.round(position) - position // For example: 45.5 => 46 - 45.5 = 0.5
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* @return absolute distance forwards or Infinity when the target cannot be reached (only possible when not isLooping)
|
|
46
|
-
*/
|
|
47
|
-
getDistanceDirectional(position: number, target: number, direction: Direction): number {
|
|
48
|
-
if (!this.isLooping && (position < -this.allowedOverScroll || position > this.allowedOverScroll + this.length - 1)) {
|
|
49
|
-
throw new Error('Invalid parameters: position is out of bounds.')
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const isForwardInvalid = (direction === 1 && position > target)
|
|
53
|
-
const isBackwardInvalid = (direction === -1 && target < position)
|
|
54
|
-
|
|
55
|
-
if (!this.isLooping && (isForwardInvalid || isBackwardInvalid)) {
|
|
56
|
-
return Infinity
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
if (direction === -1) {
|
|
60
|
-
return this.getDistanceDirectional(target, position, 1)
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
position = this.getCorrectedPosition(position)
|
|
64
|
-
target = this.getCorrectedPosition(target)
|
|
65
|
-
|
|
66
|
-
let distance = (target - position) * direction
|
|
67
|
-
if (distance < 0) {
|
|
68
|
-
distance = this.length - (Math.abs(position) % this.length) + target
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
return distance
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
getDistanceForward(position: number, target: number): number {
|
|
75
|
-
return this.getDistanceDirectional(position, target, 1)
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
getDistanceBackward(position: number, target: number): number {
|
|
79
|
-
return this.getDistanceDirectional(position, target, -1)
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
getDistance(position: number, target: number): number {
|
|
83
|
-
const forwardDistance = this.getDistanceForward(position, target)
|
|
84
|
-
const backwardDistance = this.getDistanceBackward(position, target)
|
|
85
|
-
|
|
86
|
-
return Math.min(forwardDistance, backwardDistance)
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
getBestDirection(position: number, target: number): Direction {
|
|
90
|
-
const forwardDistance = this.getDistanceForward(position, target)
|
|
91
|
-
const backwardDistance = this.getDistanceBackward(position, target)
|
|
92
|
-
return forwardDistance < backwardDistance ? 1 : -1
|
|
93
|
-
}
|
|
94
|
-
}
|
package/util/math.ts
DELETED
package/util/news.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod'
|
|
2
|
-
import type { Languages } from '../hooks/useLanguage'
|
|
3
|
-
import { languages } from '../hooks/useLanguage'
|
|
4
|
-
|
|
5
|
-
export type News = {
|
|
6
|
-
title: string,
|
|
7
|
-
date: Date,
|
|
8
|
-
description: (string | URL)[],
|
|
9
|
-
externalResource?: URL,
|
|
10
|
-
keys: string[],
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export type LocalizedNews = Record<Languages, News[]>
|
|
14
|
-
|
|
15
|
-
export const newsSchema = z.object({
|
|
16
|
-
title: z.string(),
|
|
17
|
-
description: z.string(),
|
|
18
|
-
date: z.string(),
|
|
19
|
-
image: z.string().url().optional(),
|
|
20
|
-
externalResource: z.string().url().optional(),
|
|
21
|
-
keys: z.array(z.string())
|
|
22
|
-
}).transform<News>((obj) => {
|
|
23
|
-
let description: (string | URL)[] = [obj.description]
|
|
24
|
-
if (obj.image) {
|
|
25
|
-
description = [new URL(obj.image), ...description]
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return {
|
|
29
|
-
title: obj.title,
|
|
30
|
-
date: new Date(obj.date),
|
|
31
|
-
description,
|
|
32
|
-
externalResource: obj.externalResource ? new URL(obj.externalResource) : undefined,
|
|
33
|
-
keys: obj.keys
|
|
34
|
-
}
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
export const newsListSchema = z.array(newsSchema)
|
|
38
|
-
|
|
39
|
-
export const localizedNewsSchema = z.record(z.enum(languages), newsListSchema)
|
|
40
|
-
|
|
41
|
-
export const filterNews = (localizedNews: News[], requiredKeys: string[]) => {
|
|
42
|
-
return localizedNews.filter(news => requiredKeys.every(value => news.keys.includes(value)))
|
|
43
|
-
}
|
package/util/noop.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export const noop = () => undefined
|
package/util/storage.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
class StorageService {
|
|
2
|
-
// this seems to be a bug in eslint as 'paramter-properties' is a special syntax of typescript
|
|
3
|
-
|
|
4
|
-
constructor(private storage: Storage) {}
|
|
5
|
-
|
|
6
|
-
public get<T>(key: string): T | null {
|
|
7
|
-
const value = this.storage.getItem(key)
|
|
8
|
-
if (value === null) {
|
|
9
|
-
return null
|
|
10
|
-
}
|
|
11
|
-
return JSON.parse(value)
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
public set<T>(key: string, value: T) {
|
|
15
|
-
this.storage.setItem(key, JSON.stringify(value))
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
public delete(key: string) {
|
|
19
|
-
this.storage.removeItem(key)
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
public deleteAll() {
|
|
23
|
-
this.storage.clear()
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export class LocalStorageService extends StorageService {
|
|
28
|
-
constructor() {
|
|
29
|
-
super(window.localStorage)
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export class SessionStorageService extends StorageService {
|
|
34
|
-
constructor() {
|
|
35
|
-
super(window.sessionStorage)
|
|
36
|
-
}
|
|
37
|
-
}
|
package/util/types.ts
DELETED
|
File without changes
|
|
File without changes
|