headmin 0.3.4 → 0.4.2
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 +4 -4
- data/.github/workflows/ci.yml +27 -0
- data/.gitignore +14 -0
- data/.lock-487e157d270f3062a98b7b2a012753708-1272821827 +0 -0
- data/.nvmrc +1 -0
- data/CHANGELOG.md +31 -0
- data/Gemfile +7 -4
- data/Gemfile.lock +191 -25
- data/README.md +7 -0
- data/Rakefile +1 -7
- data/app/assets/javascripts/headmin/config/i18n.js +9 -9
- data/app/assets/javascripts/headmin/controllers/autocomplete_controller.js +318 -0
- data/app/assets/javascripts/headmin/controllers/blocks_controller.js +74 -79
- data/app/assets/javascripts/headmin/controllers/date_range_controller.js +24 -24
- data/app/assets/javascripts/headmin/controllers/dropzone_controller.js +23 -25
- data/app/assets/javascripts/headmin/controllers/file_preview_controller.js +237 -237
- data/app/assets/javascripts/headmin/controllers/filter_controller.js +44 -44
- data/app/assets/javascripts/headmin/controllers/filters_controller.js +57 -61
- data/app/assets/javascripts/headmin/controllers/flatpickr_controller.js +29 -29
- data/app/assets/javascripts/headmin/controllers/hello_controller.js +3 -3
- data/app/assets/javascripts/headmin/controllers/notification_controller.js +7 -6
- data/app/assets/javascripts/headmin/controllers/popup_controller.js +57 -51
- data/app/assets/javascripts/headmin/controllers/redactorx_controller.js +36 -9
- data/app/assets/javascripts/headmin/controllers/repeater_controller.js +122 -125
- data/app/assets/javascripts/headmin/controllers/select_controller.js +40 -39
- data/app/assets/javascripts/headmin/controllers/table_actions_controller.js +100 -101
- data/app/assets/javascripts/headmin/controllers/table_controller.js +115 -115
- data/app/assets/javascripts/headmin/index.js +38 -35
- data/app/assets/javascripts/headmin.js +295 -37
- data/app/assets/stylesheets/headmin/forms/autocomplete.scss +21 -0
- data/app/assets/stylesheets/headmin/forms/file.scss +46 -0
- data/app/assets/stylesheets/headmin/forms/repeater.scss +62 -0
- data/app/assets/stylesheets/headmin/forms/search.scss +12 -0
- data/app/assets/stylesheets/headmin/forms.scss +11 -0
- data/app/assets/stylesheets/headmin/general.scss +14 -0
- data/app/assets/stylesheets/headmin/overrides/bootstrap.scss +5 -3
- data/app/assets/stylesheets/headmin/overrides/redactorx.scss +74 -0
- data/app/assets/stylesheets/headmin/popup.scss +1 -0
- data/app/assets/stylesheets/headmin/syntax.scss +36 -349
- data/app/assets/stylesheets/headmin/table.scss +1 -1
- data/app/assets/stylesheets/headmin/utilities/buttons.scss +19 -0
- data/app/assets/stylesheets/headmin/utilities/dropzone.scss +72 -0
- data/app/assets/stylesheets/headmin/utilities.scss +2 -68
- data/app/assets/stylesheets/headmin.css +209 -205
- data/app/assets/stylesheets/headmin.scss +1 -1
- data/app/helpers/headmin/admin_helper.rb +0 -1
- data/app/helpers/headmin/form_helper.rb +2 -8
- data/app/models/concerns/headmin/blockable.rb +1 -1
- data/app/models/concerns/headmin/field.rb +4 -1
- data/app/models/concerns/headmin/fieldable.rb +138 -44
- data/app/models/concerns/headmin/form/autocompletable.rb +38 -0
- data/app/models/concerns/headmin/form/hintable.rb +19 -0
- data/app/models/concerns/headmin/form/input_groupable.rb +23 -0
- data/app/models/concerns/headmin/form/labelable.rb +33 -0
- data/app/models/concerns/headmin/form/listable.rb +28 -0
- data/app/models/concerns/headmin/form/placeholderable.rb +13 -0
- data/app/models/concerns/headmin/form/validatable.rb +40 -0
- data/app/models/concerns/headmin/form/wrappable.rb +21 -0
- data/app/models/headmin/.DS_Store +0 -0
- data/app/models/headmin/blocks_view.rb +15 -0
- data/app/models/headmin/form/blocks_view.rb +29 -0
- data/app/models/headmin/form/checkbox_view.rb +52 -0
- data/app/models/headmin/form/date_range_view.rb +25 -0
- data/app/models/headmin/form/date_view.rb +45 -0
- data/app/models/headmin/form/email_view.rb +48 -0
- data/app/models/headmin/form/file_view.rb +116 -0
- data/app/models/headmin/form/flatpickr_range_view.rb +102 -0
- data/app/models/headmin/form/flatpickr_view.rb +37 -0
- data/app/models/headmin/form/hidden_view.rb +10 -0
- data/app/models/headmin/form/hint_view.rb +6 -0
- data/app/models/headmin/form/input_group_view.rb +19 -0
- data/app/models/headmin/form/label_view.rb +24 -0
- data/app/models/headmin/form/number_view.rb +49 -0
- data/app/models/headmin/form/password_view.rb +44 -0
- data/app/models/headmin/form/redactorx_view.rb +59 -0
- data/app/models/headmin/form/search_view.rb +48 -0
- data/app/models/headmin/form/select_view.rb +62 -0
- data/app/models/headmin/form/switch_view.rb +23 -0
- data/app/models/headmin/form/text_view.rb +48 -0
- data/app/models/headmin/form/textarea_view.rb +44 -0
- data/app/models/headmin/form/url_view.rb +48 -0
- data/app/models/headmin/form/wrapper_view.rb +19 -0
- data/app/models/headmin/form/wysiwyg_view.rb +17 -0
- data/app/models/headmin/{thumbnail.rb → thumbnail_view.rb} +6 -1
- data/app/models/view_model.rb +58 -0
- data/app/views/headmin/_blocks.html.erb +13 -9
- data/app/views/headmin/_heading.html.erb +7 -1
- data/app/views/headmin/_thumbnail.html.erb +1 -37
- data/app/views/headmin/forms/_autocomplete.html.erb +11 -0
- data/app/views/headmin/forms/_blocks.html.erb +16 -17
- data/app/views/headmin/forms/_checkbox.html.erb +24 -29
- data/app/views/headmin/forms/_datalist.html.erb +3 -0
- data/app/views/headmin/forms/_date.html.erb +24 -24
- data/app/views/headmin/forms/_date_range.html.erb +19 -21
- data/app/views/headmin/forms/_email.html.erb +27 -32
- data/app/views/headmin/forms/_errors.html.erb +2 -3
- data/app/views/headmin/forms/_file.html.erb +84 -181
- data/app/views/headmin/forms/_flatpickr.html.erb +19 -20
- data/app/views/headmin/forms/_flatpickr_range.html.erb +28 -37
- data/app/views/headmin/forms/_hidden.html.erb +9 -10
- data/app/views/headmin/forms/_hint.html.erb +16 -0
- data/app/views/headmin/forms/_input_group.html.erb +21 -0
- data/app/views/headmin/forms/_label.html.erb +5 -13
- data/app/views/headmin/forms/_number.html.erb +23 -35
- data/app/views/headmin/forms/_password.html.erb +21 -30
- data/app/views/headmin/forms/_redactorx.html.erb +21 -40
- data/app/views/headmin/forms/_repeater.html.erb +55 -60
- data/app/views/headmin/forms/_search.html.erb +43 -0
- data/app/views/headmin/forms/_select.html.erb +24 -49
- data/app/views/headmin/forms/_switch.html.erb +29 -0
- data/app/views/headmin/forms/_text.html.erb +42 -96
- data/app/views/headmin/forms/_textarea.html.erb +21 -32
- data/app/views/headmin/forms/_url.html.erb +26 -31
- data/app/views/headmin/forms/_validation.html.erb +10 -13
- data/app/views/headmin/forms/_wrapper.html.erb +9 -0
- data/app/views/headmin/forms/_wysiwyg.html.erb +28 -0
- data/app/views/headmin/forms/autocomplete/_item.html.erb +3 -0
- data/app/views/headmin/forms/autocomplete/_list.html.erb +3 -0
- data/app/views/headmin/forms/fields/_file.html.erb +1 -1
- data/app/views/headmin/forms/fields/_files.html.erb +17 -0
- data/app/views/headmin/forms/fields/_group.html.erb +9 -2
- data/app/views/headmin/forms/repeater/_row.html.erb +4 -4
- data/bin/console +0 -1
- data/config/locales/headmin/forms/en.yml +1 -12
- data/config/locales/headmin/forms/nl.yml +1 -12
- data/esbuild-css.js +18 -18
- data/esbuild-js.js +8 -8
- data/headmin.gemspec +1 -3
- data/lib/generators/templates/controllers/auth/confirmations_controller.rb +0 -2
- data/lib/generators/templates/controllers/auth/omniauth_callbacks_controller.rb +0 -2
- data/lib/generators/templates/controllers/auth/passwords_controller.rb +0 -2
- data/lib/generators/templates/controllers/auth/registrations_controller.rb +0 -2
- data/lib/generators/templates/controllers/auth/sessions_controller.rb +0 -2
- data/lib/generators/templates/controllers/auth/unlocks_controller.rb +0 -2
- data/lib/headmin/version.rb +1 -3
- data/lib/headmin.rb +0 -2
- data/package-lock.json +5359 -0
- data/package.json +12 -4
- data/view_model_benchmark.rb +74 -0
- data/yarn-error.log +17 -12
- data/yarn.lock +1575 -31
- metadata +64 -25
- data/app/assets/stylesheets/headmin/form.scss +0 -132
- data/app/assets/stylesheets/headmin/overrides/redactorx.css +0 -3
- data/app/helpers/headmin/documentation_helper.rb +0 -35
- data/app/models/headmin/documentation_renderer.rb +0 -32
- data/app/models/headmin/form/base.rb +0 -78
- data/app/models/headmin/form/text.rb +0 -51
- data/app/services/block_service.rb +0 -72
- data/app/views/headmin/_card.html.erb +0 -52
- data/app/views/headmin/forms/_actions.html.erb +0 -28
- data/app/views/headmin/forms/_base.html.erb +0 -114
- data/app/views/headmin/forms/_image.html.erb +0 -21
- data/app/views/headmin/forms/_video.html.erb +0 -21
- data/app/views/headmin/forms/actions/_destroy.html.erb +0 -13
- data/app/views/headmin/forms/actions/_save.html.erb +0 -12
- data/app/views/headmin/forms/actions/_view.html.erb +0 -15
- data/app/views/headmin/forms/fields/_image.html.erb +0 -17
- data/docs/blocks-and-fields.md +0 -54
- data/docs/blocks.md +0 -48
- data/docs/devise.md +0 -41
- data/docs/fields.md +0 -79
data/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "headmin",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.4.1",
|
4
4
|
"description": "Admin component library",
|
5
5
|
"module": "app/assets/javascripts/headmin.js",
|
6
6
|
"main": "app/assets/javascripts/headmin.js",
|
@@ -27,16 +27,24 @@
|
|
27
27
|
"bootstrap": "^5.1.3",
|
28
28
|
"flatpickr": "^4.6.9",
|
29
29
|
"sortablejs": "^1.14.0",
|
30
|
-
"tom-select": "^2.0.0"
|
30
|
+
"tom-select": "^2.0.0",
|
31
|
+
"yarn": "^1.22.18"
|
31
32
|
},
|
32
33
|
"devDependencies": {
|
33
34
|
"esbuild": "^0.14.11",
|
34
|
-
"esbuild-sass-plugin": "^2.0.3"
|
35
|
+
"esbuild-sass-plugin": "^2.0.3",
|
36
|
+
"standard": "^16.0.4"
|
37
|
+
},
|
38
|
+
"standard": {
|
39
|
+
"ignore": [
|
40
|
+
"headmin.js"
|
41
|
+
]
|
35
42
|
},
|
36
43
|
"scripts": {
|
44
|
+
"lint": "standard --fix",
|
37
45
|
"build:css": "node esbuild-css.js",
|
38
46
|
"build:js": "node esbuild-js.js",
|
39
|
-
"build": "yarn build:css
|
47
|
+
"build": "yarn lint && yarn build:css && yarn build:js",
|
40
48
|
"watch:css": "node esbuild-css.js -w",
|
41
49
|
"watch:js": "node esbuild-js.js -w",
|
42
50
|
"watch": "yarn watch:css & yarn watch:js",
|
@@ -0,0 +1,74 @@
|
|
1
|
+
require_relative "app/models/view_model"
|
2
|
+
require "ostruct"
|
3
|
+
require "benchmark"
|
4
|
+
|
5
|
+
COUNT = 1_000_000
|
6
|
+
NAME = "Test Name"
|
7
|
+
EMAIL = "test@example.org"
|
8
|
+
|
9
|
+
class Person
|
10
|
+
attr_accessor :name, :email
|
11
|
+
end
|
12
|
+
|
13
|
+
class PersonView < ViewModel
|
14
|
+
end
|
15
|
+
|
16
|
+
PersonStruct = Struct.new(:name, :email)
|
17
|
+
|
18
|
+
Benchmark.bm(13) do |x|
|
19
|
+
x.report("class") do
|
20
|
+
COUNT.times do
|
21
|
+
p = Person.new
|
22
|
+
p.name = NAME
|
23
|
+
p.email = EMAIL
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
x.report("view_model") do
|
28
|
+
COUNT.times do
|
29
|
+
PersonView.new(name: NAME, email: EMAIL)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
x.report("hash") do
|
34
|
+
COUNT.times do
|
35
|
+
{name: NAME, email: EMAIL}
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
x.report("struct") do
|
40
|
+
COUNT.times do
|
41
|
+
p = PersonStruct.new
|
42
|
+
p.name = NAME
|
43
|
+
p.email = EMAIL
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
x.report("openstruct") do
|
48
|
+
COUNT.times do
|
49
|
+
p = OpenStruct.new
|
50
|
+
p.name = NAME
|
51
|
+
p.email = EMAIL
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
# Date: 17/02/2022:
|
57
|
+
# Setup: 2,6 GHz 6-core Intel Core i7, 32GB 2400 MHz DDR4
|
58
|
+
#
|
59
|
+
# user system total real
|
60
|
+
# class 0.169072 0.000539 0.169611 ( 0.169697)
|
61
|
+
# view_model 0.929992 0.006090 0.936082 ( 0.941641)
|
62
|
+
# hash 0.119616 0.001091 0.120707 ( 0.120952)
|
63
|
+
# struct 0.214027 0.000405 0.214432 ( 0.214613)
|
64
|
+
# openstruct 17.307242 0.033848 17.341090 ( 17.347235)
|
65
|
+
|
66
|
+
# Date: 24/02/2022:
|
67
|
+
# Setup: Apple M1 Pro, 32GB LPDDR5
|
68
|
+
#
|
69
|
+
# user system total real
|
70
|
+
# class 0.096301 0.001296 0.097597 ( 0.097740)
|
71
|
+
# view_model 0.437532 0.003827 0.441359 ( 0.441495)
|
72
|
+
# hash 0.058507 0.000627 0.059134 ( 0.059147)
|
73
|
+
# struct 0.113017 0.001193 0.114210 ( 0.114293)
|
74
|
+
# openstruct 6.233697 0.057665 6.291362 ( 6.291534)
|
data/yarn-error.log
CHANGED
@@ -1,30 +1,30 @@
|
|
1
1
|
Arguments:
|
2
|
-
/Users/jefvlamings/.nvm/versions/node/v16.
|
2
|
+
/Users/jefvlamings/.nvm/versions/node/v16.14.0/bin/node /Users/jefvlamings/.nvm/versions/node/v16.14.0/bin/yarn add standard
|
3
3
|
|
4
4
|
PATH:
|
5
|
-
/Users/jefvlamings/.rvm/gems/ruby-3.1.0/bin:/Users/jefvlamings/.rvm/gems/ruby-3.1.0@global/bin:/Users/jefvlamings/.rvm/rubies/ruby-3.1.0/bin:/Users/jefvlamings/.rvm/bin:/Users/jefvlamings/.nvm/versions/node/v16.
|
5
|
+
/Users/jefvlamings/.rvm/gems/ruby-3.1.0/bin:/Users/jefvlamings/.rvm/gems/ruby-3.1.0@global/bin:/Users/jefvlamings/.rvm/rubies/ruby-3.1.0/bin:/Users/jefvlamings/.rvm/bin:/Users/jefvlamings/.nvm/versions/node/v16.14.0/bin:/opt/homebrew/sbin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
|
6
6
|
|
7
7
|
Yarn version:
|
8
|
-
1.22.
|
8
|
+
1.22.17
|
9
9
|
|
10
10
|
Node version:
|
11
|
-
16.
|
11
|
+
16.14.0
|
12
12
|
|
13
13
|
Platform:
|
14
|
-
darwin
|
14
|
+
darwin arm64
|
15
15
|
|
16
16
|
Trace:
|
17
|
-
SyntaxError: /
|
17
|
+
SyntaxError: /opt/homebrew/var/www/headmin/package.json: Unexpected token } in JSON at position 1345
|
18
18
|
at JSON.parse (<anonymous>)
|
19
|
-
at /
|
19
|
+
at /Users/jefvlamings/.nvm/versions/node/v16.14.0/lib/node_modules/yarn/lib/cli.js:1625:59
|
20
20
|
at Generator.next (<anonymous>)
|
21
|
-
at step (/
|
22
|
-
at /
|
21
|
+
at step (/Users/jefvlamings/.nvm/versions/node/v16.14.0/lib/node_modules/yarn/lib/cli.js:310:30)
|
22
|
+
at /Users/jefvlamings/.nvm/versions/node/v16.14.0/lib/node_modules/yarn/lib/cli.js:321:13
|
23
23
|
|
24
24
|
npm manifest:
|
25
25
|
{
|
26
26
|
"name": "headmin",
|
27
|
-
"version": "0.3.
|
27
|
+
"version": "0.3.4",
|
28
28
|
"description": "Admin component library",
|
29
29
|
"module": "app/assets/javascripts/headmin.js",
|
30
30
|
"main": "app/assets/javascripts/headmin.js",
|
@@ -57,6 +57,11 @@ npm manifest:
|
|
57
57
|
"esbuild": "^0.14.11",
|
58
58
|
"esbuild-sass-plugin": "^2.0.3"
|
59
59
|
},
|
60
|
+
"standard": {
|
61
|
+
"ignore": [
|
62
|
+
"/www/**/*.js"
|
63
|
+
]
|
64
|
+
},
|
60
65
|
"scripts": {
|
61
66
|
"build:css": "node esbuild-css.js",
|
62
67
|
"build:js": "node esbuild-js.js",
|
@@ -64,8 +69,8 @@ npm manifest:
|
|
64
69
|
"watch:css": "node esbuild-css.js -w",
|
65
70
|
"watch:js": "node esbuild-js.js -w",
|
66
71
|
"watch": "yarn watch:css & yarn watch:js",
|
67
|
-
"dev": "yarn watch"
|
68
|
-
}
|
72
|
+
"dev": "yarn watch"
|
73
|
+
},
|
69
74
|
}
|
70
75
|
|
71
76
|
yarn manifest:
|