Skip to content

Commit 6dce309

Browse files
committed
fix: rename box action prop to avoid collision
BREAKING CHANGE: box action text >>> label
1 parent 03f7f05 commit 6dce309

File tree

4 files changed

+20
-16
lines changed

4 files changed

+20
-16
lines changed

packages/components-vue/src/components/box/Action.stories.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ import Action from "./Action.vue";
55
const meta = {
66
title: "Box/Box Action",
77
component: Action as Record<keyof typeof Action, unknown>,
8-
args: { text: "Box Action", icon: "cubes" },
8+
args: { label: "Box Action", icon: "cubes" },
99
} satisfies Meta<typeof Action>;
1010

1111
type Story = StoryObj<typeof Action>;
1212

1313
export const Sample: Story = {
14-
args: { text: "Box Action", icon: "cubes" },
14+
args: { label: "Box Action", icon: "cubes" },
1515
};
1616

1717
export default meta;

packages/components-vue/src/components/box/Action.vue

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33
v-bind="{ ...$attrs, ...props, ...tooltipAttributes }"
44
:class="[modifiersClasses, stateClasses, themeClasses]"
55
class="box --button"
6-
:aria-label="text"
6+
:aria-label="label"
77
>
88
<div v-if="icon || src" :class="innerThemeClasses" class="box --square">
99
<IconFa v-if="icon" v-bind="{ size: 35, ...iconProps, name: icon }" />
1010
<BaseImg
1111
v-else-if="src"
1212
class="--bgColor-light --width --height"
1313
:src="src"
14-
:alt="text"
14+
:alt="label"
1515
/>
1616
</div>
1717
<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>
2020
</p>
2121
</BaseAction>
2222
</template>
@@ -58,10 +58,11 @@
5858
*/
5959
src?: string;
6060
/**
61-
* action text
62-
* @required
61+
* action label
62+
* @old text - collision with router-link attribute
63+
* @required true
6364
*/
64-
text: string;
65+
label: string;
6566
}
6667
6768
/**

packages/components-vue/src/components/form/Stages.vue

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@
116116
type iForm,
117117
type FormInput as FormInputClass,
118118
useI18n,
119-
useUtils,
120119
FormInput,
121120
} from "@open-xamu-co/ui-common-helpers";
122121
@@ -163,7 +162,6 @@
163162
const emit = defineEmits(["input-values", "submited", "set-active-stage"]);
164163
165164
const { t } = useHelpers(useI18n);
166-
const { isBrowser } = useHelpers(useUtils);
167165
168166
const canSubmit = ref(props.optional);
169167
const activeStage = ref(0);
@@ -214,8 +212,5 @@
214212
}
215213
216214
// lifecycle
217-
if (isBrowser) {
218-
// allow parent to switch the stage
219-
emit("set-active-stage", setActiveStage);
220-
}
215+
emit("set-active-stage", setActiveStage);
221216
</script>

packages/components-vue/src/components/value/Simple.vue

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,14 @@
185185
return /\.(jpg|jpeg|png|webp|avif|gif)$/.test(firstPart);
186186
}
187187
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+
}
189197
}
190198
</script>

0 commit comments

Comments
 (0)