@dative-gpi/foundation-shared-components 1.0.131 → 1.0.133-dashboard-options

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 (37) hide show
  1. package/components/FSBreadcrumbs.vue +20 -12
  2. package/components/FSDialogMenu.vue +17 -8
  3. package/components/FSDialogRemove.vue +1 -1
  4. package/components/FSFadeOut.vue +1 -1
  5. package/components/FSSpan.vue +8 -5
  6. package/components/FSText.vue +7 -5
  7. package/components/fields/FSAutocompleteField.vue +36 -52
  8. package/components/fields/FSSelectField.vue +36 -52
  9. package/components/fields/FSTranslateRichTextField.vue +17 -2
  10. package/components/lists/FSDataTableUI.vue +22 -14
  11. package/components/map/FSMap.vue +18 -8
  12. package/components/map/FSMapOverlay.vue +34 -19
  13. package/components/tiles/FSLocationTileUI.vue +1 -1
  14. package/components/views/desktop/FSBaseDefaultDesktopView.vue +8 -7
  15. package/components/views/desktop/FSBaseEntityDesktopView.vue +1 -0
  16. package/components/views/mobile/FSBaseDefaultMobileView.vue +8 -7
  17. package/components/views/mobile/FSBaseEntityMobileView.vue +1 -0
  18. package/composables/useSlots.ts +2 -1
  19. package/models/rules.ts +5 -2
  20. package/package.json +4 -4
  21. package/styles/components/fs_breadcrumbs.scss +19 -31
  22. package/styles/components/fs_button.scss +7 -5
  23. package/styles/components/fs_chip.scss +8 -6
  24. package/styles/components/fs_clickable.scss +14 -12
  25. package/styles/components/fs_data_iterator_item.scss +12 -10
  26. package/styles/components/fs_dialog.scss +1 -1
  27. package/styles/components/fs_dialog_menu.scss +4 -2
  28. package/styles/components/fs_image_card.scss +5 -3
  29. package/styles/components/fs_map.scss +11 -7
  30. package/styles/components/fs_password_field.scss +4 -2
  31. package/styles/components/fs_span.scss +12 -4
  32. package/styles/components/fs_tabs.scss +9 -5
  33. package/styles/components/fs_tag.scss +9 -7
  34. package/styles/globals/overrides.scss +11 -4
  35. package/styles/globals/scrollbars.scss +10 -0
  36. package/utils/index.ts +1 -0
  37. package/utils/operations.ts +69 -0
@@ -13,17 +13,19 @@
13
13
  background-color: var(--fs-tag-background-color) !important;
14
14
  color: var(--fs-tag-color) !important;
15
15
 
16
- &:hover {
17
- background-color: var(--fs-tag-hover-background-color) !important;
18
- color: var(--fs-tag-hover-color) !important;
19
- }
16
+ min-width: 20px !important;
17
+ width: 20px !important;
18
+ height: 20px !important;
20
19
 
21
20
  &:active {
22
21
  background-color: var(--fs-tag-active-background-color) !important;
23
22
  color: var(--fs-tag-active-color) !important;
24
23
  }
25
24
 
26
- min-width: 20px !important;
27
- width: 20px !important;
28
- height: 20px !important;
25
+ @include clickscreen {
26
+ &:hover {
27
+ background-color: var(--fs-tag-hover-background-color) !important;
28
+ color: var(--fs-tag-hover-color) !important;
29
+ }
30
+ }
29
31
  }
@@ -137,11 +137,16 @@
137
137
  }
138
138
  }
139
139
 
140
- // Ellipsis on input of all fields
141
140
  input {
141
+ // Ellipsis on all fields
142
142
  text-overflow: ellipsis;
143
143
  }
144
144
 
145
+ input, select, textarea {
146
+ // No zoom on focus for user of a certain version of Chrome, and who ask their mobile to zoom if font-size < 16px
147
+ touch-action: none;
148
+ }
149
+
145
150
  // No up / down buttons in input field of type number
146
151
  input[type=number] {
147
152
  -moz-appearance: textfield;
@@ -187,9 +192,11 @@ $nthOverlay: 25;
187
192
  }
188
193
 
189
194
  // Change color on arrows when hovered
190
- .v-slide-group__prev:hover,
191
- .v-slide-group__next:hover {
192
- color: var(--fs-group-hover-color);
195
+ @include clickscreen {
196
+ .v-slide-group__prev:hover,
197
+ .v-slide-group__next:hover {
198
+ color: var(--fs-group-hover-color);
199
+ }
193
200
  }
194
201
 
195
202
  /***************************************************************************/
@@ -47,9 +47,19 @@
47
47
  @include touchscreen {
48
48
  .fs-hide-x-scrollbar {
49
49
  overflow-x: scroll;
50
+
51
+ &::-webkit-scrollbar {
52
+ display: none;
53
+ }
54
+ scrollbar-width: none;
50
55
  }
51
56
 
52
57
  .fs-hide-y-scrollbar {
53
58
  overflow-y: scroll;
59
+
60
+ &::-webkit-scrollbar {
61
+ display: none;
62
+ }
63
+ scrollbar-width: none;
54
64
  }
55
65
  }
package/utils/index.ts CHANGED
@@ -8,6 +8,7 @@ export * from "./icons";
8
8
  export * from "./leafletMarkers"
9
9
  export * from "./levenshtein";
10
10
  export * from "./lexical";
11
+ export * from "./operations";
11
12
  export * from "./sort";
12
13
  export * from "./statuses";
13
14
  export * from "./time";
@@ -0,0 +1,69 @@
1
+ const MinusOperator = "-";
2
+
3
+ // Matches one of the three operators (+, *, /) or the - operator if it is preceded by something that is not another operator
4
+ const operatorsRegex = new RegExp(/[\+\*\/]|(?<=.)(?<![-\+\*\/])[-]/gm);
5
+
6
+ // Matches a nested block of parenthesis
7
+ const parenthesisRegex = new RegExp(/\([^)(]+\)/gm);
8
+
9
+ // Match a positive decimal number
10
+ const decimalRegex = new RegExp(/^\d+(.\d+)?$/gm);
11
+
12
+ const validateBlock = (block: string, operands: string[] = [], variables: string[] = []) => {
13
+ // Remove parenthesis from the block
14
+ block = block.replaceAll("(", "").replaceAll(")", "");
15
+
16
+ // Split block on operators (Leave negative signs)
17
+ const components = block.split(operatorsRegex);
18
+
19
+ // Check if each bit is a valid operand
20
+ for (let i = 0; i < components.length; i++) {
21
+ // Remove negative sign
22
+ if (components[i].startsWith(MinusOperator)) {
23
+ components[i] = components[i].substring(1);
24
+ }
25
+ if (!operands.includes(components[i]) && !variables.includes(components[i]) && !components[i].match(decimalRegex)) {
26
+ return false;
27
+ }
28
+ }
29
+ return true;
30
+ }
31
+
32
+ export const validateOperation = (rawOperation: string, operands: string[] = [], variables: string[] = []) => {
33
+ // Remove spaces
34
+ let operation = rawOperation.replaceAll(" ", "");
35
+
36
+ // Check parenthesis
37
+ const parenthesis: number[] = [];
38
+
39
+ for (let i = 0; i < operation.length; i++) {
40
+ if (operation[i] == '(') {
41
+ parenthesis.push(i);
42
+ }
43
+ else if (operation[i] == ')') {
44
+ if (parenthesis.length > 0) {
45
+ if (i == parenthesis.pop()! + 1) {
46
+ return false;
47
+ }
48
+ }
49
+ else {
50
+ return false;
51
+ }
52
+ }
53
+ }
54
+ if (parenthesis.length > 0) {
55
+ return false;
56
+ }
57
+
58
+ // Check each block between parenthesis
59
+ let match = operation.match(parenthesisRegex);
60
+
61
+ while (match?.[0]) {
62
+ if (!validateBlock(match[0], operands, variables)) {
63
+ return false;
64
+ }
65
+ operation = operation.replace(match[0], "1");
66
+ match = operation.match(parenthesisRegex);
67
+ }
68
+ return validateBlock(operation, operands, variables);
69
+ }