@globalbrain/sefirot 2.1.1 → 2.1.3

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.
@@ -17,15 +17,14 @@
17
17
  <script setup lang="ts">
18
18
  import { computed, PropType } from 'vue'
19
19
 
20
- interface ButtonGroupItem {
20
+ export interface ButtonGroupItem {
21
21
  label: string
22
22
  value: string
23
- mode: Mode
23
+ mode?: Mode
24
24
  }
25
25
 
26
- type Mode = 'neutral' | 'info' | 'success' | 'warning' | 'danger'
27
- type Size = 'mini' | 'small' | 'medium' | 'large' | 'jumbo'
28
-
26
+ export type Mode = 'neutral' | 'info' | 'success' | 'warning' | 'danger'
27
+ export type Size = 'mini' | 'small' | 'medium' | 'large' | 'jumbo'
29
28
 
30
29
  const props = defineProps({
31
30
  items: { type: Array as PropType<ButtonGroupItem[]>, required: true },
@@ -11,7 +11,7 @@ import SIcon from './SIcon.vue'
11
11
  const props = defineProps<{
12
12
  search?: boolean
13
13
  selected: MaybeRef<DropdownSectionFilterSelectedValue>
14
- options: DropdownSectionFilterOption[]
14
+ options: MaybeRef<DropdownSectionFilterOption[]>
15
15
  onClick?(value: string | number | boolean): void
16
16
  }>()
17
17
 
@@ -19,12 +19,12 @@ const input = ref<HTMLElement | null>(null)
19
19
  const query = ref('')
20
20
 
21
21
  const fuse = computed(() => {
22
- return new Fuse(props.options, { keys: ['label'] })
22
+ return new Fuse(unref(props.options), { keys: ['label'] })
23
23
  })
24
24
 
25
25
  const filteredOptions = computed(() => {
26
26
  return !props.search || !query.value
27
- ? props.options
27
+ ? unref(props.options)
28
28
  : fuse.value.search(query.value).map((r) => r.item)
29
29
  })
30
30
 
@@ -122,30 +122,39 @@ function getValue(e: Event | FocusEvent | KeyboardEvent): string | null {
122
122
 
123
123
  <style lang="postcss" scoped>
124
124
  .SInputText.mini {
125
- .input,
126
- .input-area {
125
+ .box {
126
+ padding: 0 8px;
127
127
  min-height: 32px;
128
- padding: 3px 12px;
129
- font-size: 14px;
128
+ }
130
129
 
131
- &.has-icon {
132
- padding-left: 30px;
133
- }
130
+ .value,
131
+ .input,
132
+ .display {
133
+ min-height: 30px;
134
+ }
135
+
136
+ .input,
137
+ .display {
138
+ padding: 3px 0;
139
+ letter-spacing: 0;
140
+ line-height: 24px;
141
+ font-size: 14px;
134
142
  }
135
143
 
136
144
  .icon {
137
- top: 9px;
138
- left: 10px;
145
+ width: 22px;
146
+ height: 30px;
139
147
  }
140
148
 
141
149
  .icon-svg {
142
- width: 14px;
143
- height: 14px;
150
+ width: 16px;
151
+ height: 16px;
144
152
  }
145
153
  }
146
154
 
147
155
  .SInputText.small {
148
156
  .box {
157
+ padding: 0 12px;
149
158
  min-height: 40px;
150
159
  }
151
160
 
@@ -155,10 +164,6 @@ function getValue(e: Event | FocusEvent | KeyboardEvent): string | null {
155
164
  min-height: 38px;
156
165
  }
157
166
 
158
- .box {
159
- padding: 0 12px;
160
- }
161
-
162
167
  .input,
163
168
  .display {
164
169
  padding: 5px 0;
@@ -179,25 +184,33 @@ function getValue(e: Event | FocusEvent | KeyboardEvent): string | null {
179
184
  }
180
185
 
181
186
  .SInputText.medium {
182
- .input,
183
- .input-area {
187
+ .box {
188
+ padding: 0 12px;
184
189
  min-height: 48px;
185
- padding: 11px 16px;
186
- font-size: 16px;
190
+ }
187
191
 
188
- &.has-icon {
189
- padding-left: 36px;
190
- }
192
+ .value,
193
+ .input,
194
+ .display {
195
+ min-height: 46px;
196
+ }
197
+
198
+ .input,
199
+ .display {
200
+ padding: 11px 0;
201
+ letter-spacing: 0;
202
+ line-height: 24px;
203
+ font-size: 16px;
191
204
  }
192
205
 
193
206
  .icon {
194
- top: 16px;
195
- left: 12px;
207
+ width: 28px;
208
+ height: 46px;
196
209
  }
197
210
 
198
211
  .icon-svg {
199
- width: 16px;
200
- height: 16px;
212
+ width: 18px;
213
+ height: 18px;
201
214
  }
202
215
  }
203
216
 
@@ -16,12 +16,12 @@ const emit = defineEmits<{
16
16
 
17
17
  const el = ref<any>(null)
18
18
 
19
- function onClick(e: any) {
19
+ function onClick(e: MouseEvent) {
20
20
  if (!props.closable) {
21
21
  return
22
22
  }
23
23
 
24
- if (e.target === el.value) {
24
+ if (e.button === 0 && e.target === el.value) {
25
25
  emit('close')
26
26
  }
27
27
  }
@@ -30,7 +30,7 @@ function onClick(e: any) {
30
30
  <template>
31
31
  <Teleport to="#sefirot-modals">
32
32
  <transition name="fade">
33
- <div v-if="open" class="SModal" ref="el" @click="onClick">
33
+ <div v-if="open" class="SModal" ref="el" @mousedown="onClick">
34
34
  <slot />
35
35
  </div>
36
36
  </transition>
@@ -13,7 +13,7 @@ withDefaults(defineProps<Props>(), {
13
13
  closable: true
14
14
  })
15
15
 
16
- const emit = defineEmits<{
16
+ defineEmits<{
17
17
  (e: 'close'): void
18
18
  }>()
19
19
  </script>
@@ -192,7 +192,7 @@ function updateColWidth(key: string, value: string) {
192
192
  &.head {
193
193
  position: var(--table-head-position, static);
194
194
  top: var(--table-head-top, auto);
195
- z-index: 20;
195
+ z-index: 100;
196
196
  background-color: var(--bg-elv);
197
197
 
198
198
  &::-webkit-scrollbar {
@@ -80,6 +80,10 @@ const names = computed(() => {
80
80
  border: 2px solid var(--c-bg-elv-up);
81
81
  border-radius: 50%;
82
82
  width: 28px;
83
+
84
+ .row:hover & {
85
+ border: 2px solid var(--c-bg-elv);
86
+ }
83
87
  }
84
88
 
85
89
  .names {
@@ -32,7 +32,7 @@ const _color = computed(() => {
32
32
 
33
33
  <template>
34
34
  <div class="STableCellPill" :class="[_color ?? 'mute']">
35
- <div class="value">{{ _value }}</div>
35
+ <div v-if="_value" class="value">{{ _value }}</div>
36
36
  </div>
37
37
  </template>
38
38
 
@@ -44,7 +44,7 @@ const active = computed(() => {
44
44
  return false
45
45
  }
46
46
 
47
- return item.options.some((option) => {
47
+ return unref(item.options).some((option) => {
48
48
  return selected.includes(option.value)
49
49
  })
50
50
  })
@@ -93,7 +93,11 @@ async function adjustDialogPosition() {
93
93
  const position = (window.innerWidth - rect.right) > dialogWidth ? 'right' : 'left'
94
94
 
95
95
  top.value = `${rect.top + rect.height - 8}px`
96
- left.value = position === 'right' ? `${rect.left - 4}px` : `${rect.right - dialogWidth - 4}px`
96
+ left.value =
97
+ Math.max(
98
+ 16,
99
+ position === 'right' ? rect.left - 4 : rect.right - dialogWidth - 4
100
+ ) + 'px'
97
101
  }
98
102
 
99
103
  function startDialogPositionListener() {
@@ -43,10 +43,10 @@ const hasNext = computed(() => {
43
43
  <p class="info">{{ format(from) }}–{{ format(to) }} of {{ format(_total) }}</p>
44
44
 
45
45
  <div class="actions">
46
- <button class="button prev" :class="{ active: hasPrev }" @click="onPrev">
46
+ <button class="button prev" :class="{ active: hasPrev }" @click="() => hasPrev && onPrev?.()">
47
47
  <SIcon :icon="IconCaretLeft" class="icon" />
48
48
  </button>
49
- <button class="button next" :class="{ active: hasNext }" @click="onNext">
49
+ <button class="button next" :class="{ active: hasNext }" @click="() => hasNext && onNext?.()">
50
50
  <SIcon :icon="IconCaretRight" class="icon" />
51
51
  </button>
52
52
  </div>
@@ -24,7 +24,7 @@ export interface DropdownSectionFilter extends DropdownSectionBase {
24
24
  type: 'filter'
25
25
  search?: boolean
26
26
  selected: MaybeRef<DropdownSectionFilterSelectedValue>
27
- options: DropdownSectionFilterOption[]
27
+ options: MaybeRef<DropdownSectionFilterOption[]>
28
28
  onClick?(value: string | number | boolean): void
29
29
  }
30
30
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@globalbrain/sefirot",
3
- "version": "2.1.1",
3
+ "version": "2.1.3",
4
4
  "description": "Vue Components for Global Brain Design System.",
5
5
  "files": [
6
6
  "lib"
@@ -23,24 +23,24 @@
23
23
  "@iconify-icons/ph": "^1.2.2",
24
24
  "@iconify/vue": "^4.0.0",
25
25
  "@types/body-scroll-lock": "^3.1.0",
26
- "@types/markdown-it": "^12.2.3",
27
26
  "@types/lodash-es": "^4.17.6",
28
- "@vuelidate/core": "^2.0.0-alpha.38",
29
- "@vuelidate/validators": "^2.0.0-alpha.28",
30
- "@vueuse/core": "^9.1.0",
27
+ "@types/markdown-it": "^12.2.3",
28
+ "@vuelidate/core": "^2.0.0",
29
+ "@vuelidate/validators": "^2.0.0",
30
+ "@vueuse/core": "^9.3.0",
31
31
  "body-scroll-lock": "^4.0.0-beta.0",
32
- "dayjs": "^1.11.0",
33
- "fuse.js": "^6.5.3",
32
+ "dayjs": "^1.11.5",
33
+ "fuse.js": "^6.6.2",
34
34
  "lodash-es": "^4.17.21",
35
35
  "markdown-it": "^13.0.1",
36
36
  "normalize.css": "^8.0.1",
37
37
  "pinia": "^2.0.22",
38
- "postcss": "^8.4.12",
38
+ "postcss": "^8.4.17",
39
39
  "postcss-nested": "^5.0.6",
40
- "typescript": "^4.7.4",
40
+ "typescript": "^4.8.4",
41
41
  "v-calendar": "^3.0.0-alpha.8",
42
- "vue": "^3.2.31",
43
- "vue-router": "^4.0.14"
42
+ "vue": "^3.2.40",
43
+ "vue-router": "^4.1.5"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@histoire/plugin-vue": "^0.10.7",
@@ -49,15 +49,15 @@
49
49
  "@types/body-scroll-lock": "^3.1.0",
50
50
  "@types/lodash-es": "^4.17.6",
51
51
  "@types/markdown-it": "^12.2.3",
52
- "@types/node": "^18.7.18",
52
+ "@types/node": "^18.8.0",
53
53
  "@typescript-eslint/eslint-plugin": "^5.38.0",
54
54
  "@typescript-eslint/parser": "^5.38.0",
55
- "@vitejs/plugin-vue": "^3.1.0",
55
+ "@vitejs/plugin-vue": "^3.1.2",
56
56
  "@vitest/coverage-c8": "^0.23.4",
57
- "@vue/test-utils": "^2.0.2",
58
- "@vuelidate/core": "^2.0.0-alpha.44",
59
- "@vuelidate/validators": "^2.0.0-alpha.31",
60
- "@vueuse/core": "^9.2.0",
57
+ "@vue/test-utils": "^2.1.0",
58
+ "@vuelidate/core": "^2.0.0",
59
+ "@vuelidate/validators": "^2.0.0",
60
+ "@vueuse/core": "^9.3.0",
61
61
  "body-scroll-lock": "^4.0.0-beta.0",
62
62
  "chalk": "^4.1.2",
63
63
  "conventional-changelog-cli": "^2.2.2",
@@ -74,15 +74,15 @@
74
74
  "markdown-it": "^13.0.1",
75
75
  "normalize.css": "^8.0.1",
76
76
  "pinia": "^2.0.22",
77
- "postcss": "^8.4.16",
77
+ "postcss": "^8.4.17",
78
78
  "postcss-nested": "^5.0.6",
79
79
  "semver": "^7.3.7",
80
- "typescript": "^4.8.3",
80
+ "typescript": "^4.8.4",
81
81
  "v-calendar": "3.0.0-alpha.8",
82
- "vite": "^3.1.3",
83
- "vitepress": "1.0.0-alpha.15",
82
+ "vite": "^3.1.4",
83
+ "vitepress": "1.0.0-alpha.19",
84
84
  "vitest": "^0.23.4",
85
- "vue": "^3.2.39",
85
+ "vue": "^3.2.40",
86
86
  "vue-router": "^4.1.5",
87
87
  "vue-tsc": "^0.40.13"
88
88
  },
@@ -1,3 +0,0 @@
1
- export type SyntheticEvent<E extends Event, T extends Element> = E & { target: T }
2
- export type SyntheticInputEvent<T extends Element = HTMLInputElement> = SyntheticEvent<InputEvent, T>
3
- export type SyntheticMouseEvent<T extends Element = HTMLElement> = SyntheticEvent<MouseEvent, T>