@ncino/web-components 12.0.0 → 12.1.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.
- package/dist/components/menu/menu-item/gator/menu-item.gator.js +4 -2
- package/dist/components/menu/menu-item/menu-item.js +1 -1
- package/dist/components/table/gator/table-cells/table-cell-icon-button.gator.js +9 -7
- package/dist/types/components/menu/menu-item/menu-item.d.ts +10 -0
- package/dist/types/components/table/table-cell-config.d.ts +3 -1
- package/package.json +3 -3
- package/web-types.json +41 -1
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";import{html as m}from"../../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.js";import"../../../../node_modules/.pnpm/lit-element@4.2.2/node_modules/lit-element/lit-element.js";import{customElement as a}from"../../../../utils/decorators/custom-element-decorator.js";import{NjcMenuItem as h}from"../menu-item.js";import"../../../list/gator/list-item/list-item.gator.js";import{KEY_CONSTANTS as
|
|
1
|
+
import"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";import{html as m}from"../../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.js";import"../../../../node_modules/.pnpm/lit-element@4.2.2/node_modules/lit-element/lit-element.js";import{customElement as a}from"../../../../utils/decorators/custom-element-decorator.js";import{NjcMenuItem as h}from"../menu-item.js";import"../../../list/gator/list-item/list-item.gator.js";import{KEY_CONSTANTS as n}from"../../../../consts/key-constants.js";var u=Object.getOwnPropertyDescriptor,d=(e,r,l,c)=>{for(var t=c>1?void 0:c?u(r,l):r,o=e.length-1,i;o>=0;o--)(i=e[o])&&(t=i(t)||t);return t};let s=class extends h{constructor(){super()}connectedCallback(){super.connectedCallback(),this.setAttribute("role","menuitem"),this.addEventListener("keydown",this.handleKeydown)}render(){return m`
|
|
2
2
|
<ngc-list-item
|
|
3
3
|
@click="${this.handleItemClick}"
|
|
4
4
|
text="${this.value}"
|
|
5
|
+
start-icon="${this.startIcon}"
|
|
6
|
+
end-icon="${this.endIcon}"
|
|
5
7
|
selectable
|
|
6
8
|
hide-checkmark
|
|
7
9
|
role="presentation"
|
|
8
10
|
faux-focus
|
|
9
11
|
></ngc-list-item>
|
|
10
|
-
`}focus(){this.shadowRoot?.querySelector("ngc-list-item")?.focus()}click(){this.shadowRoot?.querySelector("ngc-list-item")?.click()}handleKeydown(e){(e.key===
|
|
12
|
+
`}focus(){this.shadowRoot?.querySelector("ngc-list-item")?.focus()}click(){this.shadowRoot?.querySelector("ngc-list-item")?.click()}handleKeydown(e){(e.key===n.SPACE||e.key===n.ENTER)&&(this.handleItemKeydown(e),this.shadowRoot?.querySelector("ngc-list-item")?.click())}};s=d([a("ngc-menu-item")],s);export{s as NgcMenuItem};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";import"../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.js";import{LitElement as m}from"../../../node_modules/.pnpm/lit-element@4.2.2/node_modules/lit-element/lit-element.js";import{property as
|
|
1
|
+
import"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";import"../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.js";import{LitElement as m}from"../../../node_modules/.pnpm/lit-element@4.2.2/node_modules/lit-element/lit-element.js";import{property as i}from"../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/decorators/property.js";import{KEY_CONSTANTS as u}from"../../../consts/key-constants.js";var d=Object.defineProperty,o=(n,t,p,l)=>{for(var e=void 0,r=n.length-1,a;r>=0;r--)(a=n[r])&&(e=a(t,p,e)||e);return e&&d(t,p,e),e};class s extends m{constructor(){super(...arguments),this.value="",this.startIcon="",this.endIcon=""}handleItemKeydown(t){(t.key===u.SPACE||t.key===u.ENTER)&&(this.sendEvent(),t.preventDefault())}handleItemClick(){this.sendEvent()}sendEvent(){this.dispatchEvent(new CustomEvent("menuitemclick",{bubbles:!0,composed:!0,detail:{value:this.value}}))}}o([i({type:String})],s.prototype,"value");o([i({type:String,attribute:"start-icon"})],s.prototype,"startIcon");o([i({type:String,attribute:"end-icon"})],s.prototype,"endIcon");export{s as NjcMenuItem};
|
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
import"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";import{html as m}from"../../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.js";import"../../../../node_modules/.pnpm/lit-element@4.2.2/node_modules/lit-element/lit-element.js";import{customElement as u}from"../../../../utils/decorators/custom-element-decorator.js";import{TableCellBase as s}from"./table-cell-base.gator.js";import"../../../icon-button/gator/icon-button.gator.js";import"../../../menu/base/gator/menu.gator.js";var b=Object.getOwnPropertyDescriptor,g=(e,n,
|
|
1
|
+
import"../../../../node_modules/.pnpm/@lit_reactive-element@2.1.1/node_modules/@lit/reactive-element/reactive-element.js";import{html as m}from"../../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/lit-html.js";import"../../../../node_modules/.pnpm/lit-element@4.2.2/node_modules/lit-element/lit-element.js";import{customElement as u}from"../../../../utils/decorators/custom-element-decorator.js";import{TableCellBase as s}from"./table-cell-base.gator.js";import"../../../icon-button/gator/icon-button.gator.js";import"../../../menu/base/gator/menu.gator.js";var b=Object.getOwnPropertyDescriptor,g=(e,n,c,o)=>{for(var t=o>1?void 0:o?b(n,c):n,i=e.length-1,l;i>=0;i--)(l=e[i])&&(t=l(t)||t);return t};let r=class extends s{renderCellContent(){const e=this.column.cellConfig??{},n=e.iconName,c=typeof e.iconAriaLabel=="function"?e.iconAriaLabel(this.rowData):e.iconAriaLabel??"More actions",o=typeof e.menuItems=="function"?e.menuItems(this.rowData):e.menuItems??[],t=e.menuPlacement??"bottom-end",i=e.menuAriaLabel??"More actions",l=m`
|
|
2
2
|
<ngc-icon-button
|
|
3
3
|
icon-name="${n}"
|
|
4
4
|
size="medium"
|
|
5
|
-
aria-label="${
|
|
5
|
+
aria-label="${c}"
|
|
6
6
|
@click="${()=>this.emitCellClick()}"
|
|
7
7
|
></ngc-icon-button>
|
|
8
8
|
`;return o.length>0?m`
|
|
9
|
-
<ngc-menu placement="${t}" menu-aria-label="${
|
|
9
|
+
<ngc-menu placement="${t}" menu-aria-label="${i}">
|
|
10
10
|
<ngc-icon-button
|
|
11
11
|
slot="trigger"
|
|
12
12
|
icon-name="${n}"
|
|
13
13
|
size="medium"
|
|
14
|
-
aria-label="${
|
|
14
|
+
aria-label="${c}"
|
|
15
15
|
></ngc-icon-button>
|
|
16
|
-
${o.map(
|
|
16
|
+
${o.map(a=>this.renderMenuItem(a))}
|
|
17
17
|
</ngc-menu>
|
|
18
|
-
`:
|
|
18
|
+
`:l}renderMenuItem(e){const n=e.value??e.label;return m`
|
|
19
19
|
<ngc-menu-item
|
|
20
20
|
value="${e.label}"
|
|
21
|
+
start-icon="${e.startIcon}"
|
|
22
|
+
end-icon="${e.endIcon}"
|
|
21
23
|
@menuitemclick="${()=>this.emitCellClick(n)}"
|
|
22
24
|
></ngc-menu-item>
|
|
23
|
-
`}};
|
|
25
|
+
`}};r=g([u("ngc-table-cell-icon-button")],r);export{r as NgcTableCellIconButton};
|
|
@@ -5,6 +5,16 @@ export declare class NjcMenuItem extends LitElement {
|
|
|
5
5
|
* @type {string}
|
|
6
6
|
*/
|
|
7
7
|
value: string;
|
|
8
|
+
/**
|
|
9
|
+
* An icon displayed before the value text
|
|
10
|
+
* @type {string}
|
|
11
|
+
*/
|
|
12
|
+
startIcon: string;
|
|
13
|
+
/**
|
|
14
|
+
* An icon displayed after the value text
|
|
15
|
+
* @type {string}
|
|
16
|
+
*/
|
|
17
|
+
endIcon: string;
|
|
8
18
|
handleItemKeydown(e: KeyboardEvent): void;
|
|
9
19
|
handleItemClick(): void;
|
|
10
20
|
sendEvent(): void;
|
|
@@ -33,11 +33,13 @@ export interface TableButtonCellConfig extends TableCellConfigBase {
|
|
|
33
33
|
export type TableIconButtonMenuItem = {
|
|
34
34
|
label: string;
|
|
35
35
|
value?: string;
|
|
36
|
+
startIcon?: string;
|
|
37
|
+
endIcon?: string;
|
|
36
38
|
};
|
|
37
39
|
export interface TableIconButtonCellConfig extends TableCellConfigBase {
|
|
38
40
|
iconName: string;
|
|
39
41
|
iconAriaLabel?: string | ((row: RowData) => string);
|
|
40
|
-
menuItems?: TableIconButtonMenuItem[];
|
|
42
|
+
menuItems?: TableIconButtonMenuItem[] | ((row: RowData) => TableIconButtonMenuItem[]);
|
|
41
43
|
menuPlacement?: Placement;
|
|
42
44
|
menuAriaLabel?: string;
|
|
43
45
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ncino/web-components",
|
|
3
3
|
"author": "nCino",
|
|
4
|
-
"version": "12.
|
|
4
|
+
"version": "12.1.0",
|
|
5
5
|
"license": "(c) Copyright 2023 nCino, Inc., all rights reserved",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -100,10 +100,10 @@
|
|
|
100
100
|
"vite-plugin-static-copy": "^3.3.0",
|
|
101
101
|
"vitest": "^4.1.0",
|
|
102
102
|
"yaml-eslint-parser": "^2.0.0",
|
|
103
|
-
"@ncino/styles": "12.
|
|
103
|
+
"@ncino/styles": "12.1.0"
|
|
104
104
|
},
|
|
105
105
|
"peerDependencies": {
|
|
106
|
-
"@ncino/styles": "12.
|
|
106
|
+
"@ncino/styles": "12.1.0"
|
|
107
107
|
},
|
|
108
108
|
"bugs": {
|
|
109
109
|
"url": "https://github.com/ncino/force-sdk-web-components/issues"
|
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": "
|
|
4
|
+
"version": "12.0.0",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -2187,6 +2187,16 @@
|
|
|
2187
2187
|
"name": "value",
|
|
2188
2188
|
"description": "The value and text displayed of the menu item",
|
|
2189
2189
|
"value": { "type": "string", "default": "''" }
|
|
2190
|
+
},
|
|
2191
|
+
{
|
|
2192
|
+
"name": "start-icon",
|
|
2193
|
+
"description": "An icon displayed before the value text",
|
|
2194
|
+
"value": { "type": "string", "default": "''" }
|
|
2195
|
+
},
|
|
2196
|
+
{
|
|
2197
|
+
"name": "end-icon",
|
|
2198
|
+
"description": "An icon displayed after the value text",
|
|
2199
|
+
"value": { "type": "string", "default": "''" }
|
|
2190
2200
|
}
|
|
2191
2201
|
],
|
|
2192
2202
|
"events": [{ "name": "menuitemclick", "type": "CustomEvent" }],
|
|
@@ -2196,6 +2206,16 @@
|
|
|
2196
2206
|
"name": "value",
|
|
2197
2207
|
"description": "The value and text displayed of the menu item",
|
|
2198
2208
|
"type": "string"
|
|
2209
|
+
},
|
|
2210
|
+
{
|
|
2211
|
+
"name": "startIcon",
|
|
2212
|
+
"description": "An icon displayed before the value text",
|
|
2213
|
+
"type": "string"
|
|
2214
|
+
},
|
|
2215
|
+
{
|
|
2216
|
+
"name": "endIcon",
|
|
2217
|
+
"description": "An icon displayed after the value text",
|
|
2218
|
+
"type": "string"
|
|
2199
2219
|
}
|
|
2200
2220
|
],
|
|
2201
2221
|
"events": [{ "name": "menuitemclick", "type": "CustomEvent" }]
|
|
@@ -6237,6 +6257,16 @@
|
|
|
6237
6257
|
"name": "value",
|
|
6238
6258
|
"description": "The value and text displayed of the menu item",
|
|
6239
6259
|
"value": { "type": "string", "default": "''" }
|
|
6260
|
+
},
|
|
6261
|
+
{
|
|
6262
|
+
"name": "start-icon",
|
|
6263
|
+
"description": "An icon displayed before the value text",
|
|
6264
|
+
"value": { "type": "string", "default": "''" }
|
|
6265
|
+
},
|
|
6266
|
+
{
|
|
6267
|
+
"name": "end-icon",
|
|
6268
|
+
"description": "An icon displayed after the value text",
|
|
6269
|
+
"value": { "type": "string", "default": "''" }
|
|
6240
6270
|
}
|
|
6241
6271
|
],
|
|
6242
6272
|
"events": [{ "name": "menuitemclick", "type": "CustomEvent" }],
|
|
@@ -6247,6 +6277,16 @@
|
|
|
6247
6277
|
"name": "value",
|
|
6248
6278
|
"description": "The value and text displayed of the menu item",
|
|
6249
6279
|
"type": "string"
|
|
6280
|
+
},
|
|
6281
|
+
{
|
|
6282
|
+
"name": "startIcon",
|
|
6283
|
+
"description": "An icon displayed before the value text",
|
|
6284
|
+
"type": "string"
|
|
6285
|
+
},
|
|
6286
|
+
{
|
|
6287
|
+
"name": "endIcon",
|
|
6288
|
+
"description": "An icon displayed after the value text",
|
|
6289
|
+
"type": "string"
|
|
6250
6290
|
}
|
|
6251
6291
|
],
|
|
6252
6292
|
"events": [{ "name": "menuitemclick", "type": "CustomEvent" }]
|