@ukic/canary-web-components 2.0.0-canary.41 → 2.0.0-canary.42

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.
Files changed (38) hide show
  1. package/dist/cjs/core.cjs.js +1 -1
  2. package/dist/cjs/ic-data-table.cjs.entry.js +37 -15
  3. package/dist/cjs/ic-data-table.cjs.entry.js.map +1 -1
  4. package/dist/cjs/ic-pagination_4.cjs.entry.js +10 -4
  5. package/dist/cjs/ic-pagination_4.cjs.entry.js.map +1 -1
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/collection/components/ic-data-table/ic-data-table.js +37 -15
  8. package/dist/collection/components/ic-data-table/ic-data-table.js.map +1 -1
  9. package/dist/collection/components/ic-data-table/ic-data-table.stories.js +8 -1
  10. package/dist/collection/components/ic-data-table/ic-data-table.stories.js.map +1 -1
  11. package/dist/collection/components/ic-data-table/story-data.js +32 -3
  12. package/dist/collection/components/ic-data-table/story-data.js.map +1 -1
  13. package/dist/collection/components/ic-data-table/test/basic/ic-data-table.spec.js +23 -0
  14. package/dist/collection/components/ic-data-table/test/basic/ic-data-table.spec.js.map +1 -1
  15. package/dist/components/ic-data-table.js +37 -15
  16. package/dist/components/ic-data-table.js.map +1 -1
  17. package/dist/components/ic-text-field2.js +11 -4
  18. package/dist/components/ic-text-field2.js.map +1 -1
  19. package/dist/core/core.esm.js +1 -1
  20. package/dist/core/core.esm.js.map +1 -1
  21. package/dist/core/{p-61848e6b.entry.js → p-12f5911d.entry.js} +2 -2
  22. package/dist/core/p-12f5911d.entry.js.map +1 -0
  23. package/dist/core/p-4a89994a.entry.js +2 -0
  24. package/dist/core/p-4a89994a.entry.js.map +1 -0
  25. package/dist/esm/core.js +1 -1
  26. package/dist/esm/ic-data-table.entry.js +37 -15
  27. package/dist/esm/ic-data-table.entry.js.map +1 -1
  28. package/dist/esm/ic-pagination_4.entry.js +10 -4
  29. package/dist/esm/ic-pagination_4.entry.js.map +1 -1
  30. package/dist/esm/loader.js +1 -1
  31. package/dist/types/components/ic-data-table/ic-data-table.d.ts +1 -0
  32. package/dist/types/components/ic-data-table/ic-data-table.stories.d.ts +14 -8
  33. package/dist/types/components/ic-data-table/story-data.d.ts +1 -0
  34. package/hydrate/index.js +48 -19
  35. package/package.json +3 -3
  36. package/dist/core/p-3ebd4703.entry.js +0 -2
  37. package/dist/core/p-3ebd4703.entry.js.map +0 -1
  38. package/dist/core/p-61848e6b.entry.js.map +0 -1
@@ -1013,7 +1013,7 @@ const Select = class {
1013
1013
  };
1014
1014
  Select.style = icSelectCss;
1015
1015
 
1016
- const icTextFieldCss = "/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=\"button\"],[type=\"reset\"],[type=\"submit\"]{-webkit-appearance:button}button::-moz-focus-inner,[type=\"button\"]::-moz-focus-inner,[type=\"reset\"]::-moz-focus-inner,[type=\"submit\"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=\"button\"]:-moz-focusring,[type=\"reset\"]:-moz-focusring,[type=\"submit\"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=\"checkbox\"],[type=\"radio\"]{box-sizing:border-box;padding:0;}[type=\"number\"]::-webkit-inner-spin-button,[type=\"number\"]::-webkit-outer-spin-button{height:auto}[type=\"search\"]{-webkit-appearance:textfield;outline-offset:-2px;}[type=\"search\"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host{display:block;--ic-input-label-helpertext-padding:var(--ic-space-xxs)}:host(.fullwidth){width:100%}::-moz-placeholder{color:var(--ic-color-tertiary-text);opacity:1}::placeholder{color:var(--ic-color-tertiary-text);opacity:1}input,textarea{border:0;border-radius:var(--ic-border-radius);background-color:var(--ic-architectural-white);line-height:1.5rem;letter-spacing:0.005rem;width:100%;padding-right:var(--ic-space-xs);padding-left:var(--ic-space-xs)}textarea{min-height:var(--ic-space-lg);resize:vertical;padding-top:0.375rem}input:focus,textarea:focus{border:0;outline:0}input:disabled,textarea:disabled{color:var(--ic-architectural-200)}input.readonly,textarea.readonly{color:var(--ic-color-primary-text)}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=\"number\"]{-moz-appearance:textfield}textarea.no-resize{resize:none}.maxlengthtext{color:var(--ic-color-secondary-text);padding-right:var(--ic-space-xxxs)}.no-left-pad{padding-left:0}::slotted([slot=\"icon\"]){fill:var(--ic-color-tertiary-text)}.has-value ::slotted([slot=\"icon\"]){fill:var(--ic-color-primary-text)}.charcount{margin-right:calc(-1 * var(--ic-space-xxxs))}input[type=\"search\"]::-webkit-search-cancel-button,input[type=\"search\"]::-webkit-search-decoration,input[type=\"search\"]::-webkit-search-results-button,input[type=\"search\"]::-webkit-search-results-decoration{display:none}input[type=\"search\"].truncate-value{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}@media (forced-colors: active){input.readonly,textarea.readonly{color:canvastext}.has-value ::slotted([slot=\"icon\"]){fill:currentcolor}}";
1016
+ const icTextFieldCss = "/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%;}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible;}pre{font-family:monospace, monospace;font-size:1em;}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace, monospace;font-size:1em;}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0;}button,input{overflow:visible}button,select{text-transform:none}button,[type=\"button\"],[type=\"reset\"],[type=\"submit\"]{-webkit-appearance:button}button::-moz-focus-inner,[type=\"button\"]::-moz-focus-inner,[type=\"reset\"]::-moz-focus-inner,[type=\"submit\"]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=\"button\"]:-moz-focusring,[type=\"reset\"]:-moz-focusring,[type=\"submit\"]:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal;}progress{vertical-align:baseline}textarea{overflow:auto}[type=\"checkbox\"],[type=\"radio\"]{box-sizing:border-box;padding:0;}[type=\"number\"]::-webkit-inner-spin-button,[type=\"number\"]::-webkit-outer-spin-button{height:auto}[type=\"search\"]{-webkit-appearance:textfield;outline-offset:-2px;}[type=\"search\"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit;}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font-style:inherit;vertical-align:baseline}:host{display:block;--ic-input-label-helpertext-padding:var(--ic-space-xxs)}:host(.fullwidth){width:100%}::-moz-placeholder{color:var(--ic-color-tertiary-text);opacity:1}::placeholder{color:var(--ic-color-tertiary-text);opacity:1}input,textarea{border:0;border-radius:var(--ic-border-radius);background-color:var(--ic-architectural-white);line-height:1.5rem;letter-spacing:0.005rem;width:100%;padding-right:var(--ic-space-xs);padding-left:var(--ic-space-xs)}textarea{min-height:var(--ic-space-lg);resize:vertical;padding-top:0.375rem}input:focus,textarea:focus{border:0;outline:0}input:disabled,textarea:disabled{color:var(--ic-architectural-200)}input.readonly,textarea.readonly{color:var(--ic-color-primary-text)}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}input[type=\"number\"]{-moz-appearance:textfield}textarea.no-resize{resize:none}.maxlengthtext{color:var(--ic-color-secondary-text);padding-right:var(--ic-space-xxxs)}.no-left-pad{padding-left:0}::slotted([slot=\"icon\"]){fill:var(--ic-color-tertiary-text)}.has-value ::slotted([slot=\"icon\"]){fill:var(--ic-color-primary-text)}.charcount{margin-right:calc(-1 * var(--ic-space-xxxs))}.remaining-char-count-desc{position:absolute;left:-9999px}input[type=\"search\"]::-webkit-search-cancel-button,input[type=\"search\"]::-webkit-search-decoration,input[type=\"search\"]::-webkit-search-results-button,input[type=\"search\"]::-webkit-search-results-decoration{display:none}input[type=\"search\"].truncate-value{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}@media (forced-colors: active){input.readonly,textarea.readonly{color:canvastext}.has-value ::slotted([slot=\"icon\"]){fill:currentcolor}}";
1017
1017
 
1018
1018
  let inputIds = 0;
1019
1019
  const MUTABLE_ATTRIBUTES = [...IC_INHERITED_ARIA, "title"];
@@ -1057,9 +1057,11 @@ const TextField = class {
1057
1057
  this.minCharactersUnattained =
1058
1058
  this.minCharacters > 0 ? this.numChars < this.minCharacters : false;
1059
1059
  this.icBlur.emit({ value: value });
1060
+ this.isFocussed = false;
1060
1061
  };
1061
1062
  this.onFocus = (ev) => {
1062
1063
  this.icFocus.emit({ value: ev.target.value });
1064
+ this.isFocussed = true;
1063
1065
  };
1064
1066
  this.hasStatus = (status) => status !== "" && !this.disabled;
1065
1067
  this.handleFormReset = () => {
@@ -1100,6 +1102,7 @@ const TextField = class {
1100
1102
  this.maxLengthExceeded = false;
1101
1103
  this.maxValueExceeded = false;
1102
1104
  this.minValueUnattained = false;
1105
+ this.isFocussed = false;
1103
1106
  this.ariaActiveDescendant = undefined;
1104
1107
  this.ariaAutocomplete = undefined;
1105
1108
  this.ariaExpanded = undefined;
@@ -1202,7 +1205,7 @@ const TextField = class {
1202
1205
  (_a = this.inputEl) === null || _a === void 0 ? void 0 : _a.focus();
1203
1206
  }
1204
1207
  render() {
1205
- const { inputId, name, label, required, size, small, placeholder, helperText, rows, resize, disabled, value, min, max, maxLength, numChars, readonly, maxLengthExceeded, maxCharacters, maxCharactersError, maxCharactersReached, minCharacters, minCharactersUnattained, minValueUnattained, maxValueExceeded, validationStatus, validationText, validationInline, validationInlineInternal, spellcheck, inputmode, fullWidth, truncateValue, hiddenInput, showValidation, } = this;
1208
+ const { inputId, name, label, required, size, small, placeholder, helperText, rows, resize, disabled, value, min, max, maxLength, numChars, readonly, maxLengthExceeded, maxCharacters, maxCharactersError, maxCharactersReached, minCharacters, minCharactersUnattained, minValueUnattained, maxValueExceeded, validationStatus, validationText, validationInline, validationInlineInternal, spellcheck, inputmode, fullWidth, truncateValue, hiddenInput, showValidation, isFocussed, } = this;
1206
1209
  const disabledMode = readonly || disabled;
1207
1210
  const currentStatus = maxLengthExceeded ||
1208
1211
  maxValueExceeded ||
@@ -1237,7 +1240,10 @@ const TextField = class {
1237
1240
  !validationInlineInternal;
1238
1241
  const multiline = rows > 1;
1239
1242
  const hiddenCharCountDescId = maxLength > 0 ? `${inputId}-charcount-desc` : "";
1240
- const describedBy = `${hiddenCharCountDescId} ${getInputDescribedByText(inputId, helperText !== "", showStatusText)}`.trim();
1243
+ const charsRemaining = maxNumChars - numChars;
1244
+ const hiddenRemainingCharsCountDesc = `${charsRemaining} character${charsRemaining === 1 ? "" : "s"} remaining.`;
1245
+ const remainingCharCountDescId = `${inputId}-remaining-charcount-desc`;
1246
+ const describedBy = `${hiddenCharCountDescId} ${numChars > 0 ? remainingCharCountDescId : ""} ${getInputDescribedByText(inputId, helperText !== "", showStatusText)}`.trim();
1241
1247
  const disabledText = disabledMode && !readonly;
1242
1248
  const showLeftIcon = !!this.el.querySelector(`[slot="icon"]`) && !disabledText;
1243
1249
  const invalid = `${currentStatus === IcInformationStatus.Error}`;
@@ -1264,7 +1270,7 @@ const TextField = class {
1264
1270
  ["maxlengthtext"]: true,
1265
1271
  ["error"]: maxLengthExceeded,
1266
1272
  ["disabled"]: disabledText,
1267
- } }, h("span", { "aria-live": "polite", id: `${inputId}-charcount`, class: "charcount" }, numChars, "/", maxNumChars), h("span", { hidden: true, id: hiddenCharCountDescId }, "Field can contain a maximum of ", maxNumChars, " characters.")))))))));
1273
+ } }, h("span", { class: "charcount" }, numChars, "/", maxNumChars), h("span", { class: "remaining-char-count-desc", "aria-live": "polite", hidden: !isFocussed, id: remainingCharCountDescId }, hiddenRemainingCharsCountDesc), h("span", { hidden: true, id: hiddenCharCountDescId }, "Field can contain a maximum of ", maxNumChars, " characters.")))))))));
1268
1274
  }
1269
1275
  get el() { return getElement(this); }
1270
1276
  static get watchers() { return {