@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
@@ -1017,7 +1017,7 @@ const Select = class {
1017
1017
  };
1018
1018
  Select.style = icSelectCss;
1019
1019
 
1020
- 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}}";
1020
+ 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}}";
1021
1021
 
1022
1022
  let inputIds = 0;
1023
1023
  const MUTABLE_ATTRIBUTES = [...helpers.IC_INHERITED_ARIA, "title"];
@@ -1061,9 +1061,11 @@ const TextField = class {
1061
1061
  this.minCharactersUnattained =
1062
1062
  this.minCharacters > 0 ? this.numChars < this.minCharacters : false;
1063
1063
  this.icBlur.emit({ value: value });
1064
+ this.isFocussed = false;
1064
1065
  };
1065
1066
  this.onFocus = (ev) => {
1066
1067
  this.icFocus.emit({ value: ev.target.value });
1068
+ this.isFocussed = true;
1067
1069
  };
1068
1070
  this.hasStatus = (status) => status !== "" && !this.disabled;
1069
1071
  this.handleFormReset = () => {
@@ -1104,6 +1106,7 @@ const TextField = class {
1104
1106
  this.maxLengthExceeded = false;
1105
1107
  this.maxValueExceeded = false;
1106
1108
  this.minValueUnattained = false;
1109
+ this.isFocussed = false;
1107
1110
  this.ariaActiveDescendant = undefined;
1108
1111
  this.ariaAutocomplete = undefined;
1109
1112
  this.ariaExpanded = undefined;
@@ -1206,7 +1209,7 @@ const TextField = class {
1206
1209
  (_a = this.inputEl) === null || _a === void 0 ? void 0 : _a.focus();
1207
1210
  }
1208
1211
  render() {
1209
- 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;
1212
+ 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;
1210
1213
  const disabledMode = readonly || disabled;
1211
1214
  const currentStatus = maxLengthExceeded ||
1212
1215
  maxValueExceeded ||
@@ -1241,7 +1244,10 @@ const TextField = class {
1241
1244
  !validationInlineInternal;
1242
1245
  const multiline = rows > 1;
1243
1246
  const hiddenCharCountDescId = maxLength > 0 ? `${inputId}-charcount-desc` : "";
1244
- const describedBy = `${hiddenCharCountDescId} ${helpers.getInputDescribedByText(inputId, helperText !== "", showStatusText)}`.trim();
1247
+ const charsRemaining = maxNumChars - numChars;
1248
+ const hiddenRemainingCharsCountDesc = `${charsRemaining} character${charsRemaining === 1 ? "" : "s"} remaining.`;
1249
+ const remainingCharCountDescId = `${inputId}-remaining-charcount-desc`;
1250
+ const describedBy = `${hiddenCharCountDescId} ${numChars > 0 ? remainingCharCountDescId : ""} ${helpers.getInputDescribedByText(inputId, helperText !== "", showStatusText)}`.trim();
1245
1251
  const disabledText = disabledMode && !readonly;
1246
1252
  const showLeftIcon = !!this.el.querySelector(`[slot="icon"]`) && !disabledText;
1247
1253
  const invalid = `${currentStatus === types.IcInformationStatus.Error}`;
@@ -1268,7 +1274,7 @@ const TextField = class {
1268
1274
  ["maxlengthtext"]: true,
1269
1275
  ["error"]: maxLengthExceeded,
1270
1276
  ["disabled"]: disabledText,
1271
- } }, index.h("span", { "aria-live": "polite", id: `${inputId}-charcount`, class: "charcount" }, numChars, "/", maxNumChars), index.h("span", { hidden: true, id: hiddenCharCountDescId }, "Field can contain a maximum of ", maxNumChars, " characters.")))))))));
1277
+ } }, index.h("span", { class: "charcount" }, numChars, "/", maxNumChars), index.h("span", { class: "remaining-char-count-desc", "aria-live": "polite", hidden: !isFocussed, id: remainingCharCountDescId }, hiddenRemainingCharsCountDesc), index.h("span", { hidden: true, id: hiddenCharCountDescId }, "Field can contain a maximum of ", maxNumChars, " characters.")))))))));
1272
1278
  }
1273
1279
  get el() { return index.getElement(this); }
1274
1280
  static get watchers() { return {