@ni/ok-components 0.4.4 → 1.0.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.
- package/dist/all-components-bundle.js +101 -24
- package/dist/all-components-bundle.js.map +1 -1
- package/dist/all-components-bundle.min.js +74 -19
- package/dist/all-components-bundle.min.js.map +1 -1
- package/dist/custom-elements.json +72 -66
- package/dist/custom-elements.md +16 -16
- package/dist/esm/all-components.d.ts +1 -1
- package/dist/esm/all-components.js +1 -1
- package/dist/esm/all-components.js.map +1 -1
- package/dist/esm/ts/all-ts.d.ts +1 -0
- package/dist/esm/ts/all-ts.js +2 -0
- package/dist/esm/ts/all-ts.js.map +1 -0
- package/dist/esm/{icon-dynamic → ts/icon-dynamic}/index.d.ts +6 -6
- package/dist/esm/{icon-dynamic → ts/icon-dynamic}/index.js +13 -13
- package/dist/esm/ts/icon-dynamic/index.js.map +1 -0
- package/dist/esm/{icon-dynamic → ts/icon-dynamic}/styles.js +2 -2
- package/dist/esm/ts/icon-dynamic/styles.js.map +1 -0
- package/dist/esm/ts/icon-dynamic/template.d.ts +2 -0
- package/dist/esm/ts/icon-dynamic/template.js.map +1 -0
- package/package.json +2 -2
- package/dist/esm/icon-dynamic/index.js.map +0 -1
- package/dist/esm/icon-dynamic/styles.js.map +0 -1
- package/dist/esm/icon-dynamic/template.d.ts +0 -2
- package/dist/esm/icon-dynamic/template.js.map +0 -1
- /package/dist/esm/{icon-dynamic → ts/icon-dynamic}/styles.d.ts +0 -0
- /package/dist/esm/{icon-dynamic → ts/icon-dynamic}/template.js +0 -0
|
@@ -98696,10 +98696,57 @@ focus outline in that case.
|
|
|
98696
98696
|
width: 80px;
|
|
98697
98697
|
margin: ${mediumPadding};
|
|
98698
98698
|
}
|
|
98699
|
+
|
|
98700
|
+
.attachments {
|
|
98701
|
+
display: none;
|
|
98702
|
+
}
|
|
98703
|
+
|
|
98704
|
+
.attachments.has-content {
|
|
98705
|
+
display: flex;
|
|
98706
|
+
flex-wrap: wrap;
|
|
98707
|
+
gap: ${mediumPadding};
|
|
98708
|
+
padding: ${mediumPadding};
|
|
98709
|
+
max-height: calc(${controlSlimHeight} * 3 + ${mediumPadding} * 4 );
|
|
98710
|
+
overflow-y: auto;
|
|
98711
|
+
}
|
|
98712
|
+
|
|
98713
|
+
.attachments ::slotted(*) {
|
|
98714
|
+
height: ${controlSlimHeight};
|
|
98715
|
+
}
|
|
98716
|
+
|
|
98717
|
+
.footer {
|
|
98718
|
+
display: flex;
|
|
98719
|
+
flex-direction: row;
|
|
98720
|
+
align-items: flex-end;
|
|
98721
|
+
justify-content: flex-end;
|
|
98722
|
+
}
|
|
98723
|
+
|
|
98724
|
+
.footer-actions {
|
|
98725
|
+
display: none;
|
|
98726
|
+
flex: 1;
|
|
98727
|
+
}
|
|
98728
|
+
|
|
98729
|
+
.footer-actions.has-content {
|
|
98730
|
+
display: flex;
|
|
98731
|
+
align-items: center;
|
|
98732
|
+
flex-wrap: wrap;
|
|
98733
|
+
column-gap: ${mediumPadding};
|
|
98734
|
+
margin: ${mediumPadding};
|
|
98735
|
+
}
|
|
98736
|
+
|
|
98737
|
+
.footer-actions ::slotted(*) {
|
|
98738
|
+
height: ${controlSlimHeight};
|
|
98739
|
+
}
|
|
98699
98740
|
`;
|
|
98700
98741
|
|
|
98701
98742
|
const template$a = html `
|
|
98702
98743
|
<div class="container">
|
|
98744
|
+
<section class="attachments ${x => (x.attachmentsIsEmpty ? '' : 'has-content')}">
|
|
98745
|
+
<slot
|
|
98746
|
+
name="attachments"
|
|
98747
|
+
${slotted({ property: 'slottedAttachmentsElements' })}
|
|
98748
|
+
></slot>
|
|
98749
|
+
</section>
|
|
98703
98750
|
<textarea
|
|
98704
98751
|
${ref('textArea')}
|
|
98705
98752
|
placeholder="${x => x.placeholder}"
|
|
@@ -98709,19 +98756,27 @@ focus outline in that case.
|
|
|
98709
98756
|
@keydown="${(x, c) => x.textAreaKeydownHandler(c.event)}"
|
|
98710
98757
|
@input="${x => x.textAreaInputHandler()}"
|
|
98711
98758
|
></textarea>
|
|
98712
|
-
|
|
98713
|
-
class="
|
|
98714
|
-
|
|
98715
|
-
|
|
98716
|
-
|
|
98717
|
-
|
|
98718
|
-
|
|
98719
|
-
|
|
98720
|
-
|
|
98721
|
-
|
|
98722
|
-
|
|
98723
|
-
|
|
98724
|
-
|
|
98759
|
+
<section class="footer">
|
|
98760
|
+
<section class="footer-actions ${x => (x.footerActionsIsEmpty ? '' : 'has-content')}">
|
|
98761
|
+
<slot
|
|
98762
|
+
name="footer-actions"
|
|
98763
|
+
${slotted({ property: 'slottedFooterActionsElements' })}
|
|
98764
|
+
></slot>
|
|
98765
|
+
</section>
|
|
98766
|
+
<${buttonTag}
|
|
98767
|
+
class="action-button"
|
|
98768
|
+
appearance="block"
|
|
98769
|
+
appearance-variant="${x => (x.processing ? 'primary' : 'accent')}"
|
|
98770
|
+
?disabled=${x => (x.processing ? false : (x.sendDisabled || x.isInputEmpty))}
|
|
98771
|
+
@click=${x => (x.processing ? x.stopButtonClickHandler() : x.sendButtonClickHandler())}
|
|
98772
|
+
tabindex="${x => x.tabIndex}"
|
|
98773
|
+
title=${x => (x.processing ? x.stopButtonLabel : x.sendButtonLabel)}
|
|
98774
|
+
content-hidden
|
|
98775
|
+
>
|
|
98776
|
+
${x => (x.processing ? x.stopButtonLabel : x.sendButtonLabel)}
|
|
98777
|
+
${when(x => x.processing, html `<${iconStopSquareTag} slot="start"></${iconStopSquareTag}>`, html `<${iconPaperPlaneTag} slot="start"></${iconPaperPlaneTag}>`)}
|
|
98778
|
+
</${buttonTag}>
|
|
98779
|
+
</section>
|
|
98725
98780
|
<${iconExclamationMarkTag}
|
|
98726
98781
|
severity="error"
|
|
98727
98782
|
class="error-icon ${x => (x.scrollbarWidth >= 0 ? 'scrollbar-width-calculated' : '')}"
|
|
@@ -98750,8 +98805,18 @@ focus outline in that case.
|
|
|
98750
98805
|
* @internal
|
|
98751
98806
|
*/
|
|
98752
98807
|
this.scrollbarWidth = -1;
|
|
98808
|
+
/** @internal */
|
|
98809
|
+
this.footerActionsIsEmpty = true;
|
|
98810
|
+
/** @internal */
|
|
98811
|
+
this.attachmentsIsEmpty = true;
|
|
98753
98812
|
this.updateScrollbarWidthQueued = false;
|
|
98754
98813
|
}
|
|
98814
|
+
slottedFooterActionsElementsChanged(_prev, next) {
|
|
98815
|
+
this.footerActionsIsEmpty = next === undefined || next.length === 0;
|
|
98816
|
+
}
|
|
98817
|
+
slottedAttachmentsElementsChanged(_prev, next) {
|
|
98818
|
+
this.attachmentsIsEmpty = next === undefined || next.length === 0;
|
|
98819
|
+
}
|
|
98755
98820
|
/**
|
|
98756
98821
|
* @internal
|
|
98757
98822
|
*/
|
|
@@ -98912,6 +98977,18 @@ focus outline in that case.
|
|
|
98912
98977
|
__decorate([
|
|
98913
98978
|
observable
|
|
98914
98979
|
], ChatInput.prototype, "scrollbarWidth", void 0);
|
|
98980
|
+
__decorate([
|
|
98981
|
+
observable
|
|
98982
|
+
], ChatInput.prototype, "footerActionsIsEmpty", void 0);
|
|
98983
|
+
__decorate([
|
|
98984
|
+
observable
|
|
98985
|
+
], ChatInput.prototype, "slottedFooterActionsElements", void 0);
|
|
98986
|
+
__decorate([
|
|
98987
|
+
observable
|
|
98988
|
+
], ChatInput.prototype, "attachmentsIsEmpty", void 0);
|
|
98989
|
+
__decorate([
|
|
98990
|
+
observable
|
|
98991
|
+
], ChatInput.prototype, "slottedAttachmentsElements", void 0);
|
|
98915
98992
|
const sprightChatInput = ChatInput.compose({
|
|
98916
98993
|
baseName: 'chat-input',
|
|
98917
98994
|
template: template$a,
|
|
@@ -99833,21 +99910,21 @@ focus outline in that case.
|
|
|
99833
99910
|
/**
|
|
99834
99911
|
* Base class for dynamic icons. Not intended to be used directly, instead use to register dynamic icons:
|
|
99835
99912
|
* ```
|
|
99836
|
-
* customElements.get('ok-icon-dynamic').registerIconDynamic('ok-icon-dynamic-awesome', '<img data uri or arbitrary url>');
|
|
99913
|
+
* customElements.get('ok-ts-icon-dynamic').registerIconDynamic('ok-ts-icon-dynamic-awesome', '<img data uri or arbitrary url>');
|
|
99837
99914
|
* ```
|
|
99838
99915
|
* After calling successfully, the icon can be used like any other icon:
|
|
99839
99916
|
* ```
|
|
99840
|
-
* <ok-icon-dynamic-awesome></ok-icon-dynamic-awesome>
|
|
99841
|
-
* <nimble-mapping-icon icon="ok-icon-dynamic-awesome"></nimble-mapping-icon>
|
|
99917
|
+
* <ok-ts-icon-dynamic-awesome></ok-ts-icon-dynamic-awesome>
|
|
99918
|
+
* <nimble-mapping-icon icon="ok-ts-icon-dynamic-awesome"></nimble-mapping-icon>
|
|
99842
99919
|
* ```
|
|
99843
99920
|
*/
|
|
99844
|
-
class
|
|
99921
|
+
class TsIconDynamic extends Icon {
|
|
99845
99922
|
constructor(/** @internal */ url) {
|
|
99846
99923
|
super();
|
|
99847
99924
|
this.url = url;
|
|
99848
99925
|
}
|
|
99849
99926
|
static registerIconDynamic(tagName, url) {
|
|
99850
|
-
const tagPrefix = 'ok-icon-dynamic-';
|
|
99927
|
+
const tagPrefix = 'ok-ts-icon-dynamic-';
|
|
99851
99928
|
if (!tagName.startsWith(tagPrefix)) {
|
|
99852
99929
|
throw new Error(`Icon tag name must start with '${tagPrefix}', provided name: ${tagName}`);
|
|
99853
99930
|
}
|
|
@@ -99855,17 +99932,17 @@ focus outline in that case.
|
|
|
99855
99932
|
if (!/^[a-z][a-z]+$/.test(name)) {
|
|
99856
99933
|
throw new Error(`Icon name must be lowercase [a-z] and at least two characters long, provided name: ${name}`);
|
|
99857
99934
|
}
|
|
99858
|
-
const iconClassName = `
|
|
99935
|
+
const iconClassName = `TsIconDynamic${name.charAt(0).toUpperCase() + name.slice(1)}`;
|
|
99859
99936
|
const iconClassContainer = {
|
|
99860
99937
|
// Class name for expression should come object literal assignment, helpful for stack traces, etc.
|
|
99861
|
-
[iconClassName]: class extends
|
|
99938
|
+
[iconClassName]: class extends TsIconDynamic {
|
|
99862
99939
|
constructor() {
|
|
99863
99940
|
super(url);
|
|
99864
99941
|
}
|
|
99865
99942
|
}
|
|
99866
99943
|
};
|
|
99867
99944
|
const iconClass = iconClassContainer[iconClassName];
|
|
99868
|
-
const baseName = `icon-dynamic-${name}`;
|
|
99945
|
+
const baseName = `ts-icon-dynamic-${name}`;
|
|
99869
99946
|
const composedIcon = iconClass.compose({
|
|
99870
99947
|
baseName,
|
|
99871
99948
|
template,
|
|
@@ -99874,12 +99951,12 @@ focus outline in that case.
|
|
|
99874
99951
|
DesignSystem.getOrCreate().withPrefix('ok').register(composedIcon());
|
|
99875
99952
|
}
|
|
99876
99953
|
}
|
|
99877
|
-
const
|
|
99878
|
-
baseName: 'icon-dynamic',
|
|
99954
|
+
const okTsIconDynamic = TsIconDynamic.compose({
|
|
99955
|
+
baseName: 'ts-icon-dynamic',
|
|
99879
99956
|
template: html `<template></template>`,
|
|
99880
99957
|
styles: css `${display('none')}`
|
|
99881
99958
|
});
|
|
99882
|
-
DesignSystem.getOrCreate().withPrefix('ok').register(
|
|
99959
|
+
DesignSystem.getOrCreate().withPrefix('ok').register(okTsIconDynamic());
|
|
99883
99960
|
|
|
99884
99961
|
})();
|
|
99885
99962
|
//# sourceMappingURL=all-components-bundle.js.map
|