playbook_ui 14.5.0.pre.alpha.javascriptassets3929 → 14.5.0.pre.alpha.javascriptassets3939
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_enhanced_element/{element_observer.ts → element_observer.js} +19 -27
- data/app/pb_kits/playbook/pb_enhanced_element/{index.ts → index.js} +15 -22
- data/dist/chunks/_typeahead-DPGG9h5l.js +65 -0
- data/dist/chunks/{index-C644xhdX.js → index-CaXZ6mCT.js} +1 -1
- data/dist/chunks/index-DfoYI7sS.js +1 -0
- data/dist/chunks/lib-ByFv-sq8.js +45 -0
- data/dist/chunks/{pb_form_validation-D9zkwt2b.js → pb_form_validation-8H8TD40J.js} +1 -1
- data/dist/chunks/vendor.js +45 -1
- data/dist/playbook-doc.js +1 -1
- data/dist/playbook-rails-friendly.js +1 -1
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +8 -8
- data/dist/chunks/_typeahead-BYw0HEgO.js +0 -22
- data/dist/chunks/_weekday_stacked-DumiyWjh.js +0 -45
- data/dist/chunks/lib-CEpcaI8y.js +0 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2ca4e8e8c3df9cdee7d02f68c3a611611053345876eb602efcdb91a16b4b076
|
4
|
+
data.tar.gz: fb337ad2f116c3f991969c8e59c06ba697828ae5af32cde1c01cb49bf06b6ee6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c833f8f4d32140a79a374f9d2b2b642fff7341defb6fc781122288238ba851c62281797eb4307ad9859c3a5004fd756c37e25dea8aa73434ac0dc6952b345fe9
|
7
|
+
data.tar.gz: 468fdf29ec022656bedceb21a0f7e165aee5de1d469ebd541e09a0587a642f91dbee263fe8c7932b5cd06fa9cac6f73efd4852edeab71757d93f1ffd561638f2
|
@@ -1,47 +1,34 @@
|
|
1
|
-
// eslint-disable-next-line
|
2
|
-
// @ts-nocheck
|
3
|
-
import PbEnhancedElement from "./index"
|
4
|
-
|
5
1
|
export default class ElementObserver {
|
6
|
-
matchDelegate
|
7
|
-
target: Document
|
8
|
-
_mutationObserver: MutationObserver
|
9
|
-
|
10
|
-
constructor(matchDelegate: PbEnhancedElement, target = document) {
|
2
|
+
constructor(matchDelegate, target = document) {
|
11
3
|
this.matchDelegate = matchDelegate
|
12
4
|
this.target = target
|
13
5
|
}
|
14
6
|
|
15
|
-
|
16
|
-
return this._mutationObserver =
|
17
|
-
this._mutationObserver || new MutationObserver((mutationList) => this.processMutationList(mutationList))
|
18
|
-
}
|
19
|
-
|
20
|
-
start(): void {
|
7
|
+
start() {
|
21
8
|
this.mutationObserver.observe(this.target, { attributes: true, childList: true, subtree: true })
|
22
9
|
this.catchup()
|
23
10
|
}
|
24
11
|
|
25
|
-
stop()
|
12
|
+
stop() {
|
26
13
|
this.mutationObserverdisconnect()
|
27
14
|
}
|
28
15
|
|
29
|
-
catchup()
|
30
|
-
this.handleAdditions(this.matchDelegate.matches(this.target
|
16
|
+
catchup() {
|
17
|
+
this.handleAdditions(this.matchDelegate.matches(this.target))
|
31
18
|
}
|
32
19
|
|
33
|
-
processMutationList(mutationList
|
20
|
+
processMutationList(mutationList) {
|
34
21
|
for (const mutation of mutationList) {
|
35
22
|
if (mutation.type == 'attributes') {
|
36
|
-
this.processAttributeChange(mutation.target
|
23
|
+
this.processAttributeChange(mutation.target)
|
37
24
|
} else if (mutation.type == 'childList') {
|
38
|
-
this.processRemovedNodes(Array.from(mutation.removedNodes)
|
39
|
-
this.processAddedNodes(Array.from(mutation.addedNodes)
|
25
|
+
this.processRemovedNodes(Array.from(mutation.removedNodes))
|
26
|
+
this.processAddedNodes(Array.from(mutation.addedNodes))
|
40
27
|
}
|
41
28
|
}
|
42
29
|
}
|
43
30
|
|
44
|
-
processAttributeChange(node
|
31
|
+
processAttributeChange(node) {
|
45
32
|
if (node.nodeType !== Node.ELEMENT_NODE) return
|
46
33
|
|
47
34
|
const matches = this.matchDelegate.matches(node)
|
@@ -51,25 +38,30 @@ export default class ElementObserver {
|
|
51
38
|
this.handleAdditions(matches)
|
52
39
|
}
|
53
40
|
|
54
|
-
processRemovedNodes(nodes
|
41
|
+
processRemovedNodes(nodes) {
|
55
42
|
for (const node of nodes) {
|
56
43
|
if (node.nodeType !== Node.ELEMENT_NODE) continue
|
57
44
|
this.handleRemovals(this.matchDelegate.matches(node))
|
58
45
|
}
|
59
46
|
}
|
60
47
|
|
61
|
-
processAddedNodes(nodes
|
48
|
+
processAddedNodes(nodes) {
|
62
49
|
for (const node of nodes) {
|
63
50
|
if (node.nodeType !== Node.ELEMENT_NODE) continue
|
64
51
|
this.handleAdditions(this.matchDelegate.matches(node))
|
65
52
|
}
|
66
53
|
}
|
67
54
|
|
68
|
-
handleRemovals(elements
|
55
|
+
handleRemovals(elements) {
|
69
56
|
for (const element of elements) this.matchDelegate.removeMatch(element)
|
70
57
|
}
|
71
58
|
|
72
|
-
handleAdditions(elements
|
59
|
+
handleAdditions(elements) {
|
73
60
|
for (const element of elements) this.matchDelegate.addMatch(element)
|
74
61
|
}
|
62
|
+
|
63
|
+
get mutationObserver() {
|
64
|
+
return this._mutationObserver =
|
65
|
+
this._mutationObserver || new MutationObserver((mutationList) => this.processMutationList(mutationList))
|
66
|
+
}
|
75
67
|
}
|
@@ -1,31 +1,21 @@
|
|
1
|
-
|
2
|
-
// @ts-nocheck
|
3
|
-
import ElementObserver from './element_observer'
|
1
|
+
import ElementObserver from './element_observer.js'
|
4
2
|
|
5
3
|
export default class PbEnhancedElement {
|
6
|
-
static
|
7
|
-
static _observer: ElementObserver
|
8
|
-
element: Element
|
9
|
-
|
10
|
-
constructor(element?: Element) {
|
11
|
-
this.element = element
|
12
|
-
}
|
13
|
-
|
14
|
-
static get elements(): Map<Element, PbEnhancedElement> {
|
4
|
+
static get elements() {
|
15
5
|
return this._elements = (this._elements || new Map)
|
16
6
|
}
|
17
7
|
|
18
|
-
static get observer()
|
8
|
+
static get observer() {
|
19
9
|
return this._observer = (this._observer || new ElementObserver(this))
|
20
10
|
}
|
21
11
|
|
22
|
-
static get selector()
|
12
|
+
static get selector() {
|
23
13
|
// eslint-disable-next-line no-console
|
24
14
|
console.warn('Define a static property for selector or redefine the matches function in a subclass.', this)
|
25
15
|
return null
|
26
16
|
}
|
27
17
|
|
28
|
-
static matches(node
|
18
|
+
static matches(node) {
|
29
19
|
if (!this.selector) return []
|
30
20
|
|
31
21
|
const matches = []
|
@@ -35,7 +25,7 @@ export default class PbEnhancedElement {
|
|
35
25
|
return (matches)
|
36
26
|
}
|
37
27
|
|
38
|
-
static addMatch(element
|
28
|
+
static addMatch(element) {
|
39
29
|
if (element._pbEnhanced || this.elements.has(element)) return
|
40
30
|
|
41
31
|
const enhansedElement = new this(element)
|
@@ -44,7 +34,7 @@ export default class PbEnhancedElement {
|
|
44
34
|
element._pbEnhanced = enhansedElement
|
45
35
|
}
|
46
36
|
|
47
|
-
static removeMatch(element
|
37
|
+
static removeMatch(element) {
|
48
38
|
if (!this.elements.has(element)) return
|
49
39
|
|
50
40
|
const enhansedElement = this.elements.get(element)
|
@@ -52,19 +42,22 @@ export default class PbEnhancedElement {
|
|
52
42
|
this.elements.delete(element)
|
53
43
|
}
|
54
44
|
|
55
|
-
static start()
|
45
|
+
static start() {
|
56
46
|
this.observer.start()
|
57
47
|
}
|
58
48
|
|
59
|
-
static stop()
|
49
|
+
static stop() {
|
60
50
|
this.mutationObserver.stop()
|
61
51
|
}
|
62
52
|
|
63
|
-
|
53
|
+
constructor(element) {
|
54
|
+
this.element = element
|
55
|
+
}
|
56
|
+
|
57
|
+
connect() {
|
64
58
|
// eslint-disable-next-line no-console
|
65
59
|
console.warn('Redefine the connect function in a subclass.', this)
|
66
60
|
}
|
67
61
|
|
68
|
-
|
69
|
-
disconnect(): void {}
|
62
|
+
disconnect() { }
|
70
63
|
}
|