frappe-ui 0.1.145 → 0.1.146

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "frappe-ui",
3
- "version": "0.1.145",
3
+ "version": "0.1.146",
4
4
  "description": "A set of components and utilities for rapid UI development",
5
5
  "main": "./src/index.ts",
6
6
  "type": "module",
@@ -36,7 +36,7 @@
36
36
  <component v-else-if="icon" :is="icon" :class="slotClasses" />
37
37
  <slot name="icon" v-else-if="$slots.icon" />
38
38
  </template>
39
- <span v-else :class="{ 'sr-only': isIconButton }">
39
+ <span v-else :class="{ 'sr-only': isIconButton }" class="truncate">
40
40
  <slot>{{ label }}</slot>
41
41
  </span>
42
42
 
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div v-if="type != 'checkbox'" :class="['space-y-1.5', attrs.class]">
2
+ <div v-if="type != 'checkbox'" :class="['space-y-1.5', attrs.class]" :style="attrs.style">
3
3
  <FormLabel
4
4
  v-if="label"
5
5
  :label="label"
@@ -11,6 +11,7 @@
11
11
  v-if="type === 'select'"
12
12
  :id="id"
13
13
  v-bind="{ ...controlAttrs, size }"
14
+ v-model="model"
14
15
  >
15
16
  <template #prefix v-if="$slots.prefix">
16
17
  <slot name="prefix" />
@@ -19,6 +20,7 @@
19
20
  <Autocomplete
20
21
  v-else-if="type === 'autocomplete'"
21
22
  v-bind="{ ...controlAttrs }"
23
+ v-model="model"
22
24
  >
23
25
  <template #prefix v-if="$slots.prefix">
24
26
  <slot name="prefix" />
@@ -31,11 +33,13 @@
31
33
  v-else-if="type === 'textarea'"
32
34
  :id="id"
33
35
  v-bind="{ ...controlAttrs, size }"
36
+ v-model="model"
34
37
  />
35
38
  <TextInput
36
39
  v-else
37
40
  :id="id"
38
41
  v-bind="{ ...controlAttrs, type, size, required }"
42
+ v-model="model"
39
43
  >
40
44
  <template #prefix v-if="$slots.prefix">
41
45
  <slot name="prefix" />
@@ -52,6 +56,7 @@
52
56
  v-else
53
57
  :id="id"
54
58
  v-bind="{ ...controlAttrs, label, size, class: attrs.class }"
59
+ v-model="model"
55
60
  />
56
61
  </template>
57
62
  <script setup lang="ts">
@@ -79,6 +84,8 @@ const props = withDefaults(defineProps<FormControlProps>(), {
79
84
  size: 'sm',
80
85
  })
81
86
 
87
+ const model = defineModel()
88
+
82
89
  const attrs = useAttrs()
83
90
  const controlAttrs = computed(() => {
84
91
  // pass everything except class and style
@@ -91,16 +98,6 @@ const controlAttrs = computed(() => {
91
98
  return _attrs
92
99
  })
93
100
 
94
- const labelClasses = computed(() => {
95
- return [
96
- {
97
- sm: 'text-xs',
98
- md: 'text-base',
99
- }[props.size],
100
- 'text-ink-gray-5',
101
- ]
102
- })
103
-
104
101
  const descriptionClasses = computed(() => {
105
102
  return [
106
103
  {
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <label :class="[type == 'checkbox' ? 'flex' : 'block', $attrs.class]">
2
+ <label :class="[type == 'checkbox' ? 'flex' : 'block', $attrs.class]" :style="$attrs.style">
3
3
  <span
4
4
  v-if="label && type != 'checkbox'"
5
5
  class="mb-2 block text-sm leading-4 text-gray-700"
@@ -3,6 +3,7 @@
3
3
  <div
4
4
  class="flex w-max min-w-full flex-col overflow-y-hidden"
5
5
  :class="$attrs.class"
6
+ :style="$attrs.style"
6
7
  >
7
8
  <slot v-bind="{ showGroupedRows, selectable }">
8
9
  <ListHeader />
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="relative w-full" :class="$attrs.class" v-if="editor">
2
+ <div class="relative w-full" :class="$attrs.class" :style="$attrs.style" v-if="editor">
3
3
  <TextEditorBubbleMenu :buttons="bubbleMenu" :options="bubbleMenuOptions" />
4
4
  <TextEditorFixedMenu
5
5
  class="w-full overflow-x-auto rounded-t-lg border border-outline-gray-modals"