plutonium 0.20.4 → 0.21.1
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/app/assets/plutonium.css +2 -2
- data/app/assets/plutonium.js +19 -144
- data/app/assets/plutonium.js.map +4 -4
- data/app/assets/plutonium.min.js +41 -41
- data/app/assets/plutonium.min.js.map +4 -4
- data/app/views/rodauth/_login_form.html.erb +5 -5
- data/app/views/rodauth/verify_account.html.erb +4 -3
- data/lib/generators/pu/pkg/portal/templates/app/views/package/dashboard/index.html.erb +81 -21
- data/lib/plutonium/interaction/README.md +114 -2
- data/lib/plutonium/interaction/base.rb +3 -0
- data/lib/plutonium/interaction/nested_attributes.rb +93 -0
- data/lib/plutonium/resource/controllers/crud_actions.rb +28 -14
- data/lib/plutonium/resource/controllers/interactive_actions.rb +38 -18
- data/lib/plutonium/resource/record/associated_with.rb +2 -2
- data/lib/plutonium/ui/form/base.rb +6 -0
- data/lib/plutonium/ui/form/resource.rb +22 -7
- data/lib/plutonium/ui/form/theme.rb +1 -1
- data/lib/plutonium/version.rb +1 -1
- data/package.json +1 -1
- data/src/js/controllers/form_controller.js +17 -1
- metadata +3 -2
data/app/assets/plutonium.js
CHANGED
@@ -25,139 +25,6 @@
|
|
25
25
|
mod
|
26
26
|
));
|
27
27
|
|
28
|
-
// node_modules/lodash.debounce/index.js
|
29
|
-
var require_lodash = __commonJS({
|
30
|
-
"node_modules/lodash.debounce/index.js"(exports, module) {
|
31
|
-
var FUNC_ERROR_TEXT = "Expected a function";
|
32
|
-
var NAN = 0 / 0;
|
33
|
-
var symbolTag = "[object Symbol]";
|
34
|
-
var reTrim = /^\s+|\s+$/g;
|
35
|
-
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
36
|
-
var reIsBinary = /^0b[01]+$/i;
|
37
|
-
var reIsOctal = /^0o[0-7]+$/i;
|
38
|
-
var freeParseInt = parseInt;
|
39
|
-
var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
|
40
|
-
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
41
|
-
var root = freeGlobal || freeSelf || Function("return this")();
|
42
|
-
var objectProto = Object.prototype;
|
43
|
-
var objectToString = objectProto.toString;
|
44
|
-
var nativeMax = Math.max;
|
45
|
-
var nativeMin = Math.min;
|
46
|
-
var now = function() {
|
47
|
-
return root.Date.now();
|
48
|
-
};
|
49
|
-
function debounce6(func, wait, options2) {
|
50
|
-
var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
|
51
|
-
if (typeof func != "function") {
|
52
|
-
throw new TypeError(FUNC_ERROR_TEXT);
|
53
|
-
}
|
54
|
-
wait = toNumber(wait) || 0;
|
55
|
-
if (isObject(options2)) {
|
56
|
-
leading = !!options2.leading;
|
57
|
-
maxing = "maxWait" in options2;
|
58
|
-
maxWait = maxing ? nativeMax(toNumber(options2.maxWait) || 0, wait) : maxWait;
|
59
|
-
trailing = "trailing" in options2 ? !!options2.trailing : trailing;
|
60
|
-
}
|
61
|
-
function invokeFunc(time) {
|
62
|
-
var args = lastArgs, thisArg = lastThis;
|
63
|
-
lastArgs = lastThis = void 0;
|
64
|
-
lastInvokeTime = time;
|
65
|
-
result = func.apply(thisArg, args);
|
66
|
-
return result;
|
67
|
-
}
|
68
|
-
function leadingEdge(time) {
|
69
|
-
lastInvokeTime = time;
|
70
|
-
timerId = setTimeout(timerExpired, wait);
|
71
|
-
return leading ? invokeFunc(time) : result;
|
72
|
-
}
|
73
|
-
function remainingWait(time) {
|
74
|
-
var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, result2 = wait - timeSinceLastCall;
|
75
|
-
return maxing ? nativeMin(result2, maxWait - timeSinceLastInvoke) : result2;
|
76
|
-
}
|
77
|
-
function shouldInvoke(time) {
|
78
|
-
var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime;
|
79
|
-
return lastCallTime === void 0 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
|
80
|
-
}
|
81
|
-
function timerExpired() {
|
82
|
-
var time = now();
|
83
|
-
if (shouldInvoke(time)) {
|
84
|
-
return trailingEdge(time);
|
85
|
-
}
|
86
|
-
timerId = setTimeout(timerExpired, remainingWait(time));
|
87
|
-
}
|
88
|
-
function trailingEdge(time) {
|
89
|
-
timerId = void 0;
|
90
|
-
if (trailing && lastArgs) {
|
91
|
-
return invokeFunc(time);
|
92
|
-
}
|
93
|
-
lastArgs = lastThis = void 0;
|
94
|
-
return result;
|
95
|
-
}
|
96
|
-
function cancel() {
|
97
|
-
if (timerId !== void 0) {
|
98
|
-
clearTimeout(timerId);
|
99
|
-
}
|
100
|
-
lastInvokeTime = 0;
|
101
|
-
lastArgs = lastCallTime = lastThis = timerId = void 0;
|
102
|
-
}
|
103
|
-
function flush() {
|
104
|
-
return timerId === void 0 ? result : trailingEdge(now());
|
105
|
-
}
|
106
|
-
function debounced() {
|
107
|
-
var time = now(), isInvoking = shouldInvoke(time);
|
108
|
-
lastArgs = arguments;
|
109
|
-
lastThis = this;
|
110
|
-
lastCallTime = time;
|
111
|
-
if (isInvoking) {
|
112
|
-
if (timerId === void 0) {
|
113
|
-
return leadingEdge(lastCallTime);
|
114
|
-
}
|
115
|
-
if (maxing) {
|
116
|
-
timerId = setTimeout(timerExpired, wait);
|
117
|
-
return invokeFunc(lastCallTime);
|
118
|
-
}
|
119
|
-
}
|
120
|
-
if (timerId === void 0) {
|
121
|
-
timerId = setTimeout(timerExpired, wait);
|
122
|
-
}
|
123
|
-
return result;
|
124
|
-
}
|
125
|
-
debounced.cancel = cancel;
|
126
|
-
debounced.flush = flush;
|
127
|
-
return debounced;
|
128
|
-
}
|
129
|
-
function isObject(value) {
|
130
|
-
var type = typeof value;
|
131
|
-
return !!value && (type == "object" || type == "function");
|
132
|
-
}
|
133
|
-
function isObjectLike(value) {
|
134
|
-
return !!value && typeof value == "object";
|
135
|
-
}
|
136
|
-
function isSymbol(value) {
|
137
|
-
return typeof value == "symbol" || isObjectLike(value) && objectToString.call(value) == symbolTag;
|
138
|
-
}
|
139
|
-
function toNumber(value) {
|
140
|
-
if (typeof value == "number") {
|
141
|
-
return value;
|
142
|
-
}
|
143
|
-
if (isSymbol(value)) {
|
144
|
-
return NAN;
|
145
|
-
}
|
146
|
-
if (isObject(value)) {
|
147
|
-
var other2 = typeof value.valueOf == "function" ? value.valueOf() : value;
|
148
|
-
value = isObject(other2) ? other2 + "" : other2;
|
149
|
-
}
|
150
|
-
if (typeof value != "string") {
|
151
|
-
return value === 0 ? value : +value;
|
152
|
-
}
|
153
|
-
value = value.replace(reTrim, "");
|
154
|
-
var isBinary = reIsBinary.test(value);
|
155
|
-
return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
|
156
|
-
}
|
157
|
-
module.exports = debounce6;
|
158
|
-
}
|
159
|
-
});
|
160
|
-
|
161
28
|
// node_modules/namespace-emitter/index.js
|
162
29
|
var require_namespace_emitter = __commonJS({
|
163
30
|
"node_modules/namespace-emitter/index.js"(exports, module) {
|
@@ -431,7 +298,7 @@
|
|
431
298
|
var FUNC_ERROR_TEXT = "Expected a function";
|
432
299
|
var nativeMax = Math.max;
|
433
300
|
var nativeMin = Math.min;
|
434
|
-
function
|
301
|
+
function debounce5(func, wait, options2) {
|
435
302
|
var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
|
436
303
|
if (typeof func != "function") {
|
437
304
|
throw new TypeError(FUNC_ERROR_TEXT);
|
@@ -512,14 +379,14 @@
|
|
512
379
|
debounced.flush = flush;
|
513
380
|
return debounced;
|
514
381
|
}
|
515
|
-
module.exports =
|
382
|
+
module.exports = debounce5;
|
516
383
|
}
|
517
384
|
});
|
518
385
|
|
519
386
|
// node_modules/lodash/throttle.js
|
520
387
|
var require_throttle = __commonJS({
|
521
388
|
"node_modules/lodash/throttle.js"(exports, module) {
|
522
|
-
var
|
389
|
+
var debounce5 = require_debounce();
|
523
390
|
var isObject = require_isObject();
|
524
391
|
var FUNC_ERROR_TEXT = "Expected a function";
|
525
392
|
function throttle2(func, wait, options2) {
|
@@ -531,7 +398,7 @@
|
|
531
398
|
leading = "leading" in options2 ? !!options2.leading : leading;
|
532
399
|
trailing = "trailing" in options2 ? !!options2.trailing : trailing;
|
533
400
|
}
|
534
|
-
return
|
401
|
+
return debounce5(func, wait, {
|
535
402
|
"leading": leading,
|
536
403
|
"maxWait": wait,
|
537
404
|
"trailing": trailing
|
@@ -6271,10 +6138,18 @@
|
|
6271
6138
|
};
|
6272
6139
|
|
6273
6140
|
// src/js/controllers/form_controller.js
|
6274
|
-
var import_lodash = __toESM(require_lodash(), 1);
|
6275
6141
|
var form_controller_default = class extends Controller {
|
6276
6142
|
connect() {
|
6277
6143
|
}
|
6144
|
+
preSubmit() {
|
6145
|
+
const hiddenField = document.createElement("input");
|
6146
|
+
hiddenField.type = "hidden";
|
6147
|
+
hiddenField.name = "pre_submit";
|
6148
|
+
hiddenField.value = "true";
|
6149
|
+
this.element.appendChild(hiddenField);
|
6150
|
+
this.element.setAttribute("novalidate", "");
|
6151
|
+
this.submit();
|
6152
|
+
}
|
6278
6153
|
submit() {
|
6279
6154
|
this.element.requestSubmit();
|
6280
6155
|
}
|
@@ -7562,7 +7437,7 @@
|
|
7562
7437
|
}
|
7563
7438
|
|
7564
7439
|
// node_modules/@popperjs/core/lib/utils/debounce.js
|
7565
|
-
function
|
7440
|
+
function debounce(fn2) {
|
7566
7441
|
var pending;
|
7567
7442
|
return function() {
|
7568
7443
|
if (!pending) {
|
@@ -7687,7 +7562,7 @@
|
|
7687
7562
|
},
|
7688
7563
|
// Async and optimistically optimized update – it will not be executed if
|
7689
7564
|
// not necessary (debounced to run at most once-per-tick)
|
7690
|
-
update:
|
7565
|
+
update: debounce(function() {
|
7691
7566
|
return new Promise(function(resolve) {
|
7692
7567
|
instance.forceUpdate();
|
7693
7568
|
resolve(state);
|
@@ -14009,7 +13884,7 @@ Uppy plugins must have unique \`id\` options.`;
|
|
14009
13884
|
function _classPrivateFieldLooseKey4(e4) {
|
14010
13885
|
return "__private_" + id4++ + "_" + e4;
|
14011
13886
|
}
|
14012
|
-
function
|
13887
|
+
function debounce2(fn2) {
|
14013
13888
|
let calling = null;
|
14014
13889
|
let latestArgs;
|
14015
13890
|
return function() {
|
@@ -14069,7 +13944,7 @@ Uppy plugins must have unique \`id\` options.`;
|
|
14069
13944
|
this.isTargetDOMEl = true;
|
14070
13945
|
const uppyRootElement = document.createElement("div");
|
14071
13946
|
uppyRootElement.classList.add("uppy-Root");
|
14072
|
-
_classPrivateFieldLooseBase4(this, _updateUI)[_updateUI] =
|
13947
|
+
_classPrivateFieldLooseBase4(this, _updateUI)[_updateUI] = debounce2((state) => {
|
14073
13948
|
if (!this.uppy.getPlugin(this.id))
|
14074
13949
|
return;
|
14075
13950
|
E(this.render(state, uppyRootElement), uppyRootElement);
|
@@ -24904,7 +24779,7 @@ this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e4.byteLength}`), e4.tif
|
|
24904
24779
|
function getLocationForLink(link2) {
|
24905
24780
|
return expandURL(link2.getAttribute("href") || "");
|
24906
24781
|
}
|
24907
|
-
function
|
24782
|
+
function debounce4(fn2, delay) {
|
24908
24783
|
let timeoutId = null;
|
24909
24784
|
return (...args) => {
|
24910
24785
|
const callback = () => fn2.apply(this, args);
|
@@ -28663,7 +28538,7 @@ this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e4.byteLength}`), e4.tif
|
|
28663
28538
|
return this.#pageRefreshDebouncePeriod;
|
28664
28539
|
}
|
28665
28540
|
set pageRefreshDebouncePeriod(value) {
|
28666
|
-
this.refresh =
|
28541
|
+
this.refresh = debounce4(this.debouncedRefresh.bind(this), value);
|
28667
28542
|
this.#pageRefreshDebouncePeriod = value;
|
28668
28543
|
}
|
28669
28544
|
// Preloader delegate
|