@dative-gpi/foundation-shared-components 0.0.7 → 0.0.8
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/components/FSButton.vue +3 -3
- package/components/FSCalendar.vue +171 -0
- package/components/FSCalendarTwin.vue +394 -0
- package/components/FSCard.vue +63 -0
- package/components/FSCheckbox.vue +7 -8
- package/components/FSClock.vue +38 -0
- package/components/FSDatePicker.vue +226 -0
- package/components/FSIcon.vue +1 -1
- package/components/FSNumberField.vue +4 -4
- package/components/FSPasswordField.vue +14 -12
- package/components/FSRadio.vue +0 -1
- package/components/FSRadioGroup.vue +6 -6
- package/components/FSRichTextField.vue +558 -0
- package/components/FSSearchField.vue +103 -102
- package/components/FSSlider.vue +132 -0
- package/components/FSSwitch.vue +9 -9
- package/components/FSTagField.vue +186 -127
- package/components/FSTextArea.vue +207 -0
- package/components/FSTextField.vue +151 -146
- package/composables/index.ts +2 -1
- package/composables/useBreakpoints.ts +14 -0
- package/composables/useDates.ts +39 -0
- package/models/FSTextFields.ts +12 -6
- package/package.json +12 -4
- package/styles/components/fs_button.scss +2 -10
- package/styles/components/fs_calendar.scss +115 -0
- package/styles/components/fs_card.scss +7 -0
- package/styles/components/fs_date_picker.scss +0 -0
- package/styles/components/fs_icon.scss +3 -9
- package/styles/components/fs_rich_text_field.scss +67 -0
- package/styles/components/fs_slider.scss +20 -0
- package/styles/components/fs_tag_field.scss +9 -0
- package/styles/components/fs_text_area.scss +105 -0
- package/styles/components/index.scss +6 -0
- package/utils/FSRichTextField.ts +27 -0
- package/utils/index.ts +1 -0
- package/composables/useTouch.ts +0 -9
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
.fs-slider {
|
|
2
|
+
padding: 0px !important;
|
|
3
|
+
width: 100%;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.fs-slider-label {
|
|
7
|
+
color: var(--fs-slider-color);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.fs-slider-description {
|
|
11
|
+
color: var(--fs-slider-color);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.v-slider-thumb__ripple {
|
|
15
|
+
display: none;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.v-slider-thumb__surface:after {
|
|
19
|
+
content: none;
|
|
20
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
.fs-text-area:not(.fs-text-area-auto-grow) {
|
|
2
|
+
padding: 0px !important;
|
|
3
|
+
width: 100%;
|
|
4
|
+
|
|
5
|
+
& > .v-input__control > .v-field {
|
|
6
|
+
border: 1px solid var(--fs-text-area-border-color) !important;
|
|
7
|
+
border-radius: 4px !important;
|
|
8
|
+
padding: 0 !important;
|
|
9
|
+
|
|
10
|
+
&--error {
|
|
11
|
+
border-color: var(--fs-text-area-error-border-color) !important;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&:not(.v-field--error):focus-within {
|
|
15
|
+
border-color: var(--fs-text-area-active-border-color) !important;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
& > .v-field__outline {
|
|
19
|
+
display: none;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
& > .v-field__field > .v-field__input {
|
|
23
|
+
@extend .text-body;
|
|
24
|
+
|
|
25
|
+
@extend .fs-hide-y-scrollbar;
|
|
26
|
+
|
|
27
|
+
mask-image: none !important;
|
|
28
|
+
-webkit-mask-image: none !important;
|
|
29
|
+
|
|
30
|
+
padding-inline: 0 !important;
|
|
31
|
+
margin: 2px 2px 2px 0 !important;
|
|
32
|
+
cursor: var(--fs-text-area-cursor) !important;
|
|
33
|
+
min-height: var(--fs-text-area-min-height);
|
|
34
|
+
height: var(--fs-text-area-height);
|
|
35
|
+
color: var(--fs-text-area-color);
|
|
36
|
+
|
|
37
|
+
@include web {
|
|
38
|
+
padding: 12px 0 12px 16px !important;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@include mobile {
|
|
42
|
+
padding: 7px 0 7px 16px !important;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.fs-text-area-auto-grow {
|
|
49
|
+
padding: 0px !important;
|
|
50
|
+
width: 100%;
|
|
51
|
+
|
|
52
|
+
& > .v-input__control > .v-field {
|
|
53
|
+
border: 1px solid var(--fs-text-area-border-color) !important;
|
|
54
|
+
border-radius: 4px !important;
|
|
55
|
+
padding: 0 !important;
|
|
56
|
+
|
|
57
|
+
&--error {
|
|
58
|
+
border-color: var(--fs-text-area-error-border-color) !important;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
&:not(.v-field--error):focus-within {
|
|
62
|
+
border-color: var(--fs-text-area-active-border-color) !important;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
& > .v-field__outline {
|
|
66
|
+
display: none;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
& > .v-field__field > .v-field__input {
|
|
70
|
+
@extend .text-body;
|
|
71
|
+
|
|
72
|
+
@extend .fs-hide-y-scrollbar;
|
|
73
|
+
|
|
74
|
+
mask-image: none !important;
|
|
75
|
+
-webkit-mask-image: none !important;
|
|
76
|
+
|
|
77
|
+
padding-inline: 0 !important;
|
|
78
|
+
margin: 2px 2px 2px 0 !important;
|
|
79
|
+
cursor: var(--fs-text-area-cursor) !important;
|
|
80
|
+
height: var(--fs-text-area-height);
|
|
81
|
+
color: var(--fs-text-area-color);
|
|
82
|
+
|
|
83
|
+
@include web {
|
|
84
|
+
padding: 12px 0 12px 16px !important;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
@include mobile {
|
|
88
|
+
padding: 7px 0 7px 16px !important;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.fs-text-area-label {
|
|
95
|
+
color: var(--fs-text-area-color);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.fs-text-area-messages {
|
|
99
|
+
align-self: stretch;
|
|
100
|
+
color: var(--fs-text-area-error-color);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.fs-text-area-description {
|
|
104
|
+
color: var(--fs-text-area-color);
|
|
105
|
+
}
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
@import "fs_breadcrumbs.scss";
|
|
2
2
|
@import "fs_button.scss";
|
|
3
|
+
@import "fs_calendar.scss";
|
|
4
|
+
@import "fs_card.scss";
|
|
3
5
|
@import "fs_checkbox.scss";
|
|
4
6
|
@import "fs_col.scss";
|
|
5
7
|
@import "fs_color.scss";
|
|
8
|
+
@import "fs_date_picker.scss";
|
|
6
9
|
@import "fs_fade_out.scss";
|
|
7
10
|
@import "fs_icon.scss";
|
|
8
11
|
@import "fs_password_field.scss";
|
|
9
12
|
@import "fs_radio.scss";
|
|
13
|
+
@import "fs_rich_text_field.scss";
|
|
10
14
|
@import "fs_row.scss";
|
|
15
|
+
@import "fs_slider.scss";
|
|
11
16
|
@import "fs_span.scss";
|
|
12
17
|
@import "fs_switch.scss";
|
|
13
18
|
@import "fs_tag.scss";
|
|
14
19
|
@import "fs_tabs.scss";
|
|
15
20
|
@import "fs_tag_field.scss";
|
|
21
|
+
@import "fs_text_area.scss";
|
|
16
22
|
@import "fs_text_field.scss";
|
|
17
23
|
@import "fs_text.scss";
|
|
18
24
|
@import "fs_wrap_group.scss";
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ElementNode, LexicalNode, RangeSelection, TextNode } from "lexical";
|
|
2
|
+
import { $isAtNodeEnd } from "@lexical/selection";
|
|
3
|
+
|
|
4
|
+
export const getSelectedNode = (selection: RangeSelection): ElementNode | TextNode => {
|
|
5
|
+
const anchor = selection.anchor;
|
|
6
|
+
const focus = selection.focus;
|
|
7
|
+
const anchorNode = selection.anchor.getNode();
|
|
8
|
+
const focusNode = selection.focus.getNode();
|
|
9
|
+
if (anchorNode === focusNode) {
|
|
10
|
+
return anchorNode;
|
|
11
|
+
}
|
|
12
|
+
const isBackward = selection.isBackward();
|
|
13
|
+
if (isBackward) {
|
|
14
|
+
return $isAtNodeEnd(focus) ? anchorNode : focusNode;
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
return $isAtNodeEnd(anchor) ? focusNode : anchorNode;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const getAncestor = <NodeType extends LexicalNode = LexicalNode>(node: LexicalNode, predicate: (ancestor: LexicalNode) => ancestor is NodeType) => {
|
|
22
|
+
let parent = node;
|
|
23
|
+
while (parent !== null && parent.getParent() !== null && !predicate(parent)) {
|
|
24
|
+
parent = parent.getParentOrThrow();
|
|
25
|
+
}
|
|
26
|
+
return predicate(parent) ? parent : null;
|
|
27
|
+
}
|
package/utils/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./FSRichTextField";
|