@pequity/squirrel 5.2.3 → 5.3.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/cjs/chunks/component.js +4 -0
- package/dist/cjs/chunks/p-dropdown-select.js +1 -1
- package/dist/cjs/chunks/p-icon.js +2180 -0
- package/dist/cjs/chunks/string.js +13 -0
- package/dist/cjs/component.js +28 -0
- package/dist/cjs/index.js +32 -2188
- package/dist/cjs/p-loading.js +4 -7
- package/dist/cjs/string.js +32 -11
- package/dist/cjs/useSelectList.js +1 -1
- package/dist/es/chunks/component.js +5 -0
- package/dist/es/chunks/p-dropdown-select.js +1 -1
- package/dist/es/chunks/p-icon.js +2181 -0
- package/dist/es/chunks/string.js +14 -0
- package/dist/es/component.js +27 -0
- package/dist/es/index.js +31 -2187
- package/dist/es/p-loading.js +4 -7
- package/dist/es/string.js +32 -12
- package/dist/es/useSelectList.js +1 -1
- package/dist/squirrel/components/p-action-bar/p-action-bar.types.d.ts +3 -2
- package/dist/squirrel/utils/component.d.ts +2 -0
- package/dist/squirrel/utils/component.spec.d.ts +1 -0
- package/dist/squirrel/utils/string.d.ts +1 -0
- package/dist/squirrel/utils/string.spec.d.ts +1 -0
- package/dist/style.css +6 -6
- package/package.json +2 -2
- package/squirrel/components/p-action-bar/p-action-bar.spec.js +46 -14
- package/squirrel/components/p-action-bar/p-action-bar.stories.js +6 -0
- package/squirrel/components/p-action-bar/p-action-bar.types.ts +4 -2
- package/squirrel/components/p-action-bar/p-action-bar.vue +9 -3
- package/squirrel/components/p-avatar/p-avatar.spec.js +15 -0
- package/squirrel/components/p-icon/p-icon.spec.js +0 -1
- package/squirrel/components/p-loading/p-loading.vue +2 -7
- package/squirrel/components/p-table-td/p-table-td.spec.js +0 -1
- package/squirrel/utils/component.spec.ts +29 -0
- package/squirrel/utils/component.ts +5 -0
- package/squirrel/utils/{string.spec.js → string.spec.ts} +19 -1
- package/squirrel/utils/string.ts +2 -0
package/dist/cjs/p-loading.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const vue = require("vue");
|
|
3
|
+
const component = require("./chunks/component.js");
|
|
3
4
|
const usePLoading = require("./usePLoading.js");
|
|
4
5
|
const _pluginVue_exportHelper = require("./chunks/_plugin-vue_export-helper.js");
|
|
5
6
|
const _hoisted_1 = {
|
|
@@ -33,10 +34,6 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
33
34
|
},
|
|
34
35
|
{ flush: "post" }
|
|
35
36
|
);
|
|
36
|
-
const isComponent = (content2) => {
|
|
37
|
-
const isComponent2 = typeof content2 === "object" && content2 !== null;
|
|
38
|
-
return isComponent2;
|
|
39
|
-
};
|
|
40
37
|
vue.onBeforeUnmount(() => {
|
|
41
38
|
loadingHide();
|
|
42
39
|
});
|
|
@@ -58,7 +55,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
58
55
|
"enter-active-class": "transition duration-500"
|
|
59
56
|
}, {
|
|
60
57
|
default: vue.withCtx(() => [
|
|
61
|
-
isComponent(vue.unref(content)) ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(content)), vue.normalizeProps(vue.mergeProps({ key: 0 }, vue.unref(componentProps))), null, 16)) : (vue.openBlock(), vue.createElementBlock("div", {
|
|
58
|
+
vue.unref(component.isComponent)(vue.unref(content)) ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(content)), vue.normalizeProps(vue.mergeProps({ key: 0 }, vue.unref(componentProps))), null, 16)) : (vue.openBlock(), vue.createElementBlock("div", {
|
|
62
59
|
key: 1,
|
|
63
60
|
class: vue.normalizeClass(textDivClass)
|
|
64
61
|
}, vue.toDisplayString(vue.unref(content)), 1))
|
|
@@ -75,7 +72,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
75
72
|
ref_key: "dimsReference",
|
|
76
73
|
ref: dimsReference
|
|
77
74
|
}, [
|
|
78
|
-
isComponent(vue.unref(content)) ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(content)), vue.normalizeProps(vue.mergeProps({ key: 0 }, vue.unref(componentProps))), null, 16)) : (vue.openBlock(), vue.createElementBlock("div", {
|
|
75
|
+
vue.unref(component.isComponent)(vue.unref(content)) ? (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(content)), vue.normalizeProps(vue.mergeProps({ key: 0 }, vue.unref(componentProps))), null, 16)) : (vue.openBlock(), vue.createElementBlock("div", {
|
|
79
76
|
key: 1,
|
|
80
77
|
class: vue.normalizeClass(textDivClass)
|
|
81
78
|
}, vue.toDisplayString(vue.unref(content)), 1))
|
|
@@ -85,5 +82,5 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
85
82
|
};
|
|
86
83
|
}
|
|
87
84
|
});
|
|
88
|
-
const pLoading = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
85
|
+
const pLoading = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-980d32e1"]]);
|
|
89
86
|
module.exports = pLoading;
|
package/dist/cjs/string.js
CHANGED
|
@@ -1,12 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
const string = require("./chunks/string.js");
|
|
3
|
+
describe("toString", () => {
|
|
4
|
+
it.each(["", /* @__PURE__ */ new Date(), NaN, Infinity, {}, [], true, false, null, void 0])(
|
|
5
|
+
"returns an empty string if input is %s",
|
|
6
|
+
(val) => {
|
|
7
|
+
expect(string.toString(val)).toBe("");
|
|
8
|
+
}
|
|
9
|
+
);
|
|
10
|
+
it("returns a string when the value is a string", () => {
|
|
11
|
+
expect(string.toString("test")).toBe("test");
|
|
12
|
+
});
|
|
13
|
+
it("converts the value to a string when the value is a number", () => {
|
|
14
|
+
expect(string.toString(290349822e-2)).toBe("2903498.22");
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
describe("isString", () => {
|
|
18
|
+
it("should return true for a string", () => {
|
|
19
|
+
expect(string.isString("hello")).toBe(true);
|
|
20
|
+
});
|
|
21
|
+
it.each([
|
|
22
|
+
[123, false],
|
|
23
|
+
[{}, false],
|
|
24
|
+
[[], false],
|
|
25
|
+
[null, false],
|
|
26
|
+
[void 0, false],
|
|
27
|
+
[true, false],
|
|
28
|
+
[() => {
|
|
29
|
+
}, false]
|
|
30
|
+
])("should return %s for %p", (input, expected) => {
|
|
31
|
+
expect(string.isString(input)).toBe(expected);
|
|
32
|
+
});
|
|
33
|
+
});
|
|
@@ -4,7 +4,7 @@ const vue = require("vue");
|
|
|
4
4
|
const listKeyboardNavigation = require("./listKeyboardNavigation.js");
|
|
5
5
|
const lodashEs = require("lodash-es");
|
|
6
6
|
const object = require("./object.js");
|
|
7
|
-
const string = require("./string.js");
|
|
7
|
+
const string = require("./chunks/string.js");
|
|
8
8
|
const vueVirtual = require("@tanstack/vue-virtual");
|
|
9
9
|
const createInternalItems = (items) => {
|
|
10
10
|
let arr = Array.isArray(items) ? items.slice() : [];
|
|
@@ -4,7 +4,7 @@ import PInputSearch from "../p-input-search.js";
|
|
|
4
4
|
import { SIZES } from "../p-select-list.js";
|
|
5
5
|
import { omit } from "lodash-es";
|
|
6
6
|
import { splitStringForHighlight } from "../text.js";
|
|
7
|
-
import { toString } from "
|
|
7
|
+
import { t as toString } from "./string.js";
|
|
8
8
|
import { useInputClasses } from "../useInputClasses.js";
|
|
9
9
|
import { useSelectList } from "../useSelectList.js";
|
|
10
10
|
const _imports_0 = "data:image/svg+xml,%3csvg%20width='18'%20height='12'%20viewBox='0%200%2018%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M16.1383%200.166992L6.30411%209.83366L1.69828%205.27533L0.526611%206.46033L5.71578%2011.597C5.87174%2011.7509%206.08205%2011.8372%206.3012%2011.8372C6.52034%2011.8372%206.73065%2011.7509%206.88661%2011.597L17.3033%201.35366L16.1383%200.166992Z'%20fill='%231A123B'%20/%3e%3c/svg%3e";
|