oruga-ui / oruga Goto Github PK
View Code? Open in Web Editor NEW🐛 Oruga is a lightweight library of UI components without any CSS framework dependency
Home Page: https://oruga-ui.com
License: MIT License
🐛 Oruga is a lightweight library of UI components without any CSS framework dependency
Home Page: https://oruga-ui.com
License: MIT License
It might be a good idea to implement automatic resizing for textareas!
Having tried several packages for this, i highly recommend the following:
https://github.com/devstark-com/vue-textarea-autosize
I am happy to implement this as a feature :)
It's a common request and is not difficult to implement. Having this as part of Orgua will save users the need to search for a working implementation.
If we using full Oruga, we do something like this
Vue.use(Oruga, {
iconPack: 'fas'
})
But if we are using Individual components (tree shaking), how can we set the icon pack?
import { Icon, Config } from '@oruga-ui/oruga';
import '@oruga-ui/oruga/dist/oruga-full.css';
Vue.use(Icon);
I tried this
Vue.use(Config, {
icon: {
iconPack: 'fas',
}
})
But the o-pag
that was auto included by o-table
still using the Material design icon
Oruga version: 0.3.5
Vuejs version: 3
OS/Browser: All
Some UI components still try to access this.value
in oruga-next instead of this.modelValue
. More information on this migration can be found here.
Create an o-slider
, and o-radio
and use v-model
to bind a local variable.
Try interacting with the components.
The computed properties should resolve correctly
The variable bound to v-model
will update properly, however, computed properties that reference this.value
within the component source throw an error, and do not reflect updates visually. (For instance, clicking on a radio button does correctly update the underlying v-model
, however, the circle does not appear filled in).
Oruga version: [0.3.2]
Vuejs version: [3.0.5]
OS/Browser: Arch Linux / Mozilla Firefox
Radio button is not compatible with Vue 3. It emits an input
event instead of update:modelValue
set o-input invalid based on validationMessage if useHtml5Validation=false
If validationMessage is set (useHtml5Validation=false), then the input field will be set invalid (variant = danger and validationMessage will be shown under the input field
In order to set the o-input invalid when working with external validation plugin like vee-validate
<Field name="firstName" v-slot="{field, meta, errorMessage}" rules="required">
<o-input :useHtml5Validation="false" v-bind="field" :modelValue="meta.initialValue" :validationMessage="errorMessage">
</o-input>
</Field>
Autocomplete component provides these following classes to extend / override the component:
It should include input-class
.
We need to be able to control the size of the input.
More over, then using with icon, we need to be able to set x-padding to the input.
Hi,
Thx for providing the Vue 3 branch.
There are some methods now depricated:
Vue warn]: beforeDestroy
has been renamed to beforeUnmount
.
at
at <OTable data= (3) [{…}, {…}, {…}] isPaginated:="" true,="" ... >
at <HostListings onVnodeUnmounted=fn ref=Ref< Proxy {…} > >
at
at <HostLayout onVnodeUnmounted=fn ref=Ref< Proxy {…} > >
at
at
I can fix it, but it seems there is one code base for vue2 and vue3.
What is strategy to maintain those 2?
Oruga version: ^0.2.2
Vuejs version: ^3.0.0
OS/Browser: Sidekick Browser
according to docs:
https://oruga.io/components/Icon.html#examples
and
https://github.com/oruga-ui/oruga/blob/master/packages/oruga-tailwindcss/src/main.ts
its example not related with vue 3 anymore. so how i set the icons correctly in vue 3?
icons shows up
icons not rendered
The following errors are in the console:
runtime-dom.esm-bundler.js?830f:193 Uncaught (in promise) TypeError: Cannot convert object to primitive value
at patchDOMProp (runtime-dom.esm-bundler.js?830f:193)
at patchProp (runtime-dom.esm-bundler.js?830f:332)
at mountElement (runtime-core.esm-bundler.js?5c40:3909)
at processElement (runtime-core.esm-bundler.js?5c40:3872)
at patch (runtime-core.esm-bundler.js?5c40:3785)
at mountChildren (runtime-core.esm-bundler.js?5c40:3996)
at processFragment (runtime-core.esm-bundler.js?5c40:4155)
at patch (runtime-core.esm-bundler.js?5c40:3781)
at mountChildren (runtime-core.esm-bundler.js?5c40:3996)
at processFragment (runtime-core.esm-bundler.js?5c40:4155)
Uncaught (in promise) TypeError: Cannot read property 'parentNode' of null
at parentNode (runtime-dom.esm-bundler.js?830f:30)
at patchBlockChildren (runtime-core.esm-bundler.js?5c40:4108)
at processFragment (runtime-core.esm-bundler.js?5c40:4163)
at patch (runtime-core.esm-bundler.js?5c40:3781)
at patchBlockChildren (runtime-core.esm-bundler.js?5c40:4112)
at patchElement (runtime-core.esm-bundler.js?5c40:4076)
at processElement (runtime-core.esm-bundler.js?5c40:3875)
at patch (runtime-core.esm-bundler.js?5c40:3785)
at componentEffect (runtime-core.esm-bundler.js?5c40:4373)
at reactiveEffect (reactivity.esm-bundler.js?a1e9:42)
I copied the code from the doc in https://oruga.io/components/Table.html#examples (pagination) into the oruga-next-demo project
Oruga version: 0.3.5
Vuejs version: 2.6.12
OS/Browser: Windows 10 64 bits / Chrome 87.0.4280.141 64 bits
When one sets a default sort on a table, whether as a string (default-sort="user.first_name"
) or an array (:default-sort="['user.first_name', 'asc']"
), this sort is not applied.
You can see the bug in the official documentation for the table component, in the pagination example (https://oruga.io/components/table.html#pagination) where a default sort is set on the user.first_name
column:
<o-table
:data="data"
:paginated="isPaginated"
:per-page="perPage"
:current-page.sync="currentPage"
:pagination-simple="isPaginationSimple"
:pagination-position="paginationPosition"
:default-sort-direction="defaultSortDirection"
:sort-icon="sortIcon"
:sort-icon-size="sortIconSize"
default-sort="user.first_name"
aria-next-label="Next page"
aria-previous-label="Previous page"
aria-page-label="Page"
aria-current-label="Current page"
>
Rows should be sorted by user first name.
Rows aren't sorted by user first name, as you can see on the screenshot below:
In the table component source code, I've noticed that the checkSort
method is never called.
Moreover, the firstTimeSort
data is set to false
:
data() {
return {
// ...
// firstTimeSort: true, // Used by first time initSort
firstTimeSort: false,
// ...
}
}
In the mounted
hook of the component where I put a table, I've added this:
<template>
<o-table :data="data" :default-sort="['default-sort-column', 'asc']" />
</template>
<script>
export default: {
// ...
mounted() {
this.$children.filter((c) => /otable/gi.test(c._name))[0].initSort()
},
// ...
}
</script>
I have a proposal. Instead of moving into the core package, we could add some script in the root package.json
. Someting along:
"test:oruga": "lerna run test --scope oruga",
"test:all": "lerna run test --stream",
This way, it would be possible to test the package directly at the root using npm run test:oruga
. It could be used to build also.
Originally posted by @service-paradis in #17 (comment)
Horizontal fields are not rendering error messages at all in oruga@next, it's not just a css issue either but the element itself is not rendered
Table column props "centered" does not put the correct class on the column.
Set a table column with the props "centered".
The CSS class defined in the code in the file oruga/packages/oruga/src/scss/components/_table.scss for centered column is o-table-td-center. This class is the one that should be added to the cell.
The CSS class o-table-td-centered is added to the cell. Since it's not defined, the column is not centered.
Just reproduce it here: https://oruga.io/components/Table.html#checkable
Browser:
When a single row is checked, the row is not pushed to checkedRows so it does not sync it at all (Total checked
do not change)
However when bulk rows are checked it works as expected.
Just reproduce it here: https://oruga.io/components/Table.html#checkable
(Thx for your amazing work)
Oruga version: v0.3.6
Vuejs version: 3
OS/Browser: N/A
There is a typo in oruga-next for rightIconClick in Input.vue
@icon-right-click
in an o-input
in oruga-next.Event to trigger
Event does not trigger
Add options to debounce / throttle to o-autocomplete
component in order to reduce number of requests sent to the backend when the user types very fast.
Moreover, the method called when @typing
is triggered is added to the call stack asynchronously so the second call is triggered before the first one has finished, resulting in incoherent data combined from both calls instead of having data from the very last call.
Oruga version: [0.1.4]
Vuejs version: [2.6.11]
OS/Browser: Ubuntu 20.04/Firefox
The pagination buttons have a min-width
but no padding
. This makes links that have big numbers or even the previous and next buttons get a bit weird with the text next to the border:
I was thinking on adding a --oruga-pagination-link-padding
variable and set it to the same value of --oruga-button-padding
at first. This would leave things this way:
Notice that the buttons are not always squared anymore once you get to two digits, but I guess this is fine, its what I would expect.
When using vue-cli with Typescript, after installing oruga-next with npm, importing from '@oruga-ui/oruga-next' fails:
Could not find a declaration file for module '@oruga-ui/oruga-next'. '/home/franck/devel/git-repositories/tethys/node_modules/@oruga-ui/oruga-next/dist/cjs/index.js' implicitly has an 'any' type.
To work this around, I had to "provide custom typings about this module".
Create a folder named "typings-custom" at the root of your project Reference the content of this folder in your tsconfig.json:
"include": [
"./typings-custom/**/*.ts"
]Create a file with this exact name: foo.d.ts [foo = the name of the module] with the content:
declare module 'foo'
Your TypeScript code should now compile, albeit with NO type information (TypeScript consider the foo module of type "any").
(see https://stackoverflow.com/questions/38224232/how-to-consume-npm-modules-from-typescript==
As Vue 3 improves Typescript compatibility, more and more users could opt for TypeScript. Having Oruga-next work out of the box would be a cool feature. Moreover, good typing could improve code quality.
Oruga version: [0.2.2]
Vuejs version: [3.0.0]
OS/Browser: macOS/FF82
The o-table component calls vue.extend when you specify an array of columns, but vue.extend doesn't exist in Vue 3.
See here
Table to render
Error in console:
Uncaught (in promise) TypeError: _plugins_4daf8ef8_js__WEBPACK_IMPORTED_MODULE_1__.V.extend is not a function
A text editor is important. There are so many editors in vue but all are heavy or lightweights are not so efficient.
Text editor maybe content all like GitHub text editor and image may convert base64/upload option and importantly a table.
I see some editor like Vue2Editor but there is no support for the table.
Inside app.js
import { Button } from '@oruga-ui/oruga';
import '@oruga-ui/oruga/dist/oruga-full.css';
Inside my app.scss
$primary: black;
@import "@oruga-ui/oruga/src/scss/utilities/_variables";
On template
<o-button @click="true">Click Me</o-button>
The button still using default color
Trying with this also doesnt seems to work
$button-background-color: black;
@import "@oruga-ui/oruga/src/scss/oruga-full.scss";
How to fix this?
Hi just want to report some issues that I found when using o-tooltip
For example, the placement is top. Usually Bootstrap tooltip will auto adjust itself to Bottom to avoid the edge
So if I customize the tooltip background color inside app.scss
$tooltip-background-color: rgba(0, 0, 0, 0.75);
@import "@oruga-ui/oruga/src/scss/oruga-full.scss";
It will looks like this. Notice that the arrow color doesnt change
Thanks for the hardwork!
Using the supplied example code for tables, the pagination next and previous buttons are empty. They work but no icon is displayed
Oruga version: [X.X.X]
Vuejs version: [X.X.X]
OS/Browser:
Oruga version: [0.2.2]
Vuejs version: [3.0.0]
OS/Browser: Brave/Chromium
When using the template from here: https://oruga.io/components/Steps.html#examples
We get an error about v-slot and slot-scope being deprecated. When you remove the problematic code, or try to use new syntax, the icons on the buttons do not render. Not sure if this
Problematic code:
<template v-if="customNavigation" slot="navigation" slot-scope="{previous, next}">
<o-button outlined variant="danger" icon-pack="fas" icon-left="backward" :disabled="previous.disabled" @click.prevent="previous.action">
Previous
</o-button>
<o-button outlined variant="success" icon-pack="fas" icon-right="forward" :disabled="next.disabled" @click.prevent="next.action">
Next
</o-button>
</template>
I reckon it should be rewritten as
<template v-if="customNavigation" v-slot:navigation #="{previous, next}">
<o-button outlined variant="danger" icon-pack="fas" icon-left="backward" :disabled="previous.disabled" @click.prevent="previous.action">
Previous
</o-button>
<o-button outlined variant="success" icon-pack="fas" icon-right="forward" :disabled="next.disabled" @click.prevent="next.action">
Next
</o-button>
</template>
But I'm not sure that works for this.
Edit: Actually, it looks like the icons are a part of some library of icons "mdi" that are just not rendered properly.
What library is this "mdi"? Material Design Icons? If so you sould probably add in the installation steps to include the MDI icons using CDN or importing them.
Edit 2:
Icons work after linking to material design CDN
Oruga version: 0.2.2
Vuejs version: 2.6.11
OS/Browser: Chrome
When toggling a detailed row, the detail section appears at the end of the table.
This behavior is present in the documentation examples. See: https://oruga.io/components/table.html#detailed
It should open the detailed row under the row in which the toggle has been done.
The detailed row opens at the end of the table.
Support Typescript in oruga-next
Get the following error message using "@oruga-ui/oruga-next": "^0.2.2"
Could not find a declaration file for module '@oruga-ui/oruga-next'.
Hello,
the table th detailed class is not working for me.
<o-table v-if="activeTable"
....
detailed
th-detailed-class="o-table__th"
/>
outcome is
without any class
Any thoughts?
Cheers
Hello,
in buefy there was this feature that you can customize your subheading in a table via a slot.
I could not find something similar in oruga.
Have I missed something or is this not implemeted.
I really miss this feature.
I would appreciate any help.
Cheers
Oruga version: 0.3.4
Vuejs version: 2.6.12
Nuxtjs version: 2.15.0
OS/Browser: MacBook Pro/Chrome
checkbox disabled
style overrides the background-image
when checked
checked svg icon should be displayed with a grayscale filter
disabled prop adds a background style which overrides the checked svg img
<template>
<o-checkbox v-model="checkboxCustom" true-value="Yes" false-value="No" disabled>23</o-checkbox>
</template>
<script>
export default {
data() {
return {
checkboxCustom: "Yes",
};
},
};
</script>
Oruga version: 0.3.4
Vuejs version: 2.6.12
Nuxtjs version: 2.15.0
OS/Browser: MacBook Pro/Chrome
Tabs
component doesn't support scroll in mobile
the tabs nav should be scrollable in mobile to select last childs
can't scroll in mobile
Oruga-next version: [0.2.2]
Vuejs version: [3.0.5]
OS/Browser: Chromium/Firefox
o-field--addons
class is not added on Field component
because of slot
implementation on Vue3.
The problem is here:
oruga/packages/oruga/src/components/field/Field.vue
hasAddons() {
let renderedNode = 0
if (this.$slots.default) {
renderedNode = this.$slots.default.reduce((i, node) => node.tag ? i + 1 : i, 0)
}
return (
renderedNode > 1 &&
this.addons &&
!this.horizontal
)
}
this.$slots
https://v3.vuejs.org/guide/migration/slots-unification.html
Maybe deep refactoring is required, because Oruga uses lots of slot
.
Oruga version: 0.3.5
Vuejs version: 3
OS/Browser: Linux/Firefox
The o-select
component is missing the selectClass
prop. See here in oruga
vs here in oruga-next
.
Create an o-select
component and attempt to set the select-class
prop.
Class should be applied
Class is ignored
It is good that Oruga is CSS Framework agnostic. How about also making it abit more JS Framework agnostic? Using VanillaJS, HTML5 Custom Elements
Would make it available to even wider audience...
Oruga version: [email protected]
Vuejs version: 3.0.7
OS/Browser: Windows 10 20H2 , Chrome 89.0.4389.82
When i'm using the datetimepicker, the timepicker is missing.
I'm using the inline exemple
This is main.ts :
import { Datepicker, Timepicker, Datetimepicker, Dropdown, Icon, Input, Table, Config } from "@oruga-ui/oruga-next";
const app = createApp(App as any);
app.use(router);
app.use(Icon);
app.use(Dropdown);
app.use(Datepicker);
app.use(Timepicker);
app.use(Datetimepicker);
app.use(Input);
app.use(Table);
app.use(Config, {
iconPack: "fas",
table: {
override: true,
iconPack: "fas",
tableClass: "table",
stripedClass: "table-striped",
hoverableClass: "table-hover",
sortIcon: "angle-up",
thSortableClass: "sortable",
mobileCards: true,
mobileClass: "mobile",
wrapperClass: "o-table-wrapper"
}
});
app.mount("#app");
To have the timepicker.
Thanks a lot.
Oruga version: [0.3.3]
Vuejs version: [2.6.12]
Nuxt version: [2.14.12]
I tried to update Oruga from version 0.2.2 to 0.3.3 but the class override features doesn't seem to work anymore.
I'm using Oruga inside a Nuxt project, and I tried both ways to import Oruga in the project: the plugin way and the module way.
At the moment I'm just doing:
button: {
override: true,
rootClass: 'my-button',
variantClass: 'my-button--',
disabledClass: 'my-button--disabled',
}
which is working just fine with version 0.2.2.
yarn create nuxt-app oruga-test
and choose Oruga as UI frameworkcd oruga-test
and start it yarn dev
0.3.3
To be able to override the classes of the components just as I did in the previous version.
Custom classes are not working.
Thank you very much
Oruga version: 0.3.5
Vuejs version: 2.x
OS/Browser: any
To switch tabs, Oruga use buttons without type="button" but this can cause issues when using tabs in a form. The form will be submitted everytime the user switch tabs, as by default button are from type="submit".
Use tabs in a form.
The form is not submitted when the active tab is changed.
The form is submitted when the active tab is changed.
Edit: I've made a PR to fix this: #120. This may not be the only impacted component though.
Oruga version: [0.3.5]
Vuejs version: [2.6.12]
OS/Browser: chrome
Sorted header doesnt showed up at first, when we use default-sort
prop
Set default-sort
on table
Sorted header work and arrow icon will showed up.
This is the reference https://buefy.org/documentation/table/#async-data.
vote count
header get sorted at first load, when we set default-sort
prop
Header sorted state not shown
When multiple select true, to select multiple options we need to use ctrl but it can better interface and In our real-life application, we need to select multiple options but here data can be vast. So here we need to use filter to search target option.
You can add this searching option in the search bar which can be a better option
Can someone please show me how to overwrite a variable?
For instance the $primary color ?
I'm using SCSS.
Thanks a lot!
Oruga version: [next]
Vuejs version: [3.0.1]
OS/Browser: chrome
The following error in console
dropdown.js?3f50:603 Uncaught (in promise) TypeError: this.$destroy is not a function
at Proxy.created (dropdown.js?3f50:603)
at callSyncHook (runtime-core.esm-bundler.js?5c40:5475)
at applyOptions (runtime-core.esm-bundler.js?5c40:5428)
at finishComponentSetup (runtime-core.esm-bundler.js?5c40:6050)
at setupStatefulComponent (runtime-core.esm-bundler.js?5c40:5986)
at setupComponent (runtime-core.esm-bundler.js?5c40:5926)
at mountComponent (runtime-core.esm-bundler.js?5c40:4207)
at processComponent (runtime-core.esm-bundler.js?5c40:4183)
at patch (runtime-core.esm-bundler.js?5c40:3788)
at mountChildren (runtime-core.esm-bundler.js?5c40:3996)
<template>
<div>
<o-dropdown aria-role="list">
<template v-slot:trigger>
<o-button variant="primary" >
<span>Click me!</span>
<o-icon icon="caret-down"></o-icon>
</o-button>
</template>
<o-dropdown-item aria-role="listitem">Action</o-dropdown-item>
<o-dropdown-item aria-role="listitem">Another action</o-dropdown-item>
<o-dropdown-item aria-role="listitem">Something else</o-dropdown-item>
</o-dropdown>
</div>
</template>
<script>
export default {}
</script>
Oruga version: [0.3.3]
Vuejs version: [2.6.12]
OS/Browser: Chrome
Cant change using scss variable
i'm using nuxt and import like this
import Vue from 'vue'
import Oruga from '@oruga-ui/oruga'
import '@oruga-ui/oruga/dist/oruga-full-vars.css'
Vue.use(Oruga)
then i created index.scss
file to customize. i can do it using css variable like this:
:root {
--oruga-pagination-margin: 1em;
}
but when i using scss variable, it wont work:
$pagination-margin: 1em;
How to override style using scss variable, there is no docs for this
https://oruga.io/documentation/#using-css-or-sass-scss-variables
On version 0.3.4, and I was using TailwindCSS on my project. No configuration, basically just install Oruga to test it
I was following Open Modal Clip Scroll
https://oruga.io/components/Modal.html#examples
But the modal is not showing. Nothing happen
When inspect the vue dev tools, the o-modal active already true
Oruga version: "@oruga-ui/oruga-next": "^0.2.2",
Vuejs version: 3.0.1
OS/Browser: windows
The sort event cannot be captured
<o-table
:mobileCards="false"
:data="data"
paginated
backend-pagination
:perPage="7"
:total="total"
backend-sorting
v-model:selected="selected"
v-model:currentPage="currentPage"
:paginationSimple="false"
:paginationPosition="'bottom'"
scrollable
stickyHeader
@sort="onSort"
@select="selectRow"
@page-change="pageChange"
>
The arrow icon on the column being sorted changes
and a console log message from function onSort() listening to @sort is seen when then sort order changes
this shows sort event has been fired.
I can see the arrow icon change but no console log message
For Vue2 it seems to be working properly
Oruga version: [0.3.3]
Vuejs version: [3.0.0]
OS/Browser:
Oruga uses default instead of custom Iconpack (working in Oruga version : 0.3.2)
A Custom Iconpack (mdi-Icons) is used.
The Icons are registered like that:
app.use(Oruga, {
iconComponent: 'icon-mdi',
iconPack: 'mdijs',
customIconPacks: {
mdijs: {
iconPrefix: 'mdi-',
},
},
});
app.component('icon-mdi', iconMdi);
in the Vue component the icons are used like this:
<o-icon icon="map-marker"></o-icon>
Icons from default are being loaded and not from the custom Iconpack.
Icons from Iconpack are being laoded.
When set horizontal and grouped on a o-field with a label, the child elements are not shown.
Also some other fixes related to this component.
<o-field grouped message="What do you want to search?">
<o-input placeholder="Search..."></o-input>
<o-button variant="primary">Search</o-button>
</o-field>
</section>
Hi,
Is it possible to add a prop to the table component in order add class on table
This is needed to manage the width of the columns with tailwindcss (table-auto, table-fixed)
Maybe also something is needed at th level to specify the width by tailwind class (w-32, w-1/3)
Thx,
Filip.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.