@imaginario27/air-ui-ds 1.0.14 → 1.0.15

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.
@@ -123,7 +123,7 @@ const props = defineProps({
123
123
  default: false,
124
124
  },
125
125
  autocomplete: {
126
- type: String as PropType<'on' | 'off'>,
126
+ type: String as PropType<string>,
127
127
  default: 'off',
128
128
  },
129
129
  autofocus: {
@@ -49,15 +49,15 @@ defineProps({
49
49
  label: String as PropType<string>,
50
50
  helpText: String as PropType<string>,
51
51
  buttons: Array as PropType<ToggleButton[]>,
52
- disabled: {
53
- type: Boolean as PropType<boolean>,
54
- default: false,
55
- },
56
52
  modelValue: {
57
53
  type: String as PropType<string>,
58
54
  required: true,
59
55
  },
60
56
  groupStyle: String as PropType<ToggleButtonGroupStyle>,
57
+ disabled: {
58
+ type: Boolean as PropType<boolean>,
59
+ default: false,
60
+ },
61
61
  })
62
62
 
63
63
  // Emits
@@ -119,19 +119,19 @@ const props = defineProps({
119
119
  type: String as PropType<string>,
120
120
  required: true,
121
121
  },
122
+ label: String as PropType<string>,
123
+ helpText: String as PropType<string>,
122
124
  value: { // Value of the radio button
123
125
  type: [String, Number, Boolean] as PropType<string | number | boolean>,
124
126
  required: true,
125
127
  },
126
- label: String as PropType<string>,
127
- helpText: String as PropType<string>,
128
128
  icon: {
129
129
  type: String as PropType<any>,
130
130
  default: 'mdiHelp',
131
131
  },
132
132
  type: {
133
133
  type: String as PropType<
134
- ColorAccent.INFO | ColorAccent.SUCCESS | ColorAccent.DANGER | ColorAccent.PRIMARY_BRAND | ColorAccent.SECONDARY_BRAND
134
+ ColorAccent.INFO | ColorAccent.WARNING| ColorAccent.SUCCESS | ColorAccent.DANGER | ColorAccent.PRIMARY_BRAND | ColorAccent.SECONDARY_BRAND
135
135
  >,
136
136
  default: ColorAccent.PRIMARY_BRAND,
137
137
  validator: (value: ColorAccent) => [
@@ -72,7 +72,6 @@
72
72
  </template>
73
73
 
74
74
  <script setup lang="ts">
75
-
76
75
  // Props
77
76
  const props = defineProps({
78
77
  label: String,
@@ -144,7 +143,6 @@ const runValidation = () => {
144
143
  emit('update:error', result ?? '')
145
144
  }
146
145
 
147
-
148
146
  // Watchers
149
147
  // Watch for changes in local selectedOption and emit upward
150
148
  watch(
@@ -1,5 +1,4 @@
1
1
  export const useTableOfContents = () => {
2
- // Tracks the currently active heading
3
2
  const activeId = ref<string | null>(null)
4
3
  const route = useRoute()
5
4
 
@@ -26,21 +25,37 @@ export const useTableOfContents = () => {
26
25
  const headings = document.querySelectorAll('h2, h3')
27
26
  headings.forEach((heading) => observer!.observe(heading))
28
27
 
29
- // First heading is active by default when the page loads
30
28
  if (headings.length > 0) {
31
29
  const firstHeading = headings[0] as HTMLElement
32
30
  activeId.value = firstHeading.id ?? null
33
31
  }
34
32
  }
35
33
 
34
+ const scrollToHash = () => {
35
+ if (route.hash) {
36
+ const target = document.getElementById(route.hash.slice(1))
37
+ if (target) {
38
+ target.scrollIntoView({ behavior: 'smooth' })
39
+ }
40
+ }
41
+ }
42
+
43
+ const setupObserver = () => {
44
+ nextTick(() => {
45
+ initObserver()
46
+ scrollToHash()
47
+ })
48
+ }
49
+
50
+ onMounted(() => {
51
+ setupObserver()
52
+ })
53
+
36
54
  watch(
37
55
  () => route.path,
38
56
  () => {
39
- nextTick(() => {
40
- initObserver()
41
- })
42
- },
43
- { immediate: true }
57
+ setupObserver()
58
+ }
44
59
  )
45
60
 
46
61
  onBeforeUnmount(() => {
@@ -48,4 +63,4 @@ export const useTableOfContents = () => {
48
63
  })
49
64
 
50
65
  return { activeId }
51
- }
66
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imaginario27/air-ui-ds",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
4
4
  "author": "imaginario27",
5
5
  "type": "module",
6
6
  "homepage": "https://air-ui.netlify.app/",