@iankibetsh/shframework 5.8.6 → 5.8.8
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/README.md +5 -2
- package/dist/dist/library.mjs.css +16 -16
- package/dist/library.js +20 -7
- package/dist/library.mjs +20 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -23,8 +23,8 @@ A robust table component that handles server-side pagination, searching, and cus
|
|
|
23
23
|
- **Named Slots for Custom Formatting**: Use named slots for columns to provide custom formatting (e.g., `<template #age="{ row }">`).
|
|
24
24
|
- **Multi-Action Support**: Enable row selection and collective operations with a floating action bar.
|
|
25
25
|
- **Caching & Background Loading**: Uses IndexedDB to cache data. Shows cached data immediately while fetching fresh data in the background (enabled via `enableTableCache` config or `:cache="true"` prop).
|
|
26
|
-
- **
|
|
27
|
-
- **
|
|
26
|
+
- **User-Specific Caching**: Automatically prefixes cache keys with user identifiers (e.g., `id`, `email`) to ensure data isolation between users. Configure via `cacheUserFields`.
|
|
27
|
+
- **Metadata Tracking**: Tracks cache source URLs and timestamps in a dedicated `cache_metadata` store for better auditability.
|
|
28
28
|
- **Links & Actions**: Easily define column links and action buttons.
|
|
29
29
|
|
|
30
30
|
```html
|
|
@@ -67,6 +67,8 @@ The flagship component for generating complex forms from simple configurations.
|
|
|
67
67
|
- **Multi-Step Support**: Break long forms into logical steps with progress indicators.
|
|
68
68
|
- **Validation**: Seamlessly handles and displays Laravel validation errors (422).
|
|
69
69
|
- **GraphQL Support**: Integrate with GraphQL mutations via the `gqlMutation` prop.
|
|
70
|
+
- **Checkbox Support**: Easily handle boolean or multiple-choice fields with `type: 'checkbox'`.
|
|
71
|
+
- **Modern Reactivity**: Built using Vue 3.4's `defineModel` for clean, conflict-free two-way binding.
|
|
70
72
|
|
|
71
73
|
```html
|
|
72
74
|
<sh-auto-form
|
|
@@ -114,6 +116,7 @@ A collection of common UI and data utilities.
|
|
|
114
116
|
- `shRepo.runPlainRequest(url, message)`: Post request with a confirmation prompt.
|
|
115
117
|
- `shRepo.runSilentRequest(url)`: Direct post request without prompt.
|
|
116
118
|
- `shRepo.showToast(message, type)`: Displays a sweetalert2 toast.
|
|
119
|
+
- `shRepo.flushCache()`: Clears all IndexedDB cache data.
|
|
117
120
|
- `shRepo.swalSuccess(message)` / `shRepo.swalError(message)`: Standard success/error popups.
|
|
118
121
|
|
|
119
122
|
### shUser (State Management)
|
|
@@ -336,22 +336,6 @@
|
|
|
336
336
|
cursor: pointer;
|
|
337
337
|
}
|
|
338
338
|
|
|
339
|
-
.sh-selected-item{
|
|
340
|
-
line-height: unset!important;
|
|
341
|
-
}
|
|
342
|
-
.sh-suggestion-input{
|
|
343
|
-
padding: 0.375rem 0.75rem;
|
|
344
|
-
}
|
|
345
|
-
.sh-suggest{
|
|
346
|
-
margin-bottom: 1rem;
|
|
347
|
-
padding: 0rem 0rem;
|
|
348
|
-
}
|
|
349
|
-
.sh-suggest-control::after{
|
|
350
|
-
margin-top: auto;
|
|
351
|
-
margin-bottom: auto;
|
|
352
|
-
margin-right: 0.255em;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
339
|
.permissions-main {
|
|
356
340
|
background: #edeff2;
|
|
357
341
|
}
|
|
@@ -384,6 +368,22 @@
|
|
|
384
368
|
flex-grow: 1;
|
|
385
369
|
}
|
|
386
370
|
|
|
371
|
+
.sh-selected-item{
|
|
372
|
+
line-height: unset!important;
|
|
373
|
+
}
|
|
374
|
+
.sh-suggestion-input{
|
|
375
|
+
padding: 0.375rem 0.75rem;
|
|
376
|
+
}
|
|
377
|
+
.sh-suggest{
|
|
378
|
+
margin-bottom: 1rem;
|
|
379
|
+
padding: 0rem 0rem;
|
|
380
|
+
}
|
|
381
|
+
.sh-suggest-control::after{
|
|
382
|
+
margin-top: auto;
|
|
383
|
+
margin-bottom: auto;
|
|
384
|
+
margin-right: 0.255em;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
387
|
.callout{
|
|
388
388
|
--bs-link-color-rgb: 110,168,254;
|
|
389
389
|
--bs-code-color: #e685b5;
|
package/dist/library.js
CHANGED
|
@@ -3404,8 +3404,13 @@ var script$u = {
|
|
|
3404
3404
|
emits: /*@__PURE__*/vue.mergeModels(['clearValidationErrors'], ["update:modelValue"]),
|
|
3405
3405
|
setup(__props, { emit: __emit }) {
|
|
3406
3406
|
|
|
3407
|
-
vue.useModel(__props, "modelValue");
|
|
3407
|
+
const model = vue.useModel(__props, "modelValue");
|
|
3408
3408
|
const props = __props;
|
|
3409
|
+
const emit = __emit;
|
|
3410
|
+
|
|
3411
|
+
const onInput = () => {
|
|
3412
|
+
emit('clearValidationErrors');
|
|
3413
|
+
};
|
|
3409
3414
|
|
|
3410
3415
|
const selectOptions = vue.ref(null);
|
|
3411
3416
|
|
|
@@ -3434,7 +3439,8 @@ vue.onMounted(()=>{
|
|
|
3434
3439
|
|
|
3435
3440
|
return (_ctx, _cache) => {
|
|
3436
3441
|
return vue.withDirectives((vue.openBlock(), vue.createElementBlock("select", {
|
|
3437
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((
|
|
3442
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((model).value = $event)),
|
|
3443
|
+
onChange: onInput
|
|
3438
3444
|
}, [
|
|
3439
3445
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(selectOptions.value, (option) => {
|
|
3440
3446
|
return (vue.openBlock(), vue.createElementBlock("option", {
|
|
@@ -3442,8 +3448,8 @@ return (_ctx, _cache) => {
|
|
|
3442
3448
|
value: option.id
|
|
3443
3449
|
}, vue.toDisplayString(option.name), 9 /* TEXT, PROPS */, _hoisted_1$n))
|
|
3444
3450
|
}), 128 /* KEYED_FRAGMENT */))
|
|
3445
|
-
],
|
|
3446
|
-
[vue.vModelSelect,
|
|
3451
|
+
], 544 /* NEED_HYDRATION, NEED_PATCH */)), [
|
|
3452
|
+
[vue.vModelSelect, model.value]
|
|
3447
3453
|
])
|
|
3448
3454
|
}
|
|
3449
3455
|
}
|
|
@@ -3739,6 +3745,10 @@ var script$q = {
|
|
|
3739
3745
|
steps: {
|
|
3740
3746
|
type: Array,
|
|
3741
3747
|
required: false
|
|
3748
|
+
},
|
|
3749
|
+
hideButton: {
|
|
3750
|
+
type: Boolean,
|
|
3751
|
+
default: false
|
|
3742
3752
|
}
|
|
3743
3753
|
},
|
|
3744
3754
|
emits: ['success', 'preSubmit', 'fieldChanged', 'formSubmitted', 'formError'],
|
|
@@ -4302,7 +4312,7 @@ return (_ctx, _cache) => {
|
|
|
4302
4312
|
], 10 /* CLASS, PROPS */, _hoisted_21$1)
|
|
4303
4313
|
], 2 /* CLASS */))
|
|
4304
4314
|
: vue.createCommentVNode("v-if", true),
|
|
4305
|
-
(isLastStep.value)
|
|
4315
|
+
(isLastStep.value && !__props.hideButton)
|
|
4306
4316
|
? (vue.openBlock(), vue.createElementBlock("div", {
|
|
4307
4317
|
key: 2,
|
|
4308
4318
|
class: vue.normalizeClass(getElementClass('formGroup') + ' ms-auto')
|
|
@@ -4543,6 +4553,7 @@ var script$n = {
|
|
|
4543
4553
|
'files',
|
|
4544
4554
|
'phones',
|
|
4545
4555
|
'numbers',
|
|
4556
|
+
'hideButton',
|
|
4546
4557
|
'customComponent','modalTitle','class','successMessage', 'modalId'],
|
|
4547
4558
|
emits: ['success','fieldChanged','formSubmitted','formError','modalId'],
|
|
4548
4559
|
setup(__props, { emit: __emit }) {
|
|
@@ -4585,7 +4596,7 @@ const cleanedProp = vue.computed(()=>{
|
|
|
4585
4596
|
});
|
|
4586
4597
|
|
|
4587
4598
|
return (_ctx, _cache) => {
|
|
4588
|
-
return (vue.openBlock(), vue.createElementBlock("a", {
|
|
4599
|
+
return vue.withDirectives((vue.openBlock(), vue.createElementBlock("a", {
|
|
4589
4600
|
class: vue.normalizeClass(vue.unref(btnClass)),
|
|
4590
4601
|
href: '#' + vue.unref(realModalId),
|
|
4591
4602
|
"data-bs-toggle": "modal"
|
|
@@ -4611,7 +4622,9 @@ return (_ctx, _cache) => {
|
|
|
4611
4622
|
_: 1 /* STABLE */
|
|
4612
4623
|
}, 8 /* PROPS */, ["modal-size", "modal-id", "modal-title"])
|
|
4613
4624
|
]))
|
|
4614
|
-
], 10 /* CLASS, PROPS */, _hoisted_1$i))
|
|
4625
|
+
], 10 /* CLASS, PROPS */, _hoisted_1$i)), [
|
|
4626
|
+
[vue.vShow, !__props.hideButton]
|
|
4627
|
+
])
|
|
4615
4628
|
}
|
|
4616
4629
|
}
|
|
4617
4630
|
|
package/dist/library.mjs
CHANGED
|
@@ -3393,8 +3393,13 @@ var script$u = {
|
|
|
3393
3393
|
emits: /*@__PURE__*/mergeModels(['clearValidationErrors'], ["update:modelValue"]),
|
|
3394
3394
|
setup(__props, { emit: __emit }) {
|
|
3395
3395
|
|
|
3396
|
-
useModel(__props, "modelValue");
|
|
3396
|
+
const model = useModel(__props, "modelValue");
|
|
3397
3397
|
const props = __props;
|
|
3398
|
+
const emit = __emit;
|
|
3399
|
+
|
|
3400
|
+
const onInput = () => {
|
|
3401
|
+
emit('clearValidationErrors');
|
|
3402
|
+
};
|
|
3398
3403
|
|
|
3399
3404
|
const selectOptions = ref(null);
|
|
3400
3405
|
|
|
@@ -3423,7 +3428,8 @@ onMounted(()=>{
|
|
|
3423
3428
|
|
|
3424
3429
|
return (_ctx, _cache) => {
|
|
3425
3430
|
return withDirectives((openBlock(), createElementBlock("select", {
|
|
3426
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((
|
|
3431
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = $event => ((model).value = $event)),
|
|
3432
|
+
onChange: onInput
|
|
3427
3433
|
}, [
|
|
3428
3434
|
(openBlock(true), createElementBlock(Fragment, null, renderList(selectOptions.value, (option) => {
|
|
3429
3435
|
return (openBlock(), createElementBlock("option", {
|
|
@@ -3431,8 +3437,8 @@ return (_ctx, _cache) => {
|
|
|
3431
3437
|
value: option.id
|
|
3432
3438
|
}, toDisplayString(option.name), 9 /* TEXT, PROPS */, _hoisted_1$n))
|
|
3433
3439
|
}), 128 /* KEYED_FRAGMENT */))
|
|
3434
|
-
],
|
|
3435
|
-
[vModelSelect,
|
|
3440
|
+
], 544 /* NEED_HYDRATION, NEED_PATCH */)), [
|
|
3441
|
+
[vModelSelect, model.value]
|
|
3436
3442
|
])
|
|
3437
3443
|
}
|
|
3438
3444
|
}
|
|
@@ -3728,6 +3734,10 @@ var script$q = {
|
|
|
3728
3734
|
steps: {
|
|
3729
3735
|
type: Array,
|
|
3730
3736
|
required: false
|
|
3737
|
+
},
|
|
3738
|
+
hideButton: {
|
|
3739
|
+
type: Boolean,
|
|
3740
|
+
default: false
|
|
3731
3741
|
}
|
|
3732
3742
|
},
|
|
3733
3743
|
emits: ['success', 'preSubmit', 'fieldChanged', 'formSubmitted', 'formError'],
|
|
@@ -4291,7 +4301,7 @@ return (_ctx, _cache) => {
|
|
|
4291
4301
|
], 10 /* CLASS, PROPS */, _hoisted_21$1)
|
|
4292
4302
|
], 2 /* CLASS */))
|
|
4293
4303
|
: createCommentVNode("v-if", true),
|
|
4294
|
-
(isLastStep.value)
|
|
4304
|
+
(isLastStep.value && !__props.hideButton)
|
|
4295
4305
|
? (openBlock(), createElementBlock("div", {
|
|
4296
4306
|
key: 2,
|
|
4297
4307
|
class: normalizeClass(getElementClass('formGroup') + ' ms-auto')
|
|
@@ -4532,6 +4542,7 @@ var script$n = {
|
|
|
4532
4542
|
'files',
|
|
4533
4543
|
'phones',
|
|
4534
4544
|
'numbers',
|
|
4545
|
+
'hideButton',
|
|
4535
4546
|
'customComponent','modalTitle','class','successMessage', 'modalId'],
|
|
4536
4547
|
emits: ['success','fieldChanged','formSubmitted','formError','modalId'],
|
|
4537
4548
|
setup(__props, { emit: __emit }) {
|
|
@@ -4574,7 +4585,7 @@ const cleanedProp = computed(()=>{
|
|
|
4574
4585
|
});
|
|
4575
4586
|
|
|
4576
4587
|
return (_ctx, _cache) => {
|
|
4577
|
-
return (openBlock(), createElementBlock("a", {
|
|
4588
|
+
return withDirectives((openBlock(), createElementBlock("a", {
|
|
4578
4589
|
class: normalizeClass(unref(btnClass)),
|
|
4579
4590
|
href: '#' + unref(realModalId),
|
|
4580
4591
|
"data-bs-toggle": "modal"
|
|
@@ -4600,7 +4611,9 @@ return (_ctx, _cache) => {
|
|
|
4600
4611
|
_: 1 /* STABLE */
|
|
4601
4612
|
}, 8 /* PROPS */, ["modal-size", "modal-id", "modal-title"])
|
|
4602
4613
|
]))
|
|
4603
|
-
], 10 /* CLASS, PROPS */, _hoisted_1$i))
|
|
4614
|
+
], 10 /* CLASS, PROPS */, _hoisted_1$i)), [
|
|
4615
|
+
[vShow, !__props.hideButton]
|
|
4616
|
+
])
|
|
4604
4617
|
}
|
|
4605
4618
|
}
|
|
4606
4619
|
|