rails_accordion 1.0.0 → 1.0.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: aaaf0c683b43333faf89d02a539bc6ccd037e86c9ef305eb68240650c946a4f1
4
- data.tar.gz: c8ca332299479735ae6ef6af5b6ea618a4047388ef18b39c03fef78e565a9033
3
+ metadata.gz: e860b44c827a2fbd492dd7266d2395497681b24224e18ea5dd89ed02a59b0072
4
+ data.tar.gz: f457bad1da69fc310ce1b4755b85ba8ffdcc872a9511e1d1c3edf4c2f33cc982
5
5
  SHA512:
6
- metadata.gz: 35fbdcae2cf2ff6223c0169ec01ccc634da9a656532ed51851fe7dc073fc80b4e4d1f64eb32be369929adfd468e5d4dc794957c6672b8ad285850b2fc145c772
7
- data.tar.gz: 5e314c4950060c659a6b4fa7f3cd7760d312f6b66370d07fb12310858dc816ff9980269f641790688c236bc856a77156342f6924c85d4fac6fb72601017829e6
6
+ metadata.gz: 0a084e498ffecca067f1b6626b69d82f37b5eabd8c236ca7bc7b84ff1e13da1b679420de9119362459ca66dd7a015b8a1edcd16fef52d91dc9da09c0cdcdb3c0
7
+ data.tar.gz: e5df22a526a4133e2840eb743b4387744273430d39f118f72b8ca8ac7a7426b69f9d9495bda1507941c3c6d35bdaf4fe2e42450ee500040850e851396aa8ca34
data/Gemfile.lock CHANGED
@@ -123,4 +123,4 @@ DEPENDENCIES
123
123
  zeitwerk (~> 2.6)
124
124
 
125
125
  BUNDLED WITH
126
- 2.4.13
126
+ 2.4.14
data/README.md CHANGED
@@ -5,7 +5,7 @@ rails_accordion is a Ruby gem that provides an easy-to-use accordion component f
5
5
  ## Installation
6
6
 
7
7
  ```rb
8
- gem 'rails_accordion', '~> 0.2.0.pre.beta'
8
+ gem 'rails_accordion'
9
9
  ```
10
10
 
11
11
  ```shell
@@ -1,4 +1,11 @@
1
1
  (() => {
2
+ var __defProp = Object.defineProperty;
3
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
4
+ var __publicField = (obj, key, value) => {
5
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
6
+ return value;
7
+ };
8
+
2
9
  // node_modules/mapkick/dist/mapkick.bundle.js
3
10
  (function(global2, factory) {
4
11
  typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory() : typeof define === "function" && define.amd ? define(factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, global2.Mapkick = factory());
@@ -368,7 +375,7 @@
368
375
  return r2.path = "/v4/" + r2.authority + ".json", r2.params.push("secure"), this._makeAPIURL(r2, this._customAccessToken || e2);
369
376
  }, G.prototype.normalizeSpriteURL = function(t2, e2, r2, n2) {
370
377
  var i2 = Y(t2);
371
- return Z(t2) ? (i2.path = "/styles/v1" + i2.path + "/sprite" + e2 + r2, this._makeAPIURL(i2, this._customAccessToken || n2)) : (i2.path += "" + e2 + r2, $2(i2));
378
+ return Z(t2) ? (i2.path = "/styles/v1" + i2.path + "/sprite" + e2 + r2, this._makeAPIURL(i2, this._customAccessToken || n2)) : (i2.path += "" + e2 + r2, $(i2));
372
379
  }, G.prototype.normalizeTileURL = function(t2, e2) {
373
380
  if (this._isSkuTokenExpired() && this._createSkuToken(), t2 && !Z(t2)) {
374
381
  return t2;
@@ -409,7 +416,7 @@
409
416
  i2 >= 0 && t2.params.splice(i2, 1);
410
417
  }
411
418
  if ("/" !== n2.path && (t2.path = "" + n2.path + t2.path), !R.REQUIRE_ACCESS_TOKEN) {
412
- return $2(t2);
419
+ return $(t2);
413
420
  }
414
421
  if (!(e2 = e2 || R.ACCESS_TOKEN)) {
415
422
  throw new Error("An API access token is required to use Mapbox GL. " + r2);
@@ -419,7 +426,7 @@
419
426
  }
420
427
  return t2.params = t2.params.filter(function(t3) {
421
428
  return -1 === t3.indexOf("access_token");
422
- }), t2.params.push("access_token=" + e2), $2(t2);
429
+ }), t2.params.push("access_token=" + e2), $(t2);
423
430
  };
424
431
  var X = /^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;
425
432
  function J(t2) {
@@ -433,7 +440,7 @@
433
440
  }
434
441
  return { protocol: e2[1], authority: e2[2], path: e2[3] || "/", params: e2[4] ? e2[4].split("&") : [] };
435
442
  }
436
- function $2(t2) {
443
+ function $(t2) {
437
444
  var e2 = t2.params.length ? "?" + t2.params.join("&") : "";
438
445
  return t2.protocol + "://" + t2.authority + t2.path + e2;
439
446
  }
@@ -488,7 +495,7 @@
488
495
  if (R.EVENTS_URL) {
489
496
  var a2 = Y(R.EVENTS_URL);
490
497
  a2.params.push("access_token=" + (n2 || R.ACCESS_TOKEN || ""));
491
- var o2 = { event: this.type, created: new Date(t2).toISOString(), sdkIdentifier: "mapbox-gl-js", sdkVersion: "1.13.3", skuId: K, userId: this.anonId }, s2 = e2 ? h(o2, e2) : o2, u2 = { url: $2(a2), headers: { "Content-Type": "text/plain" }, body: JSON.stringify([s2]) };
498
+ var o2 = { event: this.type, created: new Date(t2).toISOString(), sdkIdentifier: "mapbox-gl-js", sdkVersion: "1.13.3", skuId: K, userId: this.anonId }, s2 = e2 ? h(o2, e2) : o2, u2 = { url: $(a2), headers: { "Content-Type": "text/plain" }, body: JSON.stringify([s2]) };
492
499
  this.pendingRequest = wt(u2, function(t3) {
493
500
  i2.pendingRequest = null, r2(t3), i2.saveEventData(), i2.processRequests(n2);
494
501
  });
@@ -8832,8 +8839,8 @@
8832
8839
  var Y3 = n4.horizontal[H3];
8833
8840
  if (!z4) {
8834
8841
  R4 = ha(Y3.text);
8835
- var $4 = s5.layout.get("text-rotate").evaluate(b4, {}, S4);
8836
- z4 = new Wu(u5, e4, l4, p5, c6, Y3, h5, f5, y4, $4);
8842
+ var $3 = s5.layout.get("text-rotate").evaluate(b4, {}, S4);
8843
+ z4 = new Wu(u5, e4, l4, p5, c6, Y3, h5, f5, y4, $3);
8837
8844
  }
8838
8845
  var W3 = 1 === Y3.positionedLines.length;
8839
8846
  if (V4 += sl(t4, e4, Y3, a5, s5, y4, b4, d4, M4, n4.vertical ? wu.horizontal : wu.horizontalOnly, W3 ? Object.keys(n4.horizontal) : [H3], O4, D4, w4, S4), W3) {
@@ -8876,8 +8883,8 @@
8876
8883
  }
8877
8884
  } else if ("Point" === e3.type) {
8878
8885
  for (var J2 = 0, H2 = e3.geometry; J2 < H2.length; J2 += 1) {
8879
- for (var Y2 = 0, $3 = H2[J2]; Y2 < $3.length; Y2 += 1) {
8880
- var W2 = $3[Y2];
8886
+ for (var Y2 = 0, $2 = H2[J2]; Y2 < $2.length; Y2 += 1) {
8887
+ var W2 = $2[Y2];
8881
8888
  P3([W2], new Fu(W2.x, W2.y, 0));
8882
8889
  }
8883
8890
  }
@@ -9453,7 +9460,7 @@
9453
9460
  e2.minX = Math.min(e2.minX, t2[r2]), e2.minY = Math.min(e2.minY, t2[r2 + 1]), e2.maxX = Math.max(e2.maxX, t2[r2]), e2.maxY = Math.max(e2.maxY, t2[r2 + 1]);
9454
9461
  }
9455
9462
  }
9456
- function $2(e2, t2, r2, i2) {
9463
+ function $(e2, t2, r2, i2) {
9457
9464
  if (t2.geometry) {
9458
9465
  var o2 = t2.geometry.coordinates, n2 = t2.geometry.type, a2 = Math.pow(r2.tolerance / ((1 << r2.maxZoom) * r2.extent), 2), s2 = [], l2 = t2.id;
9459
9466
  if (r2.promoteId ? l2 = t2.properties[r2.promoteId] : r2.generateId && (l2 = i2 || 0), "Point" === n2) {
@@ -9478,7 +9485,7 @@
9478
9485
  if ("MultiPolygon" !== n2) {
9479
9486
  if ("GeometryCollection" === n2) {
9480
9487
  for (u2 = 0; u2 < t2.geometry.geometries.length; u2++) {
9481
- $2(e2, { id: l2, geometry: t2.geometry.geometries[u2], properties: t2.properties }, r2, i2);
9488
+ $(e2, { id: l2, geometry: t2.geometry.geometries[u2], properties: t2.properties }, r2, i2);
9482
9489
  }
9483
9490
  return;
9484
9491
  }
@@ -9735,10 +9742,10 @@
9735
9742
  var r3 = [];
9736
9743
  if ("FeatureCollection" === e3.type) {
9737
9744
  for (var i3 = 0; i3 < e3.features.length; i3++) {
9738
- $2(r3, e3.features[i3], t3, i3);
9745
+ $(r3, e3.features[i3], t3, i3);
9739
9746
  }
9740
9747
  } else {
9741
- $2(r3, "Feature" === e3.type ? e3 : { geometry: e3 }, t3);
9748
+ $(r3, "Feature" === e3.type ? e3 : { geometry: e3 }, t3);
9742
9749
  }
9743
9750
  return r3;
9744
9751
  }(e2, t2);
@@ -11155,7 +11162,7 @@
11155
11162
  t3 ? e3.enable(e3.STENCIL_TEST) : e3.disable(e3.STENCIL_TEST), this.current = t3, this.dirty = false;
11156
11163
  }
11157
11164
  }, e2;
11158
- }(j), $2 = function(t2) {
11165
+ }(j), $ = function(t2) {
11159
11166
  function e2() {
11160
11167
  t2.apply(this, arguments);
11161
11168
  }
@@ -11451,7 +11458,7 @@
11451
11458
  };
11452
11459
  Ct.disabled = new Ct(false, 1029, 2305), Ct.backCCW = new Ct(true, 1029, 2305);
11453
11460
  var zt = function(t2) {
11454
- this.gl = t2, this.extVertexArrayObject = this.gl.getExtension("OES_vertex_array_object"), this.clearColor = new V(this), this.clearDepth = new G(this), this.clearStencil = new W(this), this.colorMask = new X(this), this.depthMask = new H(this), this.stencilMask = new K(this), this.stencilFunc = new Y(this), this.stencilOp = new J(this), this.stencilTest = new Q(this), this.depthRange = new $2(this), this.depthTest = new tt(this), this.depthFunc = new et(this), this.blend = new it(this), this.blendFunc = new ot(this), this.blendColor = new rt(this), this.blendEquation = new at(this), this.cullFace = new nt(this), this.cullFaceSide = new st(this), this.frontFace = new lt(this), this.program = new ct(this), this.activeTexture = new ut(this), this.viewport = new ht(this), this.bindFramebuffer = new pt(this), this.bindRenderbuffer = new dt(this), this.bindTexture = new _t(this), this.bindVertexBuffer = new ft(this), this.bindElementBuffer = new mt(this), this.bindVertexArrayOES = this.extVertexArrayObject && new gt(this), this.pixelStoreUnpack = new vt(this), this.pixelStoreUnpackPremultiplyAlpha = new yt(this), this.pixelStoreUnpackFlipY = new xt(this), this.extTextureFilterAnisotropic = t2.getExtension("EXT_texture_filter_anisotropic") || t2.getExtension("MOZ_EXT_texture_filter_anisotropic") || t2.getExtension("WEBKIT_EXT_texture_filter_anisotropic"), this.extTextureFilterAnisotropic && (this.extTextureFilterAnisotropicMax = t2.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)), this.extTextureHalfFloat = t2.getExtension("OES_texture_half_float"), this.extTextureHalfFloat && (t2.getExtension("OES_texture_half_float_linear"), this.extRenderToTextureHalfFloat = t2.getExtension("EXT_color_buffer_half_float")), this.extTimerQuery = t2.getExtension("EXT_disjoint_timer_query"), this.maxTextureSize = t2.getParameter(t2.MAX_TEXTURE_SIZE);
11461
+ this.gl = t2, this.extVertexArrayObject = this.gl.getExtension("OES_vertex_array_object"), this.clearColor = new V(this), this.clearDepth = new G(this), this.clearStencil = new W(this), this.colorMask = new X(this), this.depthMask = new H(this), this.stencilMask = new K(this), this.stencilFunc = new Y(this), this.stencilOp = new J(this), this.stencilTest = new Q(this), this.depthRange = new $(this), this.depthTest = new tt(this), this.depthFunc = new et(this), this.blend = new it(this), this.blendFunc = new ot(this), this.blendColor = new rt(this), this.blendEquation = new at(this), this.cullFace = new nt(this), this.cullFaceSide = new st(this), this.frontFace = new lt(this), this.program = new ct(this), this.activeTexture = new ut(this), this.viewport = new ht(this), this.bindFramebuffer = new pt(this), this.bindRenderbuffer = new dt(this), this.bindTexture = new _t(this), this.bindVertexBuffer = new ft(this), this.bindElementBuffer = new mt(this), this.bindVertexArrayOES = this.extVertexArrayObject && new gt(this), this.pixelStoreUnpack = new vt(this), this.pixelStoreUnpackPremultiplyAlpha = new yt(this), this.pixelStoreUnpackFlipY = new xt(this), this.extTextureFilterAnisotropic = t2.getExtension("EXT_texture_filter_anisotropic") || t2.getExtension("MOZ_EXT_texture_filter_anisotropic") || t2.getExtension("WEBKIT_EXT_texture_filter_anisotropic"), this.extTextureFilterAnisotropic && (this.extTextureFilterAnisotropicMax = t2.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)), this.extTextureHalfFloat = t2.getExtension("OES_texture_half_float"), this.extTextureHalfFloat && (t2.getExtension("OES_texture_half_float_linear"), this.extRenderToTextureHalfFloat = t2.getExtension("EXT_color_buffer_half_float")), this.extTimerQuery = t2.getExtension("EXT_disjoint_timer_query"), this.maxTextureSize = t2.getParameter(t2.MAX_TEXTURE_SIZE);
11455
11462
  };
11456
11463
  zt.prototype.setDefault = function() {
11457
11464
  this.unbindVAO(), this.clearColor.setDefault(), this.clearDepth.setDefault(), this.clearStencil.setDefault(), this.colorMask.setDefault(), this.depthMask.setDefault(), this.stencilMask.setDefault(), this.stencilFunc.setDefault(), this.stencilOp.setDefault(), this.stencilTest.setDefault(), this.depthRange.setDefault(), this.depthTest.setDefault(), this.depthFunc.setDefault(), this.blend.setDefault(), this.blendFunc.setDefault(), this.blendColor.setDefault(), this.blendEquation.setDefault(), this.cullFace.setDefault(), this.cullFaceSide.setDefault(), this.frontFace.setDefault(), this.program.setDefault(), this.activeTexture.setDefault(), this.bindFramebuffer.setDefault(), this.pixelStoreUnpack.setDefault(), this.pixelStoreUnpackPremultiplyAlpha.setDefault(), this.pixelStoreUnpackFlipY.setDefault();
@@ -12452,8 +12459,8 @@
12452
12459
  if (K2 || Y2 ? Y2 ? K2 || (P3 = P3 && T3) : T3 = P3 && T3 : P3 = T3 = P3 && T3, T3 && d3 && d3.box && r2.collisionIndex.insertCollisionBox(d3.box, s2.get("text-ignore-placement"), n2.bucketInstanceId, D3 && D3.box && R2 ? R2 : L2, f2.ID), P3 && M2 && r2.collisionIndex.insertCollisionBox(M2.box, s2.get("icon-ignore-placement"), n2.bucketInstanceId, k2, f2.ID), A3 && (T3 && r2.collisionIndex.insertCollisionCircles(A3.circles, s2.get("text-ignore-placement"), n2.bucketInstanceId, L2, f2.ID), o2)) {
12453
12460
  var J2 = n2.bucketInstanceId, Q2 = r2.collisionCircleArrays[J2];
12454
12461
  void 0 === Q2 && (Q2 = r2.collisionCircleArrays[J2] = new me());
12455
- for (var $3 = 0; $3 < A3.circles.length; $3 += 4) {
12456
- Q2.circles.push(A3.circles[$3 + 0]), Q2.circles.push(A3.circles[$3 + 1]), Q2.circles.push(A3.circles[$3 + 2]), Q2.circles.push(A3.collisionDetected ? 1 : 0);
12462
+ for (var $2 = 0; $2 < A3.circles.length; $2 += 4) {
12463
+ Q2.circles.push(A3.circles[$2 + 0]), Q2.circles.push(A3.circles[$2 + 1]), Q2.circles.push(A3.circles[$2 + 2]), Q2.circles.push(A3.collisionDetected ? 1 : 0);
12457
12464
  }
12458
12465
  }
12459
12466
  r2.placements[e3.crossTileID] = new fe(T3 || E2, P3 || I2, S3 || n2.justReloaded), i2[e3.crossTileID] = true;
@@ -13710,15 +13717,15 @@
13710
13717
  }
13711
13718
  var V2 = pe(C2, 1, e2.transform.zoom), G2 = Jt(S2.posMatrix, g2, m2, e2.transform, V2), W2 = Qt(S2.posMatrix, g2, m2, e2.transform, V2), X2 = T2 && z2.hasTextData(), H2 = "none" !== o2.layout.get("icon-text-fit") && X2 && z2.hasIconData();
13712
13719
  v2 && ie(z2, S2.posMatrix, e2, a2, G2, W2, g2, u2);
13713
- var K2 = e2.translatePosMatrix(S2.posMatrix, C2, n2, s2), Y2 = v2 || a2 && T2 || H2 ? Ji : G2, J2 = e2.translatePosMatrix(W2, C2, n2, s2, true), Q2 = M2 && 0 !== o2.paint.get(a2 ? "text-halo-width" : "icon-halo-width").constantOr(1), $3 = { program: k2, buffers: D2, uniformValues: M2 ? z2.iconsInText ? Wi(L2.kind, B2, y2, g2, e2, K2, Y2, J2, O2, F2) : Gi(L2.kind, B2, y2, g2, e2, K2, Y2, J2, a2, O2, true) : Vi(L2.kind, B2, y2, g2, e2, K2, Y2, J2, a2, O2), atlasTexture: U2, atlasTextureIcon: Z2, atlasInterpolation: N2, atlasInterpolationIcon: q2, isSDF: M2, hasHalo: Q2 };
13720
+ var K2 = e2.translatePosMatrix(S2.posMatrix, C2, n2, s2), Y2 = v2 || a2 && T2 || H2 ? Ji : G2, J2 = e2.translatePosMatrix(W2, C2, n2, s2, true), Q2 = M2 && 0 !== o2.paint.get(a2 ? "text-halo-width" : "icon-halo-width").constantOr(1), $2 = { program: k2, buffers: D2, uniformValues: M2 ? z2.iconsInText ? Wi(L2.kind, B2, y2, g2, e2, K2, Y2, J2, O2, F2) : Gi(L2.kind, B2, y2, g2, e2, K2, Y2, J2, a2, O2, true) : Vi(L2.kind, B2, y2, g2, e2, K2, Y2, J2, a2, O2), atlasTexture: U2, atlasTextureIcon: Z2, atlasInterpolation: N2, atlasInterpolationIcon: q2, isSDF: M2, hasHalo: Q2 };
13714
13721
  if (x2 && z2.canOverlap) {
13715
13722
  b2 = true;
13716
13723
  for (var tt2 = 0, et2 = D2.segments.get(); tt2 < et2.length; tt2 += 1) {
13717
13724
  var it2 = et2[tt2];
13718
- E2.push({ segments: new t.SegmentVector([it2]), sortKey: it2.sortKey, state: $3 });
13725
+ E2.push({ segments: new t.SegmentVector([it2]), sortKey: it2.sortKey, state: $2 });
13719
13726
  }
13720
13727
  } else {
13721
- E2.push({ segments: D2.segments, sortKey: 0, state: $3 });
13728
+ E2.push({ segments: D2.segments, sortKey: 0, state: $2 });
13722
13729
  }
13723
13730
  }
13724
13731
  }
@@ -19666,39 +19673,28 @@
19666
19673
  // app/javascript/controllers/accordion_controller.js
19667
19674
  var accordion_controller_default = class extends Controller {
19668
19675
  connect() {
19669
- this.initAccordion();
19670
- this.initDefaultState();
19671
- }
19672
- initDefaultState() {
19673
- const items = this.element.querySelectorAll(".accordion_item");
19674
- switch ($(this.element).data("default-state")) {
19676
+ switch (this.defaultStateValue) {
19675
19677
  case "all_closed":
19676
- this.hideAll(items);
19678
+ this.hideAll(this.itemTargets);
19677
19679
  break;
19678
19680
  case "all_opened":
19679
- this.showAll(items);
19681
+ this.showAll(this.itemTargets);
19680
19682
  break;
19681
19683
  case "first_opened":
19682
- this.hideAll(items);
19683
- this.open(items[0].querySelector(".accordion_content"));
19684
+ this.hideAll(this.itemTargets);
19685
+ this.open(this.itemTargets[0].querySelector(".accordion_content"));
19684
19686
  }
19685
19687
  }
19686
- initAccordion() {
19687
- const items = this.element.querySelectorAll(".accordion_item");
19688
- items.forEach((item) => {
19689
- const toggle = item.querySelector(".accordion_toggle");
19690
- const content = item.querySelector(".accordion_content");
19691
- toggle.addEventListener("click", (e) => {
19692
- if (content.classList.contains("accordion_active")) {
19693
- this.hide(content);
19694
- } else {
19695
- if ($(this.element).data("multiple-open") != true) {
19696
- this.hideAll(items);
19697
- }
19698
- this.open(content);
19699
- }
19700
- });
19701
- });
19688
+ toggle(e) {
19689
+ const content = e.currentTarget.parentNode.querySelector(".accordion_content");
19690
+ if (content.classList.contains("accordion_active")) {
19691
+ this.hide(content);
19692
+ } else {
19693
+ if (!this.multipleOpenValue) {
19694
+ this.hideAll(this.itemTargets);
19695
+ }
19696
+ this.open(content);
19697
+ }
19702
19698
  }
19703
19699
  hideAll(items) {
19704
19700
  items.forEach((item) => this.hide(item.querySelector(".accordion_content")));
@@ -19713,8 +19709,18 @@
19713
19709
  open(item) {
19714
19710
  item.classList.add("accordion_active");
19715
19711
  item.style.height = item.scrollHeight + "px";
19712
+ item.querySelectorAll(".accordion_content").forEach(function(child) {
19713
+ new ResizeObserver(function() {
19714
+ item.style.height = item.scrollHeight + "px";
19715
+ }).observe(child);
19716
+ });
19716
19717
  }
19717
19718
  };
19719
+ __publicField(accordion_controller_default, "targets", ["item"]);
19720
+ __publicField(accordion_controller_default, "values", {
19721
+ multipleOpen: Boolean,
19722
+ defaultState: String
19723
+ });
19718
19724
 
19719
19725
  // app/javascript/rails_accordion.js
19720
19726
  var application = Application.start();