formstrap 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ef711395960778d13a1deabebd22b2745d05b3f23cead8088c0213e051fca436
4
- data.tar.gz: 14080e33cab4d2f4403188d0fac4c097a8ca1a5179465bf83eb0cc42c951161f
3
+ metadata.gz: 5afd41f3d2d060b685fc6357bca9761bf8c48e4a1b84d7749ea74ead04ebe31a
4
+ data.tar.gz: 103a7f552523b866e29460eb42ba1007e0ab558a1818eba5a6728500b07ac820
5
5
  SHA512:
6
- metadata.gz: 79982ab77ff7cf658c946d0d4a8f574af5b1c6a95aad44ec746a48fde13341fe82fb9ea4f77e664324868a2671a2b37ea3d9aacc08d13ae24cb1cbd710e7a4cd
7
- data.tar.gz: d400b9aa96761a49ad6cf07736e876110c4d5360ade1337888b4c86dbac3cb981254118dedb0a13cc4aa3d66951c7a1fb9630be1fbe42826dd0cbc0b185f03cc
6
+ metadata.gz: 5e90e2f3c3e5589459b4f48c1c8ee73a5720a0dbbb00fc543e70ef59d8045111b41b20c973fd80708404b05a074b4ef81d3a9d7e8206b3c1bd3c358b8b4e531b
7
+ data.tar.gz: debe1ba9cefa1bfd484bb50df731c0b0fe555fe89e06140ec311e0e722ab93771fae0c1d9220aded9810b83c14e3869cf2336686c9169333262526aa295227ec
data/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ lts/gallium
data/README.md CHANGED
@@ -116,3 +116,105 @@ Add your custom Formstrap (e.g. map) helper into the map ```./views/formstrap```
116
116
  <% end %>
117
117
  ```
118
118
 
119
+ ## Development
120
+
121
+ For development purposes it's helpful to have both the test project and Formstrap located in the same directory.
122
+
123
+ In Gemfile
124
+
125
+ ```ruby
126
+ gem "formstrap", path: "../formstrap"
127
+ ```
128
+
129
+ In package.json
130
+
131
+ ```json
132
+ {
133
+ "dependencies": {
134
+ "formstrap": "link:../formstrap"
135
+ }
136
+ }
137
+ ```
138
+
139
+ To see frontend changes update live in development run
140
+ ```shell
141
+ # Watches changes and builds them on-the-fly
142
+ yarn dev
143
+ ```
144
+
145
+ ### Javascript
146
+
147
+ When adding new dependencies, make sure you add them to the `package.json` file as well as the `importmap.rb` file.
148
+
149
+ ## Testing
150
+
151
+ Run tests with
152
+
153
+ ```shell
154
+ rake test
155
+ ```
156
+
157
+ Or to run a single file
158
+ ```shell
159
+ rake test TEST=path/to/test/file.rb
160
+ ```
161
+
162
+ If you want to test a specific feature in a staging environment without releasing the gem, you can refer to the remote
163
+ repo in your Gemfile and package.json.
164
+
165
+ In Gemfile
166
+
167
+ ```ruby
168
+ gem 'formstrap', git: 'git@github.com:frontierdotbe/formstrap.git', branch: 'feature/test'
169
+ ```
170
+
171
+ In package.json
172
+
173
+ ```json
174
+ {
175
+ "dependencies": {
176
+ "formstrap": "ssh://git@github.com:frontierdotbe/formstrap.git#feature/test"
177
+ }
178
+ }
179
+
180
+ ```
181
+
182
+ ## Releasing
183
+
184
+ After integration a new feature of fixing a bug, first commit and push your changes.
185
+
186
+ Update the gem
187
+
188
+ ```shell
189
+ # First bundle if new runtime dependencies were added
190
+ $ bundle
191
+
192
+ # Update the version number, push commits and tag the release
193
+ $ gem bump -v {patch,minor,major,...} --push --tag
194
+
195
+ # Release to Rubygems and create a Github release tag
196
+ $ gem release
197
+ ```
198
+
199
+ Update the node package
200
+
201
+ ```shell
202
+ # Manually update the version number in package.json
203
+ $ yarn build
204
+ $ npm publish --access public
205
+ ```
206
+
207
+ ## Contributing
208
+
209
+ Bug reports and pull requests are welcome on GitHub at https://github.com/frontierdotbe/formstrap. This project is intended
210
+ to be a safe, welcoming space for collaboration, and contributors are expected to adhere to
211
+ the [code of conduct](https://github.com/frontierdotbe/formstrap/blob/master/CODE_OF_CONDUCT.md).
212
+
213
+ ## License
214
+
215
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
216
+
217
+ ## Code of Conduct
218
+
219
+ Everyone interacting in the Formstrap project's codebases, issue trackers, chat rooms and mailing lists is expected to
220
+ follow the [code of conduct](https://github.com/frontierdotbe/formstrap/blob/master/CODE_OF_CONDUCT.md).
Binary file
@@ -31,7 +31,8 @@ export default class extends Controller {
31
31
  const ids = this.activeIds()
32
32
 
33
33
  this.modalButtonTargets.forEach((button) => {
34
- const url = new URL(button.getAttribute('href'))
34
+ const sourceLocation = location.protocol + '//' + location.host
35
+ const url = new URL(button.getAttribute('href'), sourceLocation)
35
36
 
36
37
  // Remove all ids[]
37
38
  url.searchParams.delete('ids[]')
@@ -10974,7 +10974,8 @@ var media_controller_default = class extends Controller {
10974
10974
  syncIds() {
10975
10975
  const ids = this.activeIds();
10976
10976
  this.modalButtonTargets.forEach((button) => {
10977
- const url = new URL(button.getAttribute("href"));
10977
+ const sourceLocation = location.protocol + "//" + location.host;
10978
+ const url = new URL(button.getAttribute("href"), sourceLocation);
10978
10979
  url.searchParams.delete("ids[]");
10979
10980
  ids.forEach((id) => {
10980
10981
  url.searchParams.append("ids[]", id);
@@ -1,5 +1,5 @@
1
1
  .h-form-file {
2
- --fs-file-spacer-2: 1rem * .5;
2
+ --fs-file-spacer-2: calc(1rem * .5);
3
3
 
4
4
  .h-form-file-thumbnails {
5
5
  margin-bottom: var(--fs-file-spacer-2);
@@ -15,6 +15,7 @@
15
15
  }
16
16
 
17
17
  .h-form-file-thumbnails {
18
+ --fs-file-spacer-2: calc(1rem * .5);
18
19
  position: relative;
19
20
  display: flex;
20
21
  flex-wrap: wrap;
@@ -1312,7 +1312,7 @@ span.flatpickr-weekday {
1312
1312
  padding: 0;
1313
1313
  }
1314
1314
  .h-form-file {
1315
- --fs-file-spacer-2: 1rem * .5;
1315
+ --fs-file-spacer-2: calc(1rem * .5);
1316
1316
  }
1317
1317
  .h-form-file .h-form-file-thumbnails {
1318
1318
  margin-bottom: var(--fs-file-spacer-2);
@@ -1324,6 +1324,7 @@ span.flatpickr-weekday {
1324
1324
  margin-bottom: 0;
1325
1325
  }
1326
1326
  .h-form-file-thumbnails {
1327
+ --fs-file-spacer-2: calc(1rem * .5);
1327
1328
  position: relative;
1328
1329
  display: flex;
1329
1330
  flex-wrap: wrap;
@@ -35,12 +35,12 @@
35
35
 
36
36
  <!-- Render previews for attachments -->
37
37
  <%= form.fields_for(media.nested_attribute, media.association_object) do |ff| %>
38
- <%= render "formstrap/media/item", media.item_options.merge(form: ff, url: formstrap_media_url(name: media.name, ids: media.blob_ids, min: media.min, max: media.max, mimetype: media.accept)) %>
38
+ <%= render "formstrap/media/item", media.item_options.merge(form: ff, url: formstrap_media_path(name: media.name, ids: media.blob_ids, min: media.min, max: media.max, mimetype: media.accept)) %>
39
39
  <% end %>
40
40
 
41
41
  <!-- Placeholder -->
42
42
  <div class="<%= "d-none" if media.attachments.any? %>" data-media-target="placeholder">
43
- <a href="<%= formstrap_media_url(name: media.name, ids: media.blob_ids, min: media.min, max: media.max, mimetype: media.accept) %>" data-turbo-frame="remote_modal" data-media-target="modalButton">
43
+ <a href="<%= formstrap_media_path(name: media.name, ids: media.blob_ids, min: media.min, max: media.max, mimetype: media.accept) %>" data-turbo-frame="remote_modal" data-media-target="modalButton">
44
44
  <%= render "formstrap/shared/thumbnail", media.thumbnail_options %>
45
45
  </a>
46
46
  </div>
@@ -50,7 +50,7 @@
50
50
  <% association_object = ActiveStorage::Attachment.new %>
51
51
  <template data-media-target="template" data-template-id-regex="<%= association_object.object_id %>">
52
52
  <%= form.fields_for(media.nested_attribute, ActiveStorage::Attachment.new, child_index: association_object.object_id) do |ff| %>
53
- <%= render "formstrap/media/item", media.item_options.merge(form: ff, url: formstrap_media_url(name: media.name, ids: media.blob_ids, min: media.min, max: media.max, mimetype: media.accept)) %>
53
+ <%= render "formstrap/media/item", media.item_options.merge(form: ff, url: formstrap_media_path(name: media.name, ids: media.blob_ids, min: media.min, max: media.max, mimetype: media.accept)) %>
54
54
  <% end %>
55
55
  </template>
56
56
 
@@ -1,5 +1,5 @@
1
1
  <%= turbo_frame_tag "modal_content" do %>
2
- <%= formstrap_form_with url: formstrap_media_item_url(id: @blob.id), model: @blob do |form| %>
2
+ <%= formstrap_form_with url: formstrap_media_item_path(id: @blob.id), model: @blob do |form| %>
3
3
  <div class="modal-header">
4
4
  <h5 class="modal-title"><%= t(".edit") %></h5>
5
5
  <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="<%= t(".close") %>"></button>
@@ -1,6 +1,9 @@
1
1
  en:
2
2
  language_name: English
3
-
4
3
  date:
5
4
  formats:
6
- default: "%d/%m/%Y"
5
+ default: "%d/%m/%Y"
6
+ formstrap:
7
+ pagination:
8
+ infinite:
9
+ load_more: Load more
@@ -1,6 +1,9 @@
1
1
  nl:
2
2
  language_name: Nederlands
3
-
4
3
  date:
5
4
  formats:
6
5
  default: "%d/%m/%Y"
6
+ formstrap:
7
+ pagination:
8
+ infinite:
9
+ load_more: Laad meer
data/esbuild-css.js CHANGED
@@ -16,7 +16,7 @@ esbuild.build({
16
16
  entryPoints: ['src/scss/formstrap.scss'],
17
17
  outfile: 'app/assets/stylesheets/formstrap.css',
18
18
  bundle: true,
19
- watch: watch,
19
+ watch,
20
20
  allowOverwrite: true,
21
21
  plugins: [
22
22
  externalUrlPlugin,
data/esbuild-js.js CHANGED
@@ -7,5 +7,5 @@ esbuild.build({
7
7
  bundle: true,
8
8
  allowOverwrite: true,
9
9
  format: 'esm',
10
- watch: watch
10
+ watch
11
11
  }).catch((e) => console.error(e.message))
@@ -1,3 +1,3 @@
1
1
  module Formstrap
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
- "name": "formstrap",
3
- "version": "0.1",
2
+ "name": "@frontierdotbe/formstrap",
3
+ "version": "0.1.0",
4
4
  "description": "Bootstrap-powered Form Helpers",
5
5
  "module": "app/assets/javascripts/formstrap.js",
6
6
  "main": "app/assets/javascripts/formstrap.js",
@@ -17,9 +17,9 @@
17
17
  "author": "Jef Vlamings <vlamingsjef@gmail.com>",
18
18
  "license": "MIT",
19
19
  "bugs": {
20
- "url": "https://github.com/insiting/headmin/issues"
20
+ "url": "https://github.com/frontierdotbe/formstrap/issues"
21
21
  },
22
- "homepage": "https://github.com/insiting/headmin#readme",
22
+ "homepage": "https://github.com/frontierdotbe/formstrap#readme",
23
23
  "dependencies": {
24
24
  "@hotwired/stimulus": "^3.0",
25
25
  "@hotwired/stimulus-webpack-helpers": "^1.0",
@@ -34,7 +34,7 @@
34
34
  "devDependencies": {
35
35
  "esbuild": "^0.14.11",
36
36
  "esbuild-sass-plugin": "^2.0.3",
37
- "standard": "^16.0.4"
37
+ "standard": "^17.0.0"
38
38
  },
39
39
  "standard": {
40
40
  "ignore": [