Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop' into dependencies/updat…
Browse files Browse the repository at this point in the history
…e-vue
  • Loading branch information
mlmoravek committed Sep 17, 2024
2 parents 3c14861 + a2e9b8a commit 5a7a9a0
Show file tree
Hide file tree
Showing 27 changed files with 250 additions and 172 deletions.
47 changes: 23 additions & 24 deletions packages/docs/components/Sidebar.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/docs/components/Tooltip.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@

| Name | Description | Bindings |
| ------- | -------------------------------------- | ------------------------------------------- |
| content | Tooltip content, default is label prop | |
| default | Tooltip trigger slot | **active** `boolean` - tooltip active state |
| content | Tooltip content, default is label prop | |

</div>

Expand Down
8 changes: 3 additions & 5 deletions packages/oruga/src/components/datepicker/Datepicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -554,8 +554,8 @@ const listsClasses = defineClasses(["listsClass", "o-dpck__header__list"]);
const footerClasses = defineClasses(["footerClass", "o-dpck__footer"]);
const dropdownClass = defineClasses([
"dropdownClasses.rootClass",
const pickerDropdownClasses = defineClasses([
"dropdownClass",
"o-tpck__dropdown",
]);
Expand All @@ -581,8 +581,8 @@ defineExpose({ focus: () => pickerRef.value?.focus(), value: vmodel });
:max="maxDate"
:min="minDate"
:stay-open="props.multiple"
:dropdown-classes="dropdownClass"
:root-classes="rootClasses"
:dropdown-classes="pickerDropdownClasses"
:box-class="boxClassBind"
:dtf="dtf"
@focus="$emit('focus', $event)"
Expand Down Expand Up @@ -612,7 +612,6 @@ defineExpose({ focus: () => pickerRef.value?.focus(), value: vmodel });
:aria-label="ariaPreviousLabel"
:icon-pack="iconPack"
:icon-left="iconPrev"
outlined
@click.prevent="prev"
@keydown.enter.prevent="prev"
@keydown.space.prevent="prev" />
Expand All @@ -624,7 +623,6 @@ defineExpose({ focus: () => pickerRef.value?.focus(), value: vmodel });
:aria-label="ariaNextLabel"
:icon-pack="iconPack"
:icon-left="iconNext"
outlined
@click.prevent="next"
@keydown.enter.prevent="next"
@keydown.space.prevent="next" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const selectedString = computed(() =>
<template>
<section>
<o-field label="Select a date" grouped>
<o-datepicker v-model="selected">
<o-datepicker v-model="selected" teleport>
<template #trigger>
<o-button icon-left="calendar" type="primary" />
</template>
Expand Down
4 changes: 4 additions & 0 deletions packages/oruga/src/components/datepicker/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,10 @@ type DatepickerClasses = Partial<{
monthCellEventsClass: ComponentClass;
/** Class of the Datepicker when on mobile */
mobileClass: ComponentClass;
/** Class for the underlaying dropdown component */
dropdownClass: ComponentClass;
/** Class for the HTML input element */
inputClass: ComponentClass;
/**
* Class configuration for the internal input component
* @ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ exports[`ODatepicker > render correctly 1`] = `
<!--
@slot Override the header
-->
<div class="o-dpck__header__buttons"><button type="button" class="o-btn o-btn--outlined o-dpck__header__previous" role="button" data-oruga="button" aria-label="Previous Page"><span class="o-btn__wrapper"><span class="o-icon o-btn__icon o-btn__icon-left" data-oruga="icon"><!-- custom icon component --><!-- native css icon --><i class="mdi mdi-chevron-left mdi-24px"></i></span>
<div class="o-dpck__header__buttons"><button type="button" class="o-btn o-dpck__header__previous" role="button" data-oruga="button" aria-label="Previous Page"><span class="o-btn__wrapper"><span class="o-icon o-btn__icon o-btn__icon-left" data-oruga="icon"><!-- custom icon component --><!-- native css icon --><i class="mdi mdi-chevron-left mdi-24px"></i></span>
<!--v-if-->
<!--v-if--></span>
</button><button type="button" class="o-btn o-btn--outlined o-dpck__header__next" role="button" data-oruga="button" aria-label="Next Page"><span class="o-btn__wrapper"><span class="o-icon o-btn__icon o-btn__icon-left" data-oruga="icon"><!-- custom icon component --><!-- native css icon --><i class="mdi mdi-chevron-right mdi-24px"></i></span>
</button><button type="button" class="o-btn o-dpck__header__next" role="button" data-oruga="button" aria-label="Next Page"><span class="o-btn__wrapper"><span class="o-icon o-btn__icon o-btn__icon-left" data-oruga="icon"><!-- custom icon component --><!-- native css icon --><i class="mdi mdi-chevron-right mdi-24px"></i></span>
<!--v-if-->
<!--v-if--></span>
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ exports[`ODatetimepicker tests > render correctly 1`] = `
<!--
@slot Override the header
-->
<div class="o-dpck__header__buttons"><button type="button" class="o-btn o-btn--outlined o-dpck__header__previous" role="button" data-oruga="button" aria-label="Previous Page"><span class="o-btn__wrapper"><span class="o-icon o-btn__icon o-btn__icon-left" data-oruga="icon"><!-- custom icon component --><!-- native css icon --><i class="mdi mdi-chevron-left mdi-24px"></i></span>
<div class="o-dpck__header__buttons"><button type="button" class="o-btn o-dpck__header__previous" role="button" data-oruga="button" aria-label="Previous Page"><span class="o-btn__wrapper"><span class="o-icon o-btn__icon o-btn__icon-left" data-oruga="icon"><!-- custom icon component --><!-- native css icon --><i class="mdi mdi-chevron-left mdi-24px"></i></span>
<!--v-if-->
<!--v-if--></span>
</button><button type="button" class="o-btn o-btn--outlined o-dpck__header__next" role="button" data-oruga="button" aria-label="Next Page"><span class="o-btn__wrapper"><span class="o-icon o-btn__icon o-btn__icon-left" data-oruga="icon"><!-- custom icon component --><!-- native css icon --><i class="mdi mdi-chevron-right mdi-24px"></i></span>
</button><button type="button" class="o-btn o-dpck__header__next" role="button" data-oruga="button" aria-label="Next Page"><span class="o-btn__wrapper"><span class="o-icon o-btn__icon o-btn__icon-left" data-oruga="icon"><!-- custom icon component --><!-- native css icon --><i class="mdi mdi-chevron-right mdi-24px"></i></span>
<!--v-if-->
<!--v-if--></span>
</button>
Expand Down
46 changes: 23 additions & 23 deletions packages/oruga/src/components/field/Field.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,16 @@ const props = defineProps({
type: [String, Array, Function] as PropType<ComponentClass>,
default: undefined,
},
/** Class for field label when horizontal */
horizontalLabelClass: {
type: [String, Array, Function] as PropType<ComponentClass>,
default: undefined,
},
/** "Class for field body when horizontal */
horizontalBodyClass: {
type: [String, Array, Function] as PropType<ComponentClass>,
default: undefined,
},
/** Class when fields are grouped together */
groupedClass: {
type: [String, Array, Function] as PropType<ComponentClass>,
Expand All @@ -101,8 +111,8 @@ const props = defineProps({
type: [String, Array, Function] as PropType<ComponentClass>,
default: undefined,
},
/** Class for field label when horizontal */
labelHorizontalClass: {
/** Class of the label field variant */
labelVariantClass: {
type: [String, Array, Function] as PropType<ComponentClass>,
default: undefined,
},
Expand All @@ -111,11 +121,6 @@ const props = defineProps({
type: [String, Array, Function] as PropType<ComponentClass>,
default: undefined,
},
/** "Class for field body when horizontal */
bodyHorizontalClass: {
type: [String, Array, Function] as PropType<ComponentClass>,
default: undefined,
},
/** Class for components automatically attached together when inside a field */
addonsClass: {
type: [String, Array, Function] as PropType<ComponentClass>,
Expand All @@ -127,12 +132,7 @@ const props = defineProps({
default: undefined,
},
/** Class of the message field variant */
variantMessageClass: {
type: [String, Array, Function] as PropType<ComponentClass>,
default: undefined,
},
/** Class of the label field variant */
variantLabelClass: {
messageVariantClass: {
type: [String, Array, Function] as PropType<ComponentClass>,
default: undefined,
},
Expand Down Expand Up @@ -294,7 +294,7 @@ const rootClasses = defineClasses(
const messageClasses = defineClasses(
["messageClass", "o-field__message"],
[
"variantMessageClass",
"messageVariantClass",
"o-field__message-",
fieldVariant,
computed(() => !!fieldVariant.value),
Expand All @@ -310,22 +310,22 @@ const labelClasses = defineClasses(
computed(() => !!props.labelSize),
],
[
"variantLabelClass",
"labelVariantClass",
"o-field__label-",
fieldVariant,
computed(() => !!fieldVariant.value),
],
);
const labelHorizontalClasses = defineClasses([
"labelHorizontalClass",
const bodyClasses = defineClasses(["bodyClass", "o-field__body"]);
const horizontalLabelClasses = defineClasses([
"horizontalLabelClass",
"o-field__horizontal-label",
]);
const bodyClasses = defineClasses(["bodyClass", "o-field__body"]);
const bodyHorizontalClasses = defineClasses([
"bodyHorizontalClass",
const horizontalBodyClasses = defineClasses([
"horizontalBodyClass",
"o-field__horizontal-body",
]);
Expand All @@ -350,7 +350,7 @@ const innerFieldClasses = defineClasses(

<template>
<div ref="rootRef" data-oruga="field" :class="rootClasses">
<div v-if="horizontal" :class="labelHorizontalClasses">
<div v-if="horizontal" :class="horizontalLabelClasses">
<label v-if="hasLabel" :for="inputId" :class="labelClasses">
<!--
@slot Override the label
Expand All @@ -369,7 +369,7 @@ const innerFieldClasses = defineClasses(
</label>
</template>

<div v-if="horizontal" :class="bodyHorizontalClasses">
<div v-if="horizontal" :class="horizontalBodyClasses">
<template
v-for="(element, index) in getInnerContent($slots.default)"
:key="index">
Expand Down
50 changes: 25 additions & 25 deletions packages/oruga/src/components/field/examples/inspector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,25 @@ const inspectData = [
class: "horizontalClass",
description: "Class to align label and control in horizontal forms",
properties: ["horizontal"],
specificity: "when <b>mobileClass</b> is applied",
specificity: "when <b>horizontal</b> is applied",
action: (cmp, data) => {
data.horizontal = true;
},
},
{
class: "horizontalLabelClass",
description: "Class for field label when horizontal",
properties: ["horizontal"],
specificity: "when <b>horizontal</b> is applied",
action: (cmp, data) => {
data.horizontal = true;
},
},
{
class: "horizontalBodyClass",
description: "Class for field body when horizontal",
specificity: "when <b>horizontal</b> is applied",
properties: ["horizontal"],
action: (cmp, data) => {
data.horizontal = true;
},
Expand Down Expand Up @@ -52,27 +70,18 @@ const inspectData = [
},
},
{
class: "labelHorizontalClass",
description: "Class for field label when horizontal",
properties: ["horizontal"],
specificity: "when <b>mobileClass</b> is applied",
class: "labelVariantClass",
description: "Class of the label field variant",
properties: ["variant"],
suffixes: ["primary", "info", "warning", "danger"],
action: (cmp, data) => {
data.horizontal = true;
data.variant = "info";
},
},
{
class: "bodyClass",
description: "Class for field body",
},
{
class: "bodyHorizontalClass",
description: "Class for field body when horizontal",
specificity: "when <b>mobileClass</b> is applied",
properties: ["horizontal"],
action: (cmp, data) => {
data.horizontal = true;
},
},
{
class: "addonsClass",
description:
Expand All @@ -92,7 +101,7 @@ const inspectData = [
},
},
{
class: "variantMessageClass",
class: "messageVariantClass",
description: "Class of the message field variant",
properties: ["variant"],
suffixes: ["primary", "info", "warning", "danger"],
Expand All @@ -101,15 +110,6 @@ const inspectData = [
data.message = "This is a message for the field";
},
},
{
class: "variantLabelClass",
description: "Class of the label field variant",
properties: ["variant"],
suffixes: ["primary", "info", "warning", "danger"],
action: (cmp, data) => {
data.variant = "info";
},
},
{
class: "focusedClass",
description: "Class for the focused field",
Expand Down
12 changes: 12 additions & 0 deletions packages/oruga/src/components/input/examples/base.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,17 @@ const name = ref("John Silver");
<o-field label="Disabled">
<o-input placeholder="Disabled" disabled />
</o-field>

<o-field label="Expanded">
<o-input placeholder="Expanded" expanded />
</o-field>

<o-field label="Counter">
<o-input
placeholder="Counter"
:maxlength="10"
:maxitems="5"
counter />
</o-field>
</section>
</template>
Loading

0 comments on commit 5a7a9a0

Please sign in to comment.