@stsdti/funky-ui-kit 0.0.2 → 1.0.1
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/funky-ui-kit.css +2 -2
- package/dist/funky-ui-kit.es.js +86 -22
- package/dist/funky-ui-kit.es.js.map +1 -1
- package/package.json +1 -1
package/dist/funky-ui-kit.es.js
CHANGED
|
@@ -7091,7 +7091,7 @@ function bindOneWay(source, destination, { sourcePath = null, destinationPath =
|
|
|
7091
7091
|
{ immediate, deep }
|
|
7092
7092
|
);
|
|
7093
7093
|
}
|
|
7094
|
-
function bindTwoWay(source, destination, { sourcePath = null, destinationPath = null, immutable = true,
|
|
7094
|
+
function bindTwoWay(source, destination, { sourcePath = null, destinationPath = null, immutable = true, immediateSource = true, immediateDestination = false, deep = true, transformSource = null, transformDestination = null } = {}) {
|
|
7095
7095
|
if (isReactive(source) || isReactive(destination)) {
|
|
7096
7096
|
immutable = false;
|
|
7097
7097
|
}
|
|
@@ -7117,7 +7117,7 @@ function bindTwoWay(source, destination, { sourcePath = null, destinationPath =
|
|
|
7117
7117
|
}
|
|
7118
7118
|
}
|
|
7119
7119
|
},
|
|
7120
|
-
{ immediate, deep }
|
|
7120
|
+
{ immediate: immediateSource, deep }
|
|
7121
7121
|
);
|
|
7122
7122
|
watch(
|
|
7123
7123
|
() => {
|
|
@@ -7141,7 +7141,7 @@ function bindTwoWay(source, destination, { sourcePath = null, destinationPath =
|
|
|
7141
7141
|
}
|
|
7142
7142
|
}
|
|
7143
7143
|
},
|
|
7144
|
-
{ immediate, deep }
|
|
7144
|
+
{ immediate: immediateDestination, deep }
|
|
7145
7145
|
);
|
|
7146
7146
|
}
|
|
7147
7147
|
async function sleep(millis) {
|
|
@@ -23527,34 +23527,68 @@ const _sfc_main$1d = {
|
|
|
23527
23527
|
};
|
|
23528
23528
|
const _hoisted_1$S = {
|
|
23529
23529
|
key: 0,
|
|
23530
|
-
class: "
|
|
23530
|
+
class: "app-link__label"
|
|
23531
23531
|
};
|
|
23532
23532
|
const _sfc_main$1c = {
|
|
23533
23533
|
__name: "AppLink",
|
|
23534
23534
|
props: {
|
|
23535
23535
|
route: {
|
|
23536
|
+
type: [String, Object],
|
|
23537
|
+
default: null
|
|
23538
|
+
},
|
|
23539
|
+
href: {
|
|
23540
|
+
type: String,
|
|
23536
23541
|
default: null
|
|
23537
23542
|
},
|
|
23538
23543
|
label: {
|
|
23544
|
+
type: String,
|
|
23539
23545
|
default: null
|
|
23540
23546
|
}
|
|
23541
23547
|
},
|
|
23542
23548
|
setup(__props) {
|
|
23549
|
+
const props2 = __props;
|
|
23550
|
+
const isExternalUrl = (value) => {
|
|
23551
|
+
if (!value || typeof value !== "string") {
|
|
23552
|
+
return false;
|
|
23553
|
+
}
|
|
23554
|
+
return /^(http?:)?\/\//.test(value);
|
|
23555
|
+
};
|
|
23556
|
+
const externalLink = computed(() => {
|
|
23557
|
+
if (props2.href) {
|
|
23558
|
+
return props2.href;
|
|
23559
|
+
}
|
|
23560
|
+
if (typeof props2.route === "string" && isExternalUrl(props2.route)) {
|
|
23561
|
+
return props2.route;
|
|
23562
|
+
}
|
|
23563
|
+
return null;
|
|
23564
|
+
});
|
|
23565
|
+
const isExternal = computed(() => !!externalLink.value);
|
|
23566
|
+
const hasLink = computed(() => !!props2.route || !!props2.href);
|
|
23567
|
+
const componentType = computed(() => {
|
|
23568
|
+
return isExternal.value ? "a" : "router-link";
|
|
23569
|
+
});
|
|
23570
|
+
const linkBindings = computed(() => {
|
|
23571
|
+
if (isExternal.value) {
|
|
23572
|
+
return {
|
|
23573
|
+
href: externalLink.value,
|
|
23574
|
+
target: "_blank",
|
|
23575
|
+
rel: "noopener noreferrer"
|
|
23576
|
+
};
|
|
23577
|
+
}
|
|
23578
|
+
return {
|
|
23579
|
+
to: props2.route
|
|
23580
|
+
};
|
|
23581
|
+
});
|
|
23543
23582
|
return (_ctx, _cache2) => {
|
|
23544
|
-
|
|
23545
|
-
return __props.route ? (openBlock(), createBlock(_component_router_link, {
|
|
23546
|
-
key: 0,
|
|
23547
|
-
class: "app-link flex-center-vertical",
|
|
23548
|
-
to: __props.route
|
|
23549
|
-
}, {
|
|
23583
|
+
return hasLink.value ? (openBlock(), createBlock(resolveDynamicComponent(componentType.value), mergeProps({ key: 0 }, linkBindings.value, { class: "app-link" }), {
|
|
23550
23584
|
default: withCtx(() => [
|
|
23551
23585
|
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
23552
|
-
__props.label ? (openBlock(), createElementBlock("
|
|
23553
|
-
_cache2[0] || (_cache2[0] = createElementVNode("i", { class: "icon-link" }, null, -1))
|
|
23586
|
+
__props.label ? (openBlock(), createElementBlock("span", _hoisted_1$S, toDisplayString(__props.label), 1)) : createCommentVNode("", true),
|
|
23587
|
+
_cache2[0] || (_cache2[0] = createElementVNode("i", { class: "icon-link app-link__icon" }, null, -1))
|
|
23554
23588
|
])
|
|
23555
23589
|
]),
|
|
23556
23590
|
_: 3
|
|
23557
|
-
},
|
|
23591
|
+
}, 16)) : createCommentVNode("", true);
|
|
23558
23592
|
};
|
|
23559
23593
|
}
|
|
23560
23594
|
};
|
|
@@ -23856,7 +23890,7 @@ const _sfc_main$18 = {
|
|
|
23856
23890
|
if (props2.disabled) {
|
|
23857
23891
|
return true;
|
|
23858
23892
|
}
|
|
23859
|
-
if (!props2.min) {
|
|
23893
|
+
if (!Number.isFinite(props2.min)) {
|
|
23860
23894
|
return false;
|
|
23861
23895
|
}
|
|
23862
23896
|
return props2.modelValue <= props2.min;
|
|
@@ -23865,7 +23899,7 @@ const _sfc_main$18 = {
|
|
|
23865
23899
|
if (props2.disabled) {
|
|
23866
23900
|
return true;
|
|
23867
23901
|
}
|
|
23868
|
-
if (!props2.max) {
|
|
23902
|
+
if (!Number.isFinite(props2.max)) {
|
|
23869
23903
|
return false;
|
|
23870
23904
|
}
|
|
23871
23905
|
return props2.modelValue >= props2.max;
|
|
@@ -23906,7 +23940,7 @@ const _sfc_main$18 = {
|
|
|
23906
23940
|
};
|
|
23907
23941
|
}
|
|
23908
23942
|
};
|
|
23909
|
-
const AppNumberInput = /* @__PURE__ */ _export_sfc(_sfc_main$18, [["__scopeId", "data-v-
|
|
23943
|
+
const AppNumberInput = /* @__PURE__ */ _export_sfc(_sfc_main$18, [["__scopeId", "data-v-51be942a"]]);
|
|
23910
23944
|
const _sfc_main$17 = {
|
|
23911
23945
|
__name: "AppPlaceholderHeading",
|
|
23912
23946
|
props: {
|
|
@@ -30403,6 +30437,11 @@ function useTableFilters(tableFilters, emits) {
|
|
|
30403
30437
|
fromUrl ? filters.value[bagKey] = fromUrl : null;
|
|
30404
30438
|
}
|
|
30405
30439
|
}
|
|
30440
|
+
const setFilterWithLock = (field, value) => {
|
|
30441
|
+
filters.value[field] = value;
|
|
30442
|
+
blockedFilters.value = [...blockedFilters.value, field];
|
|
30443
|
+
setPayloadIsDisabled(field);
|
|
30444
|
+
};
|
|
30406
30445
|
const externalContext = {
|
|
30407
30446
|
// Refs
|
|
30408
30447
|
filters,
|
|
@@ -30427,7 +30466,8 @@ function useTableFilters(tableFilters, emits) {
|
|
|
30427
30466
|
setPayloadIsHidden,
|
|
30428
30467
|
setFilter,
|
|
30429
30468
|
setFilters,
|
|
30430
|
-
setFiltersFromUrl
|
|
30469
|
+
setFiltersFromUrl,
|
|
30470
|
+
setFilterWithLock
|
|
30431
30471
|
};
|
|
30432
30472
|
watch(toUrlFilters, (newValue, oldValue) => {
|
|
30433
30473
|
if (lodashExports.isEqual(newValue, oldValue)) {
|
|
@@ -84109,8 +84149,8 @@ function useFormValidation(config) {
|
|
|
84109
84149
|
element == null ? void 0 : element.scrollIntoView({ behavior: "smooth" });
|
|
84110
84150
|
};
|
|
84111
84151
|
const isFieldRequired2 = (fieldName) => {
|
|
84112
|
-
var _a3;
|
|
84113
|
-
const fieldSchema = (_a3 = toValue$2(schema).fields) == null ? void 0 :
|
|
84152
|
+
var _a3, _b2;
|
|
84153
|
+
const fieldSchema = (_b2 = (_a3 = toValue$2(schema)) == null ? void 0 : _a3.fields) == null ? void 0 : _b2[fieldName];
|
|
84114
84154
|
return (fieldSchema == null ? void 0 : fieldSchema.spec.optional) === false;
|
|
84115
84155
|
};
|
|
84116
84156
|
const externalContext = {
|
|
@@ -84135,7 +84175,7 @@ function useForm(config, emits) {
|
|
|
84135
84175
|
const { validationPath: globalValidationPath } = config;
|
|
84136
84176
|
const repository = model == null ? void 0 : model.getRepository();
|
|
84137
84177
|
const transformer = model == null ? void 0 : model.getTransformer();
|
|
84138
|
-
const itemEmpty = config.empty ?? (model == null ? void 0 : model.getEmpty
|
|
84178
|
+
const itemEmpty = config.empty ?? (model == null ? void 0 : model.getEmpty) ?? {};
|
|
84139
84179
|
const routeForm = (_a3 = model == null ? void 0 : model.getRouteForm) == null ? void 0 : _a3.call(model);
|
|
84140
84180
|
const routeList = (_b2 = model == null ? void 0 : model.getRouteList) == null ? void 0 : _b2.call(model);
|
|
84141
84181
|
const useDirty = config.useDirty ? config.useDirty : false;
|
|
@@ -84167,10 +84207,16 @@ function useForm(config, emits) {
|
|
|
84167
84207
|
const setPayload = (value) => {
|
|
84168
84208
|
payload.value = value;
|
|
84169
84209
|
};
|
|
84210
|
+
const getItemEmptyValue = async () => {
|
|
84211
|
+
let result = itemEmpty;
|
|
84212
|
+
result = result instanceof Function ? result() : result;
|
|
84213
|
+
result = result instanceof Promise ? await result : result;
|
|
84214
|
+
return result;
|
|
84215
|
+
};
|
|
84170
84216
|
async function initItem({ id = null, value = null, external: external2 = null, payload: payload2 = null } = {}) {
|
|
84171
84217
|
external2 ? setExternal(external2) : null;
|
|
84172
84218
|
payload2 ? setPayload(payload2) : null;
|
|
84173
|
-
let itemValue = value ? lodashExports.cloneDeep(value) : lodashExports.cloneDeep(
|
|
84219
|
+
let itemValue = value ? lodashExports.cloneDeep(value) : lodashExports.cloneDeep(await getItemEmptyValue());
|
|
84174
84220
|
setItem(itemValue);
|
|
84175
84221
|
id ? await fetchItem(id) : null;
|
|
84176
84222
|
announce(useFormEvent.inited, externalContext);
|
|
@@ -84390,6 +84436,20 @@ function useForm(config, emits) {
|
|
|
84390
84436
|
function setAllPayloadIsHidden() {
|
|
84391
84437
|
Object.keys(item.value).forEach((key) => lodashExports.set(payload.value, `${key}.isHidden`, true));
|
|
84392
84438
|
}
|
|
84439
|
+
function setPayloadEnabled(key, isEnabled = true) {
|
|
84440
|
+
const keys = [key].flat();
|
|
84441
|
+
keys.forEach((k2) => lodashExports.set(payload.value, `${k2}.isDisabled`, !isEnabled));
|
|
84442
|
+
}
|
|
84443
|
+
function setPayloadEnabledAll(isEnabled = true) {
|
|
84444
|
+
Object.keys(item.value).forEach((key) => lodashExports.set(payload.value, `${key}.isDisabled`, !isEnabled));
|
|
84445
|
+
}
|
|
84446
|
+
function setPayloadVisible(key, isVisible2 = true) {
|
|
84447
|
+
const keys = [key].flat();
|
|
84448
|
+
keys.forEach((k2) => lodashExports.set(payload.value, `${k2}.isHidden`, !isVisible2));
|
|
84449
|
+
}
|
|
84450
|
+
function setPayloadVisibleAll(isVisible2 = true) {
|
|
84451
|
+
Object.keys(item.value).forEach((key) => lodashExports.set(payload.value, `${key}.isHidden`, !isVisible2));
|
|
84452
|
+
}
|
|
84393
84453
|
const externalContext = {
|
|
84394
84454
|
isLoading: isLoading2,
|
|
84395
84455
|
itemId,
|
|
@@ -84398,7 +84458,7 @@ function useForm(config, emits) {
|
|
|
84398
84458
|
item,
|
|
84399
84459
|
payload,
|
|
84400
84460
|
fetchedItem,
|
|
84401
|
-
|
|
84461
|
+
itemEmpty,
|
|
84402
84462
|
initItem,
|
|
84403
84463
|
refreshItem,
|
|
84404
84464
|
fetchItem,
|
|
@@ -84416,6 +84476,10 @@ function useForm(config, emits) {
|
|
|
84416
84476
|
setPayloadIsHidden,
|
|
84417
84477
|
setAllPayloadIsDisabled,
|
|
84418
84478
|
setAllPayloadIsHidden,
|
|
84479
|
+
setPayloadEnabled,
|
|
84480
|
+
setPayloadEnabledAll,
|
|
84481
|
+
setPayloadVisible,
|
|
84482
|
+
setPayloadVisibleAll,
|
|
84419
84483
|
external,
|
|
84420
84484
|
formName,
|
|
84421
84485
|
getBinding: getBinding2,
|