@star-ai/star-ui 0.1.3 → 0.1.5

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/lib/index.esm.js CHANGED
@@ -3,6 +3,46 @@
3
3
 
4
4
  // Button 组件
5
5
  const StarButton = {
6
+ template: `<view
7
+ class="star-button"
8
+ :class="[
9
+ `star-button--\${type}`,
10
+ `star-button--\${size}`,
11
+ {
12
+ 'star-button--disabled': disabled,
13
+ 'star-button--loading': loading,
14
+ 'star-button--block': block,
15
+ 'star-button--plain': plain
16
+ }
17
+ ]"
18
+ :style="[customStyle]"
19
+ @click="handleClick"
20
+ >
21
+ <!-- 加载状态 -->
22
+ <view v-if="loading" class="star-button__loading">
23
+ <view class="star-button__loading-spinner"></view>
24
+ </view>
25
+
26
+ <!-- 图标 -->
27
+ <text
28
+ v-if="icon && !loading"
29
+ class="star-button__icon"
30
+ :class="icon"
31
+ ></text>
32
+
33
+ <!-- 文字内容 -->
34
+ <text class="star-button__text">
35
+ <slot></slot>
36
+ </text>
37
+
38
+ <!-- 右侧图标 -->
39
+ <text
40
+ v-if="rightIcon && !loading"
41
+ class="star-button__right-icon"
42
+ :class="rightIcon"
43
+ ></text>
44
+ </view>`,
45
+
6
46
  name: 'StarButton',
7
47
 
8
48
  // 为组件添加 install 方法,用于 Vue.use()
@@ -111,6 +151,79 @@ StarButton.install = function(Vue) {
111
151
 
112
152
  // Input 组件
113
153
  const StarInput = {
154
+ template: `<view class="star-input" :class="inputClasses">
155
+ <!-- 前置内容 -->
156
+ <view v-if="$slots.prepend || prepend" class="star-input__prepend">
157
+ <slot name="prepend">
158
+ <text v-if="prepend" class="star-input__prepend-text">{{ prepend }}</text>
159
+ </slot>
160
+ </view>
161
+
162
+ <!-- 输入框主体 -->
163
+ <view class="star-input__wrapper">
164
+ <!-- 前置图标 -->
165
+ <text
166
+ v-if="prefixIcon"
167
+ class="star-input__prefix-icon"
168
+ :class="prefixIcon"
169
+ @click="handlePrefixIconClick"
170
+ ></text>
171
+
172
+ <!-- 输入框 -->
173
+ <input
174
+ class="star-input__inner"
175
+ :type="showPassword ? (passwordVisible ? 'text' : 'password') : type"
176
+ :value="currentValue"
177
+ :placeholder="placeholder"
178
+ :disabled="disabled"
179
+ :maxlength="maxlength"
180
+ :focus="focus"
181
+ :confirm-type="confirmType"
182
+ :placeholder-style="placeholderStyle"
183
+ :placeholder-class="placeholderClass"
184
+ :cursor-spacing="cursorSpacing"
185
+ @input="handleInput"
186
+ @focus="handleFocus"
187
+ @blur="handleBlur"
188
+ @confirm="handleConfirm"
189
+ @keyboardheightchange="handleKeyboardHeightChange"
190
+ />
191
+
192
+ <!-- 清除按钮 -->
193
+ <view
194
+ v-if="clearable && currentValue && !disabled"
195
+ class="star-input__clear"
196
+ @click="handleClear"
197
+ >
198
+ <text class="star-icon-close"></text>
199
+ </view>
200
+
201
+ <!-- 密码可见切换按钮 -->
202
+ <view
203
+ v-if="showPassword && currentValue"
204
+ class="star-input__password-toggle"
205
+ @click="togglePasswordVisible"
206
+ >
207
+ <text :class="passwordVisible ? 'star-icon-eye-open' : 'star-icon-eye-close'"></text>
208
+ </view>
209
+
210
+ <!-- 后置图标 -->
211
+ <text
212
+ v-if="suffixIcon"
213
+ class="star-input__suffix-icon"
214
+ :class="suffixIcon"
215
+ @click="handleSuffixIconClick"
216
+ ></text>
217
+ </view>
218
+
219
+ <!-- 后置内容 -->
220
+ <view v-if="$slots.append || append" class="star-input__append">
221
+ <slot name="append">
222
+ <text v-if="append" class="star-input__append-text">{{ append }}</text>
223
+ </slot>
224
+ </view>
225
+ </view>`,
226
+
114
227
  name: 'StarInput',
115
228
 
116
229
  // 为组件添加 install 方法,用于 Vue.use()
@@ -325,7 +438,7 @@ if (typeof window !== 'undefined' && window.Vue) {
325
438
 
326
439
  // 创建导出对象
327
440
  const StarUI = {
328
- version: '0.1.3',
441
+ version: '0.1.5',
329
442
  install,
330
443
  // 导出所有组件
331
444
  StarButton,
package/lib/index.js CHANGED
@@ -9,6 +9,46 @@
9
9
 
10
10
  // Button 组件
11
11
  const StarButton = {
12
+ template: `<view
13
+ class="star-button"
14
+ :class="[
15
+ `star-button--\${type}`,
16
+ `star-button--\${size}`,
17
+ {
18
+ 'star-button--disabled': disabled,
19
+ 'star-button--loading': loading,
20
+ 'star-button--block': block,
21
+ 'star-button--plain': plain
22
+ }
23
+ ]"
24
+ :style="[customStyle]"
25
+ @click="handleClick"
26
+ >
27
+ <!-- 加载状态 -->
28
+ <view v-if="loading" class="star-button__loading">
29
+ <view class="star-button__loading-spinner"></view>
30
+ </view>
31
+
32
+ <!-- 图标 -->
33
+ <text
34
+ v-if="icon && !loading"
35
+ class="star-button__icon"
36
+ :class="icon"
37
+ ></text>
38
+
39
+ <!-- 文字内容 -->
40
+ <text class="star-button__text">
41
+ <slot></slot>
42
+ </text>
43
+
44
+ <!-- 右侧图标 -->
45
+ <text
46
+ v-if="rightIcon && !loading"
47
+ class="star-button__right-icon"
48
+ :class="rightIcon"
49
+ ></text>
50
+ </view>`,
51
+
12
52
  name: 'StarButton',
13
53
 
14
54
  // 为组件添加 install 方法,用于 Vue.use()
@@ -117,6 +157,79 @@
117
157
 
118
158
  // Input 组件
119
159
  const StarInput = {
160
+ template: `<view class="star-input" :class="inputClasses">
161
+ <!-- 前置内容 -->
162
+ <view v-if="$slots.prepend || prepend" class="star-input__prepend">
163
+ <slot name="prepend">
164
+ <text v-if="prepend" class="star-input__prepend-text">{{ prepend }}</text>
165
+ </slot>
166
+ </view>
167
+
168
+ <!-- 输入框主体 -->
169
+ <view class="star-input__wrapper">
170
+ <!-- 前置图标 -->
171
+ <text
172
+ v-if="prefixIcon"
173
+ class="star-input__prefix-icon"
174
+ :class="prefixIcon"
175
+ @click="handlePrefixIconClick"
176
+ ></text>
177
+
178
+ <!-- 输入框 -->
179
+ <input
180
+ class="star-input__inner"
181
+ :type="showPassword ? (passwordVisible ? 'text' : 'password') : type"
182
+ :value="currentValue"
183
+ :placeholder="placeholder"
184
+ :disabled="disabled"
185
+ :maxlength="maxlength"
186
+ :focus="focus"
187
+ :confirm-type="confirmType"
188
+ :placeholder-style="placeholderStyle"
189
+ :placeholder-class="placeholderClass"
190
+ :cursor-spacing="cursorSpacing"
191
+ @input="handleInput"
192
+ @focus="handleFocus"
193
+ @blur="handleBlur"
194
+ @confirm="handleConfirm"
195
+ @keyboardheightchange="handleKeyboardHeightChange"
196
+ />
197
+
198
+ <!-- 清除按钮 -->
199
+ <view
200
+ v-if="clearable && currentValue && !disabled"
201
+ class="star-input__clear"
202
+ @click="handleClear"
203
+ >
204
+ <text class="star-icon-close"></text>
205
+ </view>
206
+
207
+ <!-- 密码可见切换按钮 -->
208
+ <view
209
+ v-if="showPassword && currentValue"
210
+ class="star-input__password-toggle"
211
+ @click="togglePasswordVisible"
212
+ >
213
+ <text :class="passwordVisible ? 'star-icon-eye-open' : 'star-icon-eye-close'"></text>
214
+ </view>
215
+
216
+ <!-- 后置图标 -->
217
+ <text
218
+ v-if="suffixIcon"
219
+ class="star-input__suffix-icon"
220
+ :class="suffixIcon"
221
+ @click="handleSuffixIconClick"
222
+ ></text>
223
+ </view>
224
+
225
+ <!-- 后置内容 -->
226
+ <view v-if="$slots.append || append" class="star-input__append">
227
+ <slot name="append">
228
+ <text v-if="append" class="star-input__append-text">{{ append }}</text>
229
+ </slot>
230
+ </view>
231
+ </view>`,
232
+
120
233
  name: 'StarInput',
121
234
 
122
235
  // 为组件添加 install 方法,用于 Vue.use()
@@ -331,7 +444,7 @@
331
444
 
332
445
  // 创建导出对象
333
446
  const StarUI = {
334
- version: '0.1.3',
447
+ version: '0.1.5',
335
448
  install,
336
449
  // 导出所有组件
337
450
  StarButton,
package/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@star-ai/star-ui",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "基于Uniapp的Vue2组件库",
5
5
  "main": "index.js",
6
6
  "module": "index.js",
@@ -9,6 +9,46 @@
9
9
 
10
10
  // Button 组件
11
11
  const StarButton = {
12
+ template: `<view
13
+ class="star-button"
14
+ :class="[
15
+ `star-button--\${type}`,
16
+ `star-button--\${size}`,
17
+ {
18
+ 'star-button--disabled': disabled,
19
+ 'star-button--loading': loading,
20
+ 'star-button--block': block,
21
+ 'star-button--plain': plain
22
+ }
23
+ ]"
24
+ :style="[customStyle]"
25
+ @click="handleClick"
26
+ >
27
+ <!-- 加载状态 -->
28
+ <view v-if="loading" class="star-button__loading">
29
+ <view class="star-button__loading-spinner"></view>
30
+ </view>
31
+
32
+ <!-- 图标 -->
33
+ <text
34
+ v-if="icon && !loading"
35
+ class="star-button__icon"
36
+ :class="icon"
37
+ ></text>
38
+
39
+ <!-- 文字内容 -->
40
+ <text class="star-button__text">
41
+ <slot></slot>
42
+ </text>
43
+
44
+ <!-- 右侧图标 -->
45
+ <text
46
+ v-if="rightIcon && !loading"
47
+ class="star-button__right-icon"
48
+ :class="rightIcon"
49
+ ></text>
50
+ </view>`,
51
+
12
52
  name: 'StarButton',
13
53
 
14
54
  // 为组件添加 install 方法,用于 Vue.use()
@@ -116,6 +156,79 @@
116
156
 
117
157
  // Input 组件
118
158
  const StarInput = {
159
+ template: `<view class="star-input" :class="inputClasses">
160
+ <!-- 前置内容 -->
161
+ <view v-if="$slots.prepend || prepend" class="star-input__prepend">
162
+ <slot name="prepend">
163
+ <text v-if="prepend" class="star-input__prepend-text">{{ prepend }}</text>
164
+ </slot>
165
+ </view>
166
+
167
+ <!-- 输入框主体 -->
168
+ <view class="star-input__wrapper">
169
+ <!-- 前置图标 -->
170
+ <text
171
+ v-if="prefixIcon"
172
+ class="star-input__prefix-icon"
173
+ :class="prefixIcon"
174
+ @click="handlePrefixIconClick"
175
+ ></text>
176
+
177
+ <!-- 输入框 -->
178
+ <input
179
+ class="star-input__inner"
180
+ :type="showPassword ? (passwordVisible ? 'text' : 'password') : type"
181
+ :value="currentValue"
182
+ :placeholder="placeholder"
183
+ :disabled="disabled"
184
+ :maxlength="maxlength"
185
+ :focus="focus"
186
+ :confirm-type="confirmType"
187
+ :placeholder-style="placeholderStyle"
188
+ :placeholder-class="placeholderClass"
189
+ :cursor-spacing="cursorSpacing"
190
+ @input="handleInput"
191
+ @focus="handleFocus"
192
+ @blur="handleBlur"
193
+ @confirm="handleConfirm"
194
+ @keyboardheightchange="handleKeyboardHeightChange"
195
+ />
196
+
197
+ <!-- 清除按钮 -->
198
+ <view
199
+ v-if="clearable && currentValue && !disabled"
200
+ class="star-input__clear"
201
+ @click="handleClear"
202
+ >
203
+ <text class="star-icon-close"></text>
204
+ </view>
205
+
206
+ <!-- 密码可见切换按钮 -->
207
+ <view
208
+ v-if="showPassword && currentValue"
209
+ class="star-input__password-toggle"
210
+ @click="togglePasswordVisible"
211
+ >
212
+ <text :class="passwordVisible ? 'star-icon-eye-open' : 'star-icon-eye-close'"></text>
213
+ </view>
214
+
215
+ <!-- 后置图标 -->
216
+ <text
217
+ v-if="suffixIcon"
218
+ class="star-input__suffix-icon"
219
+ :class="suffixIcon"
220
+ @click="handleSuffixIconClick"
221
+ ></text>
222
+ </view>
223
+
224
+ <!-- 后置内容 -->
225
+ <view v-if="$slots.append || append" class="star-input__append">
226
+ <slot name="append">
227
+ <text v-if="append" class="star-input__append-text">{{ append }}</text>
228
+ </slot>
229
+ </view>
230
+ </view>`,
231
+
119
232
  name: 'StarInput',
120
233
 
121
234
  // 为组件添加 install 方法,用于 Vue.use()
@@ -333,7 +446,7 @@
333
446
 
334
447
  // 创建导出对象
335
448
  const StarUI = {
336
- version: '0.1.3',
449
+ version: '0.1.5',
337
450
  install,
338
451
  // 导出所有组件
339
452
  StarButton,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@star-ai/star-ui",
3
- "version": "0.1.3",
3
+ "version": "0.1.5",
4
4
  "description": "基于Uniapp的Vue2组件库",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.js",