super 0.0.2 → 0.0.7
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/.yardopts +11 -0
- data/README.md +68 -76
- data/app/assets/javascripts/super/application.js +1252 -316
- data/app/assets/stylesheets/super/application.css +102704 -17321
- data/app/controllers/super/application_controller.rb +49 -71
- data/app/views/layouts/super/application.html.erb +10 -8
- data/app/views/super/application/_collection_header.html.erb +15 -0
- data/app/views/super/application/_filter.html.erb +14 -0
- data/app/views/super/application/_filter_type_select.html.erb +31 -0
- data/app/views/super/application/_filter_type_text.html.erb +22 -0
- data/app/views/super/application/_filter_type_timestamp.html.erb +35 -0
- data/app/views/super/application/_flash.html.erb +13 -13
- data/app/views/super/application/_form_field__destroy.html.erb +9 -0
- data/app/views/super/application/_form_field_select.html.erb +23 -0
- data/app/views/super/application/_form_field_text.html.erb +13 -0
- data/app/views/super/application/_form_fieldset.html.erb +8 -0
- data/app/views/super/application/_form_has_many.html.erb +21 -0
- data/app/views/super/application/_form_has_one.html.erb +11 -0
- data/app/views/super/application/_form_inline_errors.html.erb +10 -0
- data/app/views/super/application/_member_header.html.erb +16 -0
- data/app/views/super/application/_super_layout.html.erb +29 -0
- data/app/views/super/application/_super_pagination.html.erb +16 -0
- data/app/views/super/application/_super_panel.html.erb +7 -0
- data/app/views/super/application/_super_schema_display_actions.html.erb +5 -0
- data/app/views/super/application/_super_schema_display_index.html.erb +24 -0
- data/app/views/super/application/_super_schema_display_show.html.erb +8 -0
- data/app/views/super/application/_super_schema_form.html.erb +15 -0
- data/app/views/super/application/edit.html.erb +1 -6
- data/app/views/super/application/index.html.erb +1 -1
- data/app/views/super/application/new.html.erb +1 -6
- data/app/views/super/application/show.html.erb +1 -1
- data/app/views/super/feather/{_chevron_down.svg → _chevron_down.html} +0 -0
- data/config/locales/en.yml +5 -0
- data/docs/README.md +6 -0
- data/docs/cheat.md +41 -0
- data/docs/faq.md +44 -0
- data/docs/quick_start.md +45 -0
- data/docs/webpacker.md +17 -0
- data/docs/yard_customizations.rb +41 -0
- data/frontend/super-frontend/build.js +14 -12
- data/frontend/super-frontend/dist/application.css +102704 -17321
- data/frontend/super-frontend/dist/application.js +1252 -316
- data/frontend/super-frontend/package.json +11 -4
- data/frontend/super-frontend/postcss.config.js +4 -4
- data/frontend/super-frontend/src/javascripts/super/application.ts +18 -0
- data/frontend/super-frontend/src/javascripts/super/apply_template_controller.ts +19 -0
- data/frontend/super-frontend/src/javascripts/super/rails__ujs.d.ts +1 -0
- data/frontend/super-frontend/src/javascripts/super/toggle_pending_destruction_controller.ts +15 -0
- data/frontend/super-frontend/src/stylesheets/super/application.css +63 -0
- data/frontend/super-frontend/tailwind.config.js +12 -4
- data/frontend/super-frontend/tsconfig.json +13 -0
- data/frontend/super-frontend/yarn.lock +1891 -1798
- data/lib/generators/super/install/install_generator.rb +16 -0
- data/lib/generators/super/webpacker/webpacker_generator.rb +8 -0
- data/lib/super.rb +16 -6
- data/lib/super/action_inquirer.rb +14 -1
- data/lib/super/assets.rb +1 -0
- data/lib/super/client_error.rb +43 -0
- data/lib/super/compatibility.rb +25 -0
- data/lib/super/configuration.rb +66 -44
- data/lib/super/controls.rb +26 -15
- data/lib/super/controls/optional.rb +54 -0
- data/lib/super/controls/required.rb +41 -0
- data/lib/super/controls/steps.rb +128 -0
- data/lib/super/display/schema_types.rb +90 -18
- data/lib/super/engine.rb +7 -0
- data/lib/super/error.rb +9 -8
- data/lib/super/filter.rb +137 -0
- data/lib/super/filter/operator.rb +103 -0
- data/lib/super/filter/schema_types.rb +118 -0
- data/lib/super/form.rb +48 -0
- data/lib/super/form/schema_types.rb +96 -21
- data/lib/super/layout.rb +47 -0
- data/lib/super/link.rb +110 -0
- data/lib/super/navigation/automatic.rb +2 -0
- data/lib/super/pagination.rb +80 -8
- data/lib/super/panel.rb +30 -0
- data/lib/super/partial.rb +23 -0
- data/lib/super/partial/resolving.rb +24 -0
- data/lib/super/plugin.rb +34 -63
- data/lib/super/schema.rb +65 -1
- data/lib/super/version.rb +1 -1
- data/lib/super/view_helper.rb +43 -0
- metadata +132 -33
- data/app/views/super/application/_form.html.erb +0 -15
- data/app/views/super/application/_form_field.html.erb +0 -7
- data/app/views/super/application/_form_generic_select.html.erb +0 -19
- data/app/views/super/application/_form_generic_text.html.erb +0 -7
- data/app/views/super/application/_index.html.erb +0 -60
- data/app/views/super/application/_show.html.erb +0 -12
- data/frontend/super-frontend/src/javascripts/super/application.js +0 -11
- data/lib/super/display.rb +0 -9
- data/lib/super/inline_callback.rb +0 -82
- data/lib/super/test_support/copy_app_templates/20190216224956_create_members.rb +0 -11
- data/lib/super/test_support/copy_app_templates/20190803143320_create_ships.rb +0 -11
- data/lib/super/test_support/copy_app_templates/20190806014121_add_ship_to_members.rb +0 -5
- data/lib/super/test_support/copy_app_templates/member.rb +0 -16
- data/lib/super/test_support/copy_app_templates/members_controller.rb +0 -52
- data/lib/super/test_support/copy_app_templates/routes.rb +0 -10
- data/lib/super/test_support/copy_app_templates/seeds.rb +0 -2
- data/lib/super/test_support/copy_app_templates/ship.rb +0 -3
- data/lib/super/test_support/copy_app_templates/ships_controller.rb +0 -47
- data/lib/super/test_support/fixtures/members.yml +0 -336
- data/lib/super/test_support/fixtures/ships.yml +0 -10
- data/lib/super/test_support/generate_copy_app.rb +0 -52
- data/lib/super/test_support/generate_dummy.rb +0 -94
- data/lib/super/test_support/starfleet_seeder.rb +0 -49
- data/lib/super/view.rb +0 -25
- data/lib/tasks/super_tasks.rake +0 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a8e7ba2e6b5845517d94684e487bdfed0779dcade517e3e3e89bff55fee6f258
|
|
4
|
+
data.tar.gz: 62e2a405ed8d99a95de077babfdc9eb3b654d651b1887e8776d1dba609058f8e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 76bd34e08d34ea8797f0ed197b062a6be056247204a5f6badfea5a82f119c196d37b04a65ad2b1f25535885c013a1ebed7175399090078888cc528b997b57371
|
|
7
|
+
data.tar.gz: 5933d518932ea142b70aa5ac3c844d497a5bea951ee7bd72ad1a128fabc911212e2c09b63857900b2eec881a97f28aff5682b6e5c9457a25f2d0dba431887900
|
data/.yardopts
ADDED
data/README.md
CHANGED
|
@@ -1,110 +1,96 @@
|
|
|
1
1
|
# Super
|
|
2
2
|
|
|
3
|
-
Super is
|
|
3
|
+
Super is an admin framework for Ruby on Rails applications. Super helps you make
|
|
4
|
+
powerful admin pages quickly so that you can concentrate on the parts of your
|
|
5
|
+
app that make it great.
|
|
4
6
|
|
|
5
|
-
|
|
6
|
-
efficiency, to go where no one has gone before. Most of the alternatives I tried
|
|
7
|
-
were either too limited or required a large and complicated DSL for
|
|
8
|
-
configuration.
|
|
7
|
+
Super strives to let engineers build great admin pages quickly and easily by:
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
* Providing a useful CRUD interface
|
|
10
|
+
* Relying on Rails' built in features whenever possible
|
|
11
|
+
* Preferring plain Ruby objects rather than requiring DSLs
|
|
12
|
+
* Supporting a wide range of Ruby and Rails versions
|
|
13
|
+
* Having zero dependencies
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
Super has no dependencies. That means when you install Super, only Super gets
|
|
17
|
+
added to your `Gemfile.lock`. This leads to many benefits:
|
|
18
|
+
|
|
19
|
+
* Super doesn't require common Rails libraries like [Kaminari][Kaminari],
|
|
20
|
+
[Devise][Devise], or [Sass][Sass], so it'll never conflict with the libraries
|
|
21
|
+
you have installed. If you want to upgrade Super, you won't have to upgrade
|
|
22
|
+
any of your other gems. And if you want to upgrade your other gems, you won't
|
|
23
|
+
have to upgrade Super! This will greatly reduce your maintenance burden since
|
|
24
|
+
your admin framework won't dictate which libraries and which versions your
|
|
25
|
+
application uses.
|
|
26
|
+
* All code has the possibility of bugs and security issues, whether they're
|
|
27
|
+
written by you or by others. Having fewer dependencies can reduce the risk of
|
|
28
|
+
introducing problems into your application.
|
|
14
29
|
|
|
15
30
|
|
|
16
31
|
## Features
|
|
17
32
|
|
|
18
|
-
*
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
* Built in pagination
|
|
33
|
+
* Sprockets and Webpacker compatibility
|
|
34
|
+
* Note: Webpacker support depends on one additional NPM package for parsing
|
|
35
|
+
ERB
|
|
22
36
|
* Configurable forms (new and edit forms)
|
|
37
|
+
* Nested associations are supported out of the box
|
|
23
38
|
* Configurable display (index and show tables)
|
|
39
|
+
* Pre-built frontend assets (doesn't require Sass, PostCSS, Babel, etc)
|
|
40
|
+
* Vendored assets include
|
|
41
|
+
* Stimulus JS
|
|
42
|
+
* Rails UJS
|
|
43
|
+
* Tailwind CSS
|
|
24
44
|
* Supports Rails 5.0+, Ruby 2.3+
|
|
25
|
-
* Configurable without a DSL
|
|
26
|
-
* Looks reasonably nice and modern
|
|
27
|
-
* All assets are vendored (doesn't require Sass, PostCSS, Babel, etc)
|
|
28
45
|
|
|
29
|
-
Super was inspired in part by the admin frameworks [ActiveAdmin](activeadmin)
|
|
30
|
-
and [Administrate](administrate). If Super doesn't quite fit your requirements
|
|
31
|
-
at this moment, one of those might meet your needs better.
|
|
32
46
|
|
|
47
|
+
## Super doesn't fit my needs. What should I look at?
|
|
33
48
|
|
|
34
|
-
|
|
49
|
+
There are lots of Rails admin frameworks. I've personally used
|
|
50
|
+
[ActiveAdmin][ActiveAdmin] and [Administrate][Administrate], and I had some
|
|
51
|
+
brief exposure to [RailsAdmin][RailsAdmin].
|
|
35
52
|
|
|
36
|
-
|
|
53
|
+
If you need a ton of features, I'd probably suggest looking at ActiveAdmin. It
|
|
54
|
+
relies pretty heavily on DSLs but is pretty flexible and popular.
|
|
37
55
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
* An LGPL exemption
|
|
42
|
-
|
|
43
|
-
It will be available soon. Subscribe to the [newsletter](newsletter) to be
|
|
44
|
-
notified of its availability or for brief, occasional updates.
|
|
56
|
+
I like Administrate as well. I found that it doesn't have quite as many features
|
|
57
|
+
as ActiveAdmin, but it's nice and feels like developing a normal Rails app.
|
|
58
|
+
There's no DSL.
|
|
45
59
|
|
|
46
60
|
|
|
47
|
-
##
|
|
61
|
+
## Paid editions
|
|
48
62
|
|
|
49
|
-
|
|
50
|
-
* [Super Demo source](https://github.com/zachahn/super_demo)
|
|
51
|
-
* [Super Professional Demo](https://demo-super-professional.herokuapp.com/admin/members)
|
|
63
|
+
If you have additional requirements, there are some paid editions to consider:
|
|
52
64
|
|
|
65
|
+
**Super Premium** provides:
|
|
53
66
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
### Creating new admin pages
|
|
57
|
-
|
|
58
|
-
```bash
|
|
59
|
-
$ bundle exec rails g super:resource Thing # check out the `--help` option!
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
The example above will create the appropriate admin controller. It generates a
|
|
63
|
-
`Controls` class inside the controller as well; it's where most configuration
|
|
64
|
-
lives. You generally won't need to edit the controller actions themselves.
|
|
67
|
+
* Priority email support
|
|
68
|
+
* Ensuring long term development of Super
|
|
65
69
|
|
|
66
|
-
|
|
67
|
-
look something like the following:
|
|
70
|
+
**Super Professional** provides everything in Premium and:
|
|
68
71
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
resources :things
|
|
72
|
-
end
|
|
73
|
-
```
|
|
72
|
+
* Productivity improvements and quality of life features for admins
|
|
73
|
+
* An LGPL exemption
|
|
74
74
|
|
|
75
|
+
They aren't available yet. Contact me if you're interested, or subscribe to the
|
|
76
|
+
[newsletter][newsletter] to be notified of its availability and for brief,
|
|
77
|
+
occasional updates to Super.
|
|
75
78
|
|
|
76
|
-
## Installation
|
|
77
79
|
|
|
78
|
-
|
|
80
|
+
## Demos
|
|
79
81
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
```
|
|
82
|
+
* [Super Demo][super_demo]
|
|
83
|
+
* [Super Demo source][super_demo_source]
|
|
83
84
|
|
|
84
|
-
And then execute:
|
|
85
85
|
|
|
86
|
-
|
|
87
|
-
$ bundle install
|
|
88
|
-
$ bundle exec rails g super:install # check out the `--help` option!
|
|
89
|
-
```
|
|
86
|
+
## Installation and Usage
|
|
90
87
|
|
|
91
|
-
|
|
92
|
-
to set up ERB templates under Webpacker. There are no other requirements or
|
|
93
|
-
dependencies.
|
|
88
|
+
See [Quick start](./docs/quick_start.md)
|
|
94
89
|
|
|
95
|
-
```bash
|
|
96
|
-
$ bundle exec rails webpacker:install:erb # if you haven't already
|
|
97
|
-
$ bundle exec rails g super:webpacker
|
|
98
|
-
```
|
|
99
90
|
|
|
100
|
-
|
|
91
|
+
## Path to 1.0
|
|
101
92
|
|
|
102
|
-
|
|
103
|
-
Super.configuration do |c|
|
|
104
|
-
# ...
|
|
105
|
-
c.asset_handler = Super::Assets.webpacker
|
|
106
|
-
end
|
|
107
|
-
```
|
|
93
|
+
See [STABILITY](./STABILITY.md)
|
|
108
94
|
|
|
109
95
|
|
|
110
96
|
## Contributing
|
|
@@ -117,6 +103,12 @@ See [CONTRIBUTING](./CONTRIBUTING.md)
|
|
|
117
103
|
The gem is available under the terms of the [GNU LGPLv3](./LICENSE).
|
|
118
104
|
|
|
119
105
|
|
|
120
|
-
[
|
|
121
|
-
[
|
|
106
|
+
[Administrate]: https://github.com/thoughtbot/administrate
|
|
107
|
+
[ActiveAdmin]: https://github.com/activeadmin/activeadmin
|
|
108
|
+
[RailsAdmin]: https://github.com/sferik/rails_admin
|
|
109
|
+
[Kaminari]: https://github.com/kaminari/kaminari
|
|
110
|
+
[Devise]: https://github.com/heartcombo/devise
|
|
111
|
+
[Sass]: https://github.com/sass/sassc-ruby
|
|
122
112
|
[newsletter]: https://tinyletter.com/zachahn
|
|
113
|
+
[super_demo]: https://demo-super.herokuapp.com/admin/members
|
|
114
|
+
[super_demo_source]: https://github.com/zachahn/super_demo
|
|
@@ -117,13 +117,13 @@ parcelRequire = (function (modules, cache, entry, globalName) {
|
|
|
117
117
|
}
|
|
118
118
|
|
|
119
119
|
return newRequire;
|
|
120
|
-
})({"../node_modules/
|
|
120
|
+
})({"../node_modules/@rails/ujs/lib/assets/compiled/rails-ujs.js":[function(require,module,exports) {
|
|
121
121
|
var define;
|
|
122
122
|
/*
|
|
123
123
|
Unobtrusive JavaScript
|
|
124
124
|
https://github.com/rails/rails/blob/master/actionview/app/assets/javascripts
|
|
125
125
|
Released under the MIT license
|
|
126
|
-
|
|
126
|
+
*/;
|
|
127
127
|
|
|
128
128
|
(function() {
|
|
129
129
|
var context = this;
|
|
@@ -441,6 +441,9 @@ Released under the MIT license
|
|
|
441
441
|
if (!input.name || input.disabled) {
|
|
442
442
|
return;
|
|
443
443
|
}
|
|
444
|
+
if (matches(input, 'fieldset[disabled] *')) {
|
|
445
|
+
return;
|
|
446
|
+
}
|
|
444
447
|
if (matches(input, 'select')) {
|
|
445
448
|
return toArray(input.options).forEach(function(option) {
|
|
446
449
|
if (option.selected) {
|
|
@@ -491,6 +494,10 @@ Released under the MIT license
|
|
|
491
494
|
}
|
|
492
495
|
};
|
|
493
496
|
|
|
497
|
+
Rails.confirm = function(message, element) {
|
|
498
|
+
return confirm(message);
|
|
499
|
+
};
|
|
500
|
+
|
|
494
501
|
allowAction = function(element) {
|
|
495
502
|
var answer, callback, message;
|
|
496
503
|
message = element.getAttribute('data-confirm');
|
|
@@ -500,7 +507,7 @@ Released under the MIT license
|
|
|
500
507
|
answer = false;
|
|
501
508
|
if (fire(element, 'confirm')) {
|
|
502
509
|
try {
|
|
503
|
-
answer = confirm(message);
|
|
510
|
+
answer = Rails.confirm(message, element);
|
|
504
511
|
} catch (error) {}
|
|
505
512
|
callback = fire(element, 'confirm:complete', [answer]);
|
|
506
513
|
}
|
|
@@ -509,7 +516,7 @@ Released under the MIT license
|
|
|
509
516
|
|
|
510
517
|
}).call(this);
|
|
511
518
|
(function() {
|
|
512
|
-
var disableFormElement, disableFormElements, disableLinkElement, enableFormElement, enableFormElements, enableLinkElement, formElements, getData, matches, setData, stopEverything;
|
|
519
|
+
var disableFormElement, disableFormElements, disableLinkElement, enableFormElement, enableFormElements, enableLinkElement, formElements, getData, isXhrRedirect, matches, setData, stopEverything;
|
|
513
520
|
|
|
514
521
|
matches = Rails.matches, getData = Rails.getData, setData = Rails.setData, stopEverything = Rails.stopEverything, formElements = Rails.formElements;
|
|
515
522
|
|
|
@@ -523,7 +530,14 @@ Released under the MIT license
|
|
|
523
530
|
|
|
524
531
|
Rails.enableElement = function(e) {
|
|
525
532
|
var element;
|
|
526
|
-
|
|
533
|
+
if (e instanceof Event) {
|
|
534
|
+
if (isXhrRedirect(e)) {
|
|
535
|
+
return;
|
|
536
|
+
}
|
|
537
|
+
element = e.target;
|
|
538
|
+
} else {
|
|
539
|
+
element = e;
|
|
540
|
+
}
|
|
527
541
|
if (matches(element, Rails.linkDisableSelector)) {
|
|
528
542
|
return enableLinkElement(element);
|
|
529
543
|
} else if (matches(element, Rails.buttonDisableSelector) || matches(element, Rails.formEnableSelector)) {
|
|
@@ -547,6 +561,9 @@ Released under the MIT license
|
|
|
547
561
|
|
|
548
562
|
disableLinkElement = function(element) {
|
|
549
563
|
var replacement;
|
|
564
|
+
if (getData(element, 'ujs:disabled')) {
|
|
565
|
+
return;
|
|
566
|
+
}
|
|
550
567
|
replacement = element.getAttribute('data-disable-with');
|
|
551
568
|
if (replacement != null) {
|
|
552
569
|
setData(element, 'ujs:enable-with', element.innerHTML);
|
|
@@ -573,6 +590,9 @@ Released under the MIT license
|
|
|
573
590
|
|
|
574
591
|
disableFormElement = function(element) {
|
|
575
592
|
var replacement;
|
|
593
|
+
if (getData(element, 'ujs:disabled')) {
|
|
594
|
+
return;
|
|
595
|
+
}
|
|
576
596
|
replacement = element.getAttribute('data-disable-with');
|
|
577
597
|
if (replacement != null) {
|
|
578
598
|
if (matches(element, 'button')) {
|
|
@@ -606,6 +626,12 @@ Released under the MIT license
|
|
|
606
626
|
return setData(element, 'ujs:disabled', null);
|
|
607
627
|
};
|
|
608
628
|
|
|
629
|
+
isXhrRedirect = function(event) {
|
|
630
|
+
var ref, xhr;
|
|
631
|
+
xhr = (ref = event.detail) != null ? ref[0] : void 0;
|
|
632
|
+
return (xhr != null ? xhr.getResponseHeader("X-Xhr-Redirect") : void 0) != null;
|
|
633
|
+
};
|
|
634
|
+
|
|
609
635
|
}).call(this);
|
|
610
636
|
(function() {
|
|
611
637
|
var stopEverything;
|
|
@@ -743,14 +769,14 @@ Released under the MIT license
|
|
|
743
769
|
};
|
|
744
770
|
|
|
745
771
|
Rails.preventInsignificantClick = function(e) {
|
|
746
|
-
var data, insignificantMetaClick, link, metaClick, method,
|
|
772
|
+
var data, insignificantMetaClick, link, metaClick, method, nonPrimaryMouseClick;
|
|
747
773
|
link = this;
|
|
748
774
|
method = (link.getAttribute('data-method') || 'GET').toUpperCase();
|
|
749
775
|
data = link.getAttribute('data-params');
|
|
750
776
|
metaClick = e.metaKey || e.ctrlKey;
|
|
751
777
|
insignificantMetaClick = metaClick && method === 'GET' && !data;
|
|
752
|
-
|
|
753
|
-
if (
|
|
778
|
+
nonPrimaryMouseClick = (e.button != null) && e.button !== 0;
|
|
779
|
+
if (nonPrimaryMouseClick || insignificantMetaClick) {
|
|
754
780
|
return e.stopImmediatePropagation();
|
|
755
781
|
}
|
|
756
782
|
};
|
|
@@ -840,7 +866,7 @@ Released under the MIT license
|
|
|
840
866
|
}
|
|
841
867
|
}).call(this);
|
|
842
868
|
|
|
843
|
-
},{}],"../node_modules/@stimulus/core/dist/
|
|
869
|
+
},{}],"../node_modules/@stimulus/core/dist/event_listener.js":[function(require,module,exports) {
|
|
844
870
|
"use strict";
|
|
845
871
|
|
|
846
872
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -851,18 +877,19 @@ exports.EventListener = void 0;
|
|
|
851
877
|
var EventListener =
|
|
852
878
|
/** @class */
|
|
853
879
|
function () {
|
|
854
|
-
function EventListener(eventTarget, eventName) {
|
|
880
|
+
function EventListener(eventTarget, eventName, eventOptions) {
|
|
855
881
|
this.eventTarget = eventTarget;
|
|
856
882
|
this.eventName = eventName;
|
|
883
|
+
this.eventOptions = eventOptions;
|
|
857
884
|
this.unorderedBindings = new Set();
|
|
858
885
|
}
|
|
859
886
|
|
|
860
887
|
EventListener.prototype.connect = function () {
|
|
861
|
-
this.eventTarget.addEventListener(this.eventName, this,
|
|
888
|
+
this.eventTarget.addEventListener(this.eventName, this, this.eventOptions);
|
|
862
889
|
};
|
|
863
890
|
|
|
864
891
|
EventListener.prototype.disconnect = function () {
|
|
865
|
-
this.eventTarget.removeEventListener(this.eventName, this,
|
|
892
|
+
this.eventTarget.removeEventListener(this.eventName, this, this.eventOptions);
|
|
866
893
|
}; // Binding observer delegate
|
|
867
894
|
|
|
868
895
|
/** @hidden */
|
|
@@ -900,7 +927,7 @@ function () {
|
|
|
900
927
|
return leftIndex < rightIndex ? -1 : leftIndex > rightIndex ? 1 : 0;
|
|
901
928
|
});
|
|
902
929
|
},
|
|
903
|
-
enumerable:
|
|
930
|
+
enumerable: false,
|
|
904
931
|
configurable: true
|
|
905
932
|
});
|
|
906
933
|
return EventListener;
|
|
@@ -921,8 +948,8 @@ function extendEvent(event) {
|
|
|
921
948
|
}
|
|
922
949
|
});
|
|
923
950
|
}
|
|
924
|
-
}
|
|
925
|
-
},{}],"../node_modules/@stimulus/core/dist/
|
|
951
|
+
}
|
|
952
|
+
},{}],"../node_modules/@stimulus/core/dist/dispatcher.js":[function(require,module,exports) {
|
|
926
953
|
"use strict";
|
|
927
954
|
|
|
928
955
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -965,7 +992,7 @@ function () {
|
|
|
965
992
|
return listeners.concat(Array.from(map.values()));
|
|
966
993
|
}, []);
|
|
967
994
|
},
|
|
968
|
-
enumerable:
|
|
995
|
+
enumerable: false,
|
|
969
996
|
configurable: true
|
|
970
997
|
}); // Binding observer delegate
|
|
971
998
|
|
|
@@ -992,24 +1019,26 @@ function () {
|
|
|
992
1019
|
|
|
993
1020
|
Dispatcher.prototype.fetchEventListenerForBinding = function (binding) {
|
|
994
1021
|
var eventTarget = binding.eventTarget,
|
|
995
|
-
eventName = binding.eventName
|
|
996
|
-
|
|
1022
|
+
eventName = binding.eventName,
|
|
1023
|
+
eventOptions = binding.eventOptions;
|
|
1024
|
+
return this.fetchEventListener(eventTarget, eventName, eventOptions);
|
|
997
1025
|
};
|
|
998
1026
|
|
|
999
|
-
Dispatcher.prototype.fetchEventListener = function (eventTarget, eventName) {
|
|
1027
|
+
Dispatcher.prototype.fetchEventListener = function (eventTarget, eventName, eventOptions) {
|
|
1000
1028
|
var eventListenerMap = this.fetchEventListenerMapForEventTarget(eventTarget);
|
|
1001
|
-
var
|
|
1029
|
+
var cacheKey = this.cacheKey(eventName, eventOptions);
|
|
1030
|
+
var eventListener = eventListenerMap.get(cacheKey);
|
|
1002
1031
|
|
|
1003
1032
|
if (!eventListener) {
|
|
1004
|
-
eventListener = this.createEventListener(eventTarget, eventName);
|
|
1005
|
-
eventListenerMap.set(
|
|
1033
|
+
eventListener = this.createEventListener(eventTarget, eventName, eventOptions);
|
|
1034
|
+
eventListenerMap.set(cacheKey, eventListener);
|
|
1006
1035
|
}
|
|
1007
1036
|
|
|
1008
1037
|
return eventListener;
|
|
1009
1038
|
};
|
|
1010
1039
|
|
|
1011
|
-
Dispatcher.prototype.createEventListener = function (eventTarget, eventName) {
|
|
1012
|
-
var eventListener = new _event_listener.EventListener(eventTarget, eventName);
|
|
1040
|
+
Dispatcher.prototype.createEventListener = function (eventTarget, eventName, eventOptions) {
|
|
1041
|
+
var eventListener = new _event_listener.EventListener(eventTarget, eventName, eventOptions);
|
|
1013
1042
|
|
|
1014
1043
|
if (this.started) {
|
|
1015
1044
|
eventListener.connect();
|
|
@@ -1029,28 +1058,36 @@ function () {
|
|
|
1029
1058
|
return eventListenerMap;
|
|
1030
1059
|
};
|
|
1031
1060
|
|
|
1032
|
-
|
|
1033
|
-
|
|
1061
|
+
Dispatcher.prototype.cacheKey = function (eventName, eventOptions) {
|
|
1062
|
+
var parts = [eventName];
|
|
1063
|
+
Object.keys(eventOptions).sort().forEach(function (key) {
|
|
1064
|
+
parts.push("" + (eventOptions[key] ? "" : "!") + key);
|
|
1065
|
+
});
|
|
1066
|
+
return parts.join(":");
|
|
1067
|
+
};
|
|
1034
1068
|
|
|
1069
|
+
return Dispatcher;
|
|
1070
|
+
}();
|
|
1035
1071
|
|
|
1036
1072
|
exports.Dispatcher = Dispatcher;
|
|
1037
|
-
},{"./event_listener":"../node_modules/@stimulus/core/dist/
|
|
1073
|
+
},{"./event_listener":"../node_modules/@stimulus/core/dist/event_listener.js"}],"../node_modules/@stimulus/core/dist/action_descriptor.js":[function(require,module,exports) {
|
|
1038
1074
|
"use strict";
|
|
1039
1075
|
|
|
1040
1076
|
Object.defineProperty(exports, "__esModule", {
|
|
1041
1077
|
value: true
|
|
1042
1078
|
});
|
|
1043
|
-
exports.
|
|
1079
|
+
exports.parseActionDescriptorString = parseActionDescriptorString;
|
|
1044
1080
|
exports.stringifyEventTarget = stringifyEventTarget;
|
|
1045
|
-
// capture nos.: 12 23 4 43 1 5 56 7
|
|
1046
|
-
var descriptorPattern = /^((.+?)(@(window|document))?->)?(.+?)(#(.+))?$/;
|
|
1081
|
+
// capture nos.: 12 23 4 43 1 5 56 7 768 9 98
|
|
1082
|
+
var descriptorPattern = /^((.+?)(@(window|document))?->)?(.+?)(#([^:]+?))(:(.+))?$/;
|
|
1047
1083
|
|
|
1048
|
-
function
|
|
1084
|
+
function parseActionDescriptorString(descriptorString) {
|
|
1049
1085
|
var source = descriptorString.trim();
|
|
1050
1086
|
var matches = source.match(descriptorPattern) || [];
|
|
1051
1087
|
return {
|
|
1052
1088
|
eventTarget: parseEventTarget(matches[4]),
|
|
1053
1089
|
eventName: matches[2],
|
|
1090
|
+
eventOptions: matches[9] ? parseEventOptions(matches[9]) : {},
|
|
1054
1091
|
identifier: matches[5],
|
|
1055
1092
|
methodName: matches[7]
|
|
1056
1093
|
};
|
|
@@ -1064,14 +1101,22 @@ function parseEventTarget(eventTargetName) {
|
|
|
1064
1101
|
}
|
|
1065
1102
|
}
|
|
1066
1103
|
|
|
1104
|
+
function parseEventOptions(eventOptions) {
|
|
1105
|
+
return eventOptions.split(":").reduce(function (options, token) {
|
|
1106
|
+
var _a;
|
|
1107
|
+
|
|
1108
|
+
return Object.assign(options, (_a = {}, _a[token.replace(/^!/, "")] = !/^!/.test(token), _a));
|
|
1109
|
+
}, {});
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1067
1112
|
function stringifyEventTarget(eventTarget) {
|
|
1068
1113
|
if (eventTarget == window) {
|
|
1069
1114
|
return "window";
|
|
1070
1115
|
} else if (eventTarget == document) {
|
|
1071
1116
|
return "document";
|
|
1072
1117
|
}
|
|
1073
|
-
}
|
|
1074
|
-
},{}],"../node_modules/@stimulus/core/dist/
|
|
1118
|
+
}
|
|
1119
|
+
},{}],"../node_modules/@stimulus/core/dist/action.js":[function(require,module,exports) {
|
|
1075
1120
|
"use strict";
|
|
1076
1121
|
|
|
1077
1122
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -1090,12 +1135,13 @@ function () {
|
|
|
1090
1135
|
this.index = index;
|
|
1091
1136
|
this.eventTarget = descriptor.eventTarget || element;
|
|
1092
1137
|
this.eventName = descriptor.eventName || getDefaultEventNameForElement(element) || error("missing event name");
|
|
1138
|
+
this.eventOptions = descriptor.eventOptions || {};
|
|
1093
1139
|
this.identifier = descriptor.identifier || error("missing identifier");
|
|
1094
1140
|
this.methodName = descriptor.methodName || error("missing method name");
|
|
1095
1141
|
}
|
|
1096
1142
|
|
|
1097
1143
|
Action.forToken = function (token) {
|
|
1098
|
-
return new this(token.element, token.index, (0, _action_descriptor.
|
|
1144
|
+
return new this(token.element, token.index, (0, _action_descriptor.parseActionDescriptorString)(token.content));
|
|
1099
1145
|
};
|
|
1100
1146
|
|
|
1101
1147
|
Action.prototype.toString = function () {
|
|
@@ -1107,7 +1153,7 @@ function () {
|
|
|
1107
1153
|
get: function () {
|
|
1108
1154
|
return (0, _action_descriptor.stringifyEventTarget)(this.eventTarget);
|
|
1109
1155
|
},
|
|
1110
|
-
enumerable:
|
|
1156
|
+
enumerable: false,
|
|
1111
1157
|
configurable: true
|
|
1112
1158
|
});
|
|
1113
1159
|
return Action;
|
|
@@ -1125,13 +1171,13 @@ var defaultEventNames = {
|
|
|
1125
1171
|
return "submit";
|
|
1126
1172
|
},
|
|
1127
1173
|
"input": function (e) {
|
|
1128
|
-
return e.getAttribute("type") == "submit" ? "click" : "
|
|
1174
|
+
return e.getAttribute("type") == "submit" ? "click" : "input";
|
|
1129
1175
|
},
|
|
1130
1176
|
"select": function (e) {
|
|
1131
1177
|
return "change";
|
|
1132
1178
|
},
|
|
1133
1179
|
"textarea": function (e) {
|
|
1134
|
-
return "
|
|
1180
|
+
return "input";
|
|
1135
1181
|
}
|
|
1136
1182
|
};
|
|
1137
1183
|
|
|
@@ -1145,8 +1191,8 @@ function getDefaultEventNameForElement(element) {
|
|
|
1145
1191
|
|
|
1146
1192
|
function error(message) {
|
|
1147
1193
|
throw new Error(message);
|
|
1148
|
-
}
|
|
1149
|
-
},{"./action_descriptor":"../node_modules/@stimulus/core/dist/
|
|
1194
|
+
}
|
|
1195
|
+
},{"./action_descriptor":"../node_modules/@stimulus/core/dist/action_descriptor.js"}],"../node_modules/@stimulus/core/dist/binding.js":[function(require,module,exports) {
|
|
1150
1196
|
"use strict";
|
|
1151
1197
|
|
|
1152
1198
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -1166,21 +1212,28 @@ function () {
|
|
|
1166
1212
|
get: function () {
|
|
1167
1213
|
return this.action.index;
|
|
1168
1214
|
},
|
|
1169
|
-
enumerable:
|
|
1215
|
+
enumerable: false,
|
|
1170
1216
|
configurable: true
|
|
1171
1217
|
});
|
|
1172
1218
|
Object.defineProperty(Binding.prototype, "eventTarget", {
|
|
1173
1219
|
get: function () {
|
|
1174
1220
|
return this.action.eventTarget;
|
|
1175
1221
|
},
|
|
1176
|
-
enumerable:
|
|
1222
|
+
enumerable: false,
|
|
1223
|
+
configurable: true
|
|
1224
|
+
});
|
|
1225
|
+
Object.defineProperty(Binding.prototype, "eventOptions", {
|
|
1226
|
+
get: function () {
|
|
1227
|
+
return this.action.eventOptions;
|
|
1228
|
+
},
|
|
1229
|
+
enumerable: false,
|
|
1177
1230
|
configurable: true
|
|
1178
1231
|
});
|
|
1179
1232
|
Object.defineProperty(Binding.prototype, "identifier", {
|
|
1180
1233
|
get: function () {
|
|
1181
1234
|
return this.context.identifier;
|
|
1182
1235
|
},
|
|
1183
|
-
enumerable:
|
|
1236
|
+
enumerable: false,
|
|
1184
1237
|
configurable: true
|
|
1185
1238
|
});
|
|
1186
1239
|
|
|
@@ -1194,7 +1247,7 @@ function () {
|
|
|
1194
1247
|
get: function () {
|
|
1195
1248
|
return this.action.eventName;
|
|
1196
1249
|
},
|
|
1197
|
-
enumerable:
|
|
1250
|
+
enumerable: false,
|
|
1198
1251
|
configurable: true
|
|
1199
1252
|
});
|
|
1200
1253
|
Object.defineProperty(Binding.prototype, "method", {
|
|
@@ -1207,7 +1260,7 @@ function () {
|
|
|
1207
1260
|
|
|
1208
1261
|
throw new Error("Action \"" + this.action + "\" references undefined method \"" + this.methodName + "\"");
|
|
1209
1262
|
},
|
|
1210
|
-
enumerable:
|
|
1263
|
+
enumerable: false,
|
|
1211
1264
|
configurable: true
|
|
1212
1265
|
});
|
|
1213
1266
|
|
|
@@ -1240,7 +1293,7 @@ function () {
|
|
|
1240
1293
|
} else if (eventTarget instanceof Element && this.element.contains(eventTarget)) {
|
|
1241
1294
|
return this.scope.containsElement(eventTarget);
|
|
1242
1295
|
} else {
|
|
1243
|
-
return
|
|
1296
|
+
return this.scope.containsElement(this.action.element);
|
|
1244
1297
|
}
|
|
1245
1298
|
};
|
|
1246
1299
|
|
|
@@ -1248,36 +1301,35 @@ function () {
|
|
|
1248
1301
|
get: function () {
|
|
1249
1302
|
return this.context.controller;
|
|
1250
1303
|
},
|
|
1251
|
-
enumerable:
|
|
1304
|
+
enumerable: false,
|
|
1252
1305
|
configurable: true
|
|
1253
1306
|
});
|
|
1254
1307
|
Object.defineProperty(Binding.prototype, "methodName", {
|
|
1255
1308
|
get: function () {
|
|
1256
1309
|
return this.action.methodName;
|
|
1257
1310
|
},
|
|
1258
|
-
enumerable:
|
|
1311
|
+
enumerable: false,
|
|
1259
1312
|
configurable: true
|
|
1260
1313
|
});
|
|
1261
1314
|
Object.defineProperty(Binding.prototype, "element", {
|
|
1262
1315
|
get: function () {
|
|
1263
1316
|
return this.scope.element;
|
|
1264
1317
|
},
|
|
1265
|
-
enumerable:
|
|
1318
|
+
enumerable: false,
|
|
1266
1319
|
configurable: true
|
|
1267
1320
|
});
|
|
1268
1321
|
Object.defineProperty(Binding.prototype, "scope", {
|
|
1269
1322
|
get: function () {
|
|
1270
1323
|
return this.context.scope;
|
|
1271
1324
|
},
|
|
1272
|
-
enumerable:
|
|
1325
|
+
enumerable: false,
|
|
1273
1326
|
configurable: true
|
|
1274
1327
|
});
|
|
1275
1328
|
return Binding;
|
|
1276
|
-
}();
|
|
1277
|
-
|
|
1329
|
+
}();
|
|
1278
1330
|
|
|
1279
1331
|
exports.Binding = Binding;
|
|
1280
|
-
},{}],"../node_modules/@stimulus/mutation-observers/dist/
|
|
1332
|
+
},{}],"../node_modules/@stimulus/mutation-observers/dist/element_observer.js":[function(require,module,exports) {
|
|
1281
1333
|
"use strict";
|
|
1282
1334
|
|
|
1283
1335
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -1452,11 +1504,10 @@ function () {
|
|
|
1452
1504
|
};
|
|
1453
1505
|
|
|
1454
1506
|
return ElementObserver;
|
|
1455
|
-
}();
|
|
1456
|
-
|
|
1507
|
+
}();
|
|
1457
1508
|
|
|
1458
1509
|
exports.ElementObserver = ElementObserver;
|
|
1459
|
-
},{}],"../node_modules/@stimulus/mutation-observers/dist/
|
|
1510
|
+
},{}],"../node_modules/@stimulus/mutation-observers/dist/attribute_observer.js":[function(require,module,exports) {
|
|
1460
1511
|
"use strict";
|
|
1461
1512
|
|
|
1462
1513
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -1479,14 +1530,14 @@ function () {
|
|
|
1479
1530
|
get: function () {
|
|
1480
1531
|
return this.elementObserver.element;
|
|
1481
1532
|
},
|
|
1482
|
-
enumerable:
|
|
1533
|
+
enumerable: false,
|
|
1483
1534
|
configurable: true
|
|
1484
1535
|
});
|
|
1485
1536
|
Object.defineProperty(AttributeObserver.prototype, "selector", {
|
|
1486
1537
|
get: function () {
|
|
1487
1538
|
return "[" + this.attributeName + "]";
|
|
1488
1539
|
},
|
|
1489
|
-
enumerable:
|
|
1540
|
+
enumerable: false,
|
|
1490
1541
|
configurable: true
|
|
1491
1542
|
});
|
|
1492
1543
|
|
|
@@ -1506,7 +1557,7 @@ function () {
|
|
|
1506
1557
|
get: function () {
|
|
1507
1558
|
return this.elementObserver.started;
|
|
1508
1559
|
},
|
|
1509
|
-
enumerable:
|
|
1560
|
+
enumerable: false,
|
|
1510
1561
|
configurable: true
|
|
1511
1562
|
}); // Element observer delegate
|
|
1512
1563
|
|
|
@@ -1539,11 +1590,147 @@ function () {
|
|
|
1539
1590
|
};
|
|
1540
1591
|
|
|
1541
1592
|
return AttributeObserver;
|
|
1542
|
-
}();
|
|
1543
|
-
|
|
1593
|
+
}();
|
|
1544
1594
|
|
|
1545
1595
|
exports.AttributeObserver = AttributeObserver;
|
|
1546
|
-
},{"./element_observer":"../node_modules/@stimulus/mutation-observers/dist/
|
|
1596
|
+
},{"./element_observer":"../node_modules/@stimulus/mutation-observers/dist/element_observer.js"}],"../node_modules/@stimulus/mutation-observers/dist/string_map_observer.js":[function(require,module,exports) {
|
|
1597
|
+
"use strict";
|
|
1598
|
+
|
|
1599
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1600
|
+
value: true
|
|
1601
|
+
});
|
|
1602
|
+
exports.StringMapObserver = void 0;
|
|
1603
|
+
|
|
1604
|
+
var StringMapObserver =
|
|
1605
|
+
/** @class */
|
|
1606
|
+
function () {
|
|
1607
|
+
function StringMapObserver(element, delegate) {
|
|
1608
|
+
var _this = this;
|
|
1609
|
+
|
|
1610
|
+
this.element = element;
|
|
1611
|
+
this.delegate = delegate;
|
|
1612
|
+
this.started = false;
|
|
1613
|
+
this.stringMap = new Map();
|
|
1614
|
+
this.mutationObserver = new MutationObserver(function (mutations) {
|
|
1615
|
+
return _this.processMutations(mutations);
|
|
1616
|
+
});
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1619
|
+
StringMapObserver.prototype.start = function () {
|
|
1620
|
+
if (!this.started) {
|
|
1621
|
+
this.started = true;
|
|
1622
|
+
this.mutationObserver.observe(this.element, {
|
|
1623
|
+
attributes: true
|
|
1624
|
+
});
|
|
1625
|
+
this.refresh();
|
|
1626
|
+
}
|
|
1627
|
+
};
|
|
1628
|
+
|
|
1629
|
+
StringMapObserver.prototype.stop = function () {
|
|
1630
|
+
if (this.started) {
|
|
1631
|
+
this.mutationObserver.takeRecords();
|
|
1632
|
+
this.mutationObserver.disconnect();
|
|
1633
|
+
this.started = false;
|
|
1634
|
+
}
|
|
1635
|
+
};
|
|
1636
|
+
|
|
1637
|
+
StringMapObserver.prototype.refresh = function () {
|
|
1638
|
+
if (this.started) {
|
|
1639
|
+
for (var _i = 0, _a = this.knownAttributeNames; _i < _a.length; _i++) {
|
|
1640
|
+
var attributeName = _a[_i];
|
|
1641
|
+
this.refreshAttribute(attributeName);
|
|
1642
|
+
}
|
|
1643
|
+
}
|
|
1644
|
+
}; // Mutation record processing
|
|
1645
|
+
|
|
1646
|
+
|
|
1647
|
+
StringMapObserver.prototype.processMutations = function (mutations) {
|
|
1648
|
+
if (this.started) {
|
|
1649
|
+
for (var _i = 0, mutations_1 = mutations; _i < mutations_1.length; _i++) {
|
|
1650
|
+
var mutation = mutations_1[_i];
|
|
1651
|
+
this.processMutation(mutation);
|
|
1652
|
+
}
|
|
1653
|
+
}
|
|
1654
|
+
};
|
|
1655
|
+
|
|
1656
|
+
StringMapObserver.prototype.processMutation = function (mutation) {
|
|
1657
|
+
var attributeName = mutation.attributeName;
|
|
1658
|
+
|
|
1659
|
+
if (attributeName) {
|
|
1660
|
+
this.refreshAttribute(attributeName);
|
|
1661
|
+
}
|
|
1662
|
+
}; // State tracking
|
|
1663
|
+
|
|
1664
|
+
|
|
1665
|
+
StringMapObserver.prototype.refreshAttribute = function (attributeName) {
|
|
1666
|
+
var key = this.delegate.getStringMapKeyForAttribute(attributeName);
|
|
1667
|
+
|
|
1668
|
+
if (key != null) {
|
|
1669
|
+
if (!this.stringMap.has(attributeName)) {
|
|
1670
|
+
this.stringMapKeyAdded(key, attributeName);
|
|
1671
|
+
}
|
|
1672
|
+
|
|
1673
|
+
var value = this.element.getAttribute(attributeName);
|
|
1674
|
+
|
|
1675
|
+
if (this.stringMap.get(attributeName) != value) {
|
|
1676
|
+
this.stringMapValueChanged(value, key);
|
|
1677
|
+
}
|
|
1678
|
+
|
|
1679
|
+
if (value == null) {
|
|
1680
|
+
this.stringMap.delete(attributeName);
|
|
1681
|
+
this.stringMapKeyRemoved(key, attributeName);
|
|
1682
|
+
} else {
|
|
1683
|
+
this.stringMap.set(attributeName, value);
|
|
1684
|
+
}
|
|
1685
|
+
}
|
|
1686
|
+
};
|
|
1687
|
+
|
|
1688
|
+
StringMapObserver.prototype.stringMapKeyAdded = function (key, attributeName) {
|
|
1689
|
+
if (this.delegate.stringMapKeyAdded) {
|
|
1690
|
+
this.delegate.stringMapKeyAdded(key, attributeName);
|
|
1691
|
+
}
|
|
1692
|
+
};
|
|
1693
|
+
|
|
1694
|
+
StringMapObserver.prototype.stringMapValueChanged = function (value, key) {
|
|
1695
|
+
if (this.delegate.stringMapValueChanged) {
|
|
1696
|
+
this.delegate.stringMapValueChanged(value, key);
|
|
1697
|
+
}
|
|
1698
|
+
};
|
|
1699
|
+
|
|
1700
|
+
StringMapObserver.prototype.stringMapKeyRemoved = function (key, attributeName) {
|
|
1701
|
+
if (this.delegate.stringMapKeyRemoved) {
|
|
1702
|
+
this.delegate.stringMapKeyRemoved(key, attributeName);
|
|
1703
|
+
}
|
|
1704
|
+
};
|
|
1705
|
+
|
|
1706
|
+
Object.defineProperty(StringMapObserver.prototype, "knownAttributeNames", {
|
|
1707
|
+
get: function () {
|
|
1708
|
+
return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)));
|
|
1709
|
+
},
|
|
1710
|
+
enumerable: false,
|
|
1711
|
+
configurable: true
|
|
1712
|
+
});
|
|
1713
|
+
Object.defineProperty(StringMapObserver.prototype, "currentAttributeNames", {
|
|
1714
|
+
get: function () {
|
|
1715
|
+
return Array.from(this.element.attributes).map(function (attribute) {
|
|
1716
|
+
return attribute.name;
|
|
1717
|
+
});
|
|
1718
|
+
},
|
|
1719
|
+
enumerable: false,
|
|
1720
|
+
configurable: true
|
|
1721
|
+
});
|
|
1722
|
+
Object.defineProperty(StringMapObserver.prototype, "recordedAttributeNames", {
|
|
1723
|
+
get: function () {
|
|
1724
|
+
return Array.from(this.stringMap.keys());
|
|
1725
|
+
},
|
|
1726
|
+
enumerable: false,
|
|
1727
|
+
configurable: true
|
|
1728
|
+
});
|
|
1729
|
+
return StringMapObserver;
|
|
1730
|
+
}();
|
|
1731
|
+
|
|
1732
|
+
exports.StringMapObserver = StringMapObserver;
|
|
1733
|
+
},{}],"../node_modules/@stimulus/multimap/dist/set_operations.js":[function(require,module,exports) {
|
|
1547
1734
|
"use strict";
|
|
1548
1735
|
|
|
1549
1736
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -1580,8 +1767,8 @@ function prune(map, key) {
|
|
|
1580
1767
|
if (values != null && values.size == 0) {
|
|
1581
1768
|
map.delete(key);
|
|
1582
1769
|
}
|
|
1583
|
-
}
|
|
1584
|
-
},{}],"../node_modules/@stimulus/multimap/dist/
|
|
1770
|
+
}
|
|
1771
|
+
},{}],"../node_modules/@stimulus/multimap/dist/multimap.js":[function(require,module,exports) {
|
|
1585
1772
|
"use strict";
|
|
1586
1773
|
|
|
1587
1774
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -1605,7 +1792,7 @@ function () {
|
|
|
1605
1792
|
return values.concat(Array.from(set));
|
|
1606
1793
|
}, []);
|
|
1607
1794
|
},
|
|
1608
|
-
enumerable:
|
|
1795
|
+
enumerable: false,
|
|
1609
1796
|
configurable: true
|
|
1610
1797
|
});
|
|
1611
1798
|
Object.defineProperty(Multimap.prototype, "size", {
|
|
@@ -1615,7 +1802,7 @@ function () {
|
|
|
1615
1802
|
return size + set.size;
|
|
1616
1803
|
}, 0);
|
|
1617
1804
|
},
|
|
1618
|
-
enumerable:
|
|
1805
|
+
enumerable: false,
|
|
1619
1806
|
configurable: true
|
|
1620
1807
|
});
|
|
1621
1808
|
|
|
@@ -1661,11 +1848,10 @@ function () {
|
|
|
1661
1848
|
};
|
|
1662
1849
|
|
|
1663
1850
|
return Multimap;
|
|
1664
|
-
}();
|
|
1665
|
-
|
|
1851
|
+
}();
|
|
1666
1852
|
|
|
1667
1853
|
exports.Multimap = Multimap;
|
|
1668
|
-
},{"./set_operations":"../node_modules/@stimulus/multimap/dist/
|
|
1854
|
+
},{"./set_operations":"../node_modules/@stimulus/multimap/dist/set_operations.js"}],"../node_modules/@stimulus/multimap/dist/indexed_multimap.js":[function(require,module,exports) {
|
|
1669
1855
|
"use strict";
|
|
1670
1856
|
|
|
1671
1857
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -1678,12 +1864,16 @@ var _multimap = require("./multimap");
|
|
|
1678
1864
|
var _set_operations = require("./set_operations");
|
|
1679
1865
|
|
|
1680
1866
|
var __extends = void 0 && (void 0).__extends || function () {
|
|
1681
|
-
var extendStatics =
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
d
|
|
1685
|
-
|
|
1686
|
-
|
|
1867
|
+
var extendStatics = function (d, b) {
|
|
1868
|
+
extendStatics = Object.setPrototypeOf || {
|
|
1869
|
+
__proto__: []
|
|
1870
|
+
} instanceof Array && function (d, b) {
|
|
1871
|
+
d.__proto__ = b;
|
|
1872
|
+
} || function (d, b) {
|
|
1873
|
+
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
|
1874
|
+
};
|
|
1875
|
+
|
|
1876
|
+
return extendStatics(d, b);
|
|
1687
1877
|
};
|
|
1688
1878
|
|
|
1689
1879
|
return function (d, b) {
|
|
@@ -1713,7 +1903,7 @@ function (_super) {
|
|
|
1713
1903
|
get: function () {
|
|
1714
1904
|
return Array.from(this.keysByValue.keys());
|
|
1715
1905
|
},
|
|
1716
|
-
enumerable:
|
|
1906
|
+
enumerable: false,
|
|
1717
1907
|
configurable: true
|
|
1718
1908
|
});
|
|
1719
1909
|
|
|
@@ -1739,21 +1929,34 @@ function (_super) {
|
|
|
1739
1929
|
};
|
|
1740
1930
|
|
|
1741
1931
|
return IndexedMultimap;
|
|
1742
|
-
}(_multimap.Multimap);
|
|
1743
|
-
|
|
1932
|
+
}(_multimap.Multimap);
|
|
1744
1933
|
|
|
1745
1934
|
exports.IndexedMultimap = IndexedMultimap;
|
|
1746
|
-
},{"./multimap":"../node_modules/@stimulus/multimap/dist/
|
|
1935
|
+
},{"./multimap":"../node_modules/@stimulus/multimap/dist/multimap.js","./set_operations":"../node_modules/@stimulus/multimap/dist/set_operations.js"}],"../node_modules/@stimulus/multimap/dist/index.js":[function(require,module,exports) {
|
|
1747
1936
|
"use strict";
|
|
1748
1937
|
|
|
1749
1938
|
Object.defineProperty(exports, "__esModule", {
|
|
1750
1939
|
value: true
|
|
1751
1940
|
});
|
|
1752
1941
|
|
|
1753
|
-
var
|
|
1942
|
+
var _indexed_multimap = require("./indexed_multimap");
|
|
1943
|
+
|
|
1944
|
+
Object.keys(_indexed_multimap).forEach(function (key) {
|
|
1945
|
+
if (key === "default" || key === "__esModule") return;
|
|
1946
|
+
if (key in exports && exports[key] === _indexed_multimap[key]) return;
|
|
1947
|
+
Object.defineProperty(exports, key, {
|
|
1948
|
+
enumerable: true,
|
|
1949
|
+
get: function () {
|
|
1950
|
+
return _indexed_multimap[key];
|
|
1951
|
+
}
|
|
1952
|
+
});
|
|
1953
|
+
});
|
|
1954
|
+
|
|
1955
|
+
var _multimap = require("./multimap");
|
|
1754
1956
|
|
|
1755
1957
|
Object.keys(_multimap).forEach(function (key) {
|
|
1756
1958
|
if (key === "default" || key === "__esModule") return;
|
|
1959
|
+
if (key in exports && exports[key] === _multimap[key]) return;
|
|
1757
1960
|
Object.defineProperty(exports, key, {
|
|
1758
1961
|
enumerable: true,
|
|
1759
1962
|
get: function () {
|
|
@@ -1762,18 +1965,19 @@ Object.keys(_multimap).forEach(function (key) {
|
|
|
1762
1965
|
});
|
|
1763
1966
|
});
|
|
1764
1967
|
|
|
1765
|
-
var
|
|
1968
|
+
var _set_operations = require("./set_operations");
|
|
1766
1969
|
|
|
1767
|
-
Object.keys(
|
|
1970
|
+
Object.keys(_set_operations).forEach(function (key) {
|
|
1768
1971
|
if (key === "default" || key === "__esModule") return;
|
|
1972
|
+
if (key in exports && exports[key] === _set_operations[key]) return;
|
|
1769
1973
|
Object.defineProperty(exports, key, {
|
|
1770
1974
|
enumerable: true,
|
|
1771
1975
|
get: function () {
|
|
1772
|
-
return
|
|
1976
|
+
return _set_operations[key];
|
|
1773
1977
|
}
|
|
1774
1978
|
});
|
|
1775
1979
|
});
|
|
1776
|
-
},{"./
|
|
1980
|
+
},{"./indexed_multimap":"../node_modules/@stimulus/multimap/dist/indexed_multimap.js","./multimap":"../node_modules/@stimulus/multimap/dist/multimap.js","./set_operations":"../node_modules/@stimulus/multimap/dist/set_operations.js"}],"../node_modules/@stimulus/mutation-observers/dist/token_list_observer.js":[function(require,module,exports) {
|
|
1777
1981
|
"use strict";
|
|
1778
1982
|
|
|
1779
1983
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -1798,7 +2002,7 @@ function () {
|
|
|
1798
2002
|
get: function () {
|
|
1799
2003
|
return this.attributeObserver.started;
|
|
1800
2004
|
},
|
|
1801
|
-
enumerable:
|
|
2005
|
+
enumerable: false,
|
|
1802
2006
|
configurable: true
|
|
1803
2007
|
});
|
|
1804
2008
|
|
|
@@ -1818,14 +2022,14 @@ function () {
|
|
|
1818
2022
|
get: function () {
|
|
1819
2023
|
return this.attributeObserver.element;
|
|
1820
2024
|
},
|
|
1821
|
-
enumerable:
|
|
2025
|
+
enumerable: false,
|
|
1822
2026
|
configurable: true
|
|
1823
2027
|
});
|
|
1824
2028
|
Object.defineProperty(TokenListObserver.prototype, "attributeName", {
|
|
1825
2029
|
get: function () {
|
|
1826
2030
|
return this.attributeObserver.attributeName;
|
|
1827
2031
|
},
|
|
1828
|
-
enumerable:
|
|
2032
|
+
enumerable: false,
|
|
1829
2033
|
configurable: true
|
|
1830
2034
|
}); // Attribute observer delegate
|
|
1831
2035
|
|
|
@@ -1923,8 +2127,8 @@ function zip(left, right) {
|
|
|
1923
2127
|
|
|
1924
2128
|
function tokensAreEqual(left, right) {
|
|
1925
2129
|
return left && right && left.index == right.index && left.content == right.content;
|
|
1926
|
-
}
|
|
1927
|
-
},{"./attribute_observer":"../node_modules/@stimulus/mutation-observers/dist/
|
|
2130
|
+
}
|
|
2131
|
+
},{"./attribute_observer":"../node_modules/@stimulus/mutation-observers/dist/attribute_observer.js","@stimulus/multimap":"../node_modules/@stimulus/multimap/dist/index.js"}],"../node_modules/@stimulus/mutation-observers/dist/value_list_observer.js":[function(require,module,exports) {
|
|
1928
2132
|
"use strict";
|
|
1929
2133
|
|
|
1930
2134
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -1948,7 +2152,7 @@ function () {
|
|
|
1948
2152
|
get: function () {
|
|
1949
2153
|
return this.tokenListObserver.started;
|
|
1950
2154
|
},
|
|
1951
|
-
enumerable:
|
|
2155
|
+
enumerable: false,
|
|
1952
2156
|
configurable: true
|
|
1953
2157
|
});
|
|
1954
2158
|
|
|
@@ -1968,14 +2172,14 @@ function () {
|
|
|
1968
2172
|
get: function () {
|
|
1969
2173
|
return this.tokenListObserver.element;
|
|
1970
2174
|
},
|
|
1971
|
-
enumerable:
|
|
2175
|
+
enumerable: false,
|
|
1972
2176
|
configurable: true
|
|
1973
2177
|
});
|
|
1974
2178
|
Object.defineProperty(ValueListObserver.prototype, "attributeName", {
|
|
1975
2179
|
get: function () {
|
|
1976
2180
|
return this.tokenListObserver.attributeName;
|
|
1977
2181
|
},
|
|
1978
|
-
enumerable:
|
|
2182
|
+
enumerable: false,
|
|
1979
2183
|
configurable: true
|
|
1980
2184
|
});
|
|
1981
2185
|
|
|
@@ -2035,21 +2239,21 @@ function () {
|
|
|
2035
2239
|
};
|
|
2036
2240
|
|
|
2037
2241
|
return ValueListObserver;
|
|
2038
|
-
}();
|
|
2039
|
-
|
|
2242
|
+
}();
|
|
2040
2243
|
|
|
2041
2244
|
exports.ValueListObserver = ValueListObserver;
|
|
2042
|
-
},{"./token_list_observer":"../node_modules/@stimulus/mutation-observers/dist/
|
|
2245
|
+
},{"./token_list_observer":"../node_modules/@stimulus/mutation-observers/dist/token_list_observer.js"}],"../node_modules/@stimulus/mutation-observers/dist/index.js":[function(require,module,exports) {
|
|
2043
2246
|
"use strict";
|
|
2044
2247
|
|
|
2045
2248
|
Object.defineProperty(exports, "__esModule", {
|
|
2046
2249
|
value: true
|
|
2047
2250
|
});
|
|
2048
2251
|
|
|
2049
|
-
var _attribute_observer = require("./
|
|
2252
|
+
var _attribute_observer = require("./attribute_observer");
|
|
2050
2253
|
|
|
2051
2254
|
Object.keys(_attribute_observer).forEach(function (key) {
|
|
2052
2255
|
if (key === "default" || key === "__esModule") return;
|
|
2256
|
+
if (key in exports && exports[key] === _attribute_observer[key]) return;
|
|
2053
2257
|
Object.defineProperty(exports, key, {
|
|
2054
2258
|
enumerable: true,
|
|
2055
2259
|
get: function () {
|
|
@@ -2058,10 +2262,11 @@ Object.keys(_attribute_observer).forEach(function (key) {
|
|
|
2058
2262
|
});
|
|
2059
2263
|
});
|
|
2060
2264
|
|
|
2061
|
-
var _element_observer = require("./
|
|
2265
|
+
var _element_observer = require("./element_observer");
|
|
2062
2266
|
|
|
2063
2267
|
Object.keys(_element_observer).forEach(function (key) {
|
|
2064
2268
|
if (key === "default" || key === "__esModule") return;
|
|
2269
|
+
if (key in exports && exports[key] === _element_observer[key]) return;
|
|
2065
2270
|
Object.defineProperty(exports, key, {
|
|
2066
2271
|
enumerable: true,
|
|
2067
2272
|
get: function () {
|
|
@@ -2070,10 +2275,24 @@ Object.keys(_element_observer).forEach(function (key) {
|
|
|
2070
2275
|
});
|
|
2071
2276
|
});
|
|
2072
2277
|
|
|
2073
|
-
var
|
|
2278
|
+
var _string_map_observer = require("./string_map_observer");
|
|
2279
|
+
|
|
2280
|
+
Object.keys(_string_map_observer).forEach(function (key) {
|
|
2281
|
+
if (key === "default" || key === "__esModule") return;
|
|
2282
|
+
if (key in exports && exports[key] === _string_map_observer[key]) return;
|
|
2283
|
+
Object.defineProperty(exports, key, {
|
|
2284
|
+
enumerable: true,
|
|
2285
|
+
get: function () {
|
|
2286
|
+
return _string_map_observer[key];
|
|
2287
|
+
}
|
|
2288
|
+
});
|
|
2289
|
+
});
|
|
2290
|
+
|
|
2291
|
+
var _token_list_observer = require("./token_list_observer");
|
|
2074
2292
|
|
|
2075
2293
|
Object.keys(_token_list_observer).forEach(function (key) {
|
|
2076
2294
|
if (key === "default" || key === "__esModule") return;
|
|
2295
|
+
if (key in exports && exports[key] === _token_list_observer[key]) return;
|
|
2077
2296
|
Object.defineProperty(exports, key, {
|
|
2078
2297
|
enumerable: true,
|
|
2079
2298
|
get: function () {
|
|
@@ -2082,10 +2301,11 @@ Object.keys(_token_list_observer).forEach(function (key) {
|
|
|
2082
2301
|
});
|
|
2083
2302
|
});
|
|
2084
2303
|
|
|
2085
|
-
var _value_list_observer = require("./
|
|
2304
|
+
var _value_list_observer = require("./value_list_observer");
|
|
2086
2305
|
|
|
2087
2306
|
Object.keys(_value_list_observer).forEach(function (key) {
|
|
2088
2307
|
if (key === "default" || key === "__esModule") return;
|
|
2308
|
+
if (key in exports && exports[key] === _value_list_observer[key]) return;
|
|
2089
2309
|
Object.defineProperty(exports, key, {
|
|
2090
2310
|
enumerable: true,
|
|
2091
2311
|
get: function () {
|
|
@@ -2093,7 +2313,7 @@ Object.keys(_value_list_observer).forEach(function (key) {
|
|
|
2093
2313
|
}
|
|
2094
2314
|
});
|
|
2095
2315
|
});
|
|
2096
|
-
},{"./
|
|
2316
|
+
},{"./attribute_observer":"../node_modules/@stimulus/mutation-observers/dist/attribute_observer.js","./element_observer":"../node_modules/@stimulus/mutation-observers/dist/element_observer.js","./string_map_observer":"../node_modules/@stimulus/mutation-observers/dist/string_map_observer.js","./token_list_observer":"../node_modules/@stimulus/mutation-observers/dist/token_list_observer.js","./value_list_observer":"../node_modules/@stimulus/mutation-observers/dist/value_list_observer.js"}],"../node_modules/@stimulus/core/dist/binding_observer.js":[function(require,module,exports) {
|
|
2097
2317
|
"use strict";
|
|
2098
2318
|
|
|
2099
2319
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -2135,35 +2355,35 @@ function () {
|
|
|
2135
2355
|
get: function () {
|
|
2136
2356
|
return this.context.element;
|
|
2137
2357
|
},
|
|
2138
|
-
enumerable:
|
|
2358
|
+
enumerable: false,
|
|
2139
2359
|
configurable: true
|
|
2140
2360
|
});
|
|
2141
2361
|
Object.defineProperty(BindingObserver.prototype, "identifier", {
|
|
2142
2362
|
get: function () {
|
|
2143
2363
|
return this.context.identifier;
|
|
2144
2364
|
},
|
|
2145
|
-
enumerable:
|
|
2365
|
+
enumerable: false,
|
|
2146
2366
|
configurable: true
|
|
2147
2367
|
});
|
|
2148
2368
|
Object.defineProperty(BindingObserver.prototype, "actionAttribute", {
|
|
2149
2369
|
get: function () {
|
|
2150
2370
|
return this.schema.actionAttribute;
|
|
2151
2371
|
},
|
|
2152
|
-
enumerable:
|
|
2372
|
+
enumerable: false,
|
|
2153
2373
|
configurable: true
|
|
2154
2374
|
});
|
|
2155
2375
|
Object.defineProperty(BindingObserver.prototype, "schema", {
|
|
2156
2376
|
get: function () {
|
|
2157
2377
|
return this.context.schema;
|
|
2158
2378
|
},
|
|
2159
|
-
enumerable:
|
|
2379
|
+
enumerable: false,
|
|
2160
2380
|
configurable: true
|
|
2161
2381
|
});
|
|
2162
2382
|
Object.defineProperty(BindingObserver.prototype, "bindings", {
|
|
2163
2383
|
get: function () {
|
|
2164
2384
|
return Array.from(this.bindingsByAction.values());
|
|
2165
2385
|
},
|
|
2166
|
-
enumerable:
|
|
2386
|
+
enumerable: false,
|
|
2167
2387
|
configurable: true
|
|
2168
2388
|
});
|
|
2169
2389
|
|
|
@@ -2209,11 +2429,101 @@ function () {
|
|
|
2209
2429
|
};
|
|
2210
2430
|
|
|
2211
2431
|
return BindingObserver;
|
|
2212
|
-
}();
|
|
2213
|
-
|
|
2432
|
+
}();
|
|
2214
2433
|
|
|
2215
2434
|
exports.BindingObserver = BindingObserver;
|
|
2216
|
-
},{"./action":"../node_modules/@stimulus/core/dist/
|
|
2435
|
+
},{"./action":"../node_modules/@stimulus/core/dist/action.js","./binding":"../node_modules/@stimulus/core/dist/binding.js","@stimulus/mutation-observers":"../node_modules/@stimulus/mutation-observers/dist/index.js"}],"../node_modules/@stimulus/core/dist/value_observer.js":[function(require,module,exports) {
|
|
2436
|
+
"use strict";
|
|
2437
|
+
|
|
2438
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2439
|
+
value: true
|
|
2440
|
+
});
|
|
2441
|
+
exports.ValueObserver = void 0;
|
|
2442
|
+
|
|
2443
|
+
var _mutationObservers = require("@stimulus/mutation-observers");
|
|
2444
|
+
|
|
2445
|
+
var ValueObserver =
|
|
2446
|
+
/** @class */
|
|
2447
|
+
function () {
|
|
2448
|
+
function ValueObserver(context, receiver) {
|
|
2449
|
+
this.context = context;
|
|
2450
|
+
this.receiver = receiver;
|
|
2451
|
+
this.stringMapObserver = new _mutationObservers.StringMapObserver(this.element, this);
|
|
2452
|
+
this.valueDescriptorMap = this.controller.valueDescriptorMap;
|
|
2453
|
+
this.invokeChangedCallbacksForDefaultValues();
|
|
2454
|
+
}
|
|
2455
|
+
|
|
2456
|
+
ValueObserver.prototype.start = function () {
|
|
2457
|
+
this.stringMapObserver.start();
|
|
2458
|
+
};
|
|
2459
|
+
|
|
2460
|
+
ValueObserver.prototype.stop = function () {
|
|
2461
|
+
this.stringMapObserver.stop();
|
|
2462
|
+
};
|
|
2463
|
+
|
|
2464
|
+
Object.defineProperty(ValueObserver.prototype, "element", {
|
|
2465
|
+
get: function () {
|
|
2466
|
+
return this.context.element;
|
|
2467
|
+
},
|
|
2468
|
+
enumerable: false,
|
|
2469
|
+
configurable: true
|
|
2470
|
+
});
|
|
2471
|
+
Object.defineProperty(ValueObserver.prototype, "controller", {
|
|
2472
|
+
get: function () {
|
|
2473
|
+
return this.context.controller;
|
|
2474
|
+
},
|
|
2475
|
+
enumerable: false,
|
|
2476
|
+
configurable: true
|
|
2477
|
+
}); // String map observer delegate
|
|
2478
|
+
|
|
2479
|
+
ValueObserver.prototype.getStringMapKeyForAttribute = function (attributeName) {
|
|
2480
|
+
if (attributeName in this.valueDescriptorMap) {
|
|
2481
|
+
return this.valueDescriptorMap[attributeName].name;
|
|
2482
|
+
}
|
|
2483
|
+
};
|
|
2484
|
+
|
|
2485
|
+
ValueObserver.prototype.stringMapValueChanged = function (attributeValue, name) {
|
|
2486
|
+
this.invokeChangedCallbackForValue(name);
|
|
2487
|
+
};
|
|
2488
|
+
|
|
2489
|
+
ValueObserver.prototype.invokeChangedCallbacksForDefaultValues = function () {
|
|
2490
|
+
for (var _i = 0, _a = this.valueDescriptors; _i < _a.length; _i++) {
|
|
2491
|
+
var _b = _a[_i],
|
|
2492
|
+
key = _b.key,
|
|
2493
|
+
name_1 = _b.name,
|
|
2494
|
+
defaultValue = _b.defaultValue;
|
|
2495
|
+
|
|
2496
|
+
if (defaultValue != undefined && !this.controller.data.has(key)) {
|
|
2497
|
+
this.invokeChangedCallbackForValue(name_1);
|
|
2498
|
+
}
|
|
2499
|
+
}
|
|
2500
|
+
};
|
|
2501
|
+
|
|
2502
|
+
ValueObserver.prototype.invokeChangedCallbackForValue = function (name) {
|
|
2503
|
+
var methodName = name + "Changed";
|
|
2504
|
+
var method = this.receiver[methodName];
|
|
2505
|
+
|
|
2506
|
+
if (typeof method == "function") {
|
|
2507
|
+
var value = this.receiver[name];
|
|
2508
|
+
method.call(this.receiver, value);
|
|
2509
|
+
}
|
|
2510
|
+
};
|
|
2511
|
+
|
|
2512
|
+
Object.defineProperty(ValueObserver.prototype, "valueDescriptors", {
|
|
2513
|
+
get: function () {
|
|
2514
|
+
var valueDescriptorMap = this.valueDescriptorMap;
|
|
2515
|
+
return Object.keys(valueDescriptorMap).map(function (key) {
|
|
2516
|
+
return valueDescriptorMap[key];
|
|
2517
|
+
});
|
|
2518
|
+
},
|
|
2519
|
+
enumerable: false,
|
|
2520
|
+
configurable: true
|
|
2521
|
+
});
|
|
2522
|
+
return ValueObserver;
|
|
2523
|
+
}();
|
|
2524
|
+
|
|
2525
|
+
exports.ValueObserver = ValueObserver;
|
|
2526
|
+
},{"@stimulus/mutation-observers":"../node_modules/@stimulus/mutation-observers/dist/index.js"}],"../node_modules/@stimulus/core/dist/context.js":[function(require,module,exports) {
|
|
2217
2527
|
"use strict";
|
|
2218
2528
|
|
|
2219
2529
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -2223,6 +2533,8 @@ exports.Context = void 0;
|
|
|
2223
2533
|
|
|
2224
2534
|
var _binding_observer = require("./binding_observer");
|
|
2225
2535
|
|
|
2536
|
+
var _value_observer = require("./value_observer");
|
|
2537
|
+
|
|
2226
2538
|
var Context =
|
|
2227
2539
|
/** @class */
|
|
2228
2540
|
function () {
|
|
@@ -2231,6 +2543,7 @@ function () {
|
|
|
2231
2543
|
this.scope = scope;
|
|
2232
2544
|
this.controller = new module.controllerConstructor(this);
|
|
2233
2545
|
this.bindingObserver = new _binding_observer.BindingObserver(this, this.dispatcher);
|
|
2546
|
+
this.valueObserver = new _value_observer.ValueObserver(this, this.controller);
|
|
2234
2547
|
|
|
2235
2548
|
try {
|
|
2236
2549
|
this.controller.initialize();
|
|
@@ -2241,6 +2554,7 @@ function () {
|
|
|
2241
2554
|
|
|
2242
2555
|
Context.prototype.connect = function () {
|
|
2243
2556
|
this.bindingObserver.start();
|
|
2557
|
+
this.valueObserver.start();
|
|
2244
2558
|
|
|
2245
2559
|
try {
|
|
2246
2560
|
this.controller.connect();
|
|
@@ -2256,6 +2570,7 @@ function () {
|
|
|
2256
2570
|
this.handleError(error, "disconnecting controller");
|
|
2257
2571
|
}
|
|
2258
2572
|
|
|
2573
|
+
this.valueObserver.stop();
|
|
2259
2574
|
this.bindingObserver.stop();
|
|
2260
2575
|
};
|
|
2261
2576
|
|
|
@@ -2263,42 +2578,42 @@ function () {
|
|
|
2263
2578
|
get: function () {
|
|
2264
2579
|
return this.module.application;
|
|
2265
2580
|
},
|
|
2266
|
-
enumerable:
|
|
2581
|
+
enumerable: false,
|
|
2267
2582
|
configurable: true
|
|
2268
2583
|
});
|
|
2269
2584
|
Object.defineProperty(Context.prototype, "identifier", {
|
|
2270
2585
|
get: function () {
|
|
2271
2586
|
return this.module.identifier;
|
|
2272
2587
|
},
|
|
2273
|
-
enumerable:
|
|
2588
|
+
enumerable: false,
|
|
2274
2589
|
configurable: true
|
|
2275
2590
|
});
|
|
2276
2591
|
Object.defineProperty(Context.prototype, "schema", {
|
|
2277
2592
|
get: function () {
|
|
2278
2593
|
return this.application.schema;
|
|
2279
2594
|
},
|
|
2280
|
-
enumerable:
|
|
2595
|
+
enumerable: false,
|
|
2281
2596
|
configurable: true
|
|
2282
2597
|
});
|
|
2283
2598
|
Object.defineProperty(Context.prototype, "dispatcher", {
|
|
2284
2599
|
get: function () {
|
|
2285
2600
|
return this.application.dispatcher;
|
|
2286
2601
|
},
|
|
2287
|
-
enumerable:
|
|
2602
|
+
enumerable: false,
|
|
2288
2603
|
configurable: true
|
|
2289
2604
|
});
|
|
2290
2605
|
Object.defineProperty(Context.prototype, "element", {
|
|
2291
2606
|
get: function () {
|
|
2292
2607
|
return this.scope.element;
|
|
2293
2608
|
},
|
|
2294
|
-
enumerable:
|
|
2609
|
+
enumerable: false,
|
|
2295
2610
|
configurable: true
|
|
2296
2611
|
});
|
|
2297
2612
|
Object.defineProperty(Context.prototype, "parentElement", {
|
|
2298
2613
|
get: function () {
|
|
2299
2614
|
return this.element.parentElement;
|
|
2300
2615
|
},
|
|
2301
|
-
enumerable:
|
|
2616
|
+
enumerable: false,
|
|
2302
2617
|
configurable: true
|
|
2303
2618
|
}); // Error handling
|
|
2304
2619
|
|
|
@@ -2321,26 +2636,80 @@ function () {
|
|
|
2321
2636
|
};
|
|
2322
2637
|
|
|
2323
2638
|
return Context;
|
|
2324
|
-
}();
|
|
2325
|
-
|
|
2639
|
+
}();
|
|
2326
2640
|
|
|
2327
2641
|
exports.Context = Context;
|
|
2328
|
-
},{"./binding_observer":"../node_modules/@stimulus/core/dist/
|
|
2642
|
+
},{"./binding_observer":"../node_modules/@stimulus/core/dist/binding_observer.js","./value_observer":"../node_modules/@stimulus/core/dist/value_observer.js"}],"../node_modules/@stimulus/core/dist/inheritable_statics.js":[function(require,module,exports) {
|
|
2329
2643
|
"use strict";
|
|
2330
2644
|
|
|
2331
2645
|
Object.defineProperty(exports, "__esModule", {
|
|
2332
2646
|
value: true
|
|
2333
2647
|
});
|
|
2334
|
-
exports.
|
|
2648
|
+
exports.readInheritableStaticArrayValues = readInheritableStaticArrayValues;
|
|
2649
|
+
exports.readInheritableStaticObjectPairs = readInheritableStaticObjectPairs;
|
|
2335
2650
|
|
|
2336
|
-
|
|
2337
|
-
var
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
};
|
|
2651
|
+
function readInheritableStaticArrayValues(constructor, propertyName) {
|
|
2652
|
+
var ancestors = getAncestorsForConstructor(constructor);
|
|
2653
|
+
return Array.from(ancestors.reduce(function (values, constructor) {
|
|
2654
|
+
getOwnStaticArrayValues(constructor, propertyName).forEach(function (name) {
|
|
2655
|
+
return values.add(name);
|
|
2656
|
+
});
|
|
2657
|
+
return values;
|
|
2658
|
+
}, new Set()));
|
|
2659
|
+
}
|
|
2660
|
+
|
|
2661
|
+
function readInheritableStaticObjectPairs(constructor, propertyName) {
|
|
2662
|
+
var ancestors = getAncestorsForConstructor(constructor);
|
|
2663
|
+
return ancestors.reduce(function (pairs, constructor) {
|
|
2664
|
+
pairs.push.apply(pairs, getOwnStaticObjectPairs(constructor, propertyName));
|
|
2665
|
+
return pairs;
|
|
2666
|
+
}, []);
|
|
2667
|
+
}
|
|
2668
|
+
|
|
2669
|
+
function getAncestorsForConstructor(constructor) {
|
|
2670
|
+
var ancestors = [];
|
|
2671
|
+
|
|
2672
|
+
while (constructor) {
|
|
2673
|
+
ancestors.push(constructor);
|
|
2674
|
+
constructor = Object.getPrototypeOf(constructor);
|
|
2675
|
+
}
|
|
2676
|
+
|
|
2677
|
+
return ancestors.reverse();
|
|
2678
|
+
}
|
|
2679
|
+
|
|
2680
|
+
function getOwnStaticArrayValues(constructor, propertyName) {
|
|
2681
|
+
var definition = constructor[propertyName];
|
|
2682
|
+
return Array.isArray(definition) ? definition : [];
|
|
2683
|
+
}
|
|
2684
|
+
|
|
2685
|
+
function getOwnStaticObjectPairs(constructor, propertyName) {
|
|
2686
|
+
var definition = constructor[propertyName];
|
|
2687
|
+
return definition ? Object.keys(definition).map(function (key) {
|
|
2688
|
+
return [key, definition[key]];
|
|
2689
|
+
}) : [];
|
|
2690
|
+
}
|
|
2691
|
+
},{}],"../node_modules/@stimulus/core/dist/blessing.js":[function(require,module,exports) {
|
|
2692
|
+
"use strict";
|
|
2693
|
+
|
|
2694
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2695
|
+
value: true
|
|
2696
|
+
});
|
|
2697
|
+
exports.bless = bless;
|
|
2698
|
+
|
|
2699
|
+
var _inheritable_statics = require("./inheritable_statics");
|
|
2700
|
+
|
|
2701
|
+
var __extends = void 0 && (void 0).__extends || function () {
|
|
2702
|
+
var extendStatics = function (d, b) {
|
|
2703
|
+
extendStatics = Object.setPrototypeOf || {
|
|
2704
|
+
__proto__: []
|
|
2705
|
+
} instanceof Array && function (d, b) {
|
|
2706
|
+
d.__proto__ = b;
|
|
2707
|
+
} || function (d, b) {
|
|
2708
|
+
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
|
2709
|
+
};
|
|
2710
|
+
|
|
2711
|
+
return extendStatics(d, b);
|
|
2712
|
+
};
|
|
2344
2713
|
|
|
2345
2714
|
return function (d, b) {
|
|
2346
2715
|
extendStatics(d, b);
|
|
@@ -2352,37 +2721,96 @@ var __extends = void 0 && (void 0).__extends || function () {
|
|
|
2352
2721
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
2353
2722
|
};
|
|
2354
2723
|
}();
|
|
2724
|
+
|
|
2725
|
+
var __spreadArrays = void 0 && (void 0).__spreadArrays || function () {
|
|
2726
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
2727
|
+
|
|
2728
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];
|
|
2729
|
+
|
|
2730
|
+
return r;
|
|
2731
|
+
};
|
|
2732
|
+
|
|
2355
2733
|
/** @hidden */
|
|
2734
|
+
function bless(constructor) {
|
|
2735
|
+
return shadow(constructor, getBlessedProperties(constructor));
|
|
2736
|
+
}
|
|
2356
2737
|
|
|
2738
|
+
function shadow(constructor, properties) {
|
|
2739
|
+
var shadowConstructor = extend(constructor);
|
|
2740
|
+
var shadowProperties = getShadowProperties(constructor.prototype, properties);
|
|
2741
|
+
Object.defineProperties(shadowConstructor.prototype, shadowProperties);
|
|
2742
|
+
return shadowConstructor;
|
|
2743
|
+
}
|
|
2357
2744
|
|
|
2358
|
-
function
|
|
2359
|
-
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
2745
|
+
function getBlessedProperties(constructor) {
|
|
2746
|
+
var blessings = (0, _inheritable_statics.readInheritableStaticArrayValues)(constructor, "blessings");
|
|
2747
|
+
return blessings.reduce(function (blessedProperties, blessing) {
|
|
2748
|
+
var properties = blessing(constructor);
|
|
2749
|
+
|
|
2750
|
+
for (var key in properties) {
|
|
2751
|
+
var descriptor = blessedProperties[key] || {};
|
|
2752
|
+
blessedProperties[key] = Object.assign(descriptor, properties[key]);
|
|
2753
|
+
}
|
|
2754
|
+
|
|
2755
|
+
return blessedProperties;
|
|
2756
|
+
}, {});
|
|
2363
2757
|
}
|
|
2364
2758
|
|
|
2365
|
-
function
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2759
|
+
function getShadowProperties(prototype, properties) {
|
|
2760
|
+
return getOwnKeys(properties).reduce(function (shadowProperties, key) {
|
|
2761
|
+
var _a;
|
|
2762
|
+
|
|
2763
|
+
var descriptor = getShadowedDescriptor(prototype, properties, key);
|
|
2764
|
+
|
|
2765
|
+
if (descriptor) {
|
|
2766
|
+
Object.assign(shadowProperties, (_a = {}, _a[key] = descriptor, _a));
|
|
2767
|
+
}
|
|
2768
|
+
|
|
2769
|
+
return shadowProperties;
|
|
2770
|
+
}, {});
|
|
2771
|
+
}
|
|
2772
|
+
|
|
2773
|
+
function getShadowedDescriptor(prototype, properties, key) {
|
|
2774
|
+
var shadowingDescriptor = Object.getOwnPropertyDescriptor(prototype, key);
|
|
2775
|
+
var shadowedByValue = shadowingDescriptor && "value" in shadowingDescriptor;
|
|
2776
|
+
|
|
2777
|
+
if (!shadowedByValue) {
|
|
2778
|
+
var descriptor = Object.getOwnPropertyDescriptor(properties, key).value;
|
|
2779
|
+
|
|
2780
|
+
if (shadowingDescriptor) {
|
|
2781
|
+
descriptor.get = shadowingDescriptor.get || descriptor.get;
|
|
2782
|
+
descriptor.set = shadowingDescriptor.set || descriptor.set;
|
|
2783
|
+
}
|
|
2784
|
+
|
|
2785
|
+
return descriptor;
|
|
2786
|
+
}
|
|
2369
2787
|
}
|
|
2370
2788
|
|
|
2789
|
+
var getOwnKeys = function () {
|
|
2790
|
+
if (typeof Object.getOwnPropertySymbols == "function") {
|
|
2791
|
+
return function (object) {
|
|
2792
|
+
return __spreadArrays(Object.getOwnPropertyNames(object), Object.getOwnPropertySymbols(object));
|
|
2793
|
+
};
|
|
2794
|
+
} else {
|
|
2795
|
+
return Object.getOwnPropertyNames;
|
|
2796
|
+
}
|
|
2797
|
+
}();
|
|
2798
|
+
|
|
2371
2799
|
var extend = function () {
|
|
2372
2800
|
function extendWithReflect(constructor) {
|
|
2373
|
-
function
|
|
2374
|
-
var _newTarget = this && this instanceof
|
|
2801
|
+
function extended() {
|
|
2802
|
+
var _newTarget = this && this instanceof extended ? this.constructor : void 0;
|
|
2375
2803
|
|
|
2376
2804
|
return Reflect.construct(constructor, arguments, _newTarget);
|
|
2377
2805
|
}
|
|
2378
2806
|
|
|
2379
|
-
|
|
2807
|
+
extended.prototype = Object.create(constructor.prototype, {
|
|
2380
2808
|
constructor: {
|
|
2381
|
-
value:
|
|
2809
|
+
value: extended
|
|
2382
2810
|
}
|
|
2383
2811
|
});
|
|
2384
|
-
Reflect.setPrototypeOf(
|
|
2385
|
-
return
|
|
2812
|
+
Reflect.setPrototypeOf(extended, constructor);
|
|
2813
|
+
return extended;
|
|
2386
2814
|
}
|
|
2387
2815
|
|
|
2388
2816
|
function testReflectExtension() {
|
|
@@ -2405,19 +2833,36 @@ var extend = function () {
|
|
|
2405
2833
|
return (
|
|
2406
2834
|
/** @class */
|
|
2407
2835
|
function (_super) {
|
|
2408
|
-
__extends(
|
|
2836
|
+
__extends(extended, _super);
|
|
2409
2837
|
|
|
2410
|
-
function
|
|
2838
|
+
function extended() {
|
|
2411
2839
|
return _super !== null && _super.apply(this, arguments) || this;
|
|
2412
2840
|
}
|
|
2413
2841
|
|
|
2414
|
-
return
|
|
2842
|
+
return extended;
|
|
2415
2843
|
}(constructor)
|
|
2416
2844
|
);
|
|
2417
2845
|
};
|
|
2418
2846
|
}
|
|
2419
|
-
}();
|
|
2420
|
-
},{}],"../node_modules/@stimulus/core/dist/
|
|
2847
|
+
}();
|
|
2848
|
+
},{"./inheritable_statics":"../node_modules/@stimulus/core/dist/inheritable_statics.js"}],"../node_modules/@stimulus/core/dist/definition.js":[function(require,module,exports) {
|
|
2849
|
+
"use strict";
|
|
2850
|
+
|
|
2851
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2852
|
+
value: true
|
|
2853
|
+
});
|
|
2854
|
+
exports.blessDefinition = blessDefinition;
|
|
2855
|
+
|
|
2856
|
+
var _blessing = require("./blessing");
|
|
2857
|
+
|
|
2858
|
+
/** @hidden */
|
|
2859
|
+
function blessDefinition(definition) {
|
|
2860
|
+
return {
|
|
2861
|
+
identifier: definition.identifier,
|
|
2862
|
+
controllerConstructor: (0, _blessing.bless)(definition.controllerConstructor)
|
|
2863
|
+
};
|
|
2864
|
+
}
|
|
2865
|
+
},{"./blessing":"../node_modules/@stimulus/core/dist/blessing.js"}],"../node_modules/@stimulus/core/dist/module.js":[function(require,module,exports) {
|
|
2421
2866
|
"use strict";
|
|
2422
2867
|
|
|
2423
2868
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -2443,21 +2888,21 @@ function () {
|
|
|
2443
2888
|
get: function () {
|
|
2444
2889
|
return this.definition.identifier;
|
|
2445
2890
|
},
|
|
2446
|
-
enumerable:
|
|
2891
|
+
enumerable: false,
|
|
2447
2892
|
configurable: true
|
|
2448
2893
|
});
|
|
2449
2894
|
Object.defineProperty(Module.prototype, "controllerConstructor", {
|
|
2450
2895
|
get: function () {
|
|
2451
2896
|
return this.definition.controllerConstructor;
|
|
2452
2897
|
},
|
|
2453
|
-
enumerable:
|
|
2898
|
+
enumerable: false,
|
|
2454
2899
|
configurable: true
|
|
2455
2900
|
});
|
|
2456
2901
|
Object.defineProperty(Module.prototype, "contexts", {
|
|
2457
2902
|
get: function () {
|
|
2458
2903
|
return Array.from(this.connectedContexts);
|
|
2459
2904
|
},
|
|
2460
|
-
enumerable:
|
|
2905
|
+
enumerable: false,
|
|
2461
2906
|
configurable: true
|
|
2462
2907
|
});
|
|
2463
2908
|
|
|
@@ -2488,11 +2933,77 @@ function () {
|
|
|
2488
2933
|
};
|
|
2489
2934
|
|
|
2490
2935
|
return Module;
|
|
2491
|
-
}();
|
|
2492
|
-
|
|
2936
|
+
}();
|
|
2493
2937
|
|
|
2494
2938
|
exports.Module = Module;
|
|
2495
|
-
},{"./context":"../node_modules/@stimulus/core/dist/
|
|
2939
|
+
},{"./context":"../node_modules/@stimulus/core/dist/context.js","./definition":"../node_modules/@stimulus/core/dist/definition.js"}],"../node_modules/@stimulus/core/dist/class_map.js":[function(require,module,exports) {
|
|
2940
|
+
"use strict";
|
|
2941
|
+
|
|
2942
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2943
|
+
value: true
|
|
2944
|
+
});
|
|
2945
|
+
exports.ClassMap = void 0;
|
|
2946
|
+
|
|
2947
|
+
var ClassMap =
|
|
2948
|
+
/** @class */
|
|
2949
|
+
function () {
|
|
2950
|
+
function ClassMap(scope) {
|
|
2951
|
+
this.scope = scope;
|
|
2952
|
+
}
|
|
2953
|
+
|
|
2954
|
+
ClassMap.prototype.has = function (name) {
|
|
2955
|
+
return this.data.has(this.getDataKey(name));
|
|
2956
|
+
};
|
|
2957
|
+
|
|
2958
|
+
ClassMap.prototype.get = function (name) {
|
|
2959
|
+
return this.data.get(this.getDataKey(name));
|
|
2960
|
+
};
|
|
2961
|
+
|
|
2962
|
+
ClassMap.prototype.getAttributeName = function (name) {
|
|
2963
|
+
return this.data.getAttributeNameForKey(this.getDataKey(name));
|
|
2964
|
+
};
|
|
2965
|
+
|
|
2966
|
+
ClassMap.prototype.getDataKey = function (name) {
|
|
2967
|
+
return name + "-class";
|
|
2968
|
+
};
|
|
2969
|
+
|
|
2970
|
+
Object.defineProperty(ClassMap.prototype, "data", {
|
|
2971
|
+
get: function () {
|
|
2972
|
+
return this.scope.data;
|
|
2973
|
+
},
|
|
2974
|
+
enumerable: false,
|
|
2975
|
+
configurable: true
|
|
2976
|
+
});
|
|
2977
|
+
return ClassMap;
|
|
2978
|
+
}();
|
|
2979
|
+
|
|
2980
|
+
exports.ClassMap = ClassMap;
|
|
2981
|
+
},{}],"../node_modules/@stimulus/core/dist/string_helpers.js":[function(require,module,exports) {
|
|
2982
|
+
"use strict";
|
|
2983
|
+
|
|
2984
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2985
|
+
value: true
|
|
2986
|
+
});
|
|
2987
|
+
exports.camelize = camelize;
|
|
2988
|
+
exports.capitalize = capitalize;
|
|
2989
|
+
exports.dasherize = dasherize;
|
|
2990
|
+
|
|
2991
|
+
function camelize(value) {
|
|
2992
|
+
return value.replace(/(?:[_-])([a-z0-9])/g, function (_, char) {
|
|
2993
|
+
return char.toUpperCase();
|
|
2994
|
+
});
|
|
2995
|
+
}
|
|
2996
|
+
|
|
2997
|
+
function capitalize(value) {
|
|
2998
|
+
return value.charAt(0).toUpperCase() + value.slice(1);
|
|
2999
|
+
}
|
|
3000
|
+
|
|
3001
|
+
function dasherize(value) {
|
|
3002
|
+
return value.replace(/([A-Z])/g, function (_, char) {
|
|
3003
|
+
return "-" + char.toLowerCase();
|
|
3004
|
+
});
|
|
3005
|
+
}
|
|
3006
|
+
},{}],"../node_modules/@stimulus/core/dist/data_map.js":[function(require,module,exports) {
|
|
2496
3007
|
"use strict";
|
|
2497
3008
|
|
|
2498
3009
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -2500,6 +3011,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
2500
3011
|
});
|
|
2501
3012
|
exports.DataMap = void 0;
|
|
2502
3013
|
|
|
3014
|
+
var _string_helpers = require("./string_helpers");
|
|
3015
|
+
|
|
2503
3016
|
var DataMap =
|
|
2504
3017
|
/** @class */
|
|
2505
3018
|
function () {
|
|
@@ -2511,58 +3024,86 @@ function () {
|
|
|
2511
3024
|
get: function () {
|
|
2512
3025
|
return this.scope.element;
|
|
2513
3026
|
},
|
|
2514
|
-
enumerable:
|
|
3027
|
+
enumerable: false,
|
|
2515
3028
|
configurable: true
|
|
2516
3029
|
});
|
|
2517
3030
|
Object.defineProperty(DataMap.prototype, "identifier", {
|
|
2518
3031
|
get: function () {
|
|
2519
3032
|
return this.scope.identifier;
|
|
2520
3033
|
},
|
|
2521
|
-
enumerable:
|
|
3034
|
+
enumerable: false,
|
|
2522
3035
|
configurable: true
|
|
2523
3036
|
});
|
|
2524
3037
|
|
|
2525
3038
|
DataMap.prototype.get = function (key) {
|
|
2526
|
-
|
|
2527
|
-
return this.element.getAttribute(
|
|
3039
|
+
var name = this.getAttributeNameForKey(key);
|
|
3040
|
+
return this.element.getAttribute(name);
|
|
2528
3041
|
};
|
|
2529
3042
|
|
|
2530
3043
|
DataMap.prototype.set = function (key, value) {
|
|
2531
|
-
|
|
2532
|
-
this.element.setAttribute(
|
|
3044
|
+
var name = this.getAttributeNameForKey(key);
|
|
3045
|
+
this.element.setAttribute(name, value);
|
|
2533
3046
|
return this.get(key);
|
|
2534
3047
|
};
|
|
2535
3048
|
|
|
2536
3049
|
DataMap.prototype.has = function (key) {
|
|
2537
|
-
|
|
2538
|
-
return this.element.hasAttribute(
|
|
3050
|
+
var name = this.getAttributeNameForKey(key);
|
|
3051
|
+
return this.element.hasAttribute(name);
|
|
2539
3052
|
};
|
|
2540
3053
|
|
|
2541
3054
|
DataMap.prototype.delete = function (key) {
|
|
2542
3055
|
if (this.has(key)) {
|
|
2543
|
-
|
|
2544
|
-
this.element.removeAttribute(
|
|
3056
|
+
var name_1 = this.getAttributeNameForKey(key);
|
|
3057
|
+
this.element.removeAttribute(name_1);
|
|
2545
3058
|
return true;
|
|
2546
3059
|
} else {
|
|
2547
3060
|
return false;
|
|
2548
3061
|
}
|
|
2549
3062
|
};
|
|
2550
3063
|
|
|
2551
|
-
DataMap.prototype.
|
|
2552
|
-
return "data-" + this.identifier + "-" + dasherize(key);
|
|
3064
|
+
DataMap.prototype.getAttributeNameForKey = function (key) {
|
|
3065
|
+
return "data-" + this.identifier + "-" + (0, _string_helpers.dasherize)(key);
|
|
2553
3066
|
};
|
|
2554
3067
|
|
|
2555
3068
|
return DataMap;
|
|
2556
3069
|
}();
|
|
2557
3070
|
|
|
2558
3071
|
exports.DataMap = DataMap;
|
|
3072
|
+
},{"./string_helpers":"../node_modules/@stimulus/core/dist/string_helpers.js"}],"../node_modules/@stimulus/core/dist/guide.js":[function(require,module,exports) {
|
|
3073
|
+
"use strict";
|
|
2559
3074
|
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
3075
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3076
|
+
value: true
|
|
3077
|
+
});
|
|
3078
|
+
exports.Guide = void 0;
|
|
3079
|
+
|
|
3080
|
+
var Guide =
|
|
3081
|
+
/** @class */
|
|
3082
|
+
function () {
|
|
3083
|
+
function Guide(logger) {
|
|
3084
|
+
this.warnedKeysByObject = new WeakMap();
|
|
3085
|
+
this.logger = logger;
|
|
3086
|
+
}
|
|
3087
|
+
|
|
3088
|
+
Guide.prototype.warn = function (object, key, message) {
|
|
3089
|
+
var warnedKeys = this.warnedKeysByObject.get(object);
|
|
3090
|
+
|
|
3091
|
+
if (!warnedKeys) {
|
|
3092
|
+
warnedKeys = new Set();
|
|
3093
|
+
this.warnedKeysByObject.set(object, warnedKeys);
|
|
3094
|
+
}
|
|
3095
|
+
|
|
3096
|
+
if (!warnedKeys.has(key)) {
|
|
3097
|
+
warnedKeys.add(key);
|
|
3098
|
+
this.logger.warn(message, object);
|
|
3099
|
+
}
|
|
3100
|
+
};
|
|
3101
|
+
|
|
3102
|
+
return Guide;
|
|
3103
|
+
}();
|
|
3104
|
+
|
|
3105
|
+
exports.Guide = Guide;
|
|
3106
|
+
},{}],"../node_modules/@stimulus/core/dist/selectors.js":[function(require,module,exports) {
|
|
2566
3107
|
"use strict";
|
|
2567
3108
|
|
|
2568
3109
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -2573,8 +3114,8 @@ exports.attributeValueContainsToken = attributeValueContainsToken;
|
|
|
2573
3114
|
/** @hidden */
|
|
2574
3115
|
function attributeValueContainsToken(attributeName, token) {
|
|
2575
3116
|
return "[" + attributeName + "~=\"" + token + "\"]";
|
|
2576
|
-
}
|
|
2577
|
-
},{}],"../node_modules/@stimulus/core/dist/
|
|
3117
|
+
}
|
|
3118
|
+
},{}],"../node_modules/@stimulus/core/dist/target_set.js":[function(require,module,exports) {
|
|
2578
3119
|
"use strict";
|
|
2579
3120
|
|
|
2580
3121
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -2584,6 +3125,14 @@ exports.TargetSet = void 0;
|
|
|
2584
3125
|
|
|
2585
3126
|
var _selectors = require("./selectors");
|
|
2586
3127
|
|
|
3128
|
+
var __spreadArrays = void 0 && (void 0).__spreadArrays || function () {
|
|
3129
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
3130
|
+
|
|
3131
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];
|
|
3132
|
+
|
|
3133
|
+
return r;
|
|
3134
|
+
};
|
|
3135
|
+
|
|
2587
3136
|
var TargetSet =
|
|
2588
3137
|
/** @class */
|
|
2589
3138
|
function () {
|
|
@@ -2595,21 +3144,21 @@ function () {
|
|
|
2595
3144
|
get: function () {
|
|
2596
3145
|
return this.scope.element;
|
|
2597
3146
|
},
|
|
2598
|
-
enumerable:
|
|
3147
|
+
enumerable: false,
|
|
2599
3148
|
configurable: true
|
|
2600
3149
|
});
|
|
2601
3150
|
Object.defineProperty(TargetSet.prototype, "identifier", {
|
|
2602
3151
|
get: function () {
|
|
2603
3152
|
return this.scope.identifier;
|
|
2604
3153
|
},
|
|
2605
|
-
enumerable:
|
|
3154
|
+
enumerable: false,
|
|
2606
3155
|
configurable: true
|
|
2607
3156
|
});
|
|
2608
3157
|
Object.defineProperty(TargetSet.prototype, "schema", {
|
|
2609
3158
|
get: function () {
|
|
2610
3159
|
return this.scope.schema;
|
|
2611
3160
|
},
|
|
2612
|
-
enumerable:
|
|
3161
|
+
enumerable: false,
|
|
2613
3162
|
configurable: true
|
|
2614
3163
|
});
|
|
2615
3164
|
|
|
@@ -2618,46 +3167,89 @@ function () {
|
|
|
2618
3167
|
};
|
|
2619
3168
|
|
|
2620
3169
|
TargetSet.prototype.find = function () {
|
|
3170
|
+
var _this = this;
|
|
3171
|
+
|
|
2621
3172
|
var targetNames = [];
|
|
2622
3173
|
|
|
2623
3174
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
2624
3175
|
targetNames[_i] = arguments[_i];
|
|
2625
3176
|
}
|
|
2626
3177
|
|
|
2627
|
-
|
|
2628
|
-
|
|
3178
|
+
return targetNames.reduce(function (target, targetName) {
|
|
3179
|
+
return target || _this.findTarget(targetName) || _this.findLegacyTarget(targetName);
|
|
3180
|
+
}, undefined);
|
|
2629
3181
|
};
|
|
2630
3182
|
|
|
2631
3183
|
TargetSet.prototype.findAll = function () {
|
|
3184
|
+
var _this = this;
|
|
3185
|
+
|
|
2632
3186
|
var targetNames = [];
|
|
2633
3187
|
|
|
2634
3188
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
2635
3189
|
targetNames[_i] = arguments[_i];
|
|
2636
3190
|
}
|
|
2637
3191
|
|
|
2638
|
-
|
|
3192
|
+
return targetNames.reduce(function (targets, targetName) {
|
|
3193
|
+
return __spreadArrays(targets, _this.findAllTargets(targetName), _this.findAllLegacyTargets(targetName));
|
|
3194
|
+
}, []);
|
|
3195
|
+
};
|
|
3196
|
+
|
|
3197
|
+
TargetSet.prototype.findTarget = function (targetName) {
|
|
3198
|
+
var selector = this.getSelectorForTargetName(targetName);
|
|
3199
|
+
return this.scope.findElement(selector);
|
|
3200
|
+
};
|
|
3201
|
+
|
|
3202
|
+
TargetSet.prototype.findAllTargets = function (targetName) {
|
|
3203
|
+
var selector = this.getSelectorForTargetName(targetName);
|
|
2639
3204
|
return this.scope.findAllElements(selector);
|
|
2640
3205
|
};
|
|
2641
3206
|
|
|
2642
|
-
TargetSet.prototype.
|
|
3207
|
+
TargetSet.prototype.getSelectorForTargetName = function (targetName) {
|
|
3208
|
+
var attributeName = "data-" + this.identifier + "-target";
|
|
3209
|
+
return (0, _selectors.attributeValueContainsToken)(attributeName, targetName);
|
|
3210
|
+
};
|
|
3211
|
+
|
|
3212
|
+
TargetSet.prototype.findLegacyTarget = function (targetName) {
|
|
3213
|
+
var selector = this.getLegacySelectorForTargetName(targetName);
|
|
3214
|
+
return this.deprecate(this.scope.findElement(selector), targetName);
|
|
3215
|
+
};
|
|
3216
|
+
|
|
3217
|
+
TargetSet.prototype.findAllLegacyTargets = function (targetName) {
|
|
2643
3218
|
var _this = this;
|
|
2644
3219
|
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
3220
|
+
var selector = this.getLegacySelectorForTargetName(targetName);
|
|
3221
|
+
return this.scope.findAllElements(selector).map(function (element) {
|
|
3222
|
+
return _this.deprecate(element, targetName);
|
|
3223
|
+
});
|
|
2648
3224
|
};
|
|
2649
3225
|
|
|
2650
|
-
TargetSet.prototype.
|
|
3226
|
+
TargetSet.prototype.getLegacySelectorForTargetName = function (targetName) {
|
|
2651
3227
|
var targetDescriptor = this.identifier + "." + targetName;
|
|
2652
3228
|
return (0, _selectors.attributeValueContainsToken)(this.schema.targetAttribute, targetDescriptor);
|
|
2653
3229
|
};
|
|
2654
3230
|
|
|
2655
|
-
|
|
2656
|
-
|
|
3231
|
+
TargetSet.prototype.deprecate = function (element, targetName) {
|
|
3232
|
+
if (element) {
|
|
3233
|
+
var identifier = this.identifier;
|
|
3234
|
+
var attributeName = this.schema.targetAttribute;
|
|
3235
|
+
this.guide.warn(element, "target:" + targetName, "Please replace " + attributeName + "=\"" + identifier + "." + targetName + "\" with data-" + identifier + "-target=\"" + targetName + "\". " + ("The " + attributeName + " attribute is deprecated and will be removed in a future version of Stimulus."));
|
|
3236
|
+
}
|
|
2657
3237
|
|
|
3238
|
+
return element;
|
|
3239
|
+
};
|
|
3240
|
+
|
|
3241
|
+
Object.defineProperty(TargetSet.prototype, "guide", {
|
|
3242
|
+
get: function () {
|
|
3243
|
+
return this.scope.guide;
|
|
3244
|
+
},
|
|
3245
|
+
enumerable: false,
|
|
3246
|
+
configurable: true
|
|
3247
|
+
});
|
|
3248
|
+
return TargetSet;
|
|
3249
|
+
}();
|
|
2658
3250
|
|
|
2659
3251
|
exports.TargetSet = TargetSet;
|
|
2660
|
-
},{"./selectors":"../node_modules/@stimulus/core/dist/
|
|
3252
|
+
},{"./selectors":"../node_modules/@stimulus/core/dist/selectors.js"}],"../node_modules/@stimulus/core/dist/scope.js":[function(require,module,exports) {
|
|
2661
3253
|
"use strict";
|
|
2662
3254
|
|
|
2663
3255
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -2665,58 +3257,68 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
2665
3257
|
});
|
|
2666
3258
|
exports.Scope = void 0;
|
|
2667
3259
|
|
|
3260
|
+
var _class_map = require("./class_map");
|
|
3261
|
+
|
|
2668
3262
|
var _data_map = require("./data_map");
|
|
2669
3263
|
|
|
2670
|
-
var
|
|
3264
|
+
var _guide = require("./guide");
|
|
2671
3265
|
|
|
2672
3266
|
var _selectors = require("./selectors");
|
|
2673
3267
|
|
|
3268
|
+
var _target_set = require("./target_set");
|
|
3269
|
+
|
|
3270
|
+
var __spreadArrays = void 0 && (void 0).__spreadArrays || function () {
|
|
3271
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
3272
|
+
|
|
3273
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];
|
|
3274
|
+
|
|
3275
|
+
return r;
|
|
3276
|
+
};
|
|
3277
|
+
|
|
2674
3278
|
var Scope =
|
|
2675
3279
|
/** @class */
|
|
2676
3280
|
function () {
|
|
2677
|
-
function Scope(schema, identifier,
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
this.element = element;
|
|
3281
|
+
function Scope(schema, element, identifier, logger) {
|
|
3282
|
+
var _this = this;
|
|
3283
|
+
|
|
2681
3284
|
this.targets = new _target_set.TargetSet(this);
|
|
3285
|
+
this.classes = new _class_map.ClassMap(this);
|
|
2682
3286
|
this.data = new _data_map.DataMap(this);
|
|
3287
|
+
|
|
3288
|
+
this.containsElement = function (element) {
|
|
3289
|
+
return element.closest(_this.controllerSelector) === _this.element;
|
|
3290
|
+
};
|
|
3291
|
+
|
|
3292
|
+
this.schema = schema;
|
|
3293
|
+
this.element = element;
|
|
3294
|
+
this.identifier = identifier;
|
|
3295
|
+
this.guide = new _guide.Guide(logger);
|
|
2683
3296
|
}
|
|
2684
3297
|
|
|
2685
3298
|
Scope.prototype.findElement = function (selector) {
|
|
2686
|
-
return this.
|
|
3299
|
+
return this.element.matches(selector) ? this.element : this.queryElements(selector).find(this.containsElement);
|
|
2687
3300
|
};
|
|
2688
3301
|
|
|
2689
3302
|
Scope.prototype.findAllElements = function (selector) {
|
|
2690
|
-
|
|
2691
|
-
var tail = this.filterElements(Array.from(this.element.querySelectorAll(selector)));
|
|
2692
|
-
return head.concat(tail);
|
|
3303
|
+
return __spreadArrays(this.element.matches(selector) ? [this.element] : [], this.queryElements(selector).filter(this.containsElement));
|
|
2693
3304
|
};
|
|
2694
3305
|
|
|
2695
|
-
Scope.prototype.
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
return elements.filter(function (element) {
|
|
2699
|
-
return _this.containsElement(element);
|
|
2700
|
-
});
|
|
2701
|
-
};
|
|
2702
|
-
|
|
2703
|
-
Scope.prototype.containsElement = function (element) {
|
|
2704
|
-
return element.closest(this.controllerSelector) === this.element;
|
|
3306
|
+
Scope.prototype.queryElements = function (selector) {
|
|
3307
|
+
return Array.from(this.element.querySelectorAll(selector));
|
|
2705
3308
|
};
|
|
2706
3309
|
|
|
2707
3310
|
Object.defineProperty(Scope.prototype, "controllerSelector", {
|
|
2708
3311
|
get: function () {
|
|
2709
3312
|
return (0, _selectors.attributeValueContainsToken)(this.schema.controllerAttribute, this.identifier);
|
|
2710
3313
|
},
|
|
2711
|
-
enumerable:
|
|
3314
|
+
enumerable: false,
|
|
2712
3315
|
configurable: true
|
|
2713
3316
|
});
|
|
2714
3317
|
return Scope;
|
|
2715
|
-
}();
|
|
2716
|
-
|
|
3318
|
+
}();
|
|
2717
3319
|
|
|
2718
3320
|
exports.Scope = Scope;
|
|
2719
|
-
},{"./data_map":"../node_modules/@stimulus/core/dist/
|
|
3321
|
+
},{"./class_map":"../node_modules/@stimulus/core/dist/class_map.js","./data_map":"../node_modules/@stimulus/core/dist/data_map.js","./guide":"../node_modules/@stimulus/core/dist/guide.js","./selectors":"../node_modules/@stimulus/core/dist/selectors.js","./target_set":"../node_modules/@stimulus/core/dist/target_set.js"}],"../node_modules/@stimulus/core/dist/scope_observer.js":[function(require,module,exports) {
|
|
2720
3322
|
"use strict";
|
|
2721
3323
|
|
|
2722
3324
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -2724,8 +3326,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
2724
3326
|
});
|
|
2725
3327
|
exports.ScopeObserver = void 0;
|
|
2726
3328
|
|
|
2727
|
-
var _scope = require("./scope");
|
|
2728
|
-
|
|
2729
3329
|
var _mutationObservers = require("@stimulus/mutation-observers");
|
|
2730
3330
|
|
|
2731
3331
|
var ScopeObserver =
|
|
@@ -2752,7 +3352,7 @@ function () {
|
|
|
2752
3352
|
get: function () {
|
|
2753
3353
|
return this.schema.controllerAttribute;
|
|
2754
3354
|
},
|
|
2755
|
-
enumerable:
|
|
3355
|
+
enumerable: false,
|
|
2756
3356
|
configurable: true
|
|
2757
3357
|
}); // Value observer delegate
|
|
2758
3358
|
|
|
@@ -2765,7 +3365,7 @@ function () {
|
|
|
2765
3365
|
var scope = scopesByIdentifier.get(identifier);
|
|
2766
3366
|
|
|
2767
3367
|
if (!scope) {
|
|
2768
|
-
scope =
|
|
3368
|
+
scope = this.delegate.createScopeForElementAndIdentifier(element, identifier);
|
|
2769
3369
|
scopesByIdentifier.set(identifier, scope);
|
|
2770
3370
|
}
|
|
2771
3371
|
|
|
@@ -2809,11 +3409,10 @@ function () {
|
|
|
2809
3409
|
};
|
|
2810
3410
|
|
|
2811
3411
|
return ScopeObserver;
|
|
2812
|
-
}();
|
|
2813
|
-
|
|
3412
|
+
}();
|
|
2814
3413
|
|
|
2815
3414
|
exports.ScopeObserver = ScopeObserver;
|
|
2816
|
-
},{"
|
|
3415
|
+
},{"@stimulus/mutation-observers":"../node_modules/@stimulus/mutation-observers/dist/index.js"}],"../node_modules/@stimulus/core/dist/router.js":[function(require,module,exports) {
|
|
2817
3416
|
"use strict";
|
|
2818
3417
|
|
|
2819
3418
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -2825,6 +3424,8 @@ var _module = require("./module");
|
|
|
2825
3424
|
|
|
2826
3425
|
var _multimap = require("@stimulus/multimap");
|
|
2827
3426
|
|
|
3427
|
+
var _scope = require("./scope");
|
|
3428
|
+
|
|
2828
3429
|
var _scope_observer = require("./scope_observer");
|
|
2829
3430
|
|
|
2830
3431
|
var Router =
|
|
@@ -2841,28 +3442,35 @@ function () {
|
|
|
2841
3442
|
get: function () {
|
|
2842
3443
|
return this.application.element;
|
|
2843
3444
|
},
|
|
2844
|
-
enumerable:
|
|
3445
|
+
enumerable: false,
|
|
2845
3446
|
configurable: true
|
|
2846
3447
|
});
|
|
2847
3448
|
Object.defineProperty(Router.prototype, "schema", {
|
|
2848
3449
|
get: function () {
|
|
2849
3450
|
return this.application.schema;
|
|
2850
3451
|
},
|
|
2851
|
-
enumerable:
|
|
3452
|
+
enumerable: false,
|
|
3453
|
+
configurable: true
|
|
3454
|
+
});
|
|
3455
|
+
Object.defineProperty(Router.prototype, "logger", {
|
|
3456
|
+
get: function () {
|
|
3457
|
+
return this.application.logger;
|
|
3458
|
+
},
|
|
3459
|
+
enumerable: false,
|
|
2852
3460
|
configurable: true
|
|
2853
3461
|
});
|
|
2854
3462
|
Object.defineProperty(Router.prototype, "controllerAttribute", {
|
|
2855
3463
|
get: function () {
|
|
2856
3464
|
return this.schema.controllerAttribute;
|
|
2857
3465
|
},
|
|
2858
|
-
enumerable:
|
|
3466
|
+
enumerable: false,
|
|
2859
3467
|
configurable: true
|
|
2860
3468
|
});
|
|
2861
3469
|
Object.defineProperty(Router.prototype, "modules", {
|
|
2862
3470
|
get: function () {
|
|
2863
3471
|
return Array.from(this.modulesByIdentifier.values());
|
|
2864
3472
|
},
|
|
2865
|
-
enumerable:
|
|
3473
|
+
enumerable: false,
|
|
2866
3474
|
configurable: true
|
|
2867
3475
|
});
|
|
2868
3476
|
Object.defineProperty(Router.prototype, "contexts", {
|
|
@@ -2871,7 +3479,7 @@ function () {
|
|
|
2871
3479
|
return contexts.concat(module.contexts);
|
|
2872
3480
|
}, []);
|
|
2873
3481
|
},
|
|
2874
|
-
enumerable:
|
|
3482
|
+
enumerable: false,
|
|
2875
3483
|
configurable: true
|
|
2876
3484
|
});
|
|
2877
3485
|
|
|
@@ -2917,6 +3525,12 @@ function () {
|
|
|
2917
3525
|
/** @hidden */
|
|
2918
3526
|
|
|
2919
3527
|
|
|
3528
|
+
Router.prototype.createScopeForElementAndIdentifier = function (element, identifier) {
|
|
3529
|
+
return new _scope.Scope(this.schema, element, identifier, this.logger);
|
|
3530
|
+
};
|
|
3531
|
+
/** @hidden */
|
|
3532
|
+
|
|
3533
|
+
|
|
2920
3534
|
Router.prototype.scopeConnected = function (scope) {
|
|
2921
3535
|
this.scopesByIdentifier.add(scope.identifier, scope);
|
|
2922
3536
|
var module = this.modulesByIdentifier.get(scope.identifier);
|
|
@@ -2955,11 +3569,10 @@ function () {
|
|
|
2955
3569
|
};
|
|
2956
3570
|
|
|
2957
3571
|
return Router;
|
|
2958
|
-
}();
|
|
2959
|
-
|
|
3572
|
+
}();
|
|
2960
3573
|
|
|
2961
3574
|
exports.Router = Router;
|
|
2962
|
-
},{"./module":"../node_modules/@stimulus/core/dist/
|
|
3575
|
+
},{"./module":"../node_modules/@stimulus/core/dist/module.js","@stimulus/multimap":"../node_modules/@stimulus/multimap/dist/index.js","./scope":"../node_modules/@stimulus/core/dist/scope.js","./scope_observer":"../node_modules/@stimulus/core/dist/scope_observer.js"}],"../node_modules/@stimulus/core/dist/schema.js":[function(require,module,exports) {
|
|
2963
3576
|
"use strict";
|
|
2964
3577
|
|
|
2965
3578
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -2970,10 +3583,9 @@ var defaultSchema = {
|
|
|
2970
3583
|
controllerAttribute: "data-controller",
|
|
2971
3584
|
actionAttribute: "data-action",
|
|
2972
3585
|
targetAttribute: "data-target"
|
|
2973
|
-
};
|
|
2974
|
-
|
|
3586
|
+
};
|
|
2975
3587
|
exports.defaultSchema = defaultSchema;
|
|
2976
|
-
},{}],"../node_modules/@stimulus/core/dist/
|
|
3588
|
+
},{}],"../node_modules/@stimulus/core/dist/application.js":[function(require,module,exports) {
|
|
2977
3589
|
"use strict";
|
|
2978
3590
|
|
|
2979
3591
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -2988,6 +3600,12 @@ var _router = require("./router");
|
|
|
2988
3600
|
var _schema = require("./schema");
|
|
2989
3601
|
|
|
2990
3602
|
var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
|
|
3603
|
+
function adopt(value) {
|
|
3604
|
+
return value instanceof P ? value : new P(function (resolve) {
|
|
3605
|
+
resolve(value);
|
|
3606
|
+
});
|
|
3607
|
+
}
|
|
3608
|
+
|
|
2991
3609
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
2992
3610
|
function fulfilled(value) {
|
|
2993
3611
|
try {
|
|
@@ -3006,9 +3624,7 @@ var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P
|
|
|
3006
3624
|
}
|
|
3007
3625
|
|
|
3008
3626
|
function step(result) {
|
|
3009
|
-
result.done ? resolve(result.value) :
|
|
3010
|
-
resolve(result.value);
|
|
3011
|
-
}).then(fulfilled, rejected);
|
|
3627
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
3012
3628
|
}
|
|
3013
3629
|
|
|
3014
3630
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
@@ -3047,8 +3663,8 @@ var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
|
|
|
3047
3663
|
if (f) throw new TypeError("Generator is already executing.");
|
|
3048
3664
|
|
|
3049
3665
|
while (_) try {
|
|
3050
|
-
if (f = 1, y && (t =
|
|
3051
|
-
if (y = 0, t) op = [0, t.value];
|
|
3666
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
3667
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
3052
3668
|
|
|
3053
3669
|
switch (op[0]) {
|
|
3054
3670
|
case 0:
|
|
@@ -3124,6 +3740,14 @@ var __generator = void 0 && (void 0).__generator || function (thisArg, body) {
|
|
|
3124
3740
|
}
|
|
3125
3741
|
};
|
|
3126
3742
|
|
|
3743
|
+
var __spreadArrays = void 0 && (void 0).__spreadArrays || function () {
|
|
3744
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
3745
|
+
|
|
3746
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];
|
|
3747
|
+
|
|
3748
|
+
return r;
|
|
3749
|
+
};
|
|
3750
|
+
|
|
3127
3751
|
var Application =
|
|
3128
3752
|
/** @class */
|
|
3129
3753
|
function () {
|
|
@@ -3136,6 +3760,7 @@ function () {
|
|
|
3136
3760
|
schema = _schema.defaultSchema;
|
|
3137
3761
|
}
|
|
3138
3762
|
|
|
3763
|
+
this.logger = console;
|
|
3139
3764
|
this.element = element;
|
|
3140
3765
|
this.schema = schema;
|
|
3141
3766
|
this.dispatcher = new _dispatcher.Dispatcher(this);
|
|
@@ -3160,8 +3785,8 @@ function () {
|
|
|
3160
3785
|
case 1:
|
|
3161
3786
|
_a.sent();
|
|
3162
3787
|
|
|
3163
|
-
this.router.start();
|
|
3164
3788
|
this.dispatcher.start();
|
|
3789
|
+
this.router.start();
|
|
3165
3790
|
return [2
|
|
3166
3791
|
/*return*/
|
|
3167
3792
|
];
|
|
@@ -3171,8 +3796,8 @@ function () {
|
|
|
3171
3796
|
};
|
|
3172
3797
|
|
|
3173
3798
|
Application.prototype.stop = function () {
|
|
3174
|
-
this.router.stop();
|
|
3175
3799
|
this.dispatcher.stop();
|
|
3800
|
+
this.router.stop();
|
|
3176
3801
|
};
|
|
3177
3802
|
|
|
3178
3803
|
Application.prototype.register = function (identifier, controllerConstructor) {
|
|
@@ -3191,7 +3816,7 @@ function () {
|
|
|
3191
3816
|
rest[_i - 1] = arguments[_i];
|
|
3192
3817
|
}
|
|
3193
3818
|
|
|
3194
|
-
var definitions = Array.isArray(head) ? head : [head]
|
|
3819
|
+
var definitions = Array.isArray(head) ? head : __spreadArrays([head], rest);
|
|
3195
3820
|
definitions.forEach(function (definition) {
|
|
3196
3821
|
return _this.router.loadDefinition(definition);
|
|
3197
3822
|
});
|
|
@@ -3206,7 +3831,7 @@ function () {
|
|
|
3206
3831
|
rest[_i - 1] = arguments[_i];
|
|
3207
3832
|
}
|
|
3208
3833
|
|
|
3209
|
-
var identifiers = Array.isArray(head) ? head : [head]
|
|
3834
|
+
var identifiers = Array.isArray(head) ? head : __spreadArrays([head], rest);
|
|
3210
3835
|
identifiers.forEach(function (identifier) {
|
|
3211
3836
|
return _this.router.unloadIdentifier(identifier);
|
|
3212
3837
|
});
|
|
@@ -3219,7 +3844,7 @@ function () {
|
|
|
3219
3844
|
return context.controller;
|
|
3220
3845
|
});
|
|
3221
3846
|
},
|
|
3222
|
-
enumerable:
|
|
3847
|
+
enumerable: false,
|
|
3223
3848
|
configurable: true
|
|
3224
3849
|
});
|
|
3225
3850
|
|
|
@@ -3230,7 +3855,7 @@ function () {
|
|
|
3230
3855
|
|
|
3231
3856
|
|
|
3232
3857
|
Application.prototype.handleError = function (error, message, detail) {
|
|
3233
|
-
|
|
3858
|
+
this.logger.error("%s\n\n%o\n\n%o", message, error, detail);
|
|
3234
3859
|
};
|
|
3235
3860
|
|
|
3236
3861
|
return Application;
|
|
@@ -3246,83 +3871,263 @@ function domReady() {
|
|
|
3246
3871
|
resolve();
|
|
3247
3872
|
}
|
|
3248
3873
|
});
|
|
3249
|
-
}
|
|
3250
|
-
},{"./dispatcher":"../node_modules/@stimulus/core/dist/
|
|
3874
|
+
}
|
|
3875
|
+
},{"./dispatcher":"../node_modules/@stimulus/core/dist/dispatcher.js","./router":"../node_modules/@stimulus/core/dist/router.js","./schema":"../node_modules/@stimulus/core/dist/schema.js"}],"../node_modules/@stimulus/core/dist/class_properties.js":[function(require,module,exports) {
|
|
3251
3876
|
"use strict";
|
|
3252
3877
|
|
|
3253
3878
|
Object.defineProperty(exports, "__esModule", {
|
|
3254
3879
|
value: true
|
|
3255
3880
|
});
|
|
3256
|
-
exports.
|
|
3881
|
+
exports.ClassPropertiesBlessing = ClassPropertiesBlessing;
|
|
3882
|
+
|
|
3883
|
+
var _inheritable_statics = require("./inheritable_statics");
|
|
3884
|
+
|
|
3885
|
+
var _string_helpers = require("./string_helpers");
|
|
3257
3886
|
|
|
3258
3887
|
/** @hidden */
|
|
3259
|
-
function
|
|
3260
|
-
var
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3888
|
+
function ClassPropertiesBlessing(constructor) {
|
|
3889
|
+
var classes = (0, _inheritable_statics.readInheritableStaticArrayValues)(constructor, "classes");
|
|
3890
|
+
return classes.reduce(function (properties, classDefinition) {
|
|
3891
|
+
return Object.assign(properties, propertiesForClassDefinition(classDefinition));
|
|
3892
|
+
}, {});
|
|
3893
|
+
}
|
|
3264
3894
|
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
var target = this.targets.find(name);
|
|
3895
|
+
function propertiesForClassDefinition(key) {
|
|
3896
|
+
var _a;
|
|
3268
3897
|
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3898
|
+
var name = key + "Class";
|
|
3899
|
+
return _a = {}, _a[name] = {
|
|
3900
|
+
get: function () {
|
|
3901
|
+
var classes = this.classes;
|
|
3902
|
+
|
|
3903
|
+
if (classes.has(key)) {
|
|
3904
|
+
return classes.get(key);
|
|
3905
|
+
} else {
|
|
3906
|
+
var attribute = classes.getAttributeName(key);
|
|
3907
|
+
throw new Error("Missing attribute \"" + attribute + "\"");
|
|
3274
3908
|
}
|
|
3275
|
-
}
|
|
3276
|
-
|
|
3277
|
-
|
|
3909
|
+
}
|
|
3910
|
+
}, _a["has" + (0, _string_helpers.capitalize)(name)] = {
|
|
3911
|
+
get: function () {
|
|
3912
|
+
return this.classes.has(key);
|
|
3913
|
+
}
|
|
3914
|
+
}, _a;
|
|
3915
|
+
}
|
|
3916
|
+
},{"./inheritable_statics":"../node_modules/@stimulus/core/dist/inheritable_statics.js","./string_helpers":"../node_modules/@stimulus/core/dist/string_helpers.js"}],"../node_modules/@stimulus/core/dist/target_properties.js":[function(require,module,exports) {
|
|
3917
|
+
"use strict";
|
|
3918
|
+
|
|
3919
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3920
|
+
value: true
|
|
3921
|
+
});
|
|
3922
|
+
exports.TargetPropertiesBlessing = TargetPropertiesBlessing;
|
|
3923
|
+
|
|
3924
|
+
var _inheritable_statics = require("./inheritable_statics");
|
|
3925
|
+
|
|
3926
|
+
var _string_helpers = require("./string_helpers");
|
|
3927
|
+
|
|
3928
|
+
/** @hidden */
|
|
3929
|
+
function TargetPropertiesBlessing(constructor) {
|
|
3930
|
+
var targets = (0, _inheritable_statics.readInheritableStaticArrayValues)(constructor, "targets");
|
|
3931
|
+
return targets.reduce(function (properties, targetDefinition) {
|
|
3932
|
+
return Object.assign(properties, propertiesForTargetDefinition(targetDefinition));
|
|
3933
|
+
}, {});
|
|
3934
|
+
}
|
|
3935
|
+
|
|
3936
|
+
function propertiesForTargetDefinition(name) {
|
|
3937
|
+
var _a;
|
|
3938
|
+
|
|
3939
|
+
return _a = {}, _a[name + "Target"] = {
|
|
3940
|
+
get: function () {
|
|
3941
|
+
var target = this.targets.find(name);
|
|
3942
|
+
|
|
3943
|
+
if (target) {
|
|
3944
|
+
return target;
|
|
3945
|
+
} else {
|
|
3946
|
+
throw new Error("Missing target element \"" + this.identifier + "." + name + "\"");
|
|
3278
3947
|
}
|
|
3279
|
-
}
|
|
3948
|
+
}
|
|
3949
|
+
}, _a[name + "Targets"] = {
|
|
3950
|
+
get: function () {
|
|
3951
|
+
return this.targets.findAll(name);
|
|
3952
|
+
}
|
|
3953
|
+
}, _a["has" + (0, _string_helpers.capitalize)(name) + "Target"] = {
|
|
3954
|
+
get: function () {
|
|
3955
|
+
return this.targets.has(name);
|
|
3956
|
+
}
|
|
3957
|
+
}, _a;
|
|
3958
|
+
}
|
|
3959
|
+
},{"./inheritable_statics":"../node_modules/@stimulus/core/dist/inheritable_statics.js","./string_helpers":"../node_modules/@stimulus/core/dist/string_helpers.js"}],"../node_modules/@stimulus/core/dist/value_properties.js":[function(require,module,exports) {
|
|
3960
|
+
"use strict";
|
|
3961
|
+
|
|
3962
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3963
|
+
value: true
|
|
3964
|
+
});
|
|
3965
|
+
exports.ValuePropertiesBlessing = ValuePropertiesBlessing;
|
|
3966
|
+
exports.propertiesForValueDefinitionPair = propertiesForValueDefinitionPair;
|
|
3967
|
+
|
|
3968
|
+
var _inheritable_statics = require("./inheritable_statics");
|
|
3969
|
+
|
|
3970
|
+
var _string_helpers = require("./string_helpers");
|
|
3971
|
+
|
|
3972
|
+
/** @hidden */
|
|
3973
|
+
function ValuePropertiesBlessing(constructor) {
|
|
3974
|
+
var valueDefinitionPairs = (0, _inheritable_statics.readInheritableStaticObjectPairs)(constructor, "values");
|
|
3975
|
+
var propertyDescriptorMap = {
|
|
3976
|
+
valueDescriptorMap: {
|
|
3280
3977
|
get: function () {
|
|
3281
|
-
|
|
3978
|
+
var _this = this;
|
|
3979
|
+
|
|
3980
|
+
return valueDefinitionPairs.reduce(function (result, valueDefinitionPair) {
|
|
3981
|
+
var _a;
|
|
3982
|
+
|
|
3983
|
+
var valueDescriptor = parseValueDefinitionPair(valueDefinitionPair);
|
|
3984
|
+
|
|
3985
|
+
var attributeName = _this.data.getAttributeNameForKey(valueDescriptor.key);
|
|
3986
|
+
|
|
3987
|
+
return Object.assign(result, (_a = {}, _a[attributeName] = valueDescriptor, _a));
|
|
3988
|
+
}, {});
|
|
3282
3989
|
}
|
|
3283
|
-
}
|
|
3284
|
-
}
|
|
3990
|
+
}
|
|
3991
|
+
};
|
|
3992
|
+
return valueDefinitionPairs.reduce(function (properties, valueDefinitionPair) {
|
|
3993
|
+
return Object.assign(properties, propertiesForValueDefinitionPair(valueDefinitionPair));
|
|
3994
|
+
}, propertyDescriptorMap);
|
|
3285
3995
|
}
|
|
3996
|
+
/** @hidden */
|
|
3286
3997
|
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3998
|
+
|
|
3999
|
+
function propertiesForValueDefinitionPair(valueDefinitionPair) {
|
|
4000
|
+
var _a;
|
|
4001
|
+
|
|
4002
|
+
var definition = parseValueDefinitionPair(valueDefinitionPair);
|
|
4003
|
+
var type = definition.type,
|
|
4004
|
+
key = definition.key,
|
|
4005
|
+
name = definition.name;
|
|
4006
|
+
var read = readers[type],
|
|
4007
|
+
write = writers[type] || writers.default;
|
|
4008
|
+
return _a = {}, _a[name] = {
|
|
4009
|
+
get: function () {
|
|
4010
|
+
var value = this.data.get(key);
|
|
4011
|
+
|
|
4012
|
+
if (value !== null) {
|
|
4013
|
+
return read(value);
|
|
4014
|
+
} else {
|
|
4015
|
+
return definition.defaultValue;
|
|
4016
|
+
}
|
|
4017
|
+
},
|
|
4018
|
+
set: function (value) {
|
|
4019
|
+
if (value === undefined) {
|
|
4020
|
+
this.data.delete(key);
|
|
4021
|
+
} else {
|
|
4022
|
+
this.data.set(key, write(value));
|
|
4023
|
+
}
|
|
4024
|
+
}
|
|
4025
|
+
}, _a["has" + (0, _string_helpers.capitalize)(name)] = {
|
|
4026
|
+
get: function () {
|
|
4027
|
+
return this.data.has(key);
|
|
4028
|
+
}
|
|
4029
|
+
}, _a;
|
|
3295
4030
|
}
|
|
3296
4031
|
|
|
3297
|
-
function
|
|
3298
|
-
var
|
|
4032
|
+
function parseValueDefinitionPair(_a) {
|
|
4033
|
+
var token = _a[0],
|
|
4034
|
+
typeConstant = _a[1];
|
|
4035
|
+
var type = parseValueTypeConstant(typeConstant);
|
|
4036
|
+
return valueDescriptorForTokenAndType(token, type);
|
|
4037
|
+
}
|
|
3299
4038
|
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
4039
|
+
function parseValueTypeConstant(typeConstant) {
|
|
4040
|
+
switch (typeConstant) {
|
|
4041
|
+
case Array:
|
|
4042
|
+
return "array";
|
|
4043
|
+
|
|
4044
|
+
case Boolean:
|
|
4045
|
+
return "boolean";
|
|
4046
|
+
|
|
4047
|
+
case Number:
|
|
4048
|
+
return "number";
|
|
4049
|
+
|
|
4050
|
+
case Object:
|
|
4051
|
+
return "object";
|
|
4052
|
+
|
|
4053
|
+
case String:
|
|
4054
|
+
return "string";
|
|
3303
4055
|
}
|
|
3304
4056
|
|
|
3305
|
-
|
|
4057
|
+
throw new Error("Unknown value type constant \"" + typeConstant + "\"");
|
|
3306
4058
|
}
|
|
3307
4059
|
|
|
3308
|
-
function
|
|
3309
|
-
var
|
|
3310
|
-
return
|
|
4060
|
+
function valueDescriptorForTokenAndType(token, type) {
|
|
4061
|
+
var key = (0, _string_helpers.dasherize)(token) + "-value";
|
|
4062
|
+
return {
|
|
4063
|
+
type: type,
|
|
4064
|
+
key: key,
|
|
4065
|
+
name: (0, _string_helpers.camelize)(key),
|
|
4066
|
+
|
|
4067
|
+
get defaultValue() {
|
|
4068
|
+
return defaultValuesByType[type];
|
|
4069
|
+
}
|
|
4070
|
+
|
|
4071
|
+
};
|
|
3311
4072
|
}
|
|
3312
4073
|
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
4074
|
+
var defaultValuesByType = {
|
|
4075
|
+
get array() {
|
|
4076
|
+
return [];
|
|
4077
|
+
},
|
|
4078
|
+
|
|
4079
|
+
boolean: false,
|
|
4080
|
+
number: 0,
|
|
4081
|
+
|
|
4082
|
+
get object() {
|
|
4083
|
+
return {};
|
|
4084
|
+
},
|
|
4085
|
+
|
|
4086
|
+
string: ""
|
|
4087
|
+
};
|
|
4088
|
+
var readers = {
|
|
4089
|
+
array: function (value) {
|
|
4090
|
+
var array = JSON.parse(value);
|
|
4091
|
+
|
|
4092
|
+
if (!Array.isArray(array)) {
|
|
4093
|
+
throw new TypeError("Expected array");
|
|
3318
4094
|
}
|
|
3319
|
-
|
|
4095
|
+
|
|
4096
|
+
return array;
|
|
4097
|
+
},
|
|
4098
|
+
boolean: function (value) {
|
|
4099
|
+
return !(value == "0" || value == "false");
|
|
4100
|
+
},
|
|
4101
|
+
number: function (value) {
|
|
4102
|
+
return parseFloat(value);
|
|
4103
|
+
},
|
|
4104
|
+
object: function (value) {
|
|
4105
|
+
var object = JSON.parse(value);
|
|
4106
|
+
|
|
4107
|
+
if (object === null || typeof object != "object" || Array.isArray(object)) {
|
|
4108
|
+
throw new TypeError("Expected object");
|
|
4109
|
+
}
|
|
4110
|
+
|
|
4111
|
+
return object;
|
|
4112
|
+
},
|
|
4113
|
+
string: function (value) {
|
|
4114
|
+
return value;
|
|
4115
|
+
}
|
|
4116
|
+
};
|
|
4117
|
+
var writers = {
|
|
4118
|
+
default: writeString,
|
|
4119
|
+
array: writeJSON,
|
|
4120
|
+
object: writeJSON
|
|
4121
|
+
};
|
|
4122
|
+
|
|
4123
|
+
function writeJSON(value) {
|
|
4124
|
+
return JSON.stringify(value);
|
|
3320
4125
|
}
|
|
3321
4126
|
|
|
3322
|
-
function
|
|
3323
|
-
return
|
|
3324
|
-
}
|
|
3325
|
-
},{}],"../node_modules/@stimulus/core/dist/
|
|
4127
|
+
function writeString(value) {
|
|
4128
|
+
return "" + value;
|
|
4129
|
+
}
|
|
4130
|
+
},{"./inheritable_statics":"../node_modules/@stimulus/core/dist/inheritable_statics.js","./string_helpers":"../node_modules/@stimulus/core/dist/string_helpers.js"}],"../node_modules/@stimulus/core/dist/controller.js":[function(require,module,exports) {
|
|
3326
4131
|
"use strict";
|
|
3327
4132
|
|
|
3328
4133
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -3330,8 +4135,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
3330
4135
|
});
|
|
3331
4136
|
exports.Controller = void 0;
|
|
3332
4137
|
|
|
4138
|
+
var _class_properties = require("./class_properties");
|
|
4139
|
+
|
|
3333
4140
|
var _target_properties = require("./target_properties");
|
|
3334
4141
|
|
|
4142
|
+
var _value_properties = require("./value_properties");
|
|
4143
|
+
|
|
3335
4144
|
var Controller =
|
|
3336
4145
|
/** @class */
|
|
3337
4146
|
function () {
|
|
@@ -3339,50 +4148,53 @@ function () {
|
|
|
3339
4148
|
this.context = context;
|
|
3340
4149
|
}
|
|
3341
4150
|
|
|
3342
|
-
Controller.bless = function () {
|
|
3343
|
-
(0, _target_properties.defineTargetProperties)(this);
|
|
3344
|
-
};
|
|
3345
|
-
|
|
3346
4151
|
Object.defineProperty(Controller.prototype, "application", {
|
|
3347
4152
|
get: function () {
|
|
3348
4153
|
return this.context.application;
|
|
3349
4154
|
},
|
|
3350
|
-
enumerable:
|
|
4155
|
+
enumerable: false,
|
|
3351
4156
|
configurable: true
|
|
3352
4157
|
});
|
|
3353
4158
|
Object.defineProperty(Controller.prototype, "scope", {
|
|
3354
4159
|
get: function () {
|
|
3355
4160
|
return this.context.scope;
|
|
3356
4161
|
},
|
|
3357
|
-
enumerable:
|
|
4162
|
+
enumerable: false,
|
|
3358
4163
|
configurable: true
|
|
3359
4164
|
});
|
|
3360
4165
|
Object.defineProperty(Controller.prototype, "element", {
|
|
3361
4166
|
get: function () {
|
|
3362
4167
|
return this.scope.element;
|
|
3363
4168
|
},
|
|
3364
|
-
enumerable:
|
|
4169
|
+
enumerable: false,
|
|
3365
4170
|
configurable: true
|
|
3366
4171
|
});
|
|
3367
4172
|
Object.defineProperty(Controller.prototype, "identifier", {
|
|
3368
4173
|
get: function () {
|
|
3369
4174
|
return this.scope.identifier;
|
|
3370
4175
|
},
|
|
3371
|
-
enumerable:
|
|
4176
|
+
enumerable: false,
|
|
3372
4177
|
configurable: true
|
|
3373
4178
|
});
|
|
3374
4179
|
Object.defineProperty(Controller.prototype, "targets", {
|
|
3375
4180
|
get: function () {
|
|
3376
4181
|
return this.scope.targets;
|
|
3377
4182
|
},
|
|
3378
|
-
enumerable:
|
|
4183
|
+
enumerable: false,
|
|
4184
|
+
configurable: true
|
|
4185
|
+
});
|
|
4186
|
+
Object.defineProperty(Controller.prototype, "classes", {
|
|
4187
|
+
get: function () {
|
|
4188
|
+
return this.scope.classes;
|
|
4189
|
+
},
|
|
4190
|
+
enumerable: false,
|
|
3379
4191
|
configurable: true
|
|
3380
4192
|
});
|
|
3381
4193
|
Object.defineProperty(Controller.prototype, "data", {
|
|
3382
4194
|
get: function () {
|
|
3383
4195
|
return this.scope.data;
|
|
3384
4196
|
},
|
|
3385
|
-
enumerable:
|
|
4197
|
+
enumerable: false,
|
|
3386
4198
|
configurable: true
|
|
3387
4199
|
});
|
|
3388
4200
|
|
|
@@ -3395,13 +4207,14 @@ function () {
|
|
|
3395
4207
|
Controller.prototype.disconnect = function () {// Override in your subclass to respond when the controller is disconnected from the DOM
|
|
3396
4208
|
};
|
|
3397
4209
|
|
|
4210
|
+
Controller.blessings = [_class_properties.ClassPropertiesBlessing, _target_properties.TargetPropertiesBlessing, _value_properties.ValuePropertiesBlessing];
|
|
3398
4211
|
Controller.targets = [];
|
|
4212
|
+
Controller.values = {};
|
|
3399
4213
|
return Controller;
|
|
3400
|
-
}();
|
|
3401
|
-
|
|
4214
|
+
}();
|
|
3402
4215
|
|
|
3403
4216
|
exports.Controller = Controller;
|
|
3404
|
-
},{"./target_properties":"../node_modules/@stimulus/core/dist/
|
|
4217
|
+
},{"./class_properties":"../node_modules/@stimulus/core/dist/class_properties.js","./target_properties":"../node_modules/@stimulus/core/dist/target_properties.js","./value_properties":"../node_modules/@stimulus/core/dist/value_properties.js"}],"../node_modules/@stimulus/core/dist/index.js":[function(require,module,exports) {
|
|
3405
4218
|
"use strict";
|
|
3406
4219
|
|
|
3407
4220
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -3432,14 +4245,14 @@ Object.defineProperty(exports, "defaultSchema", {
|
|
|
3432
4245
|
}
|
|
3433
4246
|
});
|
|
3434
4247
|
|
|
3435
|
-
var _application = require("./
|
|
4248
|
+
var _application = require("./application");
|
|
3436
4249
|
|
|
3437
|
-
var _context = require("./
|
|
4250
|
+
var _context = require("./context");
|
|
3438
4251
|
|
|
3439
|
-
var _controller = require("./
|
|
4252
|
+
var _controller = require("./controller");
|
|
3440
4253
|
|
|
3441
|
-
var _schema = require("./
|
|
3442
|
-
},{"./
|
|
4254
|
+
var _schema = require("./schema");
|
|
4255
|
+
},{"./application":"../node_modules/@stimulus/core/dist/application.js","./context":"../node_modules/@stimulus/core/dist/context.js","./controller":"../node_modules/@stimulus/core/dist/controller.js","./schema":"../node_modules/@stimulus/core/dist/schema.js"}],"../node_modules/stimulus/index.js":[function(require,module,exports) {
|
|
3443
4256
|
"use strict";
|
|
3444
4257
|
|
|
3445
4258
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -3450,6 +4263,7 @@ var _core = require("@stimulus/core");
|
|
|
3450
4263
|
|
|
3451
4264
|
Object.keys(_core).forEach(function (key) {
|
|
3452
4265
|
if (key === "default" || key === "__esModule") return;
|
|
4266
|
+
if (key in exports && exports[key] === _core[key]) return;
|
|
3453
4267
|
Object.defineProperty(exports, key, {
|
|
3454
4268
|
enumerable: true,
|
|
3455
4269
|
get: function () {
|
|
@@ -3457,27 +4271,149 @@ Object.keys(_core).forEach(function (key) {
|
|
|
3457
4271
|
}
|
|
3458
4272
|
});
|
|
3459
4273
|
});
|
|
3460
|
-
},{"@stimulus/core":"../node_modules/@stimulus/core/dist/index.js"}],"javascripts/super/
|
|
4274
|
+
},{"@stimulus/core":"../node_modules/@stimulus/core/dist/index.js"}],"javascripts/super/apply_template_controller.ts":[function(require,module,exports) {
|
|
4275
|
+
"use strict";
|
|
4276
|
+
|
|
4277
|
+
var __extends = this && this.__extends || function () {
|
|
4278
|
+
var _extendStatics = function extendStatics(d, b) {
|
|
4279
|
+
_extendStatics = Object.setPrototypeOf || {
|
|
4280
|
+
__proto__: []
|
|
4281
|
+
} instanceof Array && function (d, b) {
|
|
4282
|
+
d.__proto__ = b;
|
|
4283
|
+
} || function (d, b) {
|
|
4284
|
+
for (var p in b) {
|
|
4285
|
+
if (b.hasOwnProperty(p)) d[p] = b[p];
|
|
4286
|
+
}
|
|
4287
|
+
};
|
|
4288
|
+
|
|
4289
|
+
return _extendStatics(d, b);
|
|
4290
|
+
};
|
|
4291
|
+
|
|
4292
|
+
return function (d, b) {
|
|
4293
|
+
_extendStatics(d, b);
|
|
4294
|
+
|
|
4295
|
+
function __() {
|
|
4296
|
+
this.constructor = d;
|
|
4297
|
+
}
|
|
4298
|
+
|
|
4299
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
4300
|
+
};
|
|
4301
|
+
}();
|
|
4302
|
+
|
|
4303
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4304
|
+
value: true
|
|
4305
|
+
});
|
|
4306
|
+
|
|
4307
|
+
var stimulus_1 = require("stimulus");
|
|
4308
|
+
|
|
4309
|
+
var default_1 =
|
|
4310
|
+
/** @class */
|
|
4311
|
+
function (_super) {
|
|
4312
|
+
__extends(default_1, _super);
|
|
4313
|
+
|
|
4314
|
+
function default_1() {
|
|
4315
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
4316
|
+
}
|
|
4317
|
+
|
|
4318
|
+
default_1.prototype.call = function (event) {
|
|
4319
|
+
event.preventDefault();
|
|
4320
|
+
var unixtime = new Date().getTime();
|
|
4321
|
+
var content = this.templateTarget.innerHTML.replace(/TEMPLATEINDEX/g, unixtime.toString());
|
|
4322
|
+
this.templateTarget.insertAdjacentHTML("beforebegin", content);
|
|
4323
|
+
};
|
|
4324
|
+
|
|
4325
|
+
default_1.targets = ["template"];
|
|
4326
|
+
return default_1;
|
|
4327
|
+
}(stimulus_1.Controller);
|
|
4328
|
+
|
|
4329
|
+
exports.default = default_1;
|
|
4330
|
+
},{"stimulus":"../node_modules/stimulus/index.js"}],"javascripts/super/toggle_pending_destruction_controller.ts":[function(require,module,exports) {
|
|
3461
4331
|
"use strict";
|
|
3462
4332
|
|
|
4333
|
+
var __extends = this && this.__extends || function () {
|
|
4334
|
+
var _extendStatics = function extendStatics(d, b) {
|
|
4335
|
+
_extendStatics = Object.setPrototypeOf || {
|
|
4336
|
+
__proto__: []
|
|
4337
|
+
} instanceof Array && function (d, b) {
|
|
4338
|
+
d.__proto__ = b;
|
|
4339
|
+
} || function (d, b) {
|
|
4340
|
+
for (var p in b) {
|
|
4341
|
+
if (b.hasOwnProperty(p)) d[p] = b[p];
|
|
4342
|
+
}
|
|
4343
|
+
};
|
|
4344
|
+
|
|
4345
|
+
return _extendStatics(d, b);
|
|
4346
|
+
};
|
|
4347
|
+
|
|
4348
|
+
return function (d, b) {
|
|
4349
|
+
_extendStatics(d, b);
|
|
4350
|
+
|
|
4351
|
+
function __() {
|
|
4352
|
+
this.constructor = d;
|
|
4353
|
+
}
|
|
4354
|
+
|
|
4355
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
4356
|
+
};
|
|
4357
|
+
}();
|
|
4358
|
+
|
|
3463
4359
|
Object.defineProperty(exports, "__esModule", {
|
|
3464
4360
|
value: true
|
|
3465
4361
|
});
|
|
3466
|
-
exports.default = void 0;
|
|
3467
4362
|
|
|
3468
|
-
var
|
|
4363
|
+
var stimulus_1 = require("stimulus");
|
|
4364
|
+
|
|
4365
|
+
var default_1 =
|
|
4366
|
+
/** @class */
|
|
4367
|
+
function (_super) {
|
|
4368
|
+
__extends(default_1, _super);
|
|
4369
|
+
|
|
4370
|
+
function default_1() {
|
|
4371
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
4372
|
+
}
|
|
4373
|
+
|
|
4374
|
+
default_1.prototype.call = function (event) {
|
|
4375
|
+
var target = event.target;
|
|
4376
|
+
|
|
4377
|
+
if (target) {
|
|
4378
|
+
if (target.checked) {
|
|
4379
|
+
this.element.classList.add("opacity-75", "bg-gray-100");
|
|
4380
|
+
} else {
|
|
4381
|
+
this.element.classList.remove("opacity-75", "bg-gray-100");
|
|
4382
|
+
}
|
|
4383
|
+
}
|
|
4384
|
+
};
|
|
4385
|
+
|
|
4386
|
+
return default_1;
|
|
4387
|
+
}(stimulus_1.Controller);
|
|
4388
|
+
|
|
4389
|
+
exports.default = default_1;
|
|
4390
|
+
},{"stimulus":"../node_modules/stimulus/index.js"}],"javascripts/super/application.ts":[function(require,module,exports) {
|
|
4391
|
+
"use strict";
|
|
4392
|
+
|
|
4393
|
+
var __importDefault = this && this.__importDefault || function (mod) {
|
|
4394
|
+
return mod && mod.__esModule ? mod : {
|
|
4395
|
+
"default": mod
|
|
4396
|
+
};
|
|
4397
|
+
};
|
|
4398
|
+
|
|
4399
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4400
|
+
value: true
|
|
4401
|
+
});
|
|
3469
4402
|
|
|
3470
|
-
var
|
|
4403
|
+
var ujs_1 = __importDefault(require("@rails/ujs"));
|
|
3471
4404
|
|
|
3472
|
-
|
|
4405
|
+
var stimulus_1 = require("stimulus");
|
|
3473
4406
|
|
|
3474
|
-
|
|
4407
|
+
var apply_template_controller_1 = __importDefault(require("./apply_template_controller"));
|
|
3475
4408
|
|
|
3476
|
-
var
|
|
4409
|
+
var toggle_pending_destruction_controller_1 = __importDefault(require("./toggle_pending_destruction_controller"));
|
|
3477
4410
|
|
|
3478
|
-
|
|
4411
|
+
ujs_1.default.start();
|
|
4412
|
+
var application = stimulus_1.Application.start();
|
|
4413
|
+
application.register("apply-template", apply_template_controller_1.default);
|
|
4414
|
+
application.register("toggle-pending-destruction", toggle_pending_destruction_controller_1.default);
|
|
4415
|
+
exports.default = {
|
|
3479
4416
|
StimulusApplication: application,
|
|
3480
|
-
StimulusController:
|
|
4417
|
+
StimulusController: stimulus_1.Controller
|
|
3481
4418
|
};
|
|
3482
|
-
|
|
3483
|
-
},{"rails-ujs":"../node_modules/rails-ujs/lib/assets/compiled/rails-ujs.js","stimulus":"../node_modules/stimulus/index.js"}]},{},["javascripts/super/application.js"], "Super")
|
|
4419
|
+
},{"@rails/ujs":"../node_modules/@rails/ujs/lib/assets/compiled/rails-ujs.js","stimulus":"../node_modules/stimulus/index.js","./apply_template_controller":"javascripts/super/apply_template_controller.ts","./toggle_pending_destruction_controller":"javascripts/super/toggle_pending_destruction_controller.ts"}]},{},["javascripts/super/application.ts"], "Super")
|