stimulus_plumbers 0.4.11 → 0.4.13
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/CHANGELOG.md +19 -0
- data/app/assets/javascripts/stimulus-plumbers/controllers.manifest.json +31 -9
- data/app/assets/javascripts/stimulus-plumbers/index.es.js +87 -96
- data/app/assets/javascripts/stimulus-plumbers/index.es.js.map +1 -1
- data/app/assets/javascripts/stimulus-plumbers/index.umd.js +1 -1
- data/app/assets/javascripts/stimulus-plumbers/index.umd.js.map +1 -1
- data/config/locales/en.yml +1 -0
- data/docs/architecture.md +1 -1
- data/docs/component/form.md +42 -20
- data/docs/component/icon.md +9 -9
- data/docs/guide.md +2 -1
- data/lib/stimulus_plumbers/components/button/icon_layout.rb +34 -0
- data/lib/stimulus_plumbers/components/button.rb +2 -23
- data/lib/stimulus_plumbers/components/card.rb +1 -1
- data/lib/stimulus_plumbers/components/combobox/builder.rb +52 -14
- data/lib/stimulus_plumbers/components/combobox/date.rb +35 -9
- data/lib/stimulus_plumbers/components/combobox/dropdown.rb +22 -6
- data/lib/stimulus_plumbers/components/combobox/time.rb +18 -5
- data/lib/stimulus_plumbers/components/combobox/trigger.rb +1 -1
- data/lib/stimulus_plumbers/components/combobox/typeahead.rb +23 -8
- data/lib/stimulus_plumbers/components/icon.rb +5 -3
- data/lib/stimulus_plumbers/components/indicator.rb +3 -1
- data/lib/stimulus_plumbers/components/link.rb +1 -1
- data/lib/stimulus_plumbers/components/list/item.rb +1 -1
- data/lib/stimulus_plumbers/components/ordered_list/item.rb +2 -2
- data/lib/stimulus_plumbers/components/popover.rb +7 -3
- data/lib/stimulus_plumbers/components/progress_bar.rb +3 -1
- data/lib/stimulus_plumbers/components/progress_meter.rb +3 -1
- data/lib/stimulus_plumbers/components/progress_ring.rb +4 -2
- data/lib/stimulus_plumbers/components/timeline/event.rb +5 -3
- data/lib/stimulus_plumbers/form/field.rb +4 -2
- data/lib/stimulus_plumbers/form/fields/inputs/code.rb +93 -32
- data/lib/stimulus_plumbers/form/fields/inputs/credit_card.rb +61 -33
- data/lib/stimulus_plumbers/form/fields/inputs/password.rb +37 -12
- data/lib/stimulus_plumbers/form/fields/inputs/search.rb +1 -1
- data/lib/stimulus_plumbers/form/fields/inputs/submit.rb +52 -7
- data/lib/stimulus_plumbers/generators/css_entrypoint.rb +10 -0
- data/lib/stimulus_plumbers/helpers/icon_helper.rb +2 -2
- data/lib/stimulus_plumbers/plumber/dispatcher.rb +14 -12
- data/lib/stimulus_plumbers/plumber/slots.rb +8 -8
- data/lib/stimulus_plumbers/themes/schema.rb +4 -0
- data/lib/stimulus_plumbers/version.rb +1 -1
- data/lib/stimulus_plumbers.rb +1 -0
- data/vendor/ARIA.md +3 -2
- data/vendor/component/manifest.json +8 -1
- data/vendor/controller/docs/input-formatter.md +18 -39
- data/vendor/controller/docs/input-revealable.md +65 -0
- data/vendor/controller/manifest.json +31 -9
- metadata +3 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bcaacf74a9d74b9643793766765001210ac63bec6bab991cd5f5bafc74d97961
|
|
4
|
+
data.tar.gz: bf28400470cbdd7395dae9f7525654a6a8021e5c7bf46d12b068299156315729
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c0cf3b74cde9b848f515015a85abebf533038f47ba1379d37c781b70570367fb44e100bd61c093362372a1aef18eba00e7d4842afeb44cf5624723e8c55a7d70
|
|
7
|
+
data.tar.gz: 4f26886745656d790ce0bf1484537ed2dba4340a0b20bb820d21247080707bbcd0eeac596afd78ac606bf240a7a4e567a5278ee8a37e946a35270dda61f724ba
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [conventional commits](https://www.conventionalcommits.org/) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
---
|
|
6
|
+
## [0.4.12](https://github.com/ryancyq/stimulus-plumbers/compare/stimulus-plumbers-rails/v0.4.11..stimulus-plumbers-rails/v0.4.12) - 2026-07-19
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- gitignore entry should only be added if there is no existing rule on generated/builds assets ([#181](https://github.com/ryancyq/stimulus-plumbers/issues/181)) - ([bc44d68](https://github.com/ryancyq/stimulus-plumbers/commit/bc44d68068dced77930a007c097f6b27a511ab20)) - Ryan Chang
|
|
11
|
+
- refactor form inputs + make code/credit card separator configurable ([#182](https://github.com/ryancyq/stimulus-plumbers/issues/182)) - ([bbc0a55](https://github.com/ryancyq/stimulus-plumbers/commit/bbc0a55d5dbcc5cee1459434ce65606cdbfdd0e8)) - Ryan Chang
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
- form submit button with icon support ([#184](https://github.com/ryancyq/stimulus-plumbers/issues/184)) - ([ac3af21](https://github.com/ryancyq/stimulus-plumbers/commit/ac3af216125eedb01bc1bc053dd890e33482cc4b)) - Ryan Chang
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
## [0.4.11](https://github.com/ryancyq/stimulus-plumbers/compare/stimulus-plumbers-rails/v0.4.10..stimulus-plumbers-rails/v0.4.11) - 2026-07-19
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
- tailwind source being committed with machine path. migrate to generated source file which should be gitignored + import the generated file in css entry point file instead. ([#180](https://github.com/ryancyq/stimulus-plumbers/issues/180)) - ([347e6ed](https://github.com/ryancyq/stimulus-plumbers/commit/347e6edeee92571f4f2fe7e509b5eed8fd0f2893)) - Ryan Chang
|
|
23
|
+
|
|
5
24
|
---
|
|
6
25
|
## [0.4.10](https://github.com/ryancyq/stimulus-plumbers/compare/stimulus-plumbers-rails/v0.4.9..stimulus-plumbers-rails/v0.4.10) - 2026-07-19
|
|
7
26
|
|
|
@@ -464,7 +464,6 @@
|
|
|
464
464
|
"identifier": "input-formatter",
|
|
465
465
|
"targets": [
|
|
466
466
|
"input",
|
|
467
|
-
"toggle",
|
|
468
467
|
"cell"
|
|
469
468
|
],
|
|
470
469
|
"values": {
|
|
@@ -476,10 +475,6 @@
|
|
|
476
475
|
"type": "Object",
|
|
477
476
|
"default": {}
|
|
478
477
|
},
|
|
479
|
-
"revealed": {
|
|
480
|
-
"type": "Boolean",
|
|
481
|
-
"default": false
|
|
482
|
-
},
|
|
483
478
|
"groups": {
|
|
484
479
|
"type": "Array",
|
|
485
480
|
"default": []
|
|
@@ -489,10 +484,8 @@
|
|
|
489
484
|
"classes": [],
|
|
490
485
|
"actions": [
|
|
491
486
|
"attachCells",
|
|
492
|
-
"cellsValue",
|
|
493
487
|
"detachCells",
|
|
494
488
|
"drawCells",
|
|
495
|
-
"drawToggle",
|
|
496
489
|
"format",
|
|
497
490
|
"isFull",
|
|
498
491
|
"onBlur",
|
|
@@ -502,14 +495,43 @@
|
|
|
502
495
|
"onInput",
|
|
503
496
|
"onPaste",
|
|
504
497
|
"primeFilledState",
|
|
505
|
-
"readValue"
|
|
506
|
-
"toggle"
|
|
498
|
+
"readValue"
|
|
507
499
|
],
|
|
508
500
|
"dispatches": [
|
|
509
501
|
"filled",
|
|
510
502
|
"formatted"
|
|
511
503
|
]
|
|
512
504
|
},
|
|
505
|
+
"input-revealable": {
|
|
506
|
+
"identifier": "input-revealable",
|
|
507
|
+
"targets": [
|
|
508
|
+
"input",
|
|
509
|
+
"toggle",
|
|
510
|
+
"revealIcon",
|
|
511
|
+
"concealIcon"
|
|
512
|
+
],
|
|
513
|
+
"values": {
|
|
514
|
+
"revealed": {
|
|
515
|
+
"type": "Boolean",
|
|
516
|
+
"default": false
|
|
517
|
+
},
|
|
518
|
+
"revealLabel": {
|
|
519
|
+
"type": "String",
|
|
520
|
+
"default": ""
|
|
521
|
+
},
|
|
522
|
+
"concealLabel": {
|
|
523
|
+
"type": "String",
|
|
524
|
+
"default": ""
|
|
525
|
+
}
|
|
526
|
+
},
|
|
527
|
+
"outlets": [],
|
|
528
|
+
"classes": [],
|
|
529
|
+
"actions": [
|
|
530
|
+
"draw",
|
|
531
|
+
"toggle"
|
|
532
|
+
],
|
|
533
|
+
"dispatches": []
|
|
534
|
+
},
|
|
513
535
|
"modal": {
|
|
514
536
|
"identifier": "modal",
|
|
515
537
|
"targets": [
|
|
@@ -199,45 +199,45 @@ var h = (e = "a11y") => `${e}-${Math.random().toString(36).substr(2, 9)}`, ee =
|
|
|
199
199
|
function w(e, t) {
|
|
200
200
|
g(e, "aria-disabled", t), t ? e.setAttribute("tabindex", "-1") : e.removeAttribute("tabindex");
|
|
201
201
|
}
|
|
202
|
-
var T = (e, t) => g(e, "aria-valuemin", t), E = (e, t) => g(e, "aria-valuemax", t), D = (e, t) => t == null ? e.removeAttribute("aria-valuenow") : g(e, "aria-valuenow", t),
|
|
202
|
+
var T = (e, t) => g(e, "aria-valuemin", t), E = (e, t) => g(e, "aria-valuemax", t), D = (e, t) => t == null ? e.removeAttribute("aria-valuenow") : g(e, "aria-valuenow", t), ie = {
|
|
203
203
|
menu: "menu",
|
|
204
204
|
listbox: "listbox",
|
|
205
205
|
tree: "tree",
|
|
206
206
|
grid: "grid",
|
|
207
207
|
dialog: "dialog"
|
|
208
|
-
},
|
|
208
|
+
}, ae = (e, t, n) => {
|
|
209
209
|
Object.entries(t).forEach(([t, r]) => {
|
|
210
210
|
e.setAttribute(t, r), n[t] = r;
|
|
211
211
|
});
|
|
212
|
-
},
|
|
213
|
-
function
|
|
212
|
+
}, O = (e, t, n) => n || !e.hasAttribute(t);
|
|
213
|
+
function oe({ trigger: e, target: t, role: n = null, override: r = !1 }) {
|
|
214
214
|
let i = {
|
|
215
215
|
trigger: {},
|
|
216
216
|
target: {}
|
|
217
217
|
};
|
|
218
218
|
if (!e || !t) return i;
|
|
219
219
|
let a = {}, o = {};
|
|
220
|
-
if (n &&
|
|
221
|
-
let e =
|
|
220
|
+
if (n && O(t, "role", r) && (o.role = n), t.id && (O(e, "aria-controls", r) && (a["aria-controls"] = t.id), n === "tooltip" && O(e, "aria-describedby", r) && (a["aria-describedby"] = t.id)), n && O(e, "aria-haspopup", r)) {
|
|
221
|
+
let e = ie[n] || "true";
|
|
222
222
|
e && (a["aria-haspopup"] = e);
|
|
223
223
|
}
|
|
224
|
-
return
|
|
224
|
+
return ae(t, o, i.target), ae(e, a, i.trigger), i;
|
|
225
225
|
}
|
|
226
|
-
var
|
|
226
|
+
var se = (e, t) => {
|
|
227
227
|
t.forEach((t) => {
|
|
228
228
|
e.hasAttribute(t) && e.removeAttribute(t);
|
|
229
229
|
});
|
|
230
230
|
};
|
|
231
|
-
function
|
|
232
|
-
!e || !t || (
|
|
231
|
+
function ce({ trigger: e, target: t, attributes: n = null }) {
|
|
232
|
+
!e || !t || (se(e, n || [
|
|
233
233
|
"aria-controls",
|
|
234
234
|
"aria-haspopup",
|
|
235
235
|
"aria-describedby"
|
|
236
|
-
]), (!n || n.includes("role")) &&
|
|
236
|
+
]), (!n || n.includes("role")) && se(t, ["role"]));
|
|
237
237
|
}
|
|
238
238
|
//#endregion
|
|
239
239
|
//#region src/requestor.js
|
|
240
|
-
var
|
|
240
|
+
var k = class {
|
|
241
241
|
constructor() {
|
|
242
242
|
this._abortController = null, this._timer = null;
|
|
243
243
|
}
|
|
@@ -259,33 +259,33 @@ var A = class {
|
|
|
259
259
|
};
|
|
260
260
|
//#endregion
|
|
261
261
|
//#region src/researcher.js
|
|
262
|
-
function
|
|
262
|
+
function le(e, t) {
|
|
263
263
|
let n = 0;
|
|
264
264
|
for (let r = 0; r < t.length && n < e.length; r++) t[r] === e[n] && n++;
|
|
265
265
|
return n === e.length;
|
|
266
266
|
}
|
|
267
|
-
function
|
|
267
|
+
function ue(e, t) {
|
|
268
268
|
return t.includes(e);
|
|
269
269
|
}
|
|
270
|
-
function
|
|
270
|
+
function de(e, t) {
|
|
271
271
|
return t.startsWith(e);
|
|
272
272
|
}
|
|
273
|
-
function
|
|
274
|
-
return e === "contains" ?
|
|
273
|
+
function fe(e) {
|
|
274
|
+
return e === "contains" ? ue : e === "prefix" ? de : le;
|
|
275
275
|
}
|
|
276
|
-
function
|
|
276
|
+
function pe(e, t) {
|
|
277
277
|
return t === "textContent" ? e.textContent?.trim().toLowerCase() ?? "" : (e.getAttribute(t) ?? "").toLowerCase();
|
|
278
278
|
}
|
|
279
|
-
function
|
|
280
|
-
let { strategy: r = "fuzzy", matcher: i, fields: a = ["textContent"] } = n, o = typeof i == "function" ? i :
|
|
279
|
+
function me(e, t, n = {}) {
|
|
280
|
+
let { strategy: r = "fuzzy", matcher: i, fields: a = ["textContent"] } = n, o = typeof i == "function" ? i : fe(r), s = t.toLowerCase(), c = 0;
|
|
281
281
|
return e.querySelectorAll("[role=\"option\"]").forEach((e) => {
|
|
282
|
-
let t = a.some((t) => o(s,
|
|
283
|
-
e
|
|
282
|
+
let t = a.some((t) => o(s, pe(e, t)));
|
|
283
|
+
b(e, !t), t && c++;
|
|
284
284
|
}), c;
|
|
285
285
|
}
|
|
286
286
|
//#endregion
|
|
287
287
|
//#region src/plumbers/plumber/geometry.js
|
|
288
|
-
var
|
|
288
|
+
var A = {
|
|
289
289
|
get top() {
|
|
290
290
|
return "bottom";
|
|
291
291
|
},
|
|
@@ -591,8 +591,6 @@ var be = /\D/g, xe = /^\d{13,19}$/, Se = /(.{4})(?=.)/g, Ce = {
|
|
|
591
591
|
normalize: (n) => t.normalize?.(n, e.options) ?? (typeof n == "string" ? n : ""),
|
|
592
592
|
validate: (n) => t.validate?.(n, e.options) ?? !0,
|
|
593
593
|
format: (n) => t.format?.(n, e.options) ?? (typeof n == "string" ? n : ""),
|
|
594
|
-
mask: (n) => t.mask?.(n, e.options) ?? null,
|
|
595
|
-
maskable: () => typeof t.mask == "function",
|
|
596
594
|
cells: () => typeof t.cells == "function" ? t.cells(e.options) : null
|
|
597
595
|
};
|
|
598
596
|
Object.defineProperty(this.controller, "formatter", {
|
|
@@ -1015,7 +1013,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
1015
1013
|
let n = Object.assign({}, Y, t), { content: r, url: i, reload: a, stale: o } = n;
|
|
1016
1014
|
this.content = r, this.url = i, this.reload = typeof a == "string" ? a : Y.reload, this.stale = typeof o == "number" ? o : Y.stale;
|
|
1017
1015
|
let { onLoad: s, onLoaded: c } = n;
|
|
1018
|
-
this.onLoad = s, this.onLoaded = c, this._requestor = new
|
|
1016
|
+
this.onLoad = s, this.onLoaded = c, this._requestor = new k(), this.enhance();
|
|
1019
1017
|
}
|
|
1020
1018
|
get reloadable() {
|
|
1021
1019
|
switch (this.reload) {
|
|
@@ -1087,7 +1085,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
1087
1085
|
constructor(e, t = {}) {
|
|
1088
1086
|
super(e, t);
|
|
1089
1087
|
let { anchor: n, events: r, placement: i, alignment: a, onFlipped: o, ariaRole: s, respectMotion: c } = Object.assign({}, $e, t);
|
|
1090
|
-
this.anchor = n, this.events = r, this.placement = i, this.alignment = a, this.onFlipped = o, this.ariaRole = s, this.respectMotion = c, this.prefersReducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches, this.anchor && this.element &&
|
|
1088
|
+
this.anchor = n, this.events = r, this.placement = i, this.alignment = a, this.onFlipped = o, this.ariaRole = s, this.respectMotion = c, this.prefersReducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches, this.anchor && this.element && oe({
|
|
1091
1089
|
trigger: this.anchor,
|
|
1092
1090
|
target: this.element,
|
|
1093
1091
|
role: this.ariaRole
|
|
@@ -1105,7 +1103,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
1105
1103
|
}), this.dispatch("flipped", { detail: { placement: e } });
|
|
1106
1104
|
};
|
|
1107
1105
|
flippedRect(e, t) {
|
|
1108
|
-
let n = this.quadrumRect(e, M()), r = [this.placement,
|
|
1106
|
+
let n = this.quadrumRect(e, M()), r = [this.placement, A[this.placement]], i = {};
|
|
1109
1107
|
for (; !Object.keys(i).length && r.length > 0;) {
|
|
1110
1108
|
let a = r.shift();
|
|
1111
1109
|
if (!this.biggerRectThan(n[a], t)) continue;
|
|
@@ -1307,7 +1305,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
1307
1305
|
height: e.height
|
|
1308
1306
|
});
|
|
1309
1307
|
for (let e of this.boundaries) {
|
|
1310
|
-
let t = this.directionDistance(i, e, r), a =
|
|
1308
|
+
let t = this.directionDistance(i, e, r), a = A[e];
|
|
1311
1309
|
t < 0 ? i[a] + t >= r[a] && !n[a] && (n[e] = t) : n[e] = "";
|
|
1312
1310
|
}
|
|
1313
1311
|
return n;
|
|
@@ -1886,9 +1884,9 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
1886
1884
|
let e = this.viewValue === "month", t = this.viewValue === "year", n = this.viewValue === "decade";
|
|
1887
1885
|
if (this.hasCalendarMonthOutlet) {
|
|
1888
1886
|
let t = this.calendarMonthOutlet;
|
|
1889
|
-
t.hasDaysOfWeekTarget && (t.daysOfWeekTarget
|
|
1887
|
+
t.hasDaysOfWeekTarget && b(t.daysOfWeekTarget, !e), t.hasDaysOfMonthTarget && b(t.daysOfMonthTarget, !e);
|
|
1890
1888
|
}
|
|
1891
|
-
this.hasCalendarYearOutlet && (this.calendarYearOutletElement
|
|
1889
|
+
this.hasCalendarYearOutlet && b(this.calendarYearOutletElement, !t), this.hasCalendarDecadeOutlet && b(this.calendarDecadeOutletElement, !n);
|
|
1892
1890
|
}
|
|
1893
1891
|
}, St = class extends e {
|
|
1894
1892
|
static targets = [
|
|
@@ -1911,7 +1909,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
1911
1909
|
}
|
|
1912
1910
|
};
|
|
1913
1911
|
initialize() {
|
|
1914
|
-
this._requestor = new
|
|
1912
|
+
this._requestor = new k();
|
|
1915
1913
|
}
|
|
1916
1914
|
connect() {
|
|
1917
1915
|
this.hasListboxTarget && (this.listboxNav = new f(this.listboxTarget));
|
|
@@ -1944,18 +1942,18 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
1944
1942
|
e.name !== "AbortError" && console.error("[combobox-dropdown] fetch failed", e);
|
|
1945
1943
|
}).finally(() => this.setLoading(!1)), this.delayValue);
|
|
1946
1944
|
} else {
|
|
1947
|
-
let t =
|
|
1945
|
+
let t = me(this.listboxTarget, e);
|
|
1948
1946
|
this.setEmpty(t === 0);
|
|
1949
1947
|
}
|
|
1950
1948
|
}
|
|
1951
1949
|
showAll() {
|
|
1952
|
-
this.listboxTarget.querySelectorAll("[role=\"option\"]").forEach((e) => e
|
|
1950
|
+
this.listboxTarget.querySelectorAll("[role=\"option\"]").forEach((e) => b(e, !1)), this.setEmpty(!1);
|
|
1953
1951
|
}
|
|
1954
1952
|
setLoading(e) {
|
|
1955
|
-
this.hasLoadingTarget && (this.loadingTarget
|
|
1953
|
+
this.hasLoadingTarget && b(this.loadingTarget, !e);
|
|
1956
1954
|
}
|
|
1957
1955
|
setEmpty(e) {
|
|
1958
|
-
this.hasEmptyTarget && (this.emptyTarget
|
|
1956
|
+
this.hasEmptyTarget && b(this.emptyTarget, !e);
|
|
1959
1957
|
}
|
|
1960
1958
|
}, Ct = class extends e {
|
|
1961
1959
|
static targets = [
|
|
@@ -2057,11 +2055,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
2057
2055
|
this.hasInputTarget && (this.inputTarget.value = e), this.dispatch("changed", { detail: { value: e } });
|
|
2058
2056
|
}
|
|
2059
2057
|
}, Dt = class extends e {
|
|
2060
|
-
static targets = [
|
|
2061
|
-
"input",
|
|
2062
|
-
"toggle",
|
|
2063
|
-
"cell"
|
|
2064
|
-
];
|
|
2058
|
+
static targets = ["input", "cell"];
|
|
2065
2059
|
static values = {
|
|
2066
2060
|
format: {
|
|
2067
2061
|
type: String,
|
|
@@ -2071,10 +2065,6 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
2071
2065
|
type: Object,
|
|
2072
2066
|
default: {}
|
|
2073
2067
|
},
|
|
2074
|
-
revealed: {
|
|
2075
|
-
type: Boolean,
|
|
2076
|
-
default: !1
|
|
2077
|
-
},
|
|
2078
2068
|
groups: {
|
|
2079
2069
|
type: Array,
|
|
2080
2070
|
default: []
|
|
@@ -2084,13 +2074,13 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
2084
2074
|
U(this, {
|
|
2085
2075
|
type: this.formatValue,
|
|
2086
2076
|
options: this.optionsValue
|
|
2087
|
-
}), this.attachCells(), this.primeFilledState(), this.format(this.readValue())
|
|
2077
|
+
}), this.attachCells(), this.primeFilledState(), this.format(this.readValue());
|
|
2088
2078
|
}
|
|
2089
2079
|
formatValueChanged() {
|
|
2090
2080
|
this.formatter && (U(this, {
|
|
2091
2081
|
type: this.formatValue,
|
|
2092
2082
|
options: this.optionsValue
|
|
2093
|
-
}), this.attachCells(), this.primeFilledState(), this.format(this.readValue())
|
|
2083
|
+
}), this.attachCells(), this.primeFilledState(), this.format(this.readValue()));
|
|
2094
2084
|
}
|
|
2095
2085
|
optionsValueChanged() {
|
|
2096
2086
|
this.formatter && (U(this, {
|
|
@@ -2098,9 +2088,6 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
2098
2088
|
options: this.optionsValue
|
|
2099
2089
|
}), this.attachCells(), this.primeFilledState(), this.format(this.readValue()));
|
|
2100
2090
|
}
|
|
2101
|
-
revealedValueChanged() {
|
|
2102
|
-
this.formatter && (this.format(this.readValue()), this.drawToggle());
|
|
2103
|
-
}
|
|
2104
2091
|
groupsValueChanged() {
|
|
2105
2092
|
this.formatter && (this.attachCells(), this.format(this.readValue()));
|
|
2106
2093
|
}
|
|
@@ -2108,14 +2095,11 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
2108
2095
|
this.format(e?.detail?.value ?? "");
|
|
2109
2096
|
}
|
|
2110
2097
|
cellTargetConnected() {
|
|
2111
|
-
this.formatter && (this.attachCells(), this.drawCells(this.
|
|
2098
|
+
this.formatter && (this.attachCells(), this.drawCells(this.formatter.normalize(this.readValue())));
|
|
2112
2099
|
}
|
|
2113
2100
|
format(e) {
|
|
2114
2101
|
this.formatter && this.onFormatting(e);
|
|
2115
2102
|
}
|
|
2116
|
-
toggle() {
|
|
2117
|
-
!this.formatter.maskable() && this.formatValue !== "password" || (this.revealedValue = !this.revealedValue);
|
|
2118
|
-
}
|
|
2119
2103
|
onPaste(e) {
|
|
2120
2104
|
let t = e.detail?.text ?? "";
|
|
2121
2105
|
if (!this.formatter || !t) return;
|
|
@@ -2144,35 +2128,23 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
2144
2128
|
this.format(this.readValue());
|
|
2145
2129
|
}
|
|
2146
2130
|
onFocus() {
|
|
2147
|
-
this.drawCells(this.
|
|
2131
|
+
this.drawCells(this.formatter?.normalize(this.readValue()) ?? "");
|
|
2148
2132
|
}
|
|
2149
2133
|
onBlur() {
|
|
2150
|
-
this.drawCells(this.
|
|
2151
|
-
}
|
|
2152
|
-
cellsValue(e) {
|
|
2153
|
-
return !this.formatter || this.revealedValue || !this.formatter.maskable() ? e : this.formatter.mask(e);
|
|
2134
|
+
this.drawCells(this.formatter?.normalize(this.readValue()) ?? "");
|
|
2154
2135
|
}
|
|
2155
2136
|
drawCells(e) {
|
|
2156
2137
|
if (!this.hasCellTarget) return;
|
|
2157
2138
|
let t = this.hasInputTarget && document.activeElement === this.inputTarget;
|
|
2158
2139
|
this.characterCells?.draw(e, { focused: t });
|
|
2159
2140
|
}
|
|
2160
|
-
drawToggle() {
|
|
2161
|
-
if (!this.hasToggleTarget) return;
|
|
2162
|
-
let e = this.formatter?.maskable() || this.formatValue === "password";
|
|
2163
|
-
this.toggleTarget.hidden = !e, e && ne(this.toggleTarget, this.revealedValue);
|
|
2164
|
-
}
|
|
2165
2141
|
readValue() {
|
|
2166
2142
|
return this.hasInputTarget ? this.inputTarget instanceof HTMLInputElement ? this.inputTarget.value : this.inputTarget.textContent : "";
|
|
2167
2143
|
}
|
|
2168
2144
|
onFormatting(e) {
|
|
2169
2145
|
if (!this.formatter) return;
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
return;
|
|
2173
|
-
}
|
|
2174
|
-
let t = this.formatter.normalize(e), n = this.revealedValue || !this.formatter.maskable() ? this.formatter.format(t) : this.formatter.mask(t);
|
|
2175
|
-
this.hasInputTarget && (this.inputTarget instanceof HTMLInputElement ? this.inputTarget.value = n : this.inputTarget.textContent = n), this.dispatch("formatted", { detail: { value: n } }), this.drawCells(this.cellsValue(t));
|
|
2146
|
+
let t = this.formatter.normalize(e), n = this.formatter.format(t);
|
|
2147
|
+
this.hasInputTarget && (this.inputTarget instanceof HTMLInputElement ? this.inputTarget.value = n : this.inputTarget.textContent = n), this.dispatch("formatted", { detail: { value: n } }), this.drawCells(t);
|
|
2176
2148
|
let r = this.isFull(t);
|
|
2177
2149
|
r && !this.wasFull && this.dispatch("filled", { detail: { value: t } }), this.wasFull = r;
|
|
2178
2150
|
}
|
|
@@ -2201,12 +2173,45 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
2201
2173
|
this.hasInputTarget && (this.inputTarget.value = "", this.draw(), this.inputTarget.focus(), this.inputTarget.dispatchEvent(new Event("input", { bubbles: !0 })));
|
|
2202
2174
|
}
|
|
2203
2175
|
draw() {
|
|
2204
|
-
!this.hasInputTarget || !this.hasClearTarget || (this.clearTarget
|
|
2176
|
+
!this.hasInputTarget || !this.hasClearTarget || b(this.clearTarget, this.inputTarget.value.length === 0);
|
|
2205
2177
|
}
|
|
2206
2178
|
handleEscape(e) {
|
|
2207
2179
|
e.key === "Escape" && this.inputTarget.value !== "" && (e.preventDefault(), this.clear());
|
|
2208
2180
|
}
|
|
2209
2181
|
}, kt = class extends e {
|
|
2182
|
+
static targets = [
|
|
2183
|
+
"input",
|
|
2184
|
+
"toggle",
|
|
2185
|
+
"revealIcon",
|
|
2186
|
+
"concealIcon"
|
|
2187
|
+
];
|
|
2188
|
+
static values = {
|
|
2189
|
+
revealed: {
|
|
2190
|
+
type: Boolean,
|
|
2191
|
+
default: !1
|
|
2192
|
+
},
|
|
2193
|
+
revealLabel: {
|
|
2194
|
+
type: String,
|
|
2195
|
+
default: ""
|
|
2196
|
+
},
|
|
2197
|
+
concealLabel: {
|
|
2198
|
+
type: String,
|
|
2199
|
+
default: ""
|
|
2200
|
+
}
|
|
2201
|
+
};
|
|
2202
|
+
toggle() {
|
|
2203
|
+
this.revealedValue = !this.revealedValue;
|
|
2204
|
+
}
|
|
2205
|
+
revealedValueChanged() {
|
|
2206
|
+
this.draw();
|
|
2207
|
+
}
|
|
2208
|
+
draw() {
|
|
2209
|
+
if (this.hasInputTarget && (this.inputTarget.type = this.revealedValue ? "text" : "password"), !this.hasToggleTarget) return;
|
|
2210
|
+
this.hasRevealIconTarget && this.hasConcealIconTarget && (b(this.revealIconTarget, this.revealedValue), b(this.concealIconTarget, !this.revealedValue));
|
|
2211
|
+
let e = this.revealedValue ? this.concealLabelValue : this.revealLabelValue;
|
|
2212
|
+
e && this.toggleTarget.setAttribute("aria-label", e);
|
|
2213
|
+
}
|
|
2214
|
+
}, At = class extends e {
|
|
2210
2215
|
static targets = ["modal", "overlay"];
|
|
2211
2216
|
initialize() {
|
|
2212
2217
|
this.onCancel = this.close.bind(this);
|
|
@@ -2227,37 +2232,23 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
2227
2232
|
this.close();
|
|
2228
2233
|
};
|
|
2229
2234
|
open(e) {
|
|
2230
|
-
|
|
2231
|
-
if (this.isNativeDialog) this.previouslyFocused = document.activeElement, this.modalTarget.showModal();
|
|
2232
|
-
else {
|
|
2233
|
-
let e = this.hasOverlayTarget ? this.overlayTarget : this.modalTarget;
|
|
2234
|
-
e.hidden = !1, document.body.style.overflow = "hidden", this.focusTrap && this.focusTrap.activate();
|
|
2235
|
-
}
|
|
2236
|
-
m("Modal opened");
|
|
2237
|
-
}
|
|
2235
|
+
e && e.preventDefault(), this.hasModalTarget && (this.isNativeDialog ? (this.previouslyFocused = document.activeElement, this.modalTarget.showModal()) : (b(this.hasOverlayTarget ? this.overlayTarget : this.modalTarget, !1), document.body.style.overflow = "hidden", this.focusTrap && this.focusTrap.activate()), m("Modal opened"));
|
|
2238
2236
|
}
|
|
2239
2237
|
close(e) {
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
}, 0);
|
|
2244
|
-
else {
|
|
2245
|
-
let e = this.hasOverlayTarget ? this.overlayTarget : this.modalTarget;
|
|
2246
|
-
e.hidden = !0, document.body.style.overflow = "", this.focusTrap && this.focusTrap.deactivate();
|
|
2247
|
-
}
|
|
2248
|
-
m("Modal closed");
|
|
2249
|
-
}
|
|
2238
|
+
e && e.preventDefault(), this.hasModalTarget && (this.isNativeDialog ? (this.modalTarget.close(), this.previouslyFocused && this.previouslyFocused.isConnected && setTimeout(() => {
|
|
2239
|
+
this.previouslyFocused.focus();
|
|
2240
|
+
}, 0)) : (b(this.hasOverlayTarget ? this.overlayTarget : this.modalTarget, !0), document.body.style.overflow = "", this.focusTrap && this.focusTrap.deactivate()), m("Modal closed"));
|
|
2250
2241
|
}
|
|
2251
2242
|
onBackdropClick = (e) => {
|
|
2252
2243
|
let t = this.modalTarget.getBoundingClientRect();
|
|
2253
2244
|
(e.clientY < t.top || e.clientY > t.bottom || e.clientX < t.left || e.clientX > t.right) && this.close();
|
|
2254
2245
|
};
|
|
2255
|
-
},
|
|
2246
|
+
}, jt = class extends e {
|
|
2256
2247
|
static targets = ["content"];
|
|
2257
2248
|
connect() {
|
|
2258
2249
|
ct(this, { element: this.hasContentTarget ? this.contentTarget : null });
|
|
2259
2250
|
}
|
|
2260
|
-
},
|
|
2251
|
+
}, Mt = class extends e {
|
|
2261
2252
|
static targets = [
|
|
2262
2253
|
"trigger",
|
|
2263
2254
|
"panel",
|
|
@@ -2340,7 +2331,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
2340
2331
|
contentLoader() {
|
|
2341
2332
|
if (this.hasTemplateTarget) return this.templateTarget instanceof HTMLTemplateElement ? this.templateTarget.content : this.templateTarget.innerHTML;
|
|
2342
2333
|
}
|
|
2343
|
-
},
|
|
2334
|
+
}, Nt = class extends e {
|
|
2344
2335
|
static targets = ["fill", "meter"];
|
|
2345
2336
|
static values = {
|
|
2346
2337
|
variant: {
|
|
@@ -2427,7 +2418,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
2427
2418
|
let e = this.meterTarget;
|
|
2428
2419
|
e.value = this.currentValue, e.min = this.minValue, e.max = this.maxValue, this.hasLowValue && (e.low = this.lowValue), this.hasHighValue && (e.high = this.highValue), this.hasOptimumValue && (e.optimum = this.optimumValue);
|
|
2429
2420
|
}
|
|
2430
|
-
},
|
|
2421
|
+
}, Pt = class extends e {
|
|
2431
2422
|
static targets = [
|
|
2432
2423
|
"item",
|
|
2433
2424
|
"handle",
|
|
@@ -2489,7 +2480,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
2489
2480
|
moved(e) {
|
|
2490
2481
|
this.rovingTabIndex?.updateItems(this.itemTargets), this.rovingTabIndex.setCurrentIndex(this.itemTargets.indexOf(e));
|
|
2491
2482
|
}
|
|
2492
|
-
},
|
|
2483
|
+
}, Ft = class extends e {
|
|
2493
2484
|
static targets = [
|
|
2494
2485
|
"trigger",
|
|
2495
2486
|
"detail",
|
|
@@ -2546,7 +2537,7 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
2546
2537
|
let t = R.format(e.getAttribute("datetime"), this.dateFormatValue);
|
|
2547
2538
|
t && (e.textContent = t);
|
|
2548
2539
|
}
|
|
2549
|
-
},
|
|
2540
|
+
}, It = class extends e {
|
|
2550
2541
|
static targets = ["content"];
|
|
2551
2542
|
connect() {
|
|
2552
2543
|
Z(this);
|
|
@@ -2562,6 +2553,6 @@ var ze = 7, Be = 12, q = 10, Ve = {
|
|
|
2562
2553
|
}
|
|
2563
2554
|
};
|
|
2564
2555
|
//#endregion
|
|
2565
|
-
export {
|
|
2556
|
+
export { ie as ARIA_HASPOPUP_VALUES, ft as CalendarDecadeController, pt as CalendarDecadeSelectorController, mt as CalendarMonthController, ht as CalendarMonthSelectorController, _t as CalendarYearController, vt as CalendarYearSelectorController, Ie as CharacterCells, yt as ChecklistController, bt as ClipboardController, xt as ComboboxDateController, St as ComboboxDropdownController, Ct as ComboboxTimeController, wt as DismisserController, t as FOCUSABLE_SELECTOR, V as FORMATTER_TYPES, Tt as FlipperController, a as FocusTrap, Pe as Formatter, Ot as InputClearableController, Et as InputComboboxController, Dt as InputFormatterController, kt as InputRevealableController, f as ListboxNavigation, u as MODIFIER_KEYS, At as ModalController, jt as PannerController, Mt as PopoverController, Nt as ProgressController, Pt as ReorderableController, k as Requestor, d as RovingTabIndex, Ft as TimelineController, It as VisibilityController, m as announce, Le as attachCharacterCells, oe as connectTriggerToTarget, ce as disconnectTriggerFromTarget, ee as ensureId, me as filterOptions, i as focusFirst, le as fuzzyMatcher, h as generateId, n as getFocusableElements, s as isActivationKey, C as isAriaDisabled, c as isArrowKey, te as isExpanded, o as isKey, r as isVisible, l as preventDefault, S as setAriaDisabled, x as setAriaHidden, g as setAriaState, re as setChecked, y as setCurrent, w as setDisabled, _ as setExpanded, b as setHidden, ne as setPressed, v as setSelected, E as setValueMax, T as setValueMin, D as setValueNow };
|
|
2566
2557
|
|
|
2567
2558
|
//# sourceMappingURL=index.es.js.map
|