nubomed-ui 1.0.1 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (147) hide show
  1. package/.env.bi +13 -0
  2. package/.env.terminal +13 -0
  3. package/.vscode/extensions.json +3 -0
  4. package/README.md +17 -0
  5. package/index.html +13 -0
  6. package/nubomed-ui/nubomed-ui.es.js +2005 -0
  7. package/nubomed-ui/nubomed-ui.umd.js +1 -0
  8. package/nubomed-ui/style.css +1 -0
  9. package/package.json +19 -7
  10. package/src/App.vue +31 -0
  11. package/src/bi-demos/Header.vue +29 -0
  12. package/src/bi-demos/Table.vue +69 -0
  13. package/src/bi-demos/index.vue +132 -0
  14. package/src/bi-packages/components/Box/images/corner-error.png +0 -0
  15. package/src/bi-packages/components/Box/images/corner-warning.png +0 -0
  16. package/src/bi-packages/components/Box/images/corner.png +0 -0
  17. package/src/bi-packages/components/Box/index.scss +86 -0
  18. package/src/bi-packages/components/Box/index.vue +53 -0
  19. package/src/bi-packages/components/Carousel/CarouselItem.vue +0 -0
  20. package/src/bi-packages/components/Carousel/index.vue +0 -0
  21. package/src/bi-packages/components/Header/images/left-bg.png +0 -0
  22. package/src/bi-packages/components/Header/images/logo.png +0 -0
  23. package/src/bi-packages/components/Header/images/right-bg.png +0 -0
  24. package/src/bi-packages/components/Header/index.scss +50 -0
  25. package/src/bi-packages/components/Header/index.vue +54 -0
  26. package/src/bi-packages/components/Table/TableColgroup.vue +43 -0
  27. package/src/bi-packages/components/Table/index copy.vue +107 -0
  28. package/src/bi-packages/components/Table/index.scss +118 -0
  29. package/src/bi-packages/components/Table/index.vue +108 -0
  30. package/src/bi-packages/components/TableColumn/index.scss +7 -0
  31. package/src/bi-packages/components/TableColumn/index.vue +60 -0
  32. package/src/bi-packages/fonts/OPPOSans-B.ttf +0 -0
  33. package/src/bi-packages/fonts/OPPOSans-M.ttf +0 -0
  34. package/src/bi-packages/fonts/font.scss +11 -0
  35. package/src/bi-packages/iconfont-svg/demo.css +539 -0
  36. package/src/bi-packages/iconfont-svg/demo_index.html +4811 -0
  37. package/src/bi-packages/iconfont-svg/iconfont.css +819 -0
  38. package/src/bi-packages/iconfont-svg/iconfont.js +1 -0
  39. package/src/bi-packages/iconfont-svg/iconfont.json +1416 -0
  40. package/src/bi-packages/iconfont-svg/iconfont.ttf +0 -0
  41. package/src/bi-packages/iconfont-svg/iconfont.woff +0 -0
  42. package/src/bi-packages/iconfont-svg/iconfont.woff2 +0 -0
  43. package/src/bi-packages/index.js +34 -0
  44. package/src/bi-packages/styles/mixin.scss +12 -0
  45. package/src/bi-packages/styles/var.scss +11 -0
  46. package/src/demos/ActionBar.vue +59 -0
  47. package/src/demos/Badge.vue +28 -0
  48. package/src/demos/Button copy.vue +302 -0
  49. package/src/demos/Button.vue +116 -0
  50. package/src/demos/ButtonGroup.vue +40 -0
  51. package/src/demos/Check.vue +29 -0
  52. package/src/demos/Dialog.vue +255 -0
  53. package/src/demos/Empty.vue +38 -0
  54. package/src/demos/FooterMenu.vue +49 -0
  55. package/src/demos/Header.vue +71 -0
  56. package/src/demos/Icons.vue +314 -0
  57. package/src/demos/Input.vue +87 -0
  58. package/src/demos/InputKeyboard.vue +30 -0
  59. package/src/demos/InputNumber.vue +34 -0
  60. package/src/demos/LeftMenu.vue +128 -0
  61. package/src/demos/Menus.vue +106 -0
  62. package/src/demos/OpenCabinetBall.vue +37 -0
  63. package/src/demos/Statusbar.vue +146 -0
  64. package/src/demos/Steps.vue +45 -0
  65. package/src/demos/Tost.vue +35 -0
  66. package/src/demos/button/button.md +19 -0
  67. package/src/demos/data/terList.json +145 -0
  68. package/src/demos/images/cabinets/H3000-D.png +0 -0
  69. package/src/demos/images/cabinets/H3000-R.png +0 -0
  70. package/src/demos/images/cabinets/H3000-Rh.png +0 -0
  71. package/src/demos/images/cabinets/H3000-Rh2.png +0 -0
  72. package/src/demos/images/cabinets/H3010-R.png +0 -0
  73. package/src/demos/index.vue +348 -0
  74. package/src/docs/icons/Icon.vue +72 -0
  75. package/src/docs/icons/icon.md +21 -0
  76. package/src/docs/index.html +15 -0
  77. package/src/docs/index.vue +301 -0
  78. package/src/main.js +23 -0
  79. package/src/packages/components/ActionBar/images/error.png +0 -0
  80. package/src/packages/components/ActionBar/images/loading.gif +0 -0
  81. package/src/packages/components/ActionBar/images/success.png +0 -0
  82. package/src/packages/components/ActionBar/images/warning.png +0 -0
  83. package/src/packages/components/ActionBar/images/warning_yellow.png +0 -0
  84. package/src/packages/components/ActionBar/index.scss +81 -0
  85. package/src/packages/components/ActionBar/index.vue +100 -0
  86. package/src/packages/components/Badge/index.scss +50 -0
  87. package/src/packages/components/Badge/index.vue +75 -0
  88. package/src/packages/components/Button/index.scss +241 -0
  89. package/src/packages/components/Button/index.vue +111 -0
  90. package/src/packages/components/ButtonGroup/index.scss +54 -0
  91. package/src/packages/components/ButtonGroup/index.vue +75 -0
  92. package/src/packages/components/Check/Cate.vue +138 -0
  93. package/src/packages/components/Check/index.scss +47 -0
  94. package/src/packages/components/Check/index.vue +105 -0
  95. package/src/packages/components/Dialog/images/error.png +0 -0
  96. package/src/packages/components/Dialog/images/success.png +0 -0
  97. package/src/packages/components/Dialog/images/warning-red.png +0 -0
  98. package/src/packages/components/Dialog/images/warning-yellow.png +0 -0
  99. package/src/packages/components/Dialog/index.scss +154 -0
  100. package/src/packages/components/Dialog/index.vue +305 -0
  101. package/src/packages/components/Empty/images/empty-abnormal.png +0 -0
  102. package/src/packages/components/Empty/images/empty-data.png +0 -0
  103. package/src/packages/components/Empty/images/empty-search.png +0 -0
  104. package/src/packages/components/Empty/index.vue +68 -0
  105. package/src/packages/components/Form/FormItem.vue +73 -0
  106. package/src/packages/components/Form/index.vue +76 -0
  107. package/src/packages/components/Icon/index.vue +30 -0
  108. package/src/packages/components/Input/index.scss +184 -0
  109. package/src/packages/components/Input/index.vue +189 -0
  110. package/src/packages/components/InputKeyboard/index.scss +63 -0
  111. package/src/packages/components/InputKeyboard/index.vue +117 -0
  112. package/src/packages/components/InputNumber/index.scss +103 -0
  113. package/src/packages/components/InputNumber/index.vue +160 -0
  114. package/src/packages/components/Menu/index.scss +559 -0
  115. package/src/packages/components/Menu/index.vue +211 -0
  116. package/src/packages/components/OpenCabinetBall/CabinetStatus.vue +94 -0
  117. package/src/packages/components/OpenCabinetBall/index.scss +204 -0
  118. package/src/packages/components/OpenCabinetBall/index.vue +113 -0
  119. package/src/packages/components/Statusbar/CabinetList.vue +125 -0
  120. package/src/packages/components/Statusbar/CabinetListStatus.vue +75 -0
  121. package/src/packages/components/Statusbar/CabinetListTempHum.vue +108 -0
  122. package/src/packages/components/Statusbar/index.scss +205 -0
  123. package/src/packages/components/Statusbar/index.vue +83 -0
  124. package/src/packages/components/Steps/index.scss +104 -0
  125. package/src/packages/components/Steps/index.vue +66 -0
  126. package/src/packages/components/SvgIcon/index.vue +41 -0
  127. package/src/packages/components/Toast/index.vue +72 -0
  128. package/src/packages/fonts/OPPOSans-B.ttf +0 -0
  129. package/src/packages/fonts/OPPOSans-M.ttf +0 -0
  130. package/src/packages/fonts/font.scss +11 -0
  131. package/src/packages/iconfont-svg/demo.css +539 -0
  132. package/src/packages/iconfont-svg/demo_index.html +4811 -0
  133. package/src/packages/iconfont-svg/iconfont.css +819 -0
  134. package/src/packages/iconfont-svg/iconfont.js +1 -0
  135. package/src/packages/iconfont-svg/iconfont.json +1416 -0
  136. package/src/packages/iconfont-svg/iconfont.ttf +0 -0
  137. package/src/packages/iconfont-svg/iconfont.woff +0 -0
  138. package/src/packages/iconfont-svg/iconfont.woff2 +0 -0
  139. package/src/packages/index.js +64 -0
  140. package/src/packages/styles/var.scss +24 -0
  141. package/src/utils/create.js +48 -0
  142. package/src/utils/index.js +13 -0
  143. package/src/utils/validate.js +3 -0
  144. package/vite.config.js +47 -0
  145. package/nubomed-ui.es.js +0 -152
  146. package/nubomed-ui.umd.js +0 -1
  147. package/style.css +0 -1
@@ -0,0 +1,117 @@
1
+ <!--
2
+ * @Author: chenghuan.dong
3
+ * @Date: 2023-06-27 16:57:58
4
+ * @LastEditors: chenghuan.dong
5
+ * @LastEditTime: 2023-07-25 18:44:57
6
+ * @Description: 按钮
7
+ -->
8
+ <template>
9
+ <div class="nb-input-keyboard">
10
+ <div class="nb-input-keyboard__input">
11
+ <nb-input size="small" v-model="inputValue" placeholder="请输入首字母" />
12
+ <nb-button type="primary" :disabled="buttonDisabled" @click="handleSearch">搜索</nb-button>
13
+ </div>
14
+ <div class="nb-input-keyboard__keyboard">
15
+ <div v-for="(item, index) in list" :key="index">
16
+ <span
17
+ v-for="item2 in item"
18
+ :key="item2"
19
+ :style="type === 0 && ['123', '回删'].includes(item2) ? 'flex: 2' : ''"
20
+ @click="handleClick(item2)"
21
+ >{{ item2 }}</span
22
+ >
23
+ </div>
24
+ </div>
25
+ </div>
26
+ </template>
27
+ <script setup>
28
+ import { ref, computed, onMounted, nextTick } from 'vue'
29
+ import { createNamespace } from '../../../utils/create.js'
30
+
31
+ const [name, bem] = createNamespace('input-keyboard')
32
+
33
+ // 定义名称
34
+ defineOptions({
35
+ name: 'NbInputKeyboard'
36
+ })
37
+
38
+ // 定义props
39
+ const props = defineProps({})
40
+
41
+ // 定义emits
42
+ const emits = defineEmits(['search'])
43
+
44
+ const letters = [
45
+ ['A', 'B', 'C', 'D', 'E'],
46
+ ['F', 'G', 'H', 'I', 'J'],
47
+ ['K', 'L', 'M', 'N', 'O'],
48
+ ['P', 'Q', 'R', 'S', 'T'],
49
+ ['U', 'V', 'W', 'X', 'Y'],
50
+ ['123', 'Z', '回删']
51
+ ]
52
+
53
+ const numbers = [
54
+ [1, 2, 3],
55
+ [4, 5, 6],
56
+ [7, 8, 9],
57
+ ['abc', 0, '回删']
58
+ ]
59
+
60
+ let currentInput = null
61
+ const inputValue = ref('')
62
+ const type = ref(0) // 模式:0-字母,1-数字
63
+
64
+ // 当前展示的键盘
65
+ const list = computed(() => {
66
+ return type.value === 0 ? letters : numbers
67
+ })
68
+
69
+ // 搜索按钮是否禁用
70
+ const buttonDisabled = computed(() => {
71
+ if (inputValue.value) {
72
+ return false
73
+ } else {
74
+ return true
75
+ }
76
+ })
77
+
78
+ onMounted(() => {
79
+ nextTick(() => {
80
+ currentInput = document.querySelector('.nb-input__inner')
81
+ })
82
+ })
83
+
84
+ // 点击键盘
85
+ const handleClick = (key) => {
86
+ const len = currentInput.selectionStart
87
+ const value = currentInput.value
88
+ if (key === '123') {
89
+ // 字母切换成数字
90
+ type.value = 1
91
+ } else if (key === 'abc') {
92
+ // 数字切换成字母
93
+ type.value = 0
94
+ } else if (key === '回删') {
95
+ // 回删
96
+ currentInput.value = value.substring(0, len - 1) + value.substring(len, value.length)
97
+ currentInput.setSelectionRange(len - 1, len - 1)
98
+ currentInput.focus()
99
+ inputValue.value = currentInput.value
100
+ } else {
101
+ // 字母或数字
102
+ currentInput.value = value.substring(0, len) + key + value.substring(len, value.length)
103
+ currentInput.setSelectionRange(len + 1, len + 1)
104
+ currentInput.focus()
105
+ inputValue.value = currentInput.value
106
+ }
107
+ }
108
+
109
+ // 点击搜索
110
+ const handleSearch = () => {
111
+ emits('search', inputValue.value)
112
+ }
113
+ </script>
114
+
115
+ <style lang="scss">
116
+ @import './index.scss';
117
+ </style>
@@ -0,0 +1,103 @@
1
+ :root {
2
+ --nb-input-number-width: 180px;
3
+ --nb-input-number-height: 48px;
4
+ --nb-input-number-font-size: 36px;
5
+ --nb-input-number-icon-size: 32px;
6
+ }
7
+
8
+ .nb-input-number {
9
+ display: inline-flex;
10
+ align-items: center;
11
+ line-height: 1;
12
+ box-sizing: border-box;
13
+ outline: none;
14
+ transition: 0.1s;
15
+ overflow: hidden;
16
+ font-family: inherit;
17
+ font-weight: normal;
18
+ vertical-align: middle;
19
+ caret-color: var(--nb-theme-color);
20
+ width: var(--nb-input-number-width);
21
+ height: var(--nb-input-number-height);
22
+ line-height: var(--nb-input-number-height);
23
+ padding: 0;
24
+ &:focus {
25
+ outline: none;
26
+ }
27
+ .nb-input-number__inner {
28
+ width: 100%;
29
+ height: 100%;
30
+ flex-grow: 1;
31
+ -webkit-appearance: none;
32
+ color: var(--nb-input-number-color);
33
+ font-size: inherit;
34
+ padding: 0;
35
+ outline: none;
36
+ border: none;
37
+ border: 1px solid var(--nb-input-border-color);
38
+ background: none;
39
+ box-sizing: border-box;
40
+ line-height: var(--nb-input-number-height);
41
+ font-size: var(--nb-input-number-font-size);
42
+ text-align: center;
43
+ &::placeholder {
44
+ color: var(--nb-input-number-placeholder-text-color);
45
+ font-weight: 400;
46
+ font-family: inherit;
47
+ font-size: inherit;
48
+ }
49
+ }
50
+ .nb-input-number__minus,
51
+ .nb-input-number__plus {
52
+ min-width: var(--nb-input-number-height);
53
+ width: var(--nb-input-number-height);
54
+ height: 100%;
55
+ display: flex;
56
+ align-items: center;
57
+ justify-content: center;
58
+ border: 1px solid var(--nb-input-border-color);
59
+ box-sizing: border-box;
60
+ cursor: pointer;
61
+ .svg-icon {
62
+ color: #8b8ea0;
63
+ width: 32px;
64
+ height: 32px;
65
+ }
66
+ &--disabled {
67
+ cursor: not-allowed;
68
+ .svg-icon {
69
+ color: #cad0e0;
70
+ }
71
+ }
72
+ }
73
+ .nb-input-number__minus {
74
+ border-right: none;
75
+ border-top-left-radius: var(--nb-input-border-radius);
76
+ border-bottom-left-radius: var(--nb-input-border-radius);
77
+ }
78
+ .nb-input-number__plus {
79
+ border-left: none;
80
+ border-top-right-radius: var(--nb-input-border-radius);
81
+ border-bottom-right-radius: var(--nb-input-border-radius);
82
+ }
83
+
84
+ &--focus {
85
+ .nb-input-number__inner {
86
+ border: 2px solid var(--nb-theme-color);
87
+ }
88
+ }
89
+ &--error {
90
+ .nb-input-number__inner {
91
+ border: 2px solid var(--nb-abnormal-color);
92
+ }
93
+ }
94
+ &--disabled {
95
+ cursor: not-allowed;
96
+ background: var(--nb-input-number-disabled-background);
97
+ box-shadow: var(--nb-input-number-disabled-box-shadow);
98
+ border: 1px solid var(--nb-input-number-disabled-border-color);
99
+ &.nb-input-number.nb-input-number--disabled {
100
+ color: var(--nb-input-number-disabled-color);
101
+ }
102
+ }
103
+ }
@@ -0,0 +1,160 @@
1
+ <!--
2
+ * @Author: chenghuan.dong
3
+ * @Date: 2023-06-27 16:57:58
4
+ * @LastEditors: chenghuan.dong
5
+ * @LastEditTime: 2023-06-30 22:00:08
6
+ * @Description: 数字器
7
+ -->
8
+ <template>
9
+ <div :class="wrapClass">
10
+ <div :class="minusClass" @click.stop="handleStep(-step)">
11
+ <svg-icon icon="minus" />
12
+ </div>
13
+ <input
14
+ ref="input"
15
+ v-model="inputValue"
16
+ :class="[bem('inner')]"
17
+ :style="color ? `color: ${color}` : ''"
18
+ @input="handleInput"
19
+ @focus="handleFocus"
20
+ @blur="handleBlur"
21
+ />
22
+ <div class="plus" :class="plusClass" @click.stop="handleStep(step)">
23
+ <svg-icon icon="plus" />
24
+ </div>
25
+ </div>
26
+ </template>
27
+ <script setup>
28
+ import { ref, computed } from 'vue'
29
+ import { createNamespace } from '../../../utils/create.js'
30
+ import { isNumber } from '../../../utils/validate.js'
31
+
32
+ const [name, bem] = createNamespace('input-number')
33
+
34
+ // 定义名称
35
+ defineOptions({
36
+ name: 'NbInputNumber'
37
+ })
38
+
39
+ // 定义props
40
+ const props = defineProps({
41
+ // 定义Props
42
+ // 值
43
+ modelValue: {
44
+ type: [String, Number, Object],
45
+ default: ''
46
+ },
47
+ // 输入框占位文本
48
+ placeholder: {
49
+ type: String
50
+ },
51
+ // 原生 readonly 属性,是否只读
52
+ readonly: {
53
+ type: Boolean,
54
+ default: false
55
+ },
56
+ // 是否为禁用状态
57
+ disabled: {
58
+ type: Boolean,
59
+ default: false
60
+ },
61
+ // 类型
62
+ type: {
63
+ type: String,
64
+ default: ''
65
+ },
66
+ step: {
67
+ type: Number,
68
+ default: 1
69
+ },
70
+ min: {
71
+ type: Number
72
+ },
73
+ max: {
74
+ type: Number
75
+ },
76
+ // 数字颜色
77
+ color: {
78
+ type: String,
79
+ default: ''
80
+ }
81
+ })
82
+
83
+ // 定义emits
84
+ const emits = defineEmits(['input', 'change', 'focus', 'blur', 'clear'])
85
+
86
+ const hovering = ref(false)
87
+ const focused = ref(false)
88
+ const valueIsNumber = ref(true) // 输入值是否是数字
89
+
90
+ // 输入框值
91
+ const inputValue = computed({
92
+ get: () => props.modelValue,
93
+ set: (value) => {
94
+ emits('update:modelValue', Number(value))
95
+ }
96
+ })
97
+
98
+ // 样式
99
+ const wrapClass = computed(() => {
100
+ return bem([
101
+ props.type,
102
+ {
103
+ disabled: props.disabled,
104
+ focus: focused.value,
105
+ error: !valueIsNumber.value
106
+ }
107
+ ])
108
+ })
109
+
110
+ // 减号样式
111
+ const minusClass = computed(() => {
112
+ return bem('minus', {
113
+ disabled: !valueIsNumber.value || (props.min !== undefined && Number(inputValue.value) <= props.min)
114
+ })
115
+ })
116
+
117
+ // 加号样式
118
+ const plusClass = computed(() => {
119
+ return bem('plus', {
120
+ disabled: !valueIsNumber.value || (props.max !== undefined && Number(inputValue.value) >= props.max)
121
+ })
122
+ })
123
+
124
+ // 输入框
125
+ const handleFocus = () => {
126
+ focused.value = true
127
+ emits('focus')
128
+ }
129
+
130
+ const handleBlur = () => {
131
+ focused.value = false
132
+ emits('blur')
133
+ }
134
+
135
+ const handleInput = () => {
136
+ // 校验是否是数字
137
+ valueIsNumber.value = isNumber(inputValue.value)
138
+ // 非数字,显示异常
139
+ emits('input', Number(inputValue.value))
140
+ }
141
+
142
+ // 加减
143
+ const handleStep = (step) => {
144
+ if (!valueIsNumber.value) {
145
+ return
146
+ }
147
+ const value = Number(inputValue.value) + Number(step)
148
+ if (props.min !== undefined && step < 0 && value < props.min) {
149
+ return
150
+ }
151
+ if (props.max !== undefined && step > 0 && value > props.max) {
152
+ return
153
+ }
154
+ emits('update:modelValue', value)
155
+ }
156
+ </script>
157
+
158
+ <style lang="scss">
159
+ @import './index.scss';
160
+ </style>