@haiilo/catalyst 2.0.3 → 2.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/catalyst/catalyst.esm.js +1 -1
- package/dist/catalyst/catalyst.esm.js.map +1 -1
- package/dist/catalyst/p-50031766.entry.js +2 -0
- package/dist/catalyst/p-50031766.entry.js.map +1 -0
- package/dist/catalyst/p-53a1db22.js +3 -0
- package/dist/catalyst/p-53a1db22.js.map +1 -0
- package/dist/catalyst/p-5bfc70e3.entry.js +2 -0
- package/dist/catalyst/{p-270fd91d.entry.js.map → p-5bfc70e3.entry.js.map} +1 -1
- package/dist/cjs/cat-alert_22.cjs.entry.js +99 -15
- package/dist/cjs/cat-alert_22.cjs.entry.js.map +1 -1
- package/dist/cjs/cat-modal.cjs.entry.js +2 -2
- package/dist/cjs/cat-modal.cjs.entry.js.map +1 -1
- package/dist/cjs/catalyst.cjs.js +2 -2
- package/dist/cjs/{index-b2134f1b.js → index-e540e911.js} +1 -4
- package/dist/cjs/index-e540e911.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/components/cat-button/cat-button.js +50 -4
- package/dist/collection/components/cat-button/cat-button.js.map +1 -1
- package/dist/collection/components/cat-checkbox/cat-checkbox.js +50 -4
- package/dist/collection/components/cat-checkbox/cat-checkbox.js.map +1 -1
- package/dist/collection/components/cat-input/cat-input.js +50 -4
- package/dist/collection/components/cat-input/cat-input.js.map +1 -1
- package/dist/collection/components/cat-radio/cat-radio.js +50 -4
- package/dist/collection/components/cat-radio/cat-radio.js.map +1 -1
- package/dist/collection/components/cat-radio-group/cat-radio-group.js +1 -1
- package/dist/collection/components/cat-radio-group/cat-radio-group.js.map +1 -1
- package/dist/collection/components/cat-tabs/cat-tabs.js +1 -1
- package/dist/collection/components/cat-tabs/cat-tabs.js.map +1 -1
- package/dist/collection/components/cat-textarea/cat-textarea.js +50 -4
- package/dist/collection/components/cat-textarea/cat-textarea.js.map +1 -1
- package/dist/collection/components/cat-toggle/cat-toggle.js +50 -4
- package/dist/collection/components/cat-toggle/cat-toggle.js.map +1 -1
- package/dist/components/cat-button2.js +19 -3
- package/dist/components/cat-button2.js.map +1 -1
- package/dist/components/cat-checkbox2.js +19 -3
- package/dist/components/cat-checkbox2.js.map +1 -1
- package/dist/components/cat-input.js +19 -3
- package/dist/components/cat-input.js.map +1 -1
- package/dist/components/cat-radio-group.js +1 -1
- package/dist/components/cat-radio-group.js.map +1 -1
- package/dist/components/cat-radio.js +19 -3
- package/dist/components/cat-radio.js.map +1 -1
- package/dist/components/cat-tabs.js +1 -1
- package/dist/components/cat-tabs.js.map +1 -1
- package/dist/components/cat-textarea.js +19 -3
- package/dist/components/cat-textarea.js.map +1 -1
- package/dist/components/cat-toggle.js +19 -3
- package/dist/components/cat-toggle.js.map +1 -1
- package/dist/esm/cat-alert_22.entry.js +99 -15
- package/dist/esm/cat-alert_22.entry.js.map +1 -1
- package/dist/esm/cat-modal.entry.js +2 -2
- package/dist/esm/cat-modal.entry.js.map +1 -1
- package/dist/esm/catalyst.js +2 -2
- package/dist/esm/{index-033048ed.js → index-c2a28ebb.js} +2 -4
- package/dist/esm/index-c2a28ebb.js.map +1 -0
- package/dist/esm/loader.js +2 -2
- package/dist/types/components/cat-button/cat-button.d.ts +12 -2
- package/dist/types/components/cat-checkbox/cat-checkbox.d.ts +12 -2
- package/dist/types/components/cat-input/cat-input.d.ts +12 -2
- package/dist/types/components/cat-radio/cat-radio.d.ts +12 -2
- package/dist/types/components/cat-textarea/cat-textarea.d.ts +12 -2
- package/dist/types/components/cat-toggle/cat-toggle.d.ts +12 -2
- package/dist/types/components.d.ts +78 -30
- package/package.json +2 -2
- package/dist/catalyst/p-270fd91d.entry.js +0 -2
- package/dist/catalyst/p-3a489c97.entry.js +0 -2
- package/dist/catalyst/p-3a489c97.entry.js.map +0 -1
- package/dist/catalyst/p-692e49d6.js +0 -3
- package/dist/catalyst/p-692e49d6.js.map +0 -1
- package/dist/cjs/index-b2134f1b.js.map +0 -1
- package/dist/esm/index-033048ed.js.map +0 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-e540e911.js');
|
|
6
6
|
const catIconRegistry = require('./cat-icon-registry-2a54df3d.js');
|
|
7
7
|
const firstTabbable = require('./first-tabbable-7966cf1c.js');
|
|
8
8
|
|
|
@@ -384,14 +384,28 @@ const CatButton = class {
|
|
|
384
384
|
}
|
|
385
385
|
}
|
|
386
386
|
/**
|
|
387
|
-
*
|
|
387
|
+
* Programmatically move focus to the button. Use this method instead of
|
|
388
|
+
* `button.focus()`.
|
|
388
389
|
*
|
|
389
390
|
* @param options An optional object providing options to control aspects of
|
|
390
391
|
* the focusing process.
|
|
391
392
|
*/
|
|
392
|
-
async
|
|
393
|
+
async doFocus(options) {
|
|
393
394
|
this.button.focus(options);
|
|
394
395
|
}
|
|
396
|
+
/**
|
|
397
|
+
* Programmatically remove focus from the button. Use this method instead of
|
|
398
|
+
* `button.blur()`.
|
|
399
|
+
*/
|
|
400
|
+
async doBlur() {
|
|
401
|
+
this.button.blur();
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* Programmatically simulate a click on the button.
|
|
405
|
+
*/
|
|
406
|
+
async doClick() {
|
|
407
|
+
this.button.click();
|
|
408
|
+
}
|
|
395
409
|
render() {
|
|
396
410
|
var _a;
|
|
397
411
|
if (this.url) {
|
|
@@ -550,14 +564,28 @@ const CatCheckbox = class {
|
|
|
550
564
|
}
|
|
551
565
|
}
|
|
552
566
|
/**
|
|
553
|
-
*
|
|
567
|
+
* Programmatically move focus to the checkbox. Use this method instead of
|
|
568
|
+
* `input.focus()`.
|
|
554
569
|
*
|
|
555
570
|
* @param options An optional object providing options to control aspects of
|
|
556
571
|
* the focusing process.
|
|
557
572
|
*/
|
|
558
|
-
async
|
|
573
|
+
async doFocus(options) {
|
|
559
574
|
this.input.focus(options);
|
|
560
575
|
}
|
|
576
|
+
/**
|
|
577
|
+
* Programmatically remove focus from the checkbox. Use this method instead of
|
|
578
|
+
* `input.blur()`.
|
|
579
|
+
*/
|
|
580
|
+
async doBlur() {
|
|
581
|
+
this.input.blur();
|
|
582
|
+
}
|
|
583
|
+
/**
|
|
584
|
+
* Programmatically simulate a click on the checkbox.
|
|
585
|
+
*/
|
|
586
|
+
async doClick() {
|
|
587
|
+
this.input.click();
|
|
588
|
+
}
|
|
561
589
|
render() {
|
|
562
590
|
return (index.h(index.Host, null, index.h("label", { htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft } }, index.h("input", { ref: el => (this.input = el), id: this.id, type: "checkbox", name: this.name, value: this.value !== undefined ? String(this.value) : this.value, checked: this.checked, required: this.required, disabled: this.disabled, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this) }), index.h("span", { class: "box", "aria-hidden": "true", part: "checkbox" }, index.h("svg", { class: "check", viewBox: "0 0 12 10" }, index.h("polyline", { points: "1.5 6 4.5 9 10.5 1" })), index.h("svg", { class: "dash", viewBox: "0 0 12 10" }, index.h("polyline", { points: "1.5 5 10.5 5" }))), index.h("span", { class: "label", part: "label" }, (this.hasSlottedLabel && index.h("slot", { name: "label" })) || this.label)), this.hintSection));
|
|
563
591
|
}
|
|
@@ -1948,14 +1976,28 @@ const CatInput = class {
|
|
|
1948
1976
|
}
|
|
1949
1977
|
}
|
|
1950
1978
|
/**
|
|
1951
|
-
*
|
|
1979
|
+
* Programmatically move focus to the input. Use this method instead of
|
|
1980
|
+
* `input.focus()`.
|
|
1952
1981
|
*
|
|
1953
1982
|
* @param options An optional object providing options to control aspects of
|
|
1954
1983
|
* the focusing process.
|
|
1955
1984
|
*/
|
|
1956
|
-
async
|
|
1985
|
+
async doFocus(options) {
|
|
1957
1986
|
this.input.focus(options);
|
|
1958
1987
|
}
|
|
1988
|
+
/**
|
|
1989
|
+
* Programmatically remove focus from the input. Use this method instead of
|
|
1990
|
+
* `input.blur()`.
|
|
1991
|
+
*/
|
|
1992
|
+
async doBlur() {
|
|
1993
|
+
this.input.blur();
|
|
1994
|
+
}
|
|
1995
|
+
/**
|
|
1996
|
+
* Programmatically simulate a click on the input.
|
|
1997
|
+
*/
|
|
1998
|
+
async doClick() {
|
|
1999
|
+
this.input.click();
|
|
2000
|
+
}
|
|
1959
2001
|
/**
|
|
1960
2002
|
* Clear the input.
|
|
1961
2003
|
*/
|
|
@@ -2129,14 +2171,28 @@ const CatRadio = class {
|
|
|
2129
2171
|
}
|
|
2130
2172
|
}
|
|
2131
2173
|
/**
|
|
2132
|
-
*
|
|
2174
|
+
* Programmatically move focus to the radio button. Use this method instead of
|
|
2175
|
+
* `input.focus()`.
|
|
2133
2176
|
*
|
|
2134
2177
|
* @param options An optional object providing options to control aspects of
|
|
2135
2178
|
* the focusing process.
|
|
2136
2179
|
*/
|
|
2137
|
-
async
|
|
2180
|
+
async doFocus(options) {
|
|
2138
2181
|
this.input.focus(options);
|
|
2139
2182
|
}
|
|
2183
|
+
/**
|
|
2184
|
+
* Programmatically remove focus from the radio button. Use this method
|
|
2185
|
+
* instead of `input.blur()`.
|
|
2186
|
+
*/
|
|
2187
|
+
async doBlur() {
|
|
2188
|
+
this.input.blur();
|
|
2189
|
+
}
|
|
2190
|
+
/**
|
|
2191
|
+
* Programmatically simulate a click on the radio button.
|
|
2192
|
+
*/
|
|
2193
|
+
async doClick() {
|
|
2194
|
+
this.input.click();
|
|
2195
|
+
}
|
|
2140
2196
|
render() {
|
|
2141
2197
|
return (index.h(index.Host, null, index.h("label", { htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft }, role: "radio", "aria-checked": this.checked ? 'true' : 'false' }, index.h("span", { class: "radio" }, index.h("input", { ref: el => (this.input = el), id: this.id, type: "radio", name: this.name, value: this.value, checked: this.checked, required: this.required, disabled: this.disabled, onInput: this.onChange.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this) }), index.h("span", { class: "circle" })), index.h("span", { class: "label", part: "label" }, (this.hasSlottedLabel && index.h("slot", { name: "label" })) || this.label)), this.hintSection));
|
|
2142
2198
|
}
|
|
@@ -2207,7 +2263,7 @@ const CatRadioGroup = class {
|
|
|
2207
2263
|
const activeIdx = this.catRadioGroup.findIndex(catRadio => catRadio === activeElement);
|
|
2208
2264
|
const activeOff = ['ArrowDown', 'ArrowRight'].includes(event.key) ? 1 : -1;
|
|
2209
2265
|
const targetIdx = activeIdx < 0 ? 0 : (activeIdx + activeOff + targetElements.length) % targetElements.length;
|
|
2210
|
-
targetElements[targetIdx].
|
|
2266
|
+
targetElements[targetIdx].doFocus();
|
|
2211
2267
|
(_b = (_a = targetElements[targetIdx].shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('input')) === null || _b === void 0 ? void 0 : _b.click();
|
|
2212
2268
|
this.updateTabIndex();
|
|
2213
2269
|
event.preventDefault();
|
|
@@ -6179,7 +6235,7 @@ const CatTabs = class {
|
|
|
6179
6235
|
const activeIdx = activeElement ? targetElements.indexOf(activeElement) : -1;
|
|
6180
6236
|
const activeOff = ['ArrowDown', 'ArrowRight'].includes(event.key) ? 1 : -1;
|
|
6181
6237
|
const targetIdx = activeIdx < 0 ? 0 : (activeIdx + activeOff + targetElements.length) % targetElements.length;
|
|
6182
|
-
targetElements[targetIdx].
|
|
6238
|
+
targetElements[targetIdx].doFocus();
|
|
6183
6239
|
event.preventDefault();
|
|
6184
6240
|
}
|
|
6185
6241
|
}
|
|
@@ -6262,14 +6318,28 @@ const CatTextarea = class {
|
|
|
6262
6318
|
d(this.textarea);
|
|
6263
6319
|
}
|
|
6264
6320
|
/**
|
|
6265
|
-
*
|
|
6321
|
+
* Programmatically move focus to the textarea. Use this method instead of
|
|
6322
|
+
* `textarea.focus()`.
|
|
6266
6323
|
*
|
|
6267
6324
|
* @param options An optional object providing options to control aspects of
|
|
6268
6325
|
* the focusing process.
|
|
6269
6326
|
*/
|
|
6270
|
-
async
|
|
6327
|
+
async doFocus(options) {
|
|
6271
6328
|
this.textarea.focus(options);
|
|
6272
6329
|
}
|
|
6330
|
+
/**
|
|
6331
|
+
* Programmatically remove focus from the textarea. Use this method instead of
|
|
6332
|
+
* `textarea.blur()`.
|
|
6333
|
+
*/
|
|
6334
|
+
async doBlur() {
|
|
6335
|
+
this.textarea.blur();
|
|
6336
|
+
}
|
|
6337
|
+
/**
|
|
6338
|
+
* Programmatically simulate a click on the textarea.
|
|
6339
|
+
*/
|
|
6340
|
+
async doClick() {
|
|
6341
|
+
this.textarea.click();
|
|
6342
|
+
}
|
|
6273
6343
|
render() {
|
|
6274
6344
|
return (index.h(index.Host, null, (this.hasSlottedLabel || this.label) && (index.h("label", { htmlFor: this.id, class: { hidden: this.labelHidden } }, index.h("span", { part: "label" }, (this.hasSlottedLabel && index.h("slot", { name: "label" })) || this.label, !this.required && (index.h("span", { class: "input-optional", "aria-hidden": "true" }, "(Optional)"))))), index.h("textarea", { ref: el => (this.textarea = el), id: this.id, disabled: this.disabled, maxlength: this.maxLength, minlength: this.minLength, name: this.name, placeholder: this.placeholder, readonly: this.readonly, required: this.required, rows: this.rows, value: this.value, onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this) }), this.hintSection));
|
|
6275
6345
|
}
|
|
@@ -6334,14 +6404,28 @@ const CatToggle = class {
|
|
|
6334
6404
|
}
|
|
6335
6405
|
}
|
|
6336
6406
|
/**
|
|
6337
|
-
*
|
|
6407
|
+
* Programmatically move focus to the toggle. Use this method instead of
|
|
6408
|
+
* `input.focus()`.
|
|
6338
6409
|
*
|
|
6339
6410
|
* @param options An optional object providing options to control aspects of
|
|
6340
6411
|
* the focusing process.
|
|
6341
6412
|
*/
|
|
6342
|
-
async
|
|
6413
|
+
async doFocus(options) {
|
|
6343
6414
|
this.input.focus(options);
|
|
6344
6415
|
}
|
|
6416
|
+
/**
|
|
6417
|
+
* Programmatically remove focus from the toggle. Use this method instead of
|
|
6418
|
+
* `input.blur()`.
|
|
6419
|
+
*/
|
|
6420
|
+
async doBlur() {
|
|
6421
|
+
this.input.blur();
|
|
6422
|
+
}
|
|
6423
|
+
/**
|
|
6424
|
+
* Programmatically simulate a click on the toggle.
|
|
6425
|
+
*/
|
|
6426
|
+
async doClick() {
|
|
6427
|
+
this.input.click();
|
|
6428
|
+
}
|
|
6345
6429
|
render() {
|
|
6346
6430
|
return (index.h(index.Host, null, index.h("label", { htmlFor: this.id, class: { 'is-hidden': this.labelHidden, 'is-disabled': this.disabled, 'label-left': this.labelLeft } }, index.h("input", { ref: el => (this.input = el), id: this.id, type: "checkbox", name: this.name, value: this.value !== undefined ? String(this.value) : this.value, checked: this.checked, required: this.required, disabled: this.disabled, class: "form-check-input", role: "switch", onInput: this.onInput.bind(this), onFocus: this.onFocus.bind(this), onBlur: this.onBlur.bind(this) }), index.h("span", { class: "toggle", part: "toggle" }), index.h("span", { class: "label", part: "label" }, (this.hasSlottedLabel && index.h("slot", { name: "label" })) || this.label)), this.hintSection));
|
|
6347
6431
|
}
|