fit2cloud-ui-plus 0.0.1-beta.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/LICENSE +674 -0
- package/README.md +16 -0
- package/lib/favicon.bmp +0 -0
- package/lib/fit2cloud-ui-plus.es.js +3796 -0
- package/lib/fit2cloud-ui-plus.umd.js +1 -0
- package/package.json +48 -0
- package/src/components/filter-bar/FuFilter.vue +175 -0
- package/src/components/filter-bar/FuFilterBar.vue +75 -0
- package/src/components/filter-bar/FuFilterConditions.vue +29 -0
- package/src/components/filter-bar/FuSearchInput.vue +31 -0
- package/src/components/filter-bar/filter-components/FuFilterDate.vue +62 -0
- package/src/components/filter-bar/filter-components/FuFilterDateTime.vue +65 -0
- package/src/components/filter-bar/filter-components/FuFilterOption.vue +38 -0
- package/src/components/filter-bar/filter-components/FuFilterSelect.vue +143 -0
- package/src/components/filter-bar/index.ts +19 -0
- package/src/components/filter-bar/types.ts +31 -0
- package/src/components/read-write-switch/FuInputRwSwitch.vue +44 -0
- package/src/components/read-write-switch/FuReadWriteSwitch.vue +91 -0
- package/src/components/read-write-switch/FuSelectRwSwitch.vue +53 -0
- package/src/components/read-write-switch/index.ts +13 -0
- package/src/components/search-bar/FuComplexSearch.vue +108 -0
- package/src/components/search-bar/FuQuickSearch.vue +43 -0
- package/src/components/search-bar/FuSearchBar.vue +165 -0
- package/src/components/search-bar/FuSearchBarButton.vue +14 -0
- package/src/components/search-bar/FuSearchContions.vue +24 -0
- package/src/components/search-bar/index.ts +13 -0
- package/src/components/search-bar/store.ts +25 -0
- package/src/components/speed-dial/FuSpeedDial.vue +280 -0
- package/src/components/speed-dial/FuSpeedDialActionButton.vue +88 -0
- package/src/components/speed-dial/FuSpeedDialButton.vue +42 -0
- package/src/components/speed-dial/FuSpeedDialItem.vue +88 -0
- package/src/components/speed-dial/index.ts +11 -0
- package/src/components/split-pane/FuSplitPane.vue +228 -0
- package/src/components/split-pane/index.ts +8 -0
- package/src/components/steps/FuHorizontalNavigation.vue +18 -0
- package/src/components/steps/FuHorizontalSteps.vue +94 -0
- package/src/components/steps/FuStep.vue +13 -0
- package/src/components/steps/FuSteps.vue +22 -0
- package/src/components/steps/FuStepsFooter.ts +79 -0
- package/src/components/steps/FuVerticalNavigation.vue +35 -0
- package/src/components/steps/FuVerticalSteps.vue +79 -0
- package/src/components/steps/Stepper.ts +188 -0
- package/src/components/steps/index.ts +11 -0
- package/src/components/table/FuTable.vue +145 -0
- package/src/components/table/FuTableBody.ts +40 -0
- package/src/components/table/FuTablePagination.vue +42 -0
- package/src/components/table/index.ts +15 -0
- package/src/components/table/table-column-dropdown/FuTableColumnDropdown.vue +102 -0
- package/src/components/table/table-column-dropdown/index.ts +7 -0
- package/src/components/table/table-column-select/FuTableColumnSelect.vue +22 -0
- package/src/components/table/table-column-select/FuTableColumnSelectDialog.vue +99 -0
- package/src/components/table/table-column-select/FuTableColumnSelectPopover.vue +80 -0
- package/src/components/table/table-column-select/index.ts +8 -0
- package/src/components/table/table-column-select/utils.ts +59 -0
- package/src/components/table/table-operations/FuTableButton.vue +19 -0
- package/src/components/table/table-operations/FuTableMoreButton.vue +52 -0
- package/src/components/table/table-operations/FuTableOperations.vue +88 -0
- package/src/components/table/table-operations/index.ts +12 -0
- package/src/components/tabs/FuTabs.vue +84 -0
- package/src/components/tabs/index.ts +8 -0
- package/src/components/virtual-scroller/FuVirtualHorizontalScroll.js +96 -0
- package/src/components/virtual-scroller/FuVirtualScroll.js +15 -0
- package/src/components/virtual-scroller/FuVirtualVerticalScroll.js +95 -0
- package/src/components/virtual-scroller/index.js +10 -0
- package/src/hooks/index.ts +3 -0
- package/src/hooks/use-global-config/index.ts +32 -0
- package/src/hooks/use-locale/index.ts +47 -0
- package/src/index.ts +19 -0
- package/src/locale/index.ts +12 -0
- package/src/locale/lang/en.ts +58 -0
- package/src/locale/lang/zh-cn.ts +58 -0
- package/src/locale/lang/zh-tw.ts +58 -0
- package/src/styles/common/config.scss +5 -0
- package/src/styles/common/function.scss +81 -0
- package/src/styles/common/mixins.scss +85 -0
- package/src/styles/common/variables.scss +28 -0
- package/src/styles/components/filter-bar.scss +227 -0
- package/src/styles/components/read-write-switch.scss +6 -0
- package/src/styles/components/search-bar.scss +285 -0
- package/src/styles/components/speed-dial.scss +107 -0
- package/src/styles/components/split-pane.scss +111 -0
- package/src/styles/components/steps.scss +110 -0
- package/src/styles/components/table.scss +105 -0
- package/src/styles/components/tabs.scss +10 -0
- package/src/styles/components/virtual-scroller.scss +24 -0
- package/src/styles/index.scss +11 -0
- package/src/tools/theme.ts +23 -0
- package/src/tools/time.ts +30 -0
- package/src/tools/utils.ts +60 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
@use "../common/mixins.scss" as *;
|
|
2
|
+
@use "../common/variables.scss" as *;
|
|
3
|
+
|
|
4
|
+
@include b(virtual-scroll) {
|
|
5
|
+
overflow: auto;
|
|
6
|
+
height: 100%;
|
|
7
|
+
width: 100%;
|
|
8
|
+
background-color: #F5F5F5;
|
|
9
|
+
position: relative;
|
|
10
|
+
|
|
11
|
+
@include e(item) {
|
|
12
|
+
position: absolute;
|
|
13
|
+
top: 0;
|
|
14
|
+
bottom: 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@include when(horizontal) {
|
|
18
|
+
@include e(item) {
|
|
19
|
+
position: absolute;
|
|
20
|
+
top: 0;
|
|
21
|
+
bottom: 0;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
@use "./common/variables.scss";
|
|
2
|
+
@use "element-plus/theme-chalk/src/index.scss" as *;
|
|
3
|
+
@use "./components/speed-dial";
|
|
4
|
+
@use "./components/search-bar";
|
|
5
|
+
@use "./components/filter-bar";
|
|
6
|
+
@use "./components/table";
|
|
7
|
+
@use "./components/steps";
|
|
8
|
+
@use "./components/read-write-switch";
|
|
9
|
+
@use "./components/split-pane";
|
|
10
|
+
@use "./components/tabs";
|
|
11
|
+
@use "./components/virtual-scroller";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const COMPONENTS_TYPE = ["default", "primary", "success", "warning", "danger", "info"];
|
|
2
|
+
|
|
3
|
+
export const validateType = (value: string) => {
|
|
4
|
+
if (!value) return true;
|
|
5
|
+
|
|
6
|
+
if (COMPONENTS_TYPE.includes(value)) {
|
|
7
|
+
return true;
|
|
8
|
+
}
|
|
9
|
+
console.error("types is not contains " + value);
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const COMPONENTS_SIZE = ["default", "large", "small"];
|
|
14
|
+
|
|
15
|
+
export const validateSize = (value: string) => {
|
|
16
|
+
if (!value) return true;
|
|
17
|
+
|
|
18
|
+
if (COMPONENTS_SIZE.includes(value)) {
|
|
19
|
+
return true;
|
|
20
|
+
}
|
|
21
|
+
console.error("size is not contains " + value);
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const getCheckDate = (timestamp: string) => {
|
|
2
|
+
if (!timestamp) return false
|
|
3
|
+
const dt = new Date(timestamp)
|
|
4
|
+
if (isNaN(dt.getTime())) return false
|
|
5
|
+
return dt
|
|
6
|
+
}
|
|
7
|
+
export const datetimeFormat = (timestamp: string) => {
|
|
8
|
+
const dt = getCheckDate(timestamp);
|
|
9
|
+
if (!dt) return timestamp
|
|
10
|
+
|
|
11
|
+
const y = dt.getFullYear()
|
|
12
|
+
const m = (dt.getMonth() + 1 + '').padStart(2, '0')
|
|
13
|
+
const d = (dt.getDate() + '').padStart(2, '0')
|
|
14
|
+
const hh = (dt.getHours() + '').padStart(2, '0')
|
|
15
|
+
const mm = (dt.getMinutes() + '').padStart(2, '0')
|
|
16
|
+
const ss = (dt.getSeconds() + '').padStart(2, '0')
|
|
17
|
+
|
|
18
|
+
return `${y}-${m}-${d} ${hh}:${mm}:${ss}`
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const dateFormat = (timestamp: string) => {
|
|
22
|
+
const dt = getCheckDate(timestamp);
|
|
23
|
+
if (!dt) return timestamp
|
|
24
|
+
|
|
25
|
+
const y = dt.getFullYear()
|
|
26
|
+
const m = (dt.getMonth() + 1 + '').padStart(2, '0')
|
|
27
|
+
const d = (dt.getDate() + '').padStart(2, '0')
|
|
28
|
+
|
|
29
|
+
return `${y}-${m}-${d}`
|
|
30
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export const download = function ({url, name, content}) {
|
|
2
|
+
if (url) {
|
|
3
|
+
downloadByURL(url)
|
|
4
|
+
} else {
|
|
5
|
+
downloadByContent(name, content)
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const downloadByContent = function (name, content) {
|
|
10
|
+
const blob = new Blob([content])
|
|
11
|
+
const a = document.createElement('a')
|
|
12
|
+
a.setAttribute('href', window.URL.createObjectURL(blob))
|
|
13
|
+
a.setAttribute('download', name)
|
|
14
|
+
document.body.appendChild(a)
|
|
15
|
+
a.click()
|
|
16
|
+
document.body.removeChild(a)
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const downloadByURL = function (url) {
|
|
20
|
+
const a = document.createElement('a')
|
|
21
|
+
a.setAttribute('href', url)
|
|
22
|
+
a.setAttribute('download', url)
|
|
23
|
+
document.body.appendChild(a)
|
|
24
|
+
a.click()
|
|
25
|
+
document.body.removeChild(a)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const uuid = function () {
|
|
29
|
+
let d = new Date().getTime();
|
|
30
|
+
let d2 = (performance && performance.now && (performance.now() * 1000)) || 0;
|
|
31
|
+
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
32
|
+
let r = Math.random() * 16;
|
|
33
|
+
if (d > 0) {
|
|
34
|
+
r = (d + r) % 16 | 0;
|
|
35
|
+
d = Math.floor(d / 16);
|
|
36
|
+
} else {
|
|
37
|
+
r = (d2 + r) % 16 | 0;
|
|
38
|
+
d2 = Math.floor(d2 / 16);
|
|
39
|
+
}
|
|
40
|
+
return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16);
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const randomId = function () {
|
|
45
|
+
return Math.floor(Math.random() * 10000);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export const hasOwn = function (obj, key) {
|
|
49
|
+
return Object.prototype.hasOwnProperty.call(obj, key);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export const convertToUnit = function (value, unit = "px") {
|
|
53
|
+
if (value == null || value === '') {
|
|
54
|
+
return undefined
|
|
55
|
+
} else if (isNaN(+value)) {
|
|
56
|
+
return String(value)
|
|
57
|
+
} else {
|
|
58
|
+
return `${Number(value)}${unit}`
|
|
59
|
+
}
|
|
60
|
+
}
|