@pequity/squirrel 5.2.2 → 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-input-search.js +3 -2
- package/dist/cjs/p-loading.js +4 -7
- package/dist/cjs/p-modal.js +5 -2
- 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-input-search.js +3 -2
- package/dist/es/p-loading.js +4 -7
- package/dist/es/p-modal.js +5 -2
- 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 +33 -33
- package/package.json +22 -27
- package/squirrel/components/p-action-bar/p-action-bar.spec.js +47 -15
- 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-alert/p-alert.spec.js +1 -1
- package/squirrel/components/p-avatar/p-avatar.spec.js +16 -1
- package/squirrel/components/p-btn/p-btn.spec.js +3 -7
- package/squirrel/components/p-card/p-card.spec.js +1 -1
- package/squirrel/components/p-checkbox/p-checkbox.spec.js +1 -1
- package/squirrel/components/p-chips/p-chips.spec.js +1 -1
- package/squirrel/components/p-close-btn/p-close-btn.spec.js +1 -1
- package/squirrel/components/p-dropdown/p-dropdown.spec.js +5 -9
- package/squirrel/components/p-dropdown-select/p-dropdown-select.spec.js +4 -5
- package/squirrel/components/p-file-upload/p-file-upload.spec.js +1 -1
- package/squirrel/components/p-icon/p-icon.spec.js +15 -29
- package/squirrel/components/p-info-icon/p-info-icon.spec.js +1 -1
- package/squirrel/components/p-inline-date-picker/p-inline-date-picker.spec.js +4 -4
- package/squirrel/components/p-input/p-input.spec.js +1 -1
- package/squirrel/components/p-input-number/p-input-number.spec.js +1 -1
- package/squirrel/components/p-input-percent/p-input-percent.spec.js +1 -1
- package/squirrel/components/p-input-search/p-input-search.spec.js +1 -1
- package/squirrel/components/p-input-search/p-input-search.vue +1 -1
- package/squirrel/components/p-link/p-link.spec.js +3 -7
- package/squirrel/components/p-loading/p-loading.spec.js +23 -23
- package/squirrel/components/p-loading/p-loading.vue +2 -7
- package/squirrel/components/p-modal/p-modal-basic.spec.js +1 -1
- package/squirrel/components/p-modal/p-modal-events.spec.js +1 -1
- package/squirrel/components/p-modal/p-modal-features.spec.js +1 -1
- package/squirrel/components/p-modal/p-modal.vue +4 -0
- package/squirrel/components/p-pagination/p-pagination.spec.js +1 -1
- package/squirrel/components/p-pagination-info/p-pagination-info.spec.js +1 -1
- package/squirrel/components/p-progress-bar/p-progess-bar.spec.js +1 -1
- package/squirrel/components/p-ring-loader/p-ring-loader.spec.js +1 -1
- package/squirrel/components/p-select/p-select.spec.js +1 -1
- package/squirrel/components/p-select-btn/p-select-btn.spec.js +1 -1
- package/squirrel/components/p-select-list/p-select-list.spec.js +4 -5
- package/squirrel/components/p-select-pill/p-select-pill.spec.js +1 -1
- package/squirrel/components/p-skeleton-loader/p-skeleton-loader.spec.js +1 -1
- package/squirrel/components/p-table/p-table.spec.js +1 -1
- package/squirrel/components/p-table-header-cell/p-filter-icon.spec.js +1 -1
- package/squirrel/components/p-table-header-cell/p-table-header-cell.spec.js +1 -1
- package/squirrel/components/p-table-loader/p-table-loader.spec.js +1 -1
- package/squirrel/components/p-table-sort/p-table-sort.spec.js +1 -1
- package/squirrel/components/p-table-td/p-table-td.spec.js +35 -1
- package/squirrel/components/p-tabs/p-tabs.spec.js +1 -1
- package/squirrel/components/p-textarea/p-textarea.spec.js +1 -1
- package/squirrel/components/p-toggle/p-toggle.spec.js +1 -1
- package/squirrel/composables/useInputClasses.spec.js +41 -0
- package/squirrel/index.spec.js +21 -0
- package/squirrel/utils/component.spec.ts +29 -0
- package/squirrel/utils/component.ts +5 -0
- package/squirrel/utils/dom.spec.js +2 -3
- package/squirrel/utils/listKeyboardNavigation.spec.js +5 -9
- package/squirrel/utils/sanitization.spec.js +1 -1
- package/squirrel/utils/{string.spec.js → string.spec.ts} +19 -1
- package/squirrel/utils/string.ts +2 -0
- package/squirrel/utils/tailwind.spec.js +27 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const isString = (val) => typeof val === "string";
|
|
3
|
+
const toString = (value) => {
|
|
4
|
+
if (typeof value === "number" && (!isFinite(value) || isNaN(value))) {
|
|
5
|
+
return "";
|
|
6
|
+
}
|
|
7
|
+
if (typeof value !== "string" && typeof value !== "number") {
|
|
8
|
+
return "";
|
|
9
|
+
}
|
|
10
|
+
return String(value);
|
|
11
|
+
};
|
|
12
|
+
exports.isString = isString;
|
|
13
|
+
exports.toString = toString;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const pIcon_vue_vue_type_script_setup_true_lang = require("./chunks/p-icon.js");
|
|
3
|
+
const component = require("./chunks/component.js");
|
|
4
|
+
describe("isComponent", () => {
|
|
5
|
+
it("should return true for a valid component object", () => {
|
|
6
|
+
expect(component.isComponent(pIcon_vue_vue_type_script_setup_true_lang._sfc_main)).toBe(true);
|
|
7
|
+
});
|
|
8
|
+
it("should return false for null", () => {
|
|
9
|
+
expect(component.isComponent(null)).toBe(false);
|
|
10
|
+
});
|
|
11
|
+
it.each([
|
|
12
|
+
["string", "string"],
|
|
13
|
+
["number", 123],
|
|
14
|
+
["boolean", true],
|
|
15
|
+
["undefined", void 0],
|
|
16
|
+
["symbol", Symbol("symbol")],
|
|
17
|
+
["function", () => {
|
|
18
|
+
}],
|
|
19
|
+
["array", []],
|
|
20
|
+
["date", /* @__PURE__ */ new Date()],
|
|
21
|
+
["regexp", /regex/],
|
|
22
|
+
["error", new Error("error")],
|
|
23
|
+
["map", /* @__PURE__ */ new Map()],
|
|
24
|
+
["set", /* @__PURE__ */ new Set()]
|
|
25
|
+
])("should return false for a non-component object: %s", (_, value) => {
|
|
26
|
+
expect(component.isComponent(value)).toBe(false);
|
|
27
|
+
});
|
|
28
|
+
});
|