datdotorg / datdot-ui Goto Github PK
View Code? Open in Web Editor NEWdatdot-ui is now a datdot-ui organization
datdot-ui is now a datdot-ui organization
@todo
datdot-ui#144
wireframe-plan-dashboard-map"plan card"
instead"world map"
to highlight regions.@todo
@output
❓ repository
v0.0.1-alpha
@input
❓ repository
v0.0.1-alpha
)@input
❓ wireframes action bars
opts
roles
incoming message types
outgoing message types
status
the component instance can be in@output
❓ repo#readme.md
@output
❓ repo_url#v0.0.1-alpha
@info
@todo
@output
❓ repository
v0.0.1-alpha
@input
❓ repository
v0.0.1-alpha
)@input
❓ wireframes action bars
opts
roles
incoming message types
outgoing message types
status
the component instance can be in@output
❓ repo#readme.md
@output
❓ repo_url#v0.0.1-alpha
@info
...
@todo
@output
❓ repository
v0.0.1-alpha
@input
❓ repository
v0.0.1-alpha
)@input
❓ wireframes action bars
opts
roles
incoming message types
outgoing message types
status
the component instance can be in@output
❓ repo#readme.md
@output
❓ repo_url#v0.0.1-alpha
@info
@todo
datdot-ui#143
wireframe-plan-dashboard-performance-chartRAM
, CPU
, HDD
, download
, upload
, price
@todo
pnpm link --global
(to make them available)pnpm link --global <./package.json#name>
@output
📦 repository
v0.0.0-prealpha
@input
📦 repository
@output
📦 v0.0.0-prealpha
v0.0.0-alpha
@input
📦 v0.0.0-prealpha
@output
📦 v0.0.0-alpha
v0.0.1-alpha
@input
📦 v0.0.0-alpha
@output
📦 v0.0.1-alpha
v0.0.2-alpha
@input
📦 v0.0.1-alpha
messages
and status
and update documentationopts
roles
incoming message types
outgoing message types
status
the component instance can be in@output
📦 README.md@output
📦 v0.0.2-alpha
@input
📦 v0.0.2-alpha
@output
📦 repository#v0.0.3-alpha
@input
📦 v0.0.3-alpha
@output
📦 repository#v0.0.4-alpha
@info
@todo
pnpm link --global
(to make them available)pnpm link --global <./package.json#name>
@output
📦 repository
v0.0.1.-alpha
@input
📦 repository
@output
📦 v0.0.1-alpha
@input
📦 v0.0.1-alpha
@output
🏭 v0.0.3-alpha
v0.0.4-alpha
@input
📦 v0.0.3-alpha
opts
incoming message types
outgoing message types
@output
📦 v0.0.4-alpha
@info
@todo
pnpm link --global
(to make them available)pnpm link --global <./package.json#name>
@output
📦 repository
v0.0.0-prealpha
@input
📦 repository
@output
📦 v0.0.0-prealpha
v0.0.0-alpha
@input
📦 v0.0.0-prealpha
@output
📦 v0.0.0-alpha
v0.0.1-alpha
@input
📦 v0.0.0-alpha
@output
❓ v0.0.1-alpha
@input
📦 v0.0.2-alpha
@output
❓ repository#v0.0.3-alpha
v0.0.4-alpha
@input
❓ v0.0.3-alpha
@output
📦 README.md@output
📦 v0.0.4-alpha@info
https://github.com/datdotorg/datdot-ui-button
https://github.com/datdot-ui/link
@todo
@todo
@todo
pnpm link --global
(to make them available)pnpm link --global <./package.json#name>
@output
📦 repository
v0.0.0-prealpha
@output
📦 repository
@output
📦 v0.0.0-prealpha
v0.0.1-alpha
@input
📦 v0.0.0-prealpha
@output
📦 v0.0.1-alpha
@input
📦 v0.0.2-alpha
@output
❓ repository#v0.0.3-alpha
v0.0.4-alpha
@input
📦 v0.0.3-alpha
messages
and status
and update documentation@input
❓ wireframes action bars
opts
roles
incoming message types
outgoing message types
status
the component instance can be in@output
❓ v0.0.4-alpha
@info
THIS ELEMENT has been merged with the dropdown #71
// datdot-ui-filter
require('datdot-ui-button')
https://github.com/datdot-ui/filter
https://github.com/datdotorg/datdot-ui-filter-option
let optionList = { unchecked: [], checked: ['Available', 'Not available', 'Hypercore', 'Hyperdrive', 'Cabal']}
Option button
const option = filterOption({page, flow, name: 'filter-option', data: optionList.checked}, optionProtocol('filter-option'))
function optionProtocol (name) {
....
....
// get type 'unchecked' or 'checked' to check from and currentValue are equality.
if (type === 'unchecked') {
// handle chekced status
const result = optionList.checked.reduce( (acc, currentValue) => {
if (from === currentValue) {
const index = optionList.checked.indexOf(from)
optionList.unchecked.push(from)
optionList.checked.splice(index, 1)
}
acc = optionList.checked
return acc
}, [])
if (type === 'checked') {
// handle unchecked status
const result = optionList.unchecked.reduce( (acc, currentValue) => {
if (from === currentValue) {
const index = optionList.unchecked.indexOf(from)
optionList.checked.push(from)
optionList.unchecked.splice(index, 1)
}
acc = optionList.checked
return acc
}, [])
This code line is an issue to cause compare failed on Safari
from === currentValue
even change ===
to ==
is failed too
option == from
Even I do console.log(typeof from, typeof currentValue)
This is what've I got
I've tried many ways with different pattern in JavaScript
let optionList = { unchecked: [], checked: ['Available', 'Not available', 'Hypercore', 'Hyperdrive', 'Cabal']}
optionList.checked.findIndex( option => option === from ) // -1
optionList.splice( optionList.checked.indexOf(from), 1) // it is worked fine in Codepen.io
const data = [
{id: 1, status: "Available", active: true},
{id: 2, status: "Not available", active: false},
{id: 3, status: "Hypercore", active: true},
{id: 4, status: "Hyperdrive", active: false},
{id: 5, status: "Cabal", active: true}
]
src/index.js
// get lits
optionListRender(data).then( buttons => {
buttons.map( (item, i) => {
const li = bel`<li>${item}</li>`
// need to set an id to button for toggle using, because Safari cannot compare body or from (string issue)
item.setAttribute('id', i+1)
optionList.append(li)
})
return buttons
})
demo/demo.js
function actionToggleCheck (message) {
...
...
data.map( item => {
// * better to use return item for add more conditions
if (item.id === body ) item.active = !item.active
return item
})
It is still failed when I refactored the data structure and test again via item.status
and body
typeof item.status
and typeof body
are all string, somehow it is failed to compare string in Safari.
item.status.localeCompare(body)
is also return -1
, only 0
is matched
Use regex.test(string) to compare from existed array instead of comparing string by from to fix issue on Safari
let options = optionList.map( item => {
// * better to use return item for add more conditions
if (item.id === body ) item.active = !item.active
if (/^Available/.test(item.status) && item.active ) on = online(data)
if (/^Not available/.test(item.status) && item.active ) off = offline(data)
return item
}).map( item => {
if (/core/i.test(item.status) && item.active) {
let arr = data.filter( obj => /core/i.test(obj.type))
return result.push(...arr)
}
if (/drive/i.test(item.status) && item.active) {
let arr = data.filter( obj => /drive/i.test(obj.type))
return result.push(...arr)
}
if (/cabal/i.test(item.status) && item.active) {
let arr = data.filter( obj => /cabal/i.test(obj.type))
return result.push(...arr)
}
return item
})
@todo
@todo
pnpm link --global
(to make them available)pnpm link --global <./package.json#name>
@output
🏭 repository
v0.0.0-alpha
@input
🏭 repository
@output
🏭 v0.0.0-alpha
v0.0.1-alpha
@input
🏭 v0.0.0-alpha
@output
🏭 v0.0.1-alpha
v0.0.4-alpha
@input
🏭 v0.0.1-alpha
messages
and status
and update documentationopts
incoming message types
outgoing message types
@output
🏭 v0.0.4-alpha
@input
🏭 v0.0.4-alpha
@input
❓ wireframes action bars
@info
@todo
General UI Components
Screens
devtool components
@info
@todo
pnpm link --global
(to make them available)pnpm link --global <./package.json#name>
@output
📦 repository
v0.0.0-alpha
@input
📦 repository
@output
🏭 v0.0.0-alpha
v0.0.1-alpha
@input
🏭 v0.0.0-alpha
@output
🏭 v0.0.1-alpha
v0.0.2-alpha
@input
🏭 v0.0.1-alpha
messages
and status
and update documentation@input
❓ wireframes action bars
opts
roles
incoming message types
outgoing message types
status
the component instance can be in@output
🏭 v0.0.2-alpha
@info
@todo
pnpm link --global
(to make them available)pnpm link --global <./package.json#name>
@output
📦 repository
v0.0.0-prealpha
@output
📦 repository
@output
📦 v0.0.0-prealpha
v0.0.1-alpha
@input
📦 v0.0.0-prealpha
@output
📦 v0.0.1-alpha
@input
📦 v0.0.2-alpha
@output
❓ repository#v0.0.3-alpha
v0.0.4-alpha
@input
📦 v0.0.3-alpha
keyup
changes valueArrowRight
, ArrowUp
and decrease number by ArrowLeft
, ArrowDown
shiftKey
+ ArrowRight
or ArrowUp
shiftKey
+ ArrowLeft
or ArrowDown
messages
and status
and update documentation@input
❓ wireframes action bars
opts
roles
incoming message types
outgoing message types
status
the component instance can be in@output
🏭 README.md@output
❓ v0.0.4-alpha
@info
https://github.com/datdotorg/datdot-ui-range-slider
(by @fionataeyang)
@todo
@todo
pnpm link --global
(to make them available)pnpm link --global <./package.json#name>
@output
📦 repository
v0.0.1-alpha
@input
📦 repository
@output
📦 v0.0.1-alpha
@input
📦 v0.0.2-alpha
@output
❓ repository#v0.0.3-alpha
v0.0.4-alpha
@input
📦 v0.0.3-alpha
messages
and status
and update documentation@input
❓ wireframes action bars
opts
roles
incoming message types
outgoing message types
status
the component instance can be in
@output
🏭 README.md@output
🏭 v0.0.4-alpha
@info
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.