File tree Expand file tree Collapse file tree 4 files changed +20
-16
lines changed
packages/components-vue/src/components Expand file tree Collapse file tree 4 files changed +20
-16
lines changed Original file line number Diff line number Diff line change @@ -5,13 +5,13 @@ import Action from "./Action.vue";
5
5
const meta = {
6
6
title : "Box/Box Action" ,
7
7
component : Action as Record < keyof typeof Action , unknown > ,
8
- args : { text : "Box Action" , icon : "cubes" } ,
8
+ args : { label : "Box Action" , icon : "cubes" } ,
9
9
} satisfies Meta < typeof Action > ;
10
10
11
11
type Story = StoryObj < typeof Action > ;
12
12
13
13
export const Sample : Story = {
14
- args : { text : "Box Action" , icon : "cubes" } ,
14
+ args : { label : "Box Action" , icon : "cubes" } ,
15
15
} ;
16
16
17
17
export default meta ;
Original file line number Diff line number Diff line change 3
3
v-bind =" { ...$attrs, ...props, ...tooltipAttributes }"
4
4
:class =" [modifiersClasses, stateClasses, themeClasses]"
5
5
class =" box --button"
6
- :aria-label =" text "
6
+ :aria-label =" label "
7
7
>
8
8
<div v-if =" icon || src" :class =" innerThemeClasses" class =" box --square" >
9
9
<IconFa v-if =" icon" v-bind =" { size: 35, ...iconProps, name: icon }" />
10
10
<BaseImg
11
11
v-else-if =" src"
12
12
class =" --bgColor-light --width --height"
13
13
:src =" src"
14
- :alt =" text "
14
+ :alt =" label "
15
15
/>
16
16
</div >
17
17
<p >
18
- <!-- Since we only accept text there is no room for slot here -->
19
- <b >{{ text }}</b >
18
+ <!-- Since we only accept label there is no room for slot here -->
19
+ <b >{{ label }}</b >
20
20
</p >
21
21
</BaseAction >
22
22
</template >
58
58
*/
59
59
src? : string ;
60
60
/**
61
- * action text
62
- * @required
61
+ * action label
62
+ * @old text - collision with router-link attribute
63
+ * @required true
63
64
*/
64
- text : string ;
65
+ label : string ;
65
66
}
66
67
67
68
/**
Original file line number Diff line number Diff line change 116
116
type iForm ,
117
117
type FormInput as FormInputClass ,
118
118
useI18n ,
119
- useUtils ,
120
119
FormInput ,
121
120
} from " @open-xamu-co/ui-common-helpers" ;
122
121
163
162
const emit = defineEmits ([" input-values" , " submited" , " set-active-stage" ]);
164
163
165
164
const { t } = useHelpers (useI18n );
166
- const { isBrowser } = useHelpers (useUtils );
167
165
168
166
const canSubmit = ref (props .optional );
169
167
const activeStage = ref (0 );
214
212
}
215
213
216
214
// lifecycle
217
- if (isBrowser ) {
218
- // allow parent to switch the stage
219
- emit (" set-active-stage" , setActiveStage );
220
- }
215
+ emit (" set-active-stage" , setActiveStage );
221
216
</script >
Original file line number Diff line number Diff line change 185
185
return / \. (jpg| jpeg| png| webp| avif| gif)$ / .test (firstPart );
186
186
}
187
187
function isDate(dateString : string ): boolean {
188
- return validator .isDate (dateString ) || ! isNaN (Date .parse (dateString ));
188
+ try {
189
+ // bypass numbers
190
+ if (!! Number (dateString )) return false ;
191
+
192
+ return validator .isDate (dateString ) || ! isNaN (Date .parse (dateString ));
193
+ } catch (err ) {
194
+ // ignore errors
195
+ return false ;
196
+ }
189
197
}
190
198
</script >
You can’t perform that action at this time.
0 commit comments