@educarehq/solaris-ui 0.6.0 → 0.6.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.
@@ -12281,89 +12281,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
12281
12281
 
12282
12282
  const SOLARIS_ACCORDION = new InjectionToken('SolarisAccordion');
12283
12283
 
12284
- class SolarisAccordionComponent {
12285
- appearance = input('boxed', ...(ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []));
12286
- type = input('single', ...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
12287
- size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
12288
- disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
12289
- allowToggle = input(true, { ...(ngDevMode ? { debugName: "allowToggle" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
12290
- headingLevel = input(3, ...(ngDevMode ? [{ debugName: "headingLevel" }] : /* istanbul ignore next */ []));
12291
- expandIcon = input('chevron-down', ...(ngDevMode ? [{ debugName: "expandIcon" }] : /* istanbul ignore next */ []));
12292
- value = model(...(ngDevMode ? [undefined, { debugName: "value" }] : /* istanbul ignore next */ []));
12293
- items = contentChildren(SolarisCollapsibleComponent, ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
12294
- instanceId = nextIdFor('solaris-accordion');
12295
- resolvedValue = computed(() => {
12296
- const value = this.value();
12297
- if (value === undefined) {
12298
- return this.type() === 'multiple' ? [] : undefined;
12299
- }
12300
- if (this.type() === 'multiple') {
12301
- return Array.isArray(value) ? value : [value];
12302
- }
12303
- return Array.isArray(value) ? value[0] : value;
12304
- }, ...(ngDevMode ? [{ debugName: "resolvedValue" }] : /* istanbul ignore next */ []));
12305
- isOpen(value) {
12306
- const resolved = this.resolvedValue();
12307
- if (Array.isArray(resolved)) {
12308
- return value !== undefined && resolved.includes(value);
12309
- }
12310
- return resolved === value;
12311
- }
12312
- toggle(value) {
12313
- if (this.disabled()) {
12314
- return;
12315
- }
12316
- const resolved = this.resolvedValue();
12317
- if (this.type() === 'multiple') {
12318
- const list = Array.isArray(resolved) ? [...resolved] : [];
12319
- const index = list.indexOf(value);
12320
- if (index >= 0) {
12321
- list.splice(index, 1);
12322
- }
12323
- else if (value !== undefined) {
12324
- list.push(value);
12325
- }
12326
- this.value.set(list);
12327
- return;
12328
- }
12329
- if (resolved === value) {
12330
- if (this.allowToggle()) {
12331
- this.value.set(undefined);
12332
- }
12333
- return;
12334
- }
12335
- this.value.set(value);
12336
- }
12337
- generatePanelId(value) {
12338
- return `${this.instanceId}-panel-${String(value)}`;
12339
- }
12340
- generateTriggerId(value) {
12341
- return `${this.instanceId}-trigger-${String(value)}`;
12342
- }
12343
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisAccordionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
12344
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.17", type: SolarisAccordionComponent, isStandalone: true, selector: "solaris-accordion", inputs: { appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, allowToggle: { classPropertyName: "allowToggle", publicName: "allowToggle", isSignal: true, isRequired: false, transformFunction: null }, headingLevel: { classPropertyName: "headingLevel", publicName: "headingLevel", isSignal: true, isRequired: false, transformFunction: null }, expandIcon: { classPropertyName: "expandIcon", publicName: "expandIcon", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "attr.data-appearance": "appearance()", "attr.data-type": "type()", "attr.data-size": "size()", "attr.data-disabled": "disabled() ? \"\" : null" }, classAttribute: "solaris-accordion" }, providers: [
12345
- {
12346
- provide: SOLARIS_ACCORDION,
12347
- useExisting: SolarisAccordionComponent,
12348
- },
12349
- ], queries: [{ propertyName: "items", predicate: SolarisCollapsibleComponent, isSignal: true }], ngImport: i0, template: "<div class=\"solaris-accordion__inner\">\n <ng-content select=\"solaris-collapsible\" />\n</div>\n", styles: [":host{--solaris-accordion-gap: var(--solaris-spacing-2);display:block;box-sizing:border-box}.solaris-accordion__inner{display:flex;flex-direction:column;gap:var(--solaris-accordion-gap)}:host([data-appearance=lined]) .solaris-accordion__inner{gap:0}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
12350
- }
12351
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisAccordionComponent, decorators: [{
12352
- type: Component,
12353
- args: [{ selector: 'solaris-accordion', standalone: true, imports: [], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
12354
- {
12355
- provide: SOLARIS_ACCORDION,
12356
- useExisting: SolarisAccordionComponent,
12357
- },
12358
- ], host: {
12359
- class: 'solaris-accordion',
12360
- '[attr.data-appearance]': 'appearance()',
12361
- '[attr.data-type]': 'type()',
12362
- '[attr.data-size]': 'size()',
12363
- '[attr.data-disabled]': 'disabled() ? "" : null',
12364
- }, template: "<div class=\"solaris-accordion__inner\">\n <ng-content select=\"solaris-collapsible\" />\n</div>\n", styles: [":host{--solaris-accordion-gap: var(--solaris-spacing-2);display:block;box-sizing:border-box}.solaris-accordion__inner{display:flex;flex-direction:column;gap:var(--solaris-accordion-gap)}:host([data-appearance=lined]) .solaris-accordion__inner{gap:0}\n"] }]
12365
- }], propDecorators: { appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], allowToggle: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowToggle", required: false }] }], headingLevel: [{ type: i0.Input, args: [{ isSignal: true, alias: "headingLevel", required: false }] }], expandIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandIcon", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], items: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => SolarisCollapsibleComponent), { isSignal: true }] }] } });
12366
-
12367
12284
  class SolarisCollapsibleComponent {
12368
12285
  elementRef = inject(ElementRef);
12369
12286
  translateService = inject(SolarisTranslateService, {
@@ -12464,6 +12381,89 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImpo
12464
12381
  }, template: "@if (headingLevel()) {\n @switch (headingLevel()) {\n @case (2) {\n <h2 class=\"solaris-collapsible__header\">\n <ng-container *ngTemplateOutlet=\"triggerContent\" />\n </h2>\n }\n @case (3) {\n <h3 class=\"solaris-collapsible__header\">\n <ng-container *ngTemplateOutlet=\"triggerContent\" />\n </h3>\n }\n @case (4) {\n <h4 class=\"solaris-collapsible__header\">\n <ng-container *ngTemplateOutlet=\"triggerContent\" />\n </h4>\n }\n @case (5) {\n <h5 class=\"solaris-collapsible__header\">\n <ng-container *ngTemplateOutlet=\"triggerContent\" />\n </h5>\n }\n @case (6) {\n <h6 class=\"solaris-collapsible__header\">\n <ng-container *ngTemplateOutlet=\"triggerContent\" />\n </h6>\n }\n @default {\n <h3 class=\"solaris-collapsible__header\">\n <ng-container *ngTemplateOutlet=\"triggerContent\" />\n </h3>\n }\n }\n} @else {\n <div class=\"solaris-collapsible__header\">\n <ng-container *ngTemplateOutlet=\"triggerContent\" />\n </div>\n}\n\n<ng-template #triggerContent>\n <button\n type=\"button\"\n class=\"solaris-collapsible__trigger\"\n [id]=\"triggerId()\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"panelId()\"\n [attr.aria-label]=\"effectiveAriaLabel()\"\n [attr.aria-disabled]=\"!canToggleClosed() && isOpen() ? 'true' : null\"\n [disabled]=\"isEffectivelyDisabled()\"\n (click)=\"toggle()\"\n >\n <span class=\"solaris-collapsible__trigger-label\">\n {{ labelText() }}\n </span>\n <solaris-icon\n [name]=\"effectiveIcon()\"\n class=\"solaris-collapsible__trigger-icon\"\n [decorative]=\"true\"\n />\n </button>\n</ng-template>\n\n<div\n class=\"solaris-collapsible__panel\"\n [id]=\"panelId()\"\n role=\"region\"\n [attr.aria-labelledby]=\"triggerId()\"\n [attr.aria-hidden]=\"isOpen() ? null : 'true'\"\n [attr.inert]=\"isOpen() ? null : ''\"\n>\n <div class=\"solaris-collapsible__panel-inner\">\n <ng-content />\n </div>\n</div>\n", styles: [":host{--solaris-collapsible-radius: var(--solaris-radius-md);--solaris-collapsible-icon-size: var(--solaris-spacing-4);--solaris-collapsible-trigger-gap: var(--solaris-spacing-2);--solaris-collapsible-trigger-color: var(--solaris-text-muted);--solaris-collapsible-border-color: var(--solaris-border-subtle);--solaris-collapsible-trigger-font-size: var(--solaris-font-size-md);--solaris-collapsible-trigger-font-weight: var(--solaris-font-weight-medium);--solaris-collapsible-trigger-padding: var(--solaris-spacing-2) var(--solaris-spacing-3);--solaris-collapsible-header-inset-top: var(--solaris-spacing-3);display:block;box-sizing:border-box}.solaris-collapsible__header{margin:0}.solaris-collapsible__trigger{width:100%;border:none;display:flex;cursor:pointer;text-align:start;align-items:center;box-sizing:border-box;background:transparent;justify-content:space-between;gap:var(--solaris-collapsible-trigger-gap);color:var(--solaris-collapsible-trigger-color);padding:var(--solaris-collapsible-trigger-padding);transition:color var(--solaris-motion-duration-normal) var(--solaris-motion-easing-standard);font:var(--solaris-collapsible-trigger-font-weight) var(--solaris-collapsible-trigger-font-size)/1.2 var(--solaris-font-family-sans)}.solaris-collapsible__trigger:hover:not(:disabled){color:var(--solaris-text-default)}.solaris-collapsible__trigger:focus-visible{outline-offset:var(--solaris-focus-ring-offset);outline:var(--solaris-focus-ring-width) solid var(--solaris-focus-ring-color)}.solaris-collapsible__trigger:disabled{cursor:not-allowed;opacity:var(--solaris-opacity-50)}.solaris-collapsible__trigger-icon{flex-shrink:0;width:var(--solaris-collapsible-icon-size);height:var(--solaris-collapsible-icon-size);transition:transform var(--solaris-motion-duration-normal) var(--solaris-motion-easing-standard)}:host([data-open]) .solaris-collapsible__trigger-icon{transform:rotate(180deg)}.solaris-collapsible__panel{display:grid;grid-template-rows:0fr;transition:grid-template-rows var(--solaris-motion-duration-normal) var(--solaris-motion-easing-standard)}:host([data-open]) .solaris-collapsible__panel{grid-template-rows:1fr}.solaris-collapsible__panel-inner{min-height:0;overflow:hidden;color:var(--solaris-text-muted);font-size:var(--solaris-font-size-sm);padding:0 var(--solaris-spacing-5) var(--solaris-spacing-3)}:host([data-appearance=boxed]){border-radius:var(--solaris-collapsible-radius);border:var(--solaris-border-width-sm) solid var(--solaris-collapsible-border-color)}:host([data-appearance=boxed]) .solaris-collapsible__header{margin-top:var(--solaris-collapsible-header-inset-top)}:host([data-appearance=lined]) .solaris-collapsible__trigger{border-bottom:var(--solaris-border-width-sm) solid var(--solaris-collapsible-border-color)}:host([data-appearance=lined]):last-child .solaris-collapsible__trigger{border-bottom:none}@media(prefers-reduced-motion:reduce){.solaris-collapsible__trigger,.solaris-collapsible__trigger-icon,.solaris-collapsible__panel{transition:none}}:host-context([data-reduced-motion=true]) .solaris-collapsible__trigger,:host-context([data-reduced-motion=true]) .solaris-collapsible__trigger-icon,:host-context([data-reduced-motion=true]) .solaris-collapsible__panel{transition:none}\n"] }]
12465
12382
  }], propDecorators: { open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], labelKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelKey", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], ariaLabelKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabelKey", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], icon: [{ type: i0.Input, args: [{ isSignal: true, alias: "icon", required: false }] }] } });
12466
12383
 
12384
+ class SolarisAccordionComponent {
12385
+ appearance = input('boxed', ...(ngDevMode ? [{ debugName: "appearance" }] : /* istanbul ignore next */ []));
12386
+ type = input('single', ...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
12387
+ size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
12388
+ disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
12389
+ allowToggle = input(true, { ...(ngDevMode ? { debugName: "allowToggle" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
12390
+ headingLevel = input(3, ...(ngDevMode ? [{ debugName: "headingLevel" }] : /* istanbul ignore next */ []));
12391
+ expandIcon = input('chevron-down', ...(ngDevMode ? [{ debugName: "expandIcon" }] : /* istanbul ignore next */ []));
12392
+ value = model(...(ngDevMode ? [undefined, { debugName: "value" }] : /* istanbul ignore next */ []));
12393
+ items = contentChildren(SolarisCollapsibleComponent, ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
12394
+ instanceId = nextIdFor('solaris-accordion');
12395
+ resolvedValue = computed(() => {
12396
+ const value = this.value();
12397
+ if (value === undefined) {
12398
+ return this.type() === 'multiple' ? [] : undefined;
12399
+ }
12400
+ if (this.type() === 'multiple') {
12401
+ return Array.isArray(value) ? value : [value];
12402
+ }
12403
+ return Array.isArray(value) ? value[0] : value;
12404
+ }, ...(ngDevMode ? [{ debugName: "resolvedValue" }] : /* istanbul ignore next */ []));
12405
+ isOpen(value) {
12406
+ const resolved = this.resolvedValue();
12407
+ if (Array.isArray(resolved)) {
12408
+ return value !== undefined && resolved.includes(value);
12409
+ }
12410
+ return resolved === value;
12411
+ }
12412
+ toggle(value) {
12413
+ if (this.disabled()) {
12414
+ return;
12415
+ }
12416
+ const resolved = this.resolvedValue();
12417
+ if (this.type() === 'multiple') {
12418
+ const list = Array.isArray(resolved) ? [...resolved] : [];
12419
+ const index = list.indexOf(value);
12420
+ if (index >= 0) {
12421
+ list.splice(index, 1);
12422
+ }
12423
+ else if (value !== undefined) {
12424
+ list.push(value);
12425
+ }
12426
+ this.value.set(list);
12427
+ return;
12428
+ }
12429
+ if (resolved === value) {
12430
+ if (this.allowToggle()) {
12431
+ this.value.set(undefined);
12432
+ }
12433
+ return;
12434
+ }
12435
+ this.value.set(value);
12436
+ }
12437
+ generatePanelId(value) {
12438
+ return `${this.instanceId}-panel-${String(value)}`;
12439
+ }
12440
+ generateTriggerId(value) {
12441
+ return `${this.instanceId}-trigger-${String(value)}`;
12442
+ }
12443
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisAccordionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
12444
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.2.17", type: SolarisAccordionComponent, isStandalone: true, selector: "solaris-accordion", inputs: { appearance: { classPropertyName: "appearance", publicName: "appearance", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, allowToggle: { classPropertyName: "allowToggle", publicName: "allowToggle", isSignal: true, isRequired: false, transformFunction: null }, headingLevel: { classPropertyName: "headingLevel", publicName: "headingLevel", isSignal: true, isRequired: false, transformFunction: null }, expandIcon: { classPropertyName: "expandIcon", publicName: "expandIcon", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { properties: { "attr.data-appearance": "appearance()", "attr.data-type": "type()", "attr.data-size": "size()", "attr.data-disabled": "disabled() ? \"\" : null" }, classAttribute: "solaris-accordion" }, providers: [
12445
+ {
12446
+ provide: SOLARIS_ACCORDION,
12447
+ useExisting: SolarisAccordionComponent,
12448
+ },
12449
+ ], queries: [{ propertyName: "items", predicate: SolarisCollapsibleComponent, isSignal: true }], ngImport: i0, template: "<div class=\"solaris-accordion__inner\">\n <ng-content select=\"solaris-collapsible\" />\n</div>\n", styles: [":host{--solaris-accordion-gap: var(--solaris-spacing-2);display:block;box-sizing:border-box}.solaris-accordion__inner{display:flex;flex-direction:column;gap:var(--solaris-accordion-gap)}:host([data-appearance=lined]) .solaris-accordion__inner{gap:0}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
12450
+ }
12451
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.17", ngImport: i0, type: SolarisAccordionComponent, decorators: [{
12452
+ type: Component,
12453
+ args: [{ selector: 'solaris-accordion', standalone: true, imports: [], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
12454
+ {
12455
+ provide: SOLARIS_ACCORDION,
12456
+ useExisting: SolarisAccordionComponent,
12457
+ },
12458
+ ], host: {
12459
+ class: 'solaris-accordion',
12460
+ '[attr.data-appearance]': 'appearance()',
12461
+ '[attr.data-type]': 'type()',
12462
+ '[attr.data-size]': 'size()',
12463
+ '[attr.data-disabled]': 'disabled() ? "" : null',
12464
+ }, template: "<div class=\"solaris-accordion__inner\">\n <ng-content select=\"solaris-collapsible\" />\n</div>\n", styles: [":host{--solaris-accordion-gap: var(--solaris-spacing-2);display:block;box-sizing:border-box}.solaris-accordion__inner{display:flex;flex-direction:column;gap:var(--solaris-accordion-gap)}:host([data-appearance=lined]) .solaris-accordion__inner{gap:0}\n"] }]
12465
+ }], propDecorators: { appearance: [{ type: i0.Input, args: [{ isSignal: true, alias: "appearance", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], allowToggle: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowToggle", required: false }] }], headingLevel: [{ type: i0.Input, args: [{ isSignal: true, alias: "headingLevel", required: false }] }], expandIcon: [{ type: i0.Input, args: [{ isSignal: true, alias: "expandIcon", required: false }] }], value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], items: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => SolarisCollapsibleComponent), { isSignal: true }] }] } });
12466
+
12467
12467
  // SECURITY_EXCEPTION_FILE: document.querySelector required to find rename input. SSR-safe via guard.
12468
12468
  class SolarisEditableTabsComponent {
12469
12469
  translateService = inject(SolarisTranslateService, {