@ncino/web-components 9.0.0-preview.11 → 9.0.0-preview.12
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{NjcButtonCard as
|
|
1
|
+
import{NjcButtonCard as u}from"../button-card.js";import"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";import{html as a}from"../../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/lit-html.js";import{LitElement as m}from"../../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js";import{property as f}from"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";import{state as b}from"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/state.js";import{customElement as g}from"../../../utils/decorators/custom-element-decorator.js";import{ifDefined as d}from"../../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/if-defined.js";import{classMap as y}from"../../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/directives/class-map.js";import{KEY_CONSTANTS as h}from"../../../consts/key-constants.js";import C from"../../../packages/web-components/src/components/button-card/gator/button-card.gator.scss.js";import $ from"../../../packages/styles/src/gator/tokens/primitive.tokens.css.js";import v from"../../../packages/styles/src/gator/tokens/semantic.tokens.css.js";import"../../chip/gator/chip.gator.js";import"../../card/gator/base/card.gator.js";import"../../card/gator/header/card-header.gator.js";import"../../card/gator/content/card-content.gator.js";import"../../card/gator/footer/card-footer.gator.js";import"../../text-detail/gator/text-detail.gator.js";import{unsafeCSS as c}from"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/css-tag.js";var _=Object.defineProperty,E=Object.getOwnPropertyDescriptor,p=(t,i,r,e)=>{for(var s=e>1?void 0:e?E(i,r):i,l=t.length-1,n;l>=0;l--)(n=t[l])&&(s=(e?n(i,r,s):n(s))||s);return e&&s&&_(i,r,s),s};let o=class extends u{constructor(){super(...arguments),this.chipType=null,this._showDefault=null}firstUpdated(t){super.firstUpdated(t),this._checkSlotContent()}render(){return a`
|
|
2
2
|
<ngc-card
|
|
3
3
|
tabindex="${this.disabled?"-1":"0"}"
|
|
4
4
|
role="button"
|
|
@@ -8,23 +8,24 @@ import{NjcButtonCard as m}from"../button-card.js";import"../../../node_modules/.
|
|
|
8
8
|
@click=${this.handleClick}
|
|
9
9
|
@keydown=${this.handleKeydown}
|
|
10
10
|
?disabled="${this.disabled}"
|
|
11
|
-
class="${
|
|
11
|
+
class="${y(this.cardClasses)}"
|
|
12
12
|
>
|
|
13
13
|
${this.cardLabelMarkup}
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
15
|
+
${this._showDefault===!0?a`
|
|
16
|
+
<div class="gator-button-card-container ${this.disabledClass}">
|
|
17
|
+
<ngc-text-detail
|
|
18
|
+
title="${this.title}"
|
|
19
|
+
subtitle="${this.subtitle}"
|
|
20
|
+
data-testid=${d(this.dataTestid)}-text-detail
|
|
21
|
+
>
|
|
22
|
+
<slot name="start" slot="prepend"></slot>
|
|
23
|
+
<ngc-icon slot="append" name="chevron-right"></ngc-icon>
|
|
24
|
+
</ngc-text-detail>
|
|
25
|
+
</div>
|
|
26
|
+
`:a`<slot></slot>`}
|
|
26
27
|
</ngc-card>
|
|
27
|
-
`}get cardClasses(){return{selected:this.selected}}get cardLabelMarkup(){return this.chipLabel?
|
|
28
|
+
`}_checkSlotContent(){const t=this.shadowRoot?.querySelector("slot:not([name])");if(t){const r=t.assignedNodes({flatten:!0}).some(e=>e.nodeType===Node.ELEMENT_NODE?!0:e.nodeType===Node.TEXT_NODE?(e.textContent?.trim().length??0)>0:!1);this._showDefault=!r}}get cardClasses(){return{selected:this.selected}}get cardLabelMarkup(){return this.chipLabel?a`
|
|
28
29
|
<ngc-chip
|
|
29
30
|
?disabled="${this.disabled}"
|
|
30
31
|
class="gator-button-card-chip-label"
|
|
@@ -33,4 +34,4 @@ import{NjcButtonCard as m}from"../button-card.js";import"../../../node_modules/.
|
|
|
33
34
|
readonly
|
|
34
35
|
>
|
|
35
36
|
${this.chipLabel}
|
|
36
|
-
</ngc-chip>`:null}get disabledClass(){return this.disabled?"gator-button-card_disabled":""}handleClick(t){t.preventDefault(),t.stopImmediatePropagation(),!this.disabled&&this.dispatchEvent(new CustomEvent("click",{bubbles:!0}))}click(){this.handleClick(new CustomEvent("click",{bubbles:!0}))}handleKeydown(t){[
|
|
37
|
+
</ngc-chip>`:null}get disabledClass(){return this.disabled?"gator-button-card_disabled":""}handleClick(t){t.preventDefault(),t.stopImmediatePropagation(),!this.disabled&&this.dispatchEvent(new CustomEvent("click",{bubbles:!0}))}click(){this.handleClick(new CustomEvent("click",{bubbles:!0}))}handleKeydown(t){[h.ENTER,h.SPACE].includes(t.key)&&this.handleClick(t)}};o.shadowRootOptions={...m.shadowRootOptions,delegatesFocus:!0};o.styles=[c(C),c($),c(v)];p([f({type:String,attribute:"chip-type"})],o.prototype,"chipType",2);p([b()],o.prototype,"_showDefault",2);o=p([g("ngc-button-card")],o);export{o as NgcButtonCard};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { NjcButtonCard } from '../button-card.ts';
|
|
2
|
+
import { PropertyValues } from 'lit';
|
|
2
3
|
import { NJC_CHIP_TYPES } from '../../chip/chip.ts';
|
|
3
4
|
export declare class NgcButtonCard extends NjcButtonCard {
|
|
4
5
|
static shadowRootOptions: {
|
|
@@ -15,7 +16,10 @@ export declare class NgcButtonCard extends NjcButtonCard {
|
|
|
15
16
|
* @property {NJC_CHIP_TYPES} chipType
|
|
16
17
|
*/
|
|
17
18
|
chipType: NJC_CHIP_TYPES;
|
|
19
|
+
private _showDefault;
|
|
20
|
+
firstUpdated(_changedProperties: PropertyValues): void;
|
|
18
21
|
render(): import('lit').TemplateResult<1>;
|
|
22
|
+
private _checkSlotContent;
|
|
19
23
|
get cardClasses(): {
|
|
20
24
|
selected: boolean;
|
|
21
25
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ncino/web-components",
|
|
3
3
|
"author": "nCino",
|
|
4
|
-
"version": "9.0.0-preview.
|
|
4
|
+
"version": "9.0.0-preview.12",
|
|
5
5
|
"license": "(c) Copyright 2023 nCino, Inc., all rights reserved",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
"vite-plugin-static-copy": "^3.1.4",
|
|
108
108
|
"vitest": "^4.0.15",
|
|
109
109
|
"yaml-eslint-parser": "^1.3.2",
|
|
110
|
-
"@ncino/styles": "9.0.0-preview.
|
|
110
|
+
"@ncino/styles": "9.0.0-preview.12"
|
|
111
111
|
},
|
|
112
112
|
"peerDependencies": {
|
|
113
113
|
"@ncino/styles": ">=8.0.0-preview.0"
|
package/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
3
3
|
"name": "@ncino/web-components",
|
|
4
|
-
"version": "9.0.0-preview.
|
|
4
|
+
"version": "9.0.0-preview.11",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|