@kodaris/krubble-components 1.0.12 → 1.0.13
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/custom-elements.json +396 -410
- package/dist/form/index.d.ts +2 -2
- package/dist/form/index.d.ts.map +1 -1
- package/dist/form/index.js +2 -2
- package/dist/form/index.js.map +1 -1
- package/dist/form/{select/select-option.d.ts → select-field/select-field-option.d.ts} +5 -5
- package/dist/form/select-field/select-field-option.d.ts.map +1 -0
- package/dist/form/{select/select-option.js → select-field/select-field-option.js} +11 -11
- package/dist/form/select-field/select-field-option.js.map +1 -0
- package/dist/form/{select/select.d.ts → select-field/select-field.d.ts} +5 -5
- package/dist/form/select-field/select-field.d.ts.map +1 -0
- package/dist/form/{select/select.js → select-field/select-field.js} +32 -32
- package/dist/form/select-field/select-field.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/krubble.bundled.js +53 -63
- package/dist/krubble.bundled.js.map +1 -1
- package/dist/krubble.bundled.min.js +12 -12
- package/dist/krubble.bundled.min.js.map +1 -1
- package/dist/krubble.umd.js +52 -62
- package/dist/krubble.umd.js.map +1 -1
- package/dist/krubble.umd.min.js +64 -64
- package/dist/krubble.umd.min.js.map +1 -1
- package/dist/table/table.d.ts +1 -3
- package/dist/table/table.d.ts.map +1 -1
- package/dist/table/table.js +13 -23
- package/dist/table/table.js.map +1 -1
- package/package.json +1 -1
- package/dist/form/select/select-option.d.ts.map +0 -1
- package/dist/form/select/select-option.js.map +0 -1
- package/dist/form/select/select.d.ts.map +0 -1
- package/dist/form/select/select.js.map +0 -1
package/dist/krubble.umd.js
CHANGED
|
@@ -2236,7 +2236,6 @@
|
|
|
2236
2236
|
this._canScrollHorizontal = false;
|
|
2237
2237
|
this._columnPickerOpen = false;
|
|
2238
2238
|
this._displayedColumns = [];
|
|
2239
|
-
this._widthsLocked = false;
|
|
2240
2239
|
this._resizing = null;
|
|
2241
2240
|
this._resizeObserver = null;
|
|
2242
2241
|
this._searchPositionLocked = false;
|
|
@@ -2300,8 +2299,6 @@
|
|
|
2300
2299
|
})
|
|
2301
2300
|
};
|
|
2302
2301
|
this._displayedColumns = this._def.displayedColumns || this._def.columns.map(c => c.id);
|
|
2303
|
-
this._widthsLocked = false;
|
|
2304
|
-
this.classList.remove('kr-table--widths-locked');
|
|
2305
2302
|
this._fetch();
|
|
2306
2303
|
this._initRefresh();
|
|
2307
2304
|
}
|
|
@@ -2390,8 +2387,6 @@
|
|
|
2390
2387
|
}
|
|
2391
2388
|
this._dataState = 'success';
|
|
2392
2389
|
this._updateSearchPosition();
|
|
2393
|
-
if (!this._widthsLocked)
|
|
2394
|
-
this._lockColumnWidths();
|
|
2395
2390
|
})
|
|
2396
2391
|
.catch(err => {
|
|
2397
2392
|
this._dataState = 'error';
|
|
@@ -2420,15 +2415,20 @@
|
|
|
2420
2415
|
this._page = 1;
|
|
2421
2416
|
this._fetch();
|
|
2422
2417
|
}
|
|
2423
|
-
|
|
2424
|
-
this.getDisplayedColumns()
|
|
2425
|
-
|
|
2426
|
-
|
|
2418
|
+
_getGridTemplateColumns() {
|
|
2419
|
+
const cols = this.getDisplayedColumns();
|
|
2420
|
+
return cols.map((col) => {
|
|
2421
|
+
// If column has explicit width, use it
|
|
2422
|
+
if (col.width) {
|
|
2423
|
+
return col.width;
|
|
2427
2424
|
}
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2425
|
+
// Actions columns: fit content without minimum
|
|
2426
|
+
if (col.type === 'actions') {
|
|
2427
|
+
return 'max-content';
|
|
2428
|
+
}
|
|
2429
|
+
// No width specified - use content-based sizing with minimum
|
|
2430
|
+
return 'minmax(80px, auto)';
|
|
2431
|
+
}).join(' ');
|
|
2432
2432
|
}
|
|
2433
2433
|
/**
|
|
2434
2434
|
* Updates search position to be centered with equal gaps from title and tools.
|
|
@@ -2759,16 +2759,6 @@
|
|
|
2759
2759
|
}
|
|
2760
2760
|
return A;
|
|
2761
2761
|
}
|
|
2762
|
-
_getGridTemplateColumns() {
|
|
2763
|
-
const cols = this.getDisplayedColumns();
|
|
2764
|
-
const lastNonStickyIndex = cols.map((c, i) => c.sticky ? -1 : i).filter(i => i >= 0).pop();
|
|
2765
|
-
return cols.map((col, i) => {
|
|
2766
|
-
if (i === lastNonStickyIndex && this._widthsLocked) {
|
|
2767
|
-
return `minmax(${col.width || 'auto'}, 1fr)`;
|
|
2768
|
-
}
|
|
2769
|
-
return col.width || 'auto';
|
|
2770
|
-
}).join(' ');
|
|
2771
|
-
}
|
|
2772
2762
|
/** Renders the scrollable data grid with column headers and rows. */
|
|
2773
2763
|
_renderTable() {
|
|
2774
2764
|
return b `
|
|
@@ -3712,10 +3702,10 @@
|
|
|
3712
3702
|
* Uses ElementInternals for form association, allowing the component
|
|
3713
3703
|
* to participate in form submission, validation, and reset.
|
|
3714
3704
|
*
|
|
3715
|
-
* @element kr-select
|
|
3716
|
-
* @slot - The kr-select-option elements
|
|
3705
|
+
* @element kr-select-field
|
|
3706
|
+
* @slot - The kr-select-field-option elements
|
|
3717
3707
|
*/
|
|
3718
|
-
exports.
|
|
3708
|
+
exports.KRSelectField = class KRSelectField extends i$2 {
|
|
3719
3709
|
constructor() {
|
|
3720
3710
|
super();
|
|
3721
3711
|
/**
|
|
@@ -3765,7 +3755,7 @@
|
|
|
3765
3755
|
this._handleKeyDown = (e) => {
|
|
3766
3756
|
if (!this._isOpen)
|
|
3767
3757
|
return;
|
|
3768
|
-
const options = Array.from(this.querySelectorAll('kr-select-option'));
|
|
3758
|
+
const options = Array.from(this.querySelectorAll('kr-select-field-option'));
|
|
3769
3759
|
switch (e.key) {
|
|
3770
3760
|
case 'Escape':
|
|
3771
3761
|
this._close();
|
|
@@ -3857,7 +3847,7 @@
|
|
|
3857
3847
|
}
|
|
3858
3848
|
else {
|
|
3859
3849
|
this._isOpen = true;
|
|
3860
|
-
const options = Array.from(this.querySelectorAll('kr-select-option'));
|
|
3850
|
+
const options = Array.from(this.querySelectorAll('kr-select-field-option'));
|
|
3861
3851
|
this._highlightedIndex = options.findIndex(o => o.value === this.value);
|
|
3862
3852
|
}
|
|
3863
3853
|
}
|
|
@@ -3888,7 +3878,7 @@
|
|
|
3888
3878
|
}
|
|
3889
3879
|
}
|
|
3890
3880
|
render() {
|
|
3891
|
-
const options = Array.from(this.querySelectorAll('kr-select-option'));
|
|
3881
|
+
const options = Array.from(this.querySelectorAll('kr-select-field-option'));
|
|
3892
3882
|
const selectedLabel = options.find(o => o.value === this.value)?.label;
|
|
3893
3883
|
return b `
|
|
3894
3884
|
<div class="wrapper">
|
|
@@ -3986,7 +3976,7 @@
|
|
|
3986
3976
|
this._triggerElement?.blur();
|
|
3987
3977
|
}
|
|
3988
3978
|
};
|
|
3989
|
-
exports.
|
|
3979
|
+
exports.KRSelectField.styles = i$5 `
|
|
3990
3980
|
:host {
|
|
3991
3981
|
display: block;
|
|
3992
3982
|
font-family: inherit;
|
|
@@ -4108,32 +4098,32 @@
|
|
|
4108
4098
|
gap: 0.5rem;
|
|
4109
4099
|
padding: 0.5rem 0.75rem;
|
|
4110
4100
|
font-size: 14px;
|
|
4111
|
-
color: var(--kr-select-option-color, #111827);
|
|
4101
|
+
color: var(--kr-select-field-option-color, #111827);
|
|
4112
4102
|
cursor: pointer;
|
|
4113
4103
|
border-radius: 4px;
|
|
4114
4104
|
transition: background-color 0.15s;
|
|
4115
4105
|
}
|
|
4116
4106
|
|
|
4117
4107
|
.select-option:hover:not(.select-option--disabled) {
|
|
4118
|
-
background-color: var(--kr-select-option-hover-bg, #f3f4f6);
|
|
4108
|
+
background-color: var(--kr-select-field-option-hover-bg, #f3f4f6);
|
|
4119
4109
|
}
|
|
4120
4110
|
|
|
4121
4111
|
.select-option--selected {
|
|
4122
|
-
background-color: var(--kr-select-option-selected-bg, #eff6ff);
|
|
4123
|
-
color: var(--kr-select-option-selected-color, #1d4ed8);
|
|
4112
|
+
background-color: var(--kr-select-field-option-selected-bg, #eff6ff);
|
|
4113
|
+
color: var(--kr-select-field-option-selected-color, #1d4ed8);
|
|
4124
4114
|
}
|
|
4125
4115
|
|
|
4126
4116
|
.select-option--selected:hover {
|
|
4127
|
-
background-color: var(--kr-select-option-selected-hover-bg, #dbeafe);
|
|
4117
|
+
background-color: var(--kr-select-field-option-selected-hover-bg, #dbeafe);
|
|
4128
4118
|
}
|
|
4129
4119
|
|
|
4130
4120
|
.select-option--disabled {
|
|
4131
|
-
color: var(--kr-select-option-disabled-color, #9ca3af);
|
|
4121
|
+
color: var(--kr-select-field-option-disabled-color, #9ca3af);
|
|
4132
4122
|
cursor: not-allowed;
|
|
4133
4123
|
}
|
|
4134
4124
|
|
|
4135
4125
|
.select-option--highlighted {
|
|
4136
|
-
background-color: var(--kr-select-option-hover-bg, #f3f4f6);
|
|
4126
|
+
background-color: var(--kr-select-field-option-hover-bg, #f3f4f6);
|
|
4137
4127
|
}
|
|
4138
4128
|
|
|
4139
4129
|
.select-empty {
|
|
@@ -4174,46 +4164,46 @@
|
|
|
4174
4164
|
}
|
|
4175
4165
|
`;
|
|
4176
4166
|
// Enable form association
|
|
4177
|
-
exports.
|
|
4167
|
+
exports.KRSelectField.formAssociated = true;
|
|
4178
4168
|
__decorate$1([
|
|
4179
4169
|
n$1({ type: String })
|
|
4180
|
-
], exports.
|
|
4170
|
+
], exports.KRSelectField.prototype, "label", void 0);
|
|
4181
4171
|
__decorate$1([
|
|
4182
4172
|
n$1({ type: String })
|
|
4183
|
-
], exports.
|
|
4173
|
+
], exports.KRSelectField.prototype, "name", void 0);
|
|
4184
4174
|
__decorate$1([
|
|
4185
4175
|
n$1({ type: String })
|
|
4186
|
-
], exports.
|
|
4176
|
+
], exports.KRSelectField.prototype, "value", void 0);
|
|
4187
4177
|
__decorate$1([
|
|
4188
4178
|
n$1({ type: String })
|
|
4189
|
-
], exports.
|
|
4179
|
+
], exports.KRSelectField.prototype, "placeholder", void 0);
|
|
4190
4180
|
__decorate$1([
|
|
4191
4181
|
n$1({ type: Boolean })
|
|
4192
|
-
], exports.
|
|
4182
|
+
], exports.KRSelectField.prototype, "disabled", void 0);
|
|
4193
4183
|
__decorate$1([
|
|
4194
4184
|
n$1({ type: Boolean })
|
|
4195
|
-
], exports.
|
|
4185
|
+
], exports.KRSelectField.prototype, "required", void 0);
|
|
4196
4186
|
__decorate$1([
|
|
4197
4187
|
n$1({ type: Boolean })
|
|
4198
|
-
], exports.
|
|
4188
|
+
], exports.KRSelectField.prototype, "readonly", void 0);
|
|
4199
4189
|
__decorate$1([
|
|
4200
4190
|
n$1({ type: String })
|
|
4201
|
-
], exports.
|
|
4191
|
+
], exports.KRSelectField.prototype, "hint", void 0);
|
|
4202
4192
|
__decorate$1([
|
|
4203
4193
|
r$1()
|
|
4204
|
-
], exports.
|
|
4194
|
+
], exports.KRSelectField.prototype, "_isOpen", void 0);
|
|
4205
4195
|
__decorate$1([
|
|
4206
4196
|
r$1()
|
|
4207
|
-
], exports.
|
|
4197
|
+
], exports.KRSelectField.prototype, "_highlightedIndex", void 0);
|
|
4208
4198
|
__decorate$1([
|
|
4209
4199
|
r$1()
|
|
4210
|
-
], exports.
|
|
4200
|
+
], exports.KRSelectField.prototype, "_touched", void 0);
|
|
4211
4201
|
__decorate$1([
|
|
4212
4202
|
e$3('.select-trigger')
|
|
4213
|
-
], exports.
|
|
4214
|
-
exports.
|
|
4215
|
-
t$1('kr-select')
|
|
4216
|
-
], exports.
|
|
4203
|
+
], exports.KRSelectField.prototype, "_triggerElement", void 0);
|
|
4204
|
+
exports.KRSelectField = __decorate$1([
|
|
4205
|
+
t$1('kr-select-field')
|
|
4206
|
+
], exports.KRSelectField);
|
|
4217
4207
|
|
|
4218
4208
|
var __decorate = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
4219
4209
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -4222,12 +4212,12 @@
|
|
|
4222
4212
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
4223
4213
|
};
|
|
4224
4214
|
/**
|
|
4225
|
-
* An option for the kr-select component.
|
|
4215
|
+
* An option for the kr-select-field component.
|
|
4226
4216
|
*
|
|
4227
|
-
* @element kr-select-option
|
|
4217
|
+
* @element kr-select-field-option
|
|
4228
4218
|
* @slot - The option label content
|
|
4229
4219
|
*/
|
|
4230
|
-
exports.
|
|
4220
|
+
exports.KRSelectFieldOption = class KRSelectFieldOption extends i$2 {
|
|
4231
4221
|
constructor() {
|
|
4232
4222
|
super(...arguments);
|
|
4233
4223
|
/**
|
|
@@ -4247,20 +4237,20 @@
|
|
|
4247
4237
|
return b `<slot></slot>`;
|
|
4248
4238
|
}
|
|
4249
4239
|
};
|
|
4250
|
-
exports.
|
|
4240
|
+
exports.KRSelectFieldOption.styles = i$5 `
|
|
4251
4241
|
:host {
|
|
4252
4242
|
display: none;
|
|
4253
4243
|
}
|
|
4254
4244
|
`;
|
|
4255
4245
|
__decorate([
|
|
4256
4246
|
n$1({ type: String })
|
|
4257
|
-
], exports.
|
|
4247
|
+
], exports.KRSelectFieldOption.prototype, "value", void 0);
|
|
4258
4248
|
__decorate([
|
|
4259
4249
|
n$1({ type: Boolean })
|
|
4260
|
-
], exports.
|
|
4261
|
-
exports.
|
|
4262
|
-
t$1('kr-select-option')
|
|
4263
|
-
], exports.
|
|
4250
|
+
], exports.KRSelectFieldOption.prototype, "disabled", void 0);
|
|
4251
|
+
exports.KRSelectFieldOption = __decorate([
|
|
4252
|
+
t$1('kr-select-field-option')
|
|
4253
|
+
], exports.KRSelectFieldOption);
|
|
4264
4254
|
|
|
4265
4255
|
exports.DialogRef = DialogRef;
|
|
4266
4256
|
exports.krBaseCSS = krBaseCSS;
|