stimeo-ui 0.7.0 → 0.8.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.
Files changed (50) hide show
  1. package/CHANGELOG.md +62 -0
  2. package/dist/controllers/auto_submit_controller.d.ts +14 -3
  3. package/dist/controllers/auto_submit_controller.js +94 -16
  4. package/dist/controllers/auto_submit_controller.js.map +1 -1
  5. package/dist/controllers/carousel_controller.d.ts +81 -47
  6. package/dist/controllers/carousel_controller.js +451 -100
  7. package/dist/controllers/carousel_controller.js.map +1 -1
  8. package/dist/controllers/currency_input_controller.d.ts +39 -5
  9. package/dist/controllers/currency_input_controller.js +305 -74
  10. package/dist/controllers/currency_input_controller.js.map +1 -1
  11. package/dist/controllers/direct_upload_controller.d.ts +3 -1
  12. package/dist/controllers/direct_upload_controller.js +12 -2
  13. package/dist/controllers/direct_upload_controller.js.map +1 -1
  14. package/dist/controllers/file_dropzone_controller.d.ts +123 -29
  15. package/dist/controllers/file_dropzone_controller.js +386 -63
  16. package/dist/controllers/file_dropzone_controller.js.map +1 -1
  17. package/dist/controllers/flash_controller.d.ts +3 -1
  18. package/dist/controllers/flash_controller.js +3 -1
  19. package/dist/controllers/flash_controller.js.map +1 -1
  20. package/dist/controllers/frame_loading_controller.d.ts +4 -2
  21. package/dist/controllers/frame_loading_controller.js +2 -1
  22. package/dist/controllers/frame_loading_controller.js.map +1 -1
  23. package/dist/controllers/input_mask_controller.d.ts +42 -16
  24. package/dist/controllers/input_mask_controller.js +251 -76
  25. package/dist/controllers/input_mask_controller.js.map +1 -1
  26. package/dist/controllers/nested_form_controller.d.ts +51 -14
  27. package/dist/controllers/nested_form_controller.js +450 -42
  28. package/dist/controllers/nested_form_controller.js.map +1 -1
  29. package/dist/controllers/otp_controller.d.ts +61 -25
  30. package/dist/controllers/otp_controller.js +472 -114
  31. package/dist/controllers/otp_controller.js.map +1 -1
  32. package/dist/controllers/spinner_controller.d.ts +3 -2
  33. package/dist/controllers/spinner_controller.js +7 -5
  34. package/dist/controllers/spinner_controller.js.map +1 -1
  35. package/dist/controllers/submit_once_controller.d.ts +4 -1
  36. package/dist/controllers/submit_once_controller.js +3 -1
  37. package/dist/controllers/submit_once_controller.js.map +1 -1
  38. package/dist/controllers/textarea_autosize_controller.d.ts +30 -10
  39. package/dist/controllers/textarea_autosize_controller.js +131 -3
  40. package/dist/controllers/textarea_autosize_controller.js.map +1 -1
  41. package/dist/index.js +1927 -607
  42. package/dist/index.js.map +1 -1
  43. package/dist/inspector/cli.d.ts +8 -1
  44. package/dist/inspector/cli.js +3 -1
  45. package/dist/inspector/cli.js.map +1 -1
  46. package/dist/inspector/cli_bin.js +3 -1
  47. package/dist/inspector/cli_bin.js.map +1 -1
  48. package/dist/inspector/examples.json +4 -4
  49. package/dist/inspector/manifest.json +182 -23
  50. package/package.json +2 -2
@@ -169,12 +169,19 @@ interface ValueCondition {
169
169
  * emptiness alone, since the controller cannot tell "still loading" from
170
170
  * "nothing to show" and therefore never infers it.
171
171
  *
172
+ * `within: "scope"` widens the count to the whole controller scope, for the
173
+ * contracts where a *sibling* decides the requirement: a carousel's slides are
174
+ * `tabpanel`s when the carousel has pickers to control them and `group`s when it
175
+ * has none, and no slide ever holds a picker of its own.
176
+ *
172
177
  * Bounds are inclusive and independently optional; a condition with neither is
173
178
  * meaningless and rejected by the manifest tests.
174
179
  */
175
180
  interface ContentCondition {
176
- /** Target name counted **inside** the element the rule applies to. */
181
+ /** Target name counted inside the counting container. */
177
182
  readonly target: string;
183
+ /** Where to count: the element the rule applies to, or the controller scope. */
184
+ readonly within?: "element" | "scope";
178
185
  /** Arms the rule when the count is at least this. */
179
186
  readonly min?: number;
180
187
  /** Arms the rule when the count is at most this. */
@@ -13,6 +13,7 @@ var ANNOUNCING_CONTROLLERS = [
13
13
  "stimeo--countdown",
14
14
  "stimeo--direct-upload",
15
15
  "stimeo--empty-state",
16
+ "stimeo--file-dropzone",
16
17
  "stimeo--flash",
17
18
  "stimeo--form-field",
18
19
  "stimeo--frame-loading",
@@ -1189,8 +1190,9 @@ function checkSource(source, manifest) {
1189
1190
  const contentHolds = (scope, identifier, element, condition) => {
1190
1191
  if (!condition) return true;
1191
1192
  const nodes = targetNodes.get(scope)?.get(identifier)?.get(condition.target) ?? [];
1193
+ const container = condition.within === "scope" ? scope : element;
1192
1194
  let held = 0;
1193
- for (const node of nodes) if (isWithin(node, element)) held += 1;
1195
+ for (const node of nodes) if (isWithin(node, container)) held += 1;
1194
1196
  if (condition.min !== void 0 && held < condition.min) return false;
1195
1197
  if (condition.max !== void 0 && held > condition.max) return false;
1196
1198
  return true;