Selaa lähdekoodia

Merge branch 'master' into master

Muhammad Hizbullah 4 vuotta sitten
vanhempi
commit
468ecce0f7
18 muutettua tiedostoa jossa 32 lisäystä ja 29 poistoa
  1. 1 1
      LICENSE.md
  2. 1 1
      README.ar.md
  3. 1 1
      README.de.md
  4. 1 1
      README.es.md
  5. 1 1
      README.fr.md
  6. 2 2
      README.id.md
  7. 1 1
      README.ja.md
  8. 1 1
      README.ko.md
  9. 5 4
      README.md
  10. 1 1
      README.pt.md
  11. 1 1
      README.tr.md
  12. 1 1
      README.zh-CN.md
  13. 1 1
      README.zh-TW.md
  14. 4 4
      dist/alpine-ie11.js
  15. 4 4
      dist/alpine.js
  16. 1 0
      examples/index.html
  17. 1 0
      examples/tags.html
  18. 4 4
      src/component.js

+ 1 - 1
LICENSE.md

@@ -1,6 +1,6 @@
 # MIT License
 
-Copyright © 2019-2020 Caleb Porzio and contributors
+Copyright © 2019-2021 Caleb Porzio and contributors
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal

+ 1 - 1
README.ar.md

@@ -953,7 +953,7 @@ import 'alpinejs'
 
 ## الرخصة
 
-حقوق النشر محفوظة  © 2019-2020 لـ Caleb Porzio والمساهمين.
+حقوق النشر محفوظة  © 2019-2021 لـ Caleb Porzio والمساهمين.
 
 مرخص بموجب ترخيص MIT، راجع [LICENSE.md](LICENSE.md) للحصول على التفاصيل.
 

+ 1 - 1
README.de.md

@@ -784,6 +784,6 @@ Da sich die policy auf alle Skripts einer Seite auswirkt, ist es wichtig sicherz
 
 ## License
 
-Copyright © 2019-2020 Caleb Porzio and contributors
+Copyright © 2019-2021 Caleb Porzio and contributors
 
 Licensed under the MIT license, see [LICENSE.md](LICENSE.md) for details.

+ 1 - 1
README.es.md

@@ -747,6 +747,6 @@ Ya que la política se aplica a todos los scripts de tu página, es improtante q
 
 ## Licencia
 
-Copyright © 2019-2020 Caleb Porzio y colaboradores
+Copyright © 2019-2021 Caleb Porzio y colaboradores
 
 Licenciado bajo la licencia MIT, ve [LICENSE.md](LICENSE.md) para más detalles.

+ 1 - 1
README.fr.md

@@ -788,6 +788,6 @@ Si vous utilisez Alpine sur un site web traitant des données sensibles et néce
 
 ## License
 
-Copyright © 2019-2020 Caleb Porzio et contributeurs
+Copyright © 2019-2021 Caleb Porzio et contributeurs
 
 Licencié sous la licence du MIT, voir [LICENSE.md](LICENSE.md) pour plus de détails.

+ 2 - 2
README.id.md

@@ -89,7 +89,7 @@ Pola di atas adalah pola [module/nomodule pattern](https://philipwalton.com/arti
 ```
 
 Anda bahkan dapat menggunakannya untuk hal-hal yang tidak sepele: 
-*Mengambil konten HTML dari dropdown terlebih dahulu saat mengarahkan kursor*
+*Mengambil konten HTML dari dropdown terlebih dahulu saat mengarahkan kursor*.
 ```html
 <div x-data="{ open: false }">
     <button
@@ -797,6 +797,6 @@ Karena kebijakan berlaku untuk semua skrip di halaman Anda, penting agar pustaka
 
 ## Lisensi
 
-hak cipta © 2019-2020 Caleb Porzio dan kontributor
+hak cipta © 2019-2021 Caleb Porzio dan kontributor
 
 Berlisensi di bawah lisensi MIT, lihat [LICENSE.md](LICENSE.md) untuk detailnya.

+ 1 - 1
README.ja.md

@@ -546,6 +546,6 @@ Alpineでは `Function` オブジェクトを使用したカスタム実装に
 
 ## ライセンス
 
-Copyright © 2019-2020 Caleb Porzio and contributors
+Copyright © 2019-2021 Caleb Porzio and contributors
 
 MIT ライセンスの下でライセンスされています。詳細については、[LICENSE.md](LICENSE.md) を参照してください。

+ 1 - 1
README.ko.md

@@ -778,6 +778,6 @@ Alpine은 지시자을 평가하기 위해 `Function` 객체를 사용하는 사
 
 ## 라이센스
 
-저작권 © 2019-2020 Caleb Porzio 와 기여자들
+저작권 © 2019-2021 Caleb Porzio 와 기여자들
 
 MIT 라이센스에 따라 허가되며, 더 자세한 내용은 [LICENSE.md](LICENSE.md)를 확인하세요.

+ 5 - 4
README.md

@@ -149,11 +149,12 @@ And 6 magic properties:
 
 ## Community Projects
 
-* [AlpineJS Weekly Newsletter](https://alpinejs.codewithhugo.com/newsletter/)
-* [Spruce (State Management)](https://github.com/ryangjchandler/spruce)
-* [Turbolinks Adapter](https://github.com/SimoTod/alpine-turbolinks-adapter)
+* [Alpine Devtools](https://github.com/HugoDF/alpinejs-devtools)
 * [Alpine Magic Helpers](https://github.com/KevinBatdorf/alpine-magic-helpers)
+* [Alpine Weekly Newsletter](https://alpinejs.codewithhugo.com/newsletter/)
+* [Spruce (State Management)](https://github.com/ryangjchandler/spruce)
 * [Awesome Alpine](https://github.com/ryangjchandler/awesome-alpine)
+* [Turbolinks Adapter](https://github.com/SimoTod/alpine-turbolinks-adapter)
 
 ### Directives
 
@@ -796,6 +797,6 @@ Since a policy applies to all scripts in your page, it's important that other ex
 
 ## License
 
-Copyright © 2019-2020 Caleb Porzio and contributors
+Copyright © 2019-2021 Caleb Porzio and contributors
 
 Licensed under the MIT license, see [LICENSE.md](LICENSE.md) for details.

+ 1 - 1
README.pt.md

@@ -784,6 +784,6 @@ Como uma política se aplica a todos os scripts da sua página, é importante qu
 
 ## Licença
 
-Copyright © 2019-2020 Caleb Porzio e colaboradores
+Copyright © 2019-2021 Caleb Porzio e colaboradores
 
 Licenciado sob a licença MIT, consulte [LICENSE.md](LICENSE.md) para obter detalhes.

+ 1 - 1
README.tr.md

@@ -787,6 +787,6 @@ Bu politika, sayfanızdaki tüm kodlara uygulanacağından, sitenize eklediğini
 
 ## Lisans
 
-Copyright © 2019-2020 Caleb Porzio and contributors
+Copyright © 2019-2021 Caleb Porzio and contributors
 
 MIT lisansı altında lisanslanmıştır, detaylar için [LICENSE.md](LICENSE.md) 'e bakınız.

+ 1 - 1
README.zh-CN.md

@@ -778,6 +778,6 @@ Alpine 依赖对 `Function` 对象的自定义实现来运行指令。虽然比
 
 ## 许可证 License
 
-Copyright © 2019-2020 Caleb Porzio 与仓库所有贡献者 版权所有
+Copyright © 2019-2021 Caleb Porzio 与仓库所有贡献者 版权所有
 
 基于 MIT 许可证开源,查看 [LICENSE.md](LICENSE.md) 获取详情。

+ 1 - 1
README.zh-TW.md

@@ -744,7 +744,7 @@ Alpine 仰賴與使用 `Function` 物件來自定實作以對指示詞取值。
 
 ## 授權條款 License
 
-Copyright © 2019-2020 Caleb Porzio and contributors
+Copyright © 2019-2021 Caleb Porzio and contributors
 
 Licensed under the MIT license, see [LICENSE.md](LICENSE.md) for details.
 透過 MIT 授權條款授權,詳情請參閱 [LICENSE.md](LICENSE.md)。

+ 4 - 4
dist/alpine-ie11.js

@@ -7358,7 +7358,7 @@
 
       this.initializeElements(this.$el, function () {
         _newArrowCheck(this, _this);
-      }.bind(this), componentForClone ? false : true); // Use mutation observer to detect new elements being added within this component at run-time.
+      }.bind(this), componentForClone); // Use mutation observer to detect new elements being added within this component at run-time.
       // Alpine's just so darn flexible amirite?
 
       this.listenForNewElementsToInitialize();
@@ -7511,7 +7511,7 @@
         var extraVars = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {
           _newArrowCheck(this, _this10);
         }.bind(this);
-        var shouldRegisterListeners = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
+        var componentForClone = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
         this.walkAndSkipNestedComponents(rootEl, function (el) {
           _newArrowCheck(this, _this10);
 
@@ -7519,11 +7519,11 @@
           if (el.__x_for_key !== undefined) return false; // Don't touch spawns from if directives
 
           if (el.__x_inserted_me !== undefined) return false;
-          this.initializeElement(el, extraVars, shouldRegisterListeners);
+          this.initializeElement(el, extraVars, componentForClone ? false : true);
         }.bind(this), function (el) {
           _newArrowCheck(this, _this10);
 
-          el.__x = new Component(el);
+          if (!componentForClone) el.__x = new Component(el);
         }.bind(this));
         this.executeAndClearRemainingShowDirectiveStack();
         this.executeAndClearNextTickStack(rootEl);

+ 4 - 4
dist/alpine.js

@@ -1514,7 +1514,7 @@
       // event listeners are registered (the mutation observer will take care of them)
 
 
-      this.initializeElements(this.$el, () => {}, componentForClone ? false : true); // Use mutation observer to detect new elements being added within this component at run-time.
+      this.initializeElements(this.$el, () => {}, componentForClone); // Use mutation observer to detect new elements being added within this component at run-time.
       // Alpine's just so darn flexible amirite?
 
       this.listenForNewElementsToInitialize();
@@ -1603,15 +1603,15 @@
       });
     }
 
-    initializeElements(rootEl, extraVars = () => {}, shouldRegisterListeners = true) {
+    initializeElements(rootEl, extraVars = () => {}, componentForClone = false) {
       this.walkAndSkipNestedComponents(rootEl, el => {
         // Don't touch spawns from for loop
         if (el.__x_for_key !== undefined) return false; // Don't touch spawns from if directives
 
         if (el.__x_inserted_me !== undefined) return false;
-        this.initializeElement(el, extraVars, shouldRegisterListeners);
+        this.initializeElement(el, extraVars, componentForClone ? false : true);
       }, el => {
-        el.__x = new Component(el);
+        if (!componentForClone) el.__x = new Component(el);
       });
       this.executeAndClearRemainingShowDirectiveStack();
       this.executeAndClearNextTickStack(rootEl);

+ 1 - 0
examples/index.html

@@ -1,5 +1,6 @@
 <html>
     <head>
+        <meta charset="utf-8"/>
         <style>
             .hidden { display: none; }
             [x-cloak] { display: none; }

+ 1 - 0
examples/tags.html

@@ -1,5 +1,6 @@
 <html>
     <head>
+        <meta charset="utf-8"/>
         <style>
         .tags-input {
         display: flex;

+ 4 - 4
src/component.js

@@ -96,7 +96,7 @@ export default class Component {
         // Register all our listeners and set all our attribute bindings.
         // If we're cloning a component, the third parameter ensures no duplicate
         // event listeners are registered (the mutation observer will take care of them)
-        this.initializeElements(this.$el, () => {}, componentForClone ? false : true)
+        this.initializeElements(this.$el, () => {}, componentForClone)
 
         // Use mutation observer to detect new elements being added within this component at run-time.
         // Alpine's just so darn flexible amirite?
@@ -197,7 +197,7 @@ export default class Component {
         })
     }
 
-    initializeElements(rootEl, extraVars = () => {}, shouldRegisterListeners = true) {
+    initializeElements(rootEl, extraVars = () => {}, componentForClone = false) {
         this.walkAndSkipNestedComponents(rootEl, el => {
             // Don't touch spawns from for loop
             if (el.__x_for_key !== undefined) return false
@@ -205,9 +205,9 @@ export default class Component {
             // Don't touch spawns from if directives
             if (el.__x_inserted_me !== undefined) return false
 
-            this.initializeElement(el, extraVars, shouldRegisterListeners)
+            this.initializeElement(el, extraVars, componentForClone ? false : true)
         }, el => {
-            el.__x = new Component(el)
+            if(! componentForClone) el.__x = new Component(el)
         })
 
         this.executeAndClearRemainingShowDirectiveStack()