@kubex/zinc 1.1.116 → 1.1.118

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.
package/dist/zn.d.ts CHANGED
@@ -7288,7 +7288,7 @@ declare module "components/form-actions/index" {
7288
7288
  }
7289
7289
  }
7290
7290
  declare module "components/form-group/form-group.component" {
7291
- import { type CSSResultGroup } from 'lit';
7291
+ import { type CSSResultGroup, type PropertyValues } from 'lit';
7292
7292
  import ZincElement from "internal/zinc-element";
7293
7293
  /**
7294
7294
  * @summary Short summary of the component's intended use.
@@ -7299,6 +7299,10 @@ declare module "components/form-group/form-group.component" {
7299
7299
  * @slot - The default slot.
7300
7300
  * @slot chip - A chip displayed under the form group's help text.
7301
7301
  *
7302
+ * @csspart form-control-text - The column holding the label, help text and chip.
7303
+ *
7304
+ * @cssproperty --zn-form-group-sticky-top - Offset the label column sticks at while the inputs scroll past.
7305
+ *
7302
7306
  */
7303
7307
  export default class ZnFormGroup extends ZincElement {
7304
7308
  static styles: CSSResultGroup;
@@ -7318,6 +7322,38 @@ declare module "components/form-group/form-group.component" {
7318
7322
  forceCols: boolean;
7319
7323
  layout: string;
7320
7324
  pad: boolean;
7325
+ /** The scroller the label is tracked against by hand; null while native sticky is enough. */
7326
+ private tracked;
7327
+ private stickyTop;
7328
+ private frame;
7329
+ private rebind;
7330
+ private offset;
7331
+ private resizeObserver;
7332
+ connectedCallback(): void;
7333
+ disconnectedCallback(): void;
7334
+ protected firstUpdated(changedProperties: PropertyValues): void;
7335
+ private get labelColumn();
7336
+ /** Coalesces scroll and resize work into one frame, and out of the ResizeObserver callback. */
7337
+ private schedule;
7338
+ /**
7339
+ * Native sticky only follows the nearest scroll container. Where that container isn't the one
7340
+ * the user actually scrolls — a `zn-panel` body sized to its content inside a scrolling
7341
+ * slideout, say — the label never moves, so it gets translated by hand instead.
7342
+ */
7343
+ private findScroller;
7344
+ private trackScroller;
7345
+ /** The document scrolls through the window, every other scroller reports its own events. */
7346
+ private scrollTarget;
7347
+ private readonly onScroll;
7348
+ private readonly onViewportResize;
7349
+ private positionLabel;
7350
+ /** The box native sticky would anchor to, whether or not it can be scrolled. */
7351
+ private nearestScrollContainer;
7352
+ /** The nearest ancestor the user can actually scroll, falling back to the document. */
7353
+ private scrollingAncestor;
7354
+ private isScrollContainer;
7355
+ /** Walks the flattened tree, so slots and shadow boundaries are crossed the way layout does. */
7356
+ private ancestors;
7321
7357
  render(): import("lit-html").TemplateResult<1>;
7322
7358
  }
7323
7359
  }
@@ -9097,10 +9133,7 @@ declare module "components/translations/translations.component" {
9097
9133
  hasTranslation(language: string): boolean;
9098
9134
  /** The chip shown against a language, in the select's value and against each of its options. */
9099
9135
  private languageState;
9100
- /**
9101
- * `English (EN)` — the configured name plus its code, unless the name already is the code, in which case the code
9102
- * alone. `languages` is written both ways: `{"en": "English"}` and `{"en": "EN"}`.
9103
- */
9136
+ /** The configured name, or the code where `languages` does not name the language. */
9104
9137
  private languageLabel;
9105
9138
  /**
9106
9139
  * `values`, falling back to the `value` attribute it is built from while that is still pending. A parent
@@ -9274,7 +9307,7 @@ declare module "components/animated-button/index" {
9274
9307
  declare module "components/translation-group/translation-group.component" {
9275
9308
  import { type CSSResultGroup, type PropertyValues } from 'lit';
9276
9309
  import ZnChip from "components/chip/index";
9277
- import ZnHeader from "components/header/index";
9310
+ import ZnFormGroup from "components/form-group/index";
9278
9311
  import ZnOption from "components/option/index";
9279
9312
  import ZnPanel from "components/panel/panel.component";
9280
9313
  import ZnSelect from "components/select/index";
@@ -9285,8 +9318,12 @@ declare module "components/translation-group/translation-group.component" {
9285
9318
  * @status experimental
9286
9319
  * @since 1.0
9287
9320
  *
9288
- * The select sits at the top right of the header, opposite the caption. Choosing a language switches every child at
9289
- * once, and each child hides its own select while it is in a group `grouped` is set on them here.
9321
+ * The fields sit in a `zn-form-group`, so the caption, help text and the language select share its label column and
9322
+ * the fields line up with every other form group around them. Choosing a language switches every child at once, and
9323
+ * each child hides its own select while it is in a group — `grouped` is set on them here.
9324
+ *
9325
+ * The select is searchable. Each option holds its language code as its value, so typing `de` finds German without the
9326
+ * code being on show.
9290
9327
  *
9291
9328
  * Closed, the select carries how many target languages are done — `1/5`. Its options each carry a chip aggregated
9292
9329
  * across the children:
@@ -9301,11 +9338,11 @@ declare module "components/translation-group/translation-group.component" {
9301
9338
  * The children own their values; this component only chooses which language is shown and reports on what they hold.
9302
9339
  * It reads them back on every child `zn-change`, so the chips and the count follow an edit as it is typed.
9303
9340
  *
9304
- * Extends `zn-panel`, so `caption`, `icon`, `flush`, `transparent` and the `footer` slot behave as they do there.
9305
- * Nested inside another panel, add `inline` to drop the chrome and keep the fields aligned with the surrounding form.
9341
+ * Extends `zn-panel`, so `caption`, `flush`, `transparent` and the `footer` slot behave as they do there. Nested
9342
+ * inside another panel, add `inline` to drop the chrome and keep the fields aligned with the surrounding form.
9306
9343
  *
9307
9344
  * @dependency zn-chip
9308
- * @dependency zn-header
9345
+ * @dependency zn-form-group
9309
9346
  * @dependency zn-option
9310
9347
  * @dependency zn-select
9311
9348
  *
@@ -9315,27 +9352,29 @@ declare module "components/translation-group/translation-group.component" {
9315
9352
  * @slot actions - Buttons for the bottom of the panel, on the white body rather than the grey footer. They sit on
9316
9353
  * the right, as zinc's form action rows do; `align="start"` moves one to the left. Write them in the order they
9317
9354
  * should be read — the sides are set by CSS ordering, so markup order is what a keyboard follows.
9318
- * @slot footer - Content displayed in the grey panel footer. The header belongs to the language select; nothing
9319
- * else is slotted into it.
9355
+ * @slot footer - Content displayed in the grey panel footer.
9320
9356
  *
9321
9357
  * @csspart base - The component's base wrapper.
9358
+ * @csspart form-group - The form group holding the caption, the language select and the fields.
9322
9359
  * @csspart actions - The row of buttons at the bottom of the body.
9323
- * @csspart language-field - The label and select that choose the language every child is editing.
9360
+ * @csspart language-field - The select that chooses the language every child is editing, in the group's chip slot.
9324
9361
  * @csspart language-select - The select itself.
9325
9362
  */
9326
9363
  export default class ZnTranslationGroup extends ZnPanel {
9327
9364
  static styles: CSSResultGroup;
9328
9365
  static dependencies: {
9329
9366
  'zn-chip': typeof ZnChip;
9330
- 'zn-header': typeof ZnHeader;
9367
+ 'zn-form-group': typeof ZnFormGroup;
9331
9368
  'zn-option': typeof ZnOption;
9332
9369
  'zn-select': typeof ZnSelect;
9333
9370
  };
9334
9371
  private readonly _slotController;
9335
- /** The caption shown in the panel header. An alias for the inherited `caption`, which wins where both are set. */
9372
+ /** The form group's label. An alias for the inherited `caption`, which wins where both are set. */
9336
9373
  label: string;
9374
+ /** Sits under the label, above the language select, as help text does in any other form group. */
9375
+ helpText: string;
9337
9376
  /**
9338
- * Drops the panel chrome — border, background and padding — so the group reads as a section of the form around it
9377
+ * Drops the panel chrome — border, background and padding — so the group reads as a section of the surrounding form
9339
9378
  * rather than a panel of its own. For groups nested inside another panel, where the fields would otherwise sit
9340
9379
  * indented behind a second border.
9341
9380
  */
@@ -9367,7 +9406,7 @@ declare module "components/translation-group/translation-group.component" {
9367
9406
  * count are read off the children, so a child's edit has to bring the group back round.
9368
9407
  */
9369
9408
  private languageState;
9370
- /** `English (EN)`, or the code alone where the configured name already is the code. */
9409
+ /** The configured name, or the code where `languages` does not name the language. */
9371
9410
  private displayName;
9372
9411
  /** Children take their language list from the group, so a change to `languages` has to reach them. */
9373
9412
  private syncChildLanguages;