stimeo-ui 0.4.0 → 0.5.0
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 +68 -0
- data/dist/controllers/aspect_ratio_controller.js +1 -1
- data/dist/controllers/breadcrumb_controller.js +5 -1
- data/dist/controllers/carousel_controller.js +5 -1
- data/dist/controllers/clipboard_controller.js +8 -3
- data/dist/controllers/collapsible_controller.js +4 -1
- data/dist/controllers/color_picker_controller.js +6 -2
- data/dist/controllers/context_menu_controller.js +2 -2
- data/dist/controllers/countdown_controller.js +5 -1
- data/dist/controllers/date_range_picker_controller.js +5 -1
- data/dist/controllers/direct_upload_controller.js +3 -3
- data/dist/controllers/empty_state_controller.js +107 -16
- data/dist/controllers/flash_controller.js +161 -21
- data/dist/controllers/form_validation_controller.js +8 -2
- data/dist/controllers/frame_loading_controller.js +94 -22
- data/dist/controllers/highlight_controller.js +38 -1
- data/dist/controllers/idle_controller.js +13 -2
- data/dist/controllers/local_time_controller.js +2 -0
- data/dist/controllers/masonry_controller.js +1 -1
- data/dist/controllers/meter_controller.js +3 -1
- data/dist/controllers/network_status_controller.js +1 -3
- data/dist/controllers/number_input_controller.js +191 -24
- data/dist/controllers/overflow_menu_controller.js +1 -1
- data/dist/controllers/pagination_controller.js +5 -1
- data/dist/controllers/password_strength_controller.js +1 -1
- data/dist/controllers/pointer_drag_controller.js +10 -0
- data/dist/controllers/portal_controller.js +10 -0
- data/dist/controllers/progress_controller.js +7 -3
- data/dist/controllers/range_slider_controller.js +385 -94
- data/dist/controllers/rating_controller.js +2 -0
- data/dist/controllers/relative_time_controller.js +2 -0
- data/dist/controllers/scroll_area_controller.js +1 -1
- data/dist/controllers/separator_controller.js +13 -17
- data/dist/controllers/skeleton_controller.js +71 -3
- data/dist/controllers/slider_controller.js +325 -48
- data/dist/controllers/spinner_controller.js +18 -3
- data/dist/controllers/step_indicator_controller.js +3 -1
- data/dist/controllers/stepper_controller.js +2 -0
- data/dist/controllers/switch_controller.js +162 -18
- data/dist/controllers/textarea_autosize_controller.js +1 -1
- data/dist/controllers/time_picker_controller.js +6 -3
- data/dist/controllers/tree_view_controller.js +19 -1
- data/dist/index.js +1214 -307
- data/lib/stimeo/ui/version.rb +1 -1
- metadata +2 -2
|
@@ -190,7 +190,7 @@ var INDEX = "data-stimeo--overflow-menu-index";
|
|
|
190
190
|
var BOUNDARY = "data-stimeo--overflow-menu-boundary";
|
|
191
191
|
var SAVED_ROLE = "data-stimeo--overflow-menu-role";
|
|
192
192
|
var SAVED_TABINDEX = "data-stimeo--overflow-menu-tabindex";
|
|
193
|
-
var SAVED_MENU_TARGET = "data-stimeo--overflow-menu-menu
|
|
193
|
+
var SAVED_MENU_TARGET = "data-stimeo--overflow-menu-saved-menu";
|
|
194
194
|
var MENU_TARGET = "data-stimeo--menu-target";
|
|
195
195
|
var BOOKKEEPING = [BANKED, INDEX, SAVED_ROLE, SAVED_TABINDEX, SAVED_MENU_TARGET];
|
|
196
196
|
var OverflowMenuController = class extends Controller {
|
|
@@ -132,7 +132,11 @@ var PaginationController = class _PaginationController extends Controller {
|
|
|
132
132
|
if (!Object.is(page, this.pageValue)) this.pageValue = page;
|
|
133
133
|
this.#render();
|
|
134
134
|
}
|
|
135
|
-
/**
|
|
135
|
+
/**
|
|
136
|
+
* Syncs `aria-current` on the page buttons and the prev/next `disabled` state.
|
|
137
|
+
*
|
|
138
|
+
* @stimeoRenderRoot
|
|
139
|
+
*/
|
|
136
140
|
#render() {
|
|
137
141
|
const page = this.#page;
|
|
138
142
|
for (const button of this.pageTargets) {
|
|
@@ -126,7 +126,7 @@ var PasswordStrengthController = class _PasswordStrengthController extends Contr
|
|
|
126
126
|
this.#toggle("data-strength", band, band.length > 0);
|
|
127
127
|
this.#toggle("data-below-min", "true", score > 0 && score < this.minScoreValue);
|
|
128
128
|
const ratio = max > 0 ? score / max : 0;
|
|
129
|
-
this.element.style.setProperty("--stimeo
|
|
129
|
+
this.element.style.setProperty("--stimeo--password-strength", String(ratio));
|
|
130
130
|
}
|
|
131
131
|
#writeLabel(label) {
|
|
132
132
|
if (this.hasLabelTarget) this.labelTarget.textContent = label;
|
|
@@ -12,6 +12,16 @@ function isReservedArrowChord(event, allow = []) {
|
|
|
12
12
|
var DetachGate = class _DetachGate {
|
|
13
13
|
/** Set while a probe is queued, waiting for a reconnect to cancel it. */
|
|
14
14
|
#pending = false;
|
|
15
|
+
/**
|
|
16
|
+
* True while a probe is queued — the last disconnect was ambiguous and no
|
|
17
|
+
* reconnect has cancelled it yet. Read it from `connect()` to tell the
|
|
18
|
+
* reconnect half of an in-page move from a first connect: a controller whose
|
|
19
|
+
* initialisation restarts a measurement (a min-duration floor, an elapsed
|
|
20
|
+
* counter) must skip it for the move, where nothing actually restarted.
|
|
21
|
+
*/
|
|
22
|
+
get pending() {
|
|
23
|
+
return this.#pending;
|
|
24
|
+
}
|
|
15
25
|
/**
|
|
16
26
|
* True when the disconnect is definitely a real detach — the element left
|
|
17
27
|
* the document, or `data-controller` no longer lists the identifier. False
|
|
@@ -6,6 +6,16 @@ import { Controller } from '@hotwired/stimulus';
|
|
|
6
6
|
var DetachGate = class _DetachGate {
|
|
7
7
|
/** Set while a probe is queued, waiting for a reconnect to cancel it. */
|
|
8
8
|
#pending = false;
|
|
9
|
+
/**
|
|
10
|
+
* True while a probe is queued — the last disconnect was ambiguous and no
|
|
11
|
+
* reconnect has cancelled it yet. Read it from `connect()` to tell the
|
|
12
|
+
* reconnect half of an in-page move from a first connect: a controller whose
|
|
13
|
+
* initialisation restarts a measurement (a min-duration floor, an elapsed
|
|
14
|
+
* counter) must skip it for the move, where nothing actually restarted.
|
|
15
|
+
*/
|
|
16
|
+
get pending() {
|
|
17
|
+
return this.#pending;
|
|
18
|
+
}
|
|
9
19
|
/**
|
|
10
20
|
* True when the disconnect is definitely a real detach — the element left
|
|
11
21
|
* the document, or `data-controller` no longer lists the identifier. False
|
|
@@ -153,20 +153,24 @@ var ProgressController = class extends Controller {
|
|
|
153
153
|
get #ratio() {
|
|
154
154
|
return rangeFraction(this.valueValue, this.minValue, this.maxValue);
|
|
155
155
|
}
|
|
156
|
-
/**
|
|
156
|
+
/**
|
|
157
|
+
* Reflects value/range/indeterminate onto ARIA, `data-state`, and the ratio.
|
|
158
|
+
*
|
|
159
|
+
* @stimeoRenderRoot
|
|
160
|
+
*/
|
|
157
161
|
#render() {
|
|
158
162
|
this.element.setAttribute("aria-valuemin", String(this.minValue));
|
|
159
163
|
this.element.setAttribute("aria-valuemax", String(this.maxValue));
|
|
160
164
|
if (this.indeterminateValue) {
|
|
161
165
|
this.element.removeAttribute("aria-valuenow");
|
|
162
166
|
this.#clearOwnValueText();
|
|
163
|
-
this.element.style.removeProperty("--stimeo
|
|
167
|
+
this.element.style.removeProperty("--stimeo--progress-ratio");
|
|
164
168
|
this.element.setAttribute("data-state", "indeterminate");
|
|
165
169
|
return;
|
|
166
170
|
}
|
|
167
171
|
const value = this.#clamp(this.valueValue);
|
|
168
172
|
this.element.setAttribute("aria-valuenow", String(value));
|
|
169
|
-
this.element.style.setProperty("--stimeo
|
|
173
|
+
this.element.style.setProperty("--stimeo--progress-ratio", String(this.#ratio));
|
|
170
174
|
this.element.setAttribute("data-state", "determinate");
|
|
171
175
|
this.#applyValueText(value);
|
|
172
176
|
}
|