@finema/core 3.16.11 → 3.17.0

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/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finema/core",
3
- "version": "3.16.11",
3
+ "version": "3.17.0",
4
4
  "configKey": "core",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
package/dist/module.mjs CHANGED
@@ -4,7 +4,7 @@ import * as lodash from 'lodash-es';
4
4
  import * as theme from '../dist/runtime/theme/index.js';
5
5
 
6
6
  const name = "@finema/core";
7
- const version = "3.16.11";
7
+ const version = "3.17.0";
8
8
 
9
9
  const nuxtAppOptions = {
10
10
  head: {
@@ -2,6 +2,8 @@ import type { ISelectFieldProps } from '#core/components/Form/InputSelect/types'
2
2
  declare const __VLS_export: import("vue").DefineComponent<ISelectFieldProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, any, string, import("vue").PublicProps, any, {
3
3
  clearIcon: string;
4
4
  componentPosition: "leading" | "trailing";
5
+ menuLabelLines: number;
6
+ selectedLabelLines: number;
5
7
  searchInput: {
6
8
  placeholder?: string;
7
9
  icon?: string;
@@ -36,7 +36,7 @@
36
36
  })
37
37
  "
38
38
  >
39
- <div class="flex items-center gap-x-2">
39
+ <div class="flex min-w-0 items-center gap-x-2">
40
40
  <component
41
41
  :is="selectedOption.component"
42
42
  v-if="
@@ -45,13 +45,21 @@
45
45
  v-bind="selectedOption.componentProps"
46
46
  />
47
47
  <span
48
- :class="
48
+ :class="[
49
+ 'min-w-0 flex-1',
49
50
  theme.selectedLabel({
50
51
  class: [ui?.selectedLabel]
51
52
  })
52
- "
53
+ ]"
54
+ :style="selectedLabelStyle"
53
55
  >
54
- {{ selectedOption?.label ?? modelValue }}
56
+ <span
57
+ :class="[
58
+ props.selectedLabelLines && props.selectedLabelLines > 1 ? 'block min-w-0 break-words whitespace-normal' : 'block min-w-0 truncate'
59
+ ]"
60
+ >
61
+ {{ selectedOption?.label ?? modelValue }}
62
+ </span>
55
63
  </span>
56
64
  <component
57
65
  :is="selectedOption.component"
@@ -81,7 +89,7 @@
81
89
  />
82
90
  <div
83
91
  v-else
84
- class="flex items-center gap-x-2"
92
+ class="flex min-w-0 items-center gap-x-2"
85
93
  >
86
94
  <Chip
87
95
  v-if="item?.chip"
@@ -105,7 +113,14 @@
105
113
  v-if="componentPosition === 'leading' && item?.component"
106
114
  v-bind="item?.componentProps"
107
115
  />
108
- <span class="truncate">{{ item?.label ?? item?.value }}</span>
116
+ <span
117
+ :class="[
118
+ props.menuLabelLines && props.menuLabelLines > 1 ? 'min-w-0 break-words whitespace-normal' : 'truncate'
119
+ ]"
120
+ :style="menuLabelStyle"
121
+ >
122
+ {{ item?.label ?? item?.value }}
123
+ </span>
109
124
  <component
110
125
  :is="item?.component"
111
126
  v-if="componentPosition === 'trailing' && item?.component"
@@ -132,6 +147,8 @@ const props = defineProps({
132
147
  variant: { type: null, required: false },
133
148
  selectedIcon: { type: String, required: false },
134
149
  componentPosition: { type: String, required: false, default: "trailing" },
150
+ menuLabelLines: { type: Number, required: false, default: 1 },
151
+ selectedLabelLines: { type: Number, required: false, default: 1 },
135
152
  searchInput: { type: [Object, Boolean], required: false, default: void 0 },
136
153
  clearable: { type: Boolean, required: false },
137
154
  loading: { type: Boolean, required: false },
@@ -160,6 +177,26 @@ const {
160
177
  const selectedOption = computed(
161
178
  () => props.options.find((item) => item.value === value.value)
162
179
  );
180
+ const menuLabelStyle = computed(() => {
181
+ const lines = props.menuLabelLines ?? 1;
182
+ if (lines <= 1) return void 0;
183
+ return {
184
+ display: "-webkit-box",
185
+ WebkitLineClamp: String(lines),
186
+ WebkitBoxOrient: "vertical",
187
+ overflow: "hidden"
188
+ };
189
+ });
190
+ const selectedLabelStyle = computed(() => {
191
+ const lines = props.selectedLabelLines ?? 1;
192
+ if (lines <= 1) return void 0;
193
+ return {
194
+ display: "-webkit-box",
195
+ WebkitLineClamp: String(lines),
196
+ WebkitBoxOrient: "vertical",
197
+ overflow: "hidden"
198
+ };
199
+ });
163
200
  const onChange = (value2) => {
164
201
  handleChange(value2);
165
202
  emits("change", value2);
@@ -2,6 +2,8 @@ import type { ISelectFieldProps } from '#core/components/Form/InputSelect/types'
2
2
  declare const __VLS_export: import("vue").DefineComponent<ISelectFieldProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, any, string, import("vue").PublicProps, any, {
3
3
  clearIcon: string;
4
4
  componentPosition: "leading" | "trailing";
5
+ menuLabelLines: number;
6
+ selectedLabelLines: number;
5
7
  searchInput: {
6
8
  placeholder?: string;
7
9
  icon?: string;
@@ -15,6 +15,8 @@ export interface ISelectFieldProps extends IFieldProps {
15
15
  variant?: 'outline' | 'soft' | 'subtle' | 'ghost' | 'none' | undefined;
16
16
  selectedIcon?: string;
17
17
  componentPosition?: 'leading' | 'trailing';
18
+ menuLabelLines?: number;
19
+ selectedLabelLines?: number;
18
20
  searchInput?: {
19
21
  placeholder?: string;
20
22
  icon?: string;
@@ -2,6 +2,7 @@ import type { ISelectFieldProps } from '#core/components/Form/InputSelect/types'
2
2
  declare const __VLS_export: import("vue").DefineComponent<ISelectFieldProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, any, string, import("vue").PublicProps, any, {
3
3
  clearIcon: string;
4
4
  componentPosition: "leading" | "trailing";
5
+ menuLabelLines: number;
5
6
  searchInput: {
6
7
  placeholder?: string;
7
8
  icon?: string;
@@ -102,7 +102,7 @@
102
102
  />
103
103
  <div
104
104
  v-else
105
- class="flex items-center gap-x-2"
105
+ class="flex min-w-0 items-center gap-x-2"
106
106
  >
107
107
  <Chip
108
108
  v-if="item?.chip"
@@ -126,7 +126,14 @@
126
126
  v-if="componentPosition === 'leading' && item?.component"
127
127
  v-bind="item?.componentProps"
128
128
  />
129
- <span class="truncate">{{ item?.label ?? item?.value }}</span>
129
+ <span
130
+ :class="[
131
+ props.menuLabelLines && props.menuLabelLines > 1 ? 'min-w-0 break-words whitespace-normal' : 'truncate'
132
+ ]"
133
+ :style="menuLabelStyle"
134
+ >
135
+ {{ item?.label ?? item?.value }}
136
+ </span>
130
137
  <component
131
138
  :is="item?.component"
132
139
  v-if="componentPosition === 'trailing' && item?.component"
@@ -154,6 +161,8 @@ const props = defineProps({
154
161
  variant: { type: null, required: false },
155
162
  selectedIcon: { type: String, required: false },
156
163
  componentPosition: { type: String, required: false, default: "trailing" },
164
+ menuLabelLines: { type: Number, required: false, default: 1 },
165
+ selectedLabelLines: { type: Number, required: false },
157
166
  searchInput: { type: [Object, Boolean], required: false, default: void 0 },
158
167
  clearable: { type: Boolean, required: false },
159
168
  loading: { type: Boolean, required: false },
@@ -184,6 +193,16 @@ const optionByValue = computed(
184
193
  );
185
194
  const getOption = (_value) => optionByValue.value.get(_value);
186
195
  const componentPosition = computed(() => props.componentPosition);
196
+ const menuLabelStyle = computed(() => {
197
+ const lines = props.menuLabelLines ?? 1;
198
+ if (lines <= 1) return void 0;
199
+ return {
200
+ display: "-webkit-box",
201
+ WebkitLineClamp: String(lines),
202
+ WebkitBoxOrient: "vertical",
203
+ overflow: "hidden"
204
+ };
205
+ });
187
206
  const onChange = (value2) => {
188
207
  handleChange(value2);
189
208
  emits("change", value2);
@@ -2,6 +2,7 @@ import type { ISelectFieldProps } from '#core/components/Form/InputSelect/types'
2
2
  declare const __VLS_export: import("vue").DefineComponent<ISelectFieldProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, any, string, import("vue").PublicProps, any, {
3
3
  clearIcon: string;
4
4
  componentPosition: "leading" | "trailing";
5
+ menuLabelLines: number;
5
6
  searchInput: {
6
7
  placeholder?: string;
7
8
  icon?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finema/core",
3
- "version": "3.16.11",
3
+ "version": "3.17.0",
4
4
  "repository": "https://gitlab.finema.co/finema/ui-kit",
5
5
  "license": "MIT",
6
6
  "author": "Finema Dev Core Team",