rails_design 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +20 -0
- data/README.md +18 -0
- data/Rakefile +18 -0
- data/app/assets/images/image-square.png +0 -0
- data/app/assets/images/logo.png +0 -0
- data/app/assets/javascripts/default_form/datetime.js +31 -0
- data/app/assets/javascripts/default_form/default_valid.js +101 -0
- data/app/assets/javascripts/default_form/field.js +33 -0
- data/app/assets/javascripts/default_form/index.js +9 -0
- data/app/assets/javascripts/default_form/valid_weui.js +17 -0
- data/app/assets/javascripts/rails_design/attachment.js +295 -0
- data/app/assets/javascripts/rails_design/cable.js +3 -0
- data/app/assets/javascripts/rails_design/dataset.js +39 -0
- data/app/assets/javascripts/rails_design/index.js +4 -0
- data/app/assets/javascripts/rails_design/stimulus.js +19 -0
- data/app/assets/javascripts/rails_design/turbo.js +35 -0
- data/app/assets/javascripts/stimulus_com/checkbox.js +77 -0
- data/app/assets/javascripts/stimulus_com/choice.js +18 -0
- data/app/assets/javascripts/stimulus_com/common.js +52 -0
- data/app/assets/javascripts/stimulus_com/count_down.js +27 -0
- data/app/assets/javascripts/stimulus_com/former.js +26 -0
- data/app/assets/javascripts/stimulus_com/hover.js +40 -0
- data/app/assets/javascripts/stimulus_com/index.js +58 -0
- data/app/assets/javascripts/stimulus_com/input.js +36 -0
- data/app/assets/javascripts/stimulus_com/menu.js +34 -0
- data/app/assets/javascripts/stimulus_com/modal.js +85 -0
- data/app/assets/javascripts/stimulus_com/modal_show.js +16 -0
- data/app/assets/javascripts/stimulus_com/navbar.js +11 -0
- data/app/assets/javascripts/stimulus_com/notice.js +10 -0
- data/app/assets/javascripts/stimulus_com/picture.js +85 -0
- data/app/assets/javascripts/stimulus_com/show.js +26 -0
- data/app/assets/javascripts/stimulus_com/showcase.js +34 -0
- data/app/assets/javascripts/stimulus_com/slide.js +188 -0
- data/app/assets/javascripts/stimulus_com/slide_y.js +189 -0
- data/app/assets/javascripts/stimulus_com/sortable.js +41 -0
- data/app/assets/javascripts/stimulus_com/sticky.js +11 -0
- data/app/assets/javascripts/stimulus_com/swipe.js +78 -0
- data/app/assets/javascripts/stimulus_com/taxon.js +45 -0
- data/app/assets/javascripts/stimulus_com/time.js +19 -0
- data/app/assets/javascripts/stimulus_com/touch.js +83 -0
- data/app/assets/javascripts/stimulus_com/tree.js +34 -0
- data/app/assets/javascripts/stimulus_com/tree_remote.js +64 -0
- data/app/assets/javascripts/stimulus_com/typer.js +41 -0
- data/app/assets/javascripts/stimulus_com/visit.js +61 -0
- data/app/assets/javascripts/stimulus_phone/index.js +19 -0
- data/app/assets/javascripts/stimulus_phone/qq_map.js +29 -0
- data/app/assets/javascripts/stimulus_phone/search.js +37 -0
- data/app/assets/javascripts/stimulus_phone/wechat.js +80 -0
- data/app/assets/javascripts/stimulus_phone/weui-actionsheet.js +43 -0
- data/app/assets/javascripts/stimulus_phone/weui-datepicker.js +38 -0
- data/app/assets/javascripts/stimulus_phone/weui-dialog.js +24 -0
- data/app/assets/javascripts/stimulus_phone/weui-picker.js +54 -0
- data/app/assets/javascripts/stimulus_phone/wxpay.js +29 -0
- data/app/assets/stylesheets/app.scss +3 -0
- data/app/assets/stylesheets/ext_bulma/base/_all.scss +5 -0
- data/app/assets/stylesheets/ext_bulma/base/_choices.scss +3 -0
- data/app/assets/stylesheets/ext_bulma/base/_global.scss +19 -0
- data/app/assets/stylesheets/ext_bulma/base/_main.scss +15 -0
- data/app/assets/stylesheets/ext_bulma/components/_all.scss +10 -0
- data/app/assets/stylesheets/ext_bulma/components/_box.scss +15 -0
- data/app/assets/stylesheets/ext_bulma/components/_breadcrumb.scss +17 -0
- data/app/assets/stylesheets/ext_bulma/components/_card.scss +12 -0
- data/app/assets/stylesheets/ext_bulma/components/_level.scss +8 -0
- data/app/assets/stylesheets/ext_bulma/components/_media.scss +14 -0
- data/app/assets/stylesheets/ext_bulma/components/_menu.scss +76 -0
- data/app/assets/stylesheets/ext_bulma/components/_pagination.scss +9 -0
- data/app/assets/stylesheets/ext_bulma/components/_panel.scss +5 -0
- data/app/assets/stylesheets/ext_bulma/elements/_all.scss +7 -0
- data/app/assets/stylesheets/ext_bulma/elements/_button.scss +14 -0
- data/app/assets/stylesheets/ext_bulma/elements/_fa.scss +4 -0
- data/app/assets/stylesheets/ext_bulma/elements/_image.scss +38 -0
- data/app/assets/stylesheets/ext_bulma/elements/_table.scss +52 -0
- data/app/assets/stylesheets/ext_bulma/elements/_title.scss +9 -0
- data/app/assets/stylesheets/ext_bulma/expand/_all.scss +2 -0
- data/app/assets/stylesheets/ext_bulma/expand/_slide.scss +26 -0
- data/app/assets/stylesheets/ext_bulma/expand/_sortable.scss +4 -0
- data/app/assets/stylesheets/ext_bulma/form/_all.scss +34 -0
- data/app/assets/stylesheets/ext_bulma/form/_checkbox.scss +267 -0
- data/app/assets/stylesheets/ext_bulma/form/_file.scss +23 -0
- data/app/assets/stylesheets/ext_bulma/form/_select.scss +5 -0
- data/app/assets/stylesheets/ext_bulma/form/_tools.scss +30 -0
- data/app/assets/stylesheets/ext_bulma/grid/_all.scss +3 -0
- data/app/assets/stylesheets/ext_bulma/grid/_columns.scss +13 -0
- data/app/assets/stylesheets/ext_bulma/helpers/_all.scss +5 -0
- data/app/assets/stylesheets/ext_bulma/helpers/_dot.scss +11 -0
- data/app/assets/stylesheets/ext_bulma/helpers/_drawable.scss +3 -0
- data/app/assets/stylesheets/ext_bulma/helpers/_grid.scss +10 -0
- data/app/assets/stylesheets/ext_bulma/index.scss +22 -0
- data/app/assets/stylesheets/ext_bulma/layout/_all.scss +4 -0
- data/app/assets/stylesheets/ext_bulma/layout/_footer.scss +4 -0
- data/app/assets/stylesheets/ext_bulma/layout/_level.scss +1 -0
- data/app/assets/stylesheets/ext_choices/index.scss +16 -0
- data/app/assets/stylesheets/ext_font/index.scss +4 -0
- data/app/assets/stylesheets/ext_weui/index.scss +24 -0
- data/app/assets/stylesheets/ext_weui/widget/_actionsheet.scss +3 -0
- data/app/assets/stylesheets/ext_weui/widget/_article.scss +7 -0
- data/app/assets/stylesheets/ext_weui/widget/_button.scss +7 -0
- data/app/assets/stylesheets/ext_weui/widget/_cell.scss +17 -0
- data/app/assets/stylesheets/ext_weui/widget/_form.scss +3 -0
- data/app/assets/stylesheets/ext_weui/widget/_half_screen_dialog.scss +10 -0
- data/app/assets/stylesheets/ext_weui/widget/_icon.scss +9 -0
- data/app/assets/stylesheets/ext_weui/widget/_media.scss +43 -0
- data/app/assets/stylesheets/ext_weui/widget/_panel.scss +4 -0
- data/app/assets/stylesheets/ext_weui/widget/_preview.scss +5 -0
- data/app/assets/stylesheets/ext_weui/widget/_search.scss +5 -0
- data/app/assets/stylesheets/ext_weui/widget/_tab.scss +10 -0
- data/app/assets/stylesheets/ext_weui/widget/_tabbar.scss +12 -0
- data/app/assets/stylesheets/ext_weui/widget/_uploader.scss +14 -0
- data/app/assets/stylesheets/phone.scss +6 -0
- data/app/assets/stylesheets/slide/index.scss +208 -0
- data/app/assets/stylesheets/ui_tooltip/_mixins.scss +46 -0
- data/app/assets/stylesheets/ui_tooltip/_variables.scss +5 -0
- data/app/assets/stylesheets/ui_tooltip/index.scss +278 -0
- data/app/controllers/design/base_controller.rb +4 -0
- data/app/controllers/design/home_controller.rb +13 -0
- data/app/views/design/home/swipe.html.erb +7 -0
- data/app/views/layouts/ui/base.html.erb +5 -0
- data/config/routes.rb +11 -0
- data/lib/rails_design/config.rb +8 -0
- data/lib/rails_design/engine.rb +5 -0
- data/lib/rails_design.rb +2 -0
- metadata +181 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Controller } from '@hotwired/stimulus'
|
|
2
|
+
|
|
3
|
+
export default class extends Controller {
|
|
4
|
+
static targets = ['dialog']
|
|
5
|
+
|
|
6
|
+
connect() {
|
|
7
|
+
console.debug('connected:', this.identifier)
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
close() {
|
|
11
|
+
let ele = this.element
|
|
12
|
+
ele.style.display = 'none'
|
|
13
|
+
ele.style.opacity = 0
|
|
14
|
+
ele.style.transition = 'opacity 2s'
|
|
15
|
+
this.dialogTarget.classList.remove('weui-half-screen-dialog_show')
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
show() {
|
|
19
|
+
let ele = this.element
|
|
20
|
+
ele.style.display = 'block'
|
|
21
|
+
ele.style.opacity = 1
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Controller } from '@hotwired/stimulus'
|
|
2
|
+
import weui from 'weui.js'
|
|
3
|
+
|
|
4
|
+
export default class extends Controller {
|
|
5
|
+
static values = {
|
|
6
|
+
id: String,
|
|
7
|
+
url: String
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
connect() {
|
|
11
|
+
console.debug('connected:', this.identifier)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// focus->weui-picker#getData
|
|
15
|
+
getData(event) {
|
|
16
|
+
document.activeElement.blur() // disable input
|
|
17
|
+
let ele = event.currentTarget
|
|
18
|
+
|
|
19
|
+
fetch(this.urlValue, {
|
|
20
|
+
method: 'GET',
|
|
21
|
+
headers: {
|
|
22
|
+
Accept: 'application/json'
|
|
23
|
+
}
|
|
24
|
+
}).then(response => {
|
|
25
|
+
return response.json()
|
|
26
|
+
}).then(body => {
|
|
27
|
+
this.picker(body, ele)
|
|
28
|
+
})
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
picker(data, ele) {
|
|
32
|
+
weui.picker(data.values, {
|
|
33
|
+
id: data.default.join('_'),
|
|
34
|
+
title: '多列选择器',
|
|
35
|
+
defaultValue: data.default,
|
|
36
|
+
depth: 3,
|
|
37
|
+
onChange: result => {
|
|
38
|
+
console.log('changed', result)
|
|
39
|
+
},
|
|
40
|
+
onConfirm: result => {
|
|
41
|
+
let val = result[result.length - 1]
|
|
42
|
+
let names = result.map(item => {
|
|
43
|
+
return item.label
|
|
44
|
+
})
|
|
45
|
+
console.debug('Val', val)
|
|
46
|
+
document.getElementById(this.idValue).value = val.value
|
|
47
|
+
ele.value = names.join(' ')
|
|
48
|
+
},
|
|
49
|
+
onClose: () => {
|
|
50
|
+
}
|
|
51
|
+
})
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Controller } from '@hotwired/stimulus'
|
|
2
|
+
|
|
3
|
+
export default class extends Controller {
|
|
4
|
+
static values = {
|
|
5
|
+
params: Object
|
|
6
|
+
}
|
|
7
|
+
static targets = ['load']
|
|
8
|
+
|
|
9
|
+
connect() {
|
|
10
|
+
console.debug('connected:', this.identifier)
|
|
11
|
+
this.chooseWXPay()
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
chooseWXPay() {
|
|
15
|
+
wx.ready(() => {
|
|
16
|
+
wx.chooseWXPay({
|
|
17
|
+
...this.paramsValue,
|
|
18
|
+
success: (res) => {
|
|
19
|
+
console.log(res)
|
|
20
|
+
this.loadTarget.style.removeProperty('display')
|
|
21
|
+
},
|
|
22
|
+
error: (e) => {
|
|
23
|
+
alert(e)
|
|
24
|
+
}
|
|
25
|
+
})
|
|
26
|
+
})
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
.as-tooltip {
|
|
2
|
+
position: absolute;
|
|
3
|
+
bottom: 100%;
|
|
4
|
+
min-width: max-content;
|
|
5
|
+
z-index: 1;
|
|
6
|
+
.as-tooltip-arrow {
|
|
7
|
+
width: 0;
|
|
8
|
+
height: 0;
|
|
9
|
+
position: relative;
|
|
10
|
+
border-left: 7px solid transparent;
|
|
11
|
+
border-right: 7px solid transparent;
|
|
12
|
+
border-top: 7px solid #000;
|
|
13
|
+
box-shadow: 1px 1px;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
.breadcrumb {
|
|
2
|
+
border-bottom: solid 1px rgba(34, 36, 38, .1);
|
|
3
|
+
padding-bottom: .5em;
|
|
4
|
+
|
|
5
|
+
&:not(:last-child) {
|
|
6
|
+
margin-bottom: 0.75em;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
li {
|
|
10
|
+
&.is-active::before {
|
|
11
|
+
padding-right: 0.75em;
|
|
12
|
+
}
|
|
13
|
+
&:empty + li::before {
|
|
14
|
+
display: none;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
.ex-accordion {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
padding: 0;
|
|
5
|
+
color: grey;
|
|
6
|
+
.menu-label {
|
|
7
|
+
order: 1;
|
|
8
|
+
font-size: 1em;
|
|
9
|
+
display: block;
|
|
10
|
+
margin-top: 0;
|
|
11
|
+
margin-bottom: 0;
|
|
12
|
+
padding: 1em 1.5em;
|
|
13
|
+
.dropdown {
|
|
14
|
+
float: right;
|
|
15
|
+
line-height: 1.5;
|
|
16
|
+
}
|
|
17
|
+
.dropdown:before {
|
|
18
|
+
content: '\f0d9';
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
.menu-list {
|
|
22
|
+
order: 2;
|
|
23
|
+
display: none;
|
|
24
|
+
padding-top: .5em;
|
|
25
|
+
padding-left: 1.5em;
|
|
26
|
+
a {
|
|
27
|
+
font-size: .9em;
|
|
28
|
+
}
|
|
29
|
+
a.is-active,
|
|
30
|
+
a:hover {
|
|
31
|
+
background-color: initial;
|
|
32
|
+
font-weight: bold;
|
|
33
|
+
}
|
|
34
|
+
&:empty + .menu-label {
|
|
35
|
+
display: none;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
&.is-active {
|
|
39
|
+
.menu-label {
|
|
40
|
+
border-bottom: none;
|
|
41
|
+
padding-bottom: 0;
|
|
42
|
+
.dropdown:before {
|
|
43
|
+
content: '\f0d7';
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
.menu-list {
|
|
47
|
+
display: block;
|
|
48
|
+
border-bottom: solid 1px rgba(34, 36, 38, .1);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.menu {
|
|
54
|
+
@each $name, $pair in $colors {
|
|
55
|
+
$color: nth($pair, 1);
|
|
56
|
+
$color-invert: nth($pair, 2);
|
|
57
|
+
&.is-#{$name} {
|
|
58
|
+
background-color: $color;
|
|
59
|
+
.menu-label {
|
|
60
|
+
border-bottom: solid 1px $color;
|
|
61
|
+
color: $color-invert;
|
|
62
|
+
}
|
|
63
|
+
.menu-list {
|
|
64
|
+
a {
|
|
65
|
+
color: $color-invert;
|
|
66
|
+
}
|
|
67
|
+
&:hover {
|
|
68
|
+
color: $color-invert;
|
|
69
|
+
}
|
|
70
|
+
&.is-active {
|
|
71
|
+
color: $color-invert;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
.images {
|
|
2
|
+
.image + .image {
|
|
3
|
+
margin-left: 1em;
|
|
4
|
+
}
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.image {
|
|
8
|
+
&.is-border {
|
|
9
|
+
border: solid 1px red;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
&.is-flex-item {
|
|
13
|
+
display: inline-block;
|
|
14
|
+
vertical-align: middle;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
figure.is-flex {
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-flow: column;
|
|
21
|
+
margin: auto;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
figure.image {
|
|
25
|
+
background-color: white;
|
|
26
|
+
opacity: 1;
|
|
27
|
+
|
|
28
|
+
figcaption {
|
|
29
|
+
background-color: #666;
|
|
30
|
+
color: #fff;
|
|
31
|
+
padding: 3px;
|
|
32
|
+
text-align: center;
|
|
33
|
+
}
|
|
34
|
+
img, video {
|
|
35
|
+
height: inherit;
|
|
36
|
+
object-fit: contain;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
.table {
|
|
2
|
+
&.is-border {
|
|
3
|
+
border: solid 1px $border;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
thead th, td {
|
|
7
|
+
border-bottom-width: 1px;
|
|
8
|
+
}
|
|
9
|
+
tfoot td, th {
|
|
10
|
+
border-top-width: 1px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
tbody + tbody {
|
|
14
|
+
tr:first-child td,
|
|
15
|
+
tr:last-child th {
|
|
16
|
+
border-top-width: 1px;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
th, td {
|
|
21
|
+
vertical-align: middle;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&.as-show {
|
|
25
|
+
td:first-child {
|
|
26
|
+
width: 33%;
|
|
27
|
+
}
|
|
28
|
+
tbody td:first-child::after {
|
|
29
|
+
content: ':';
|
|
30
|
+
padding-left: .25em;
|
|
31
|
+
color: #888;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
table.as-search {
|
|
37
|
+
th, td {
|
|
38
|
+
padding: 0 .5em .75em 0;
|
|
39
|
+
vertical-align: middle;
|
|
40
|
+
}
|
|
41
|
+
th {
|
|
42
|
+
text-align: right;
|
|
43
|
+
white-space: nowrap;
|
|
44
|
+
}
|
|
45
|
+
th::after {
|
|
46
|
+
content: ':';
|
|
47
|
+
color: #888;
|
|
48
|
+
}
|
|
49
|
+
td {
|
|
50
|
+
width: 100%;
|
|
51
|
+
}
|
|
52
|
+
}
|