@symbo.ls/datepicker 0.4.2 → 0.5.10
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/.parcel-cache/3085beb0745a2550.txt +2 -0
- package/.parcel-cache/736b9fb319e7887f.txt +2 -0
- package/.parcel-cache/data.mdb +0 -0
- package/.parcel-cache/lock.mdb +0 -0
- package/dist/index.js +347 -0
- package/dist/index.js.map +1 -0
- package/package.json +6 -6
- package/packages/react/index.js +7 -0
- package/packages/react/node_modules/.yarn-integrity +105 -0
- package/packages/react/node_modules/@domql/cache/LICENSE +21 -0
- package/packages/react/node_modules/@domql/cache/index.js +0 -0
- package/packages/react/node_modules/@domql/cache/package.json +10 -0
- package/packages/react/node_modules/@domql/cookie/LICENSE +21 -0
- package/packages/react/node_modules/@domql/cookie/index.js +22 -0
- package/packages/react/node_modules/@domql/cookie/package.json +10 -0
- package/packages/react/node_modules/@domql/define/LICENSE +21 -0
- package/packages/react/node_modules/@domql/define/index.js +14 -0
- package/packages/react/node_modules/@domql/define/package.json +11 -0
- package/packages/react/node_modules/@domql/domql/LICENSE +21 -0
- package/packages/react/node_modules/@domql/domql/dist/index.js +93 -0
- package/packages/react/node_modules/@domql/domql/dist/index.js.map +1 -0
- package/packages/react/node_modules/@domql/domql/package.json +33 -0
- package/packages/react/node_modules/@domql/element/LICENSE +21 -0
- package/packages/react/node_modules/@domql/element/package.json +20 -0
- package/packages/react/node_modules/@domql/element/src/assign.js +22 -0
- package/packages/react/node_modules/@domql/element/src/create.js +125 -0
- package/packages/react/node_modules/@domql/element/src/index.js +8 -0
- package/packages/react/node_modules/@domql/element/src/iterate.js +80 -0
- package/packages/react/node_modules/@domql/element/src/methods.js +96 -0
- package/packages/react/node_modules/@domql/element/src/set.js +44 -0
- package/packages/react/node_modules/@domql/element/src/update.js +100 -0
- package/packages/react/node_modules/@domql/event/LICENSE +21 -0
- package/packages/react/node_modules/@domql/event/package.json +14 -0
- package/packages/react/node_modules/@domql/event/src/can.js +10 -0
- package/packages/react/node_modules/@domql/event/src/index.js +11 -0
- package/packages/react/node_modules/@domql/event/src/is.js +13 -0
- package/packages/react/node_modules/@domql/event/src/on.js +33 -0
- package/packages/react/node_modules/@domql/event/src/store.js +6 -0
- package/packages/react/node_modules/@domql/event/src/wrappers.js +14 -0
- package/packages/react/node_modules/@domql/event/yarn-error.log +44 -0
- package/packages/react/node_modules/@domql/id/LICENSE +21 -0
- package/packages/react/node_modules/@domql/id/index.js +12 -0
- package/packages/react/node_modules/@domql/id/package.json +10 -0
- package/packages/react/node_modules/@domql/mixins/LICENSE +21 -0
- package/packages/react/node_modules/@domql/mixins/package.json +12 -0
- package/packages/react/node_modules/@domql/mixins/src/attr.js +19 -0
- package/packages/react/node_modules/@domql/mixins/src/classList.js +37 -0
- package/packages/react/node_modules/@domql/mixins/src/content.js +17 -0
- package/packages/react/node_modules/@domql/mixins/src/data.js +21 -0
- package/packages/react/node_modules/@domql/mixins/src/html.js +17 -0
- package/packages/react/node_modules/@domql/mixins/src/index.js +11 -0
- package/packages/react/node_modules/@domql/mixins/src/registry.js +55 -0
- package/packages/react/node_modules/@domql/mixins/src/state.js +16 -0
- package/packages/react/node_modules/@domql/mixins/src/style.js +14 -0
- package/packages/react/node_modules/@domql/mixins/src/text.js +19 -0
- package/packages/react/node_modules/@domql/node/LICENSE +21 -0
- package/packages/react/node_modules/@domql/node/package.json +18 -0
- package/packages/react/node_modules/@domql/node/src/cache.js +53 -0
- package/packages/react/node_modules/@domql/node/src/create.js +86 -0
- package/packages/react/node_modules/@domql/node/src/index.js +5 -0
- package/packages/react/node_modules/@domql/node/src/registry.js +139 -0
- package/packages/react/node_modules/@domql/node/yarn-error.log +166 -0
- package/packages/react/node_modules/@domql/parse/LICENSE +21 -0
- package/packages/react/node_modules/@domql/parse/index.js +16 -0
- package/packages/react/node_modules/@domql/parse/package.json +10 -0
- package/packages/react/node_modules/@domql/props/LICENSE +21 -0
- package/packages/react/node_modules/@domql/props/package.json +10 -0
- package/packages/react/node_modules/@domql/props/src/index.js +62 -0
- package/packages/react/node_modules/@domql/proto/LICENSE +21 -0
- package/packages/react/node_modules/@domql/proto/index.js +66 -0
- package/packages/react/node_modules/@domql/proto/package.json +10 -0
- package/packages/react/node_modules/@domql/react-transformer/LICENSE +21 -0
- package/packages/react/node_modules/@domql/react-transformer/dist/index.js +62 -0
- package/packages/react/node_modules/@domql/react-transformer/dist/index.js.map +1 -0
- package/packages/react/node_modules/@domql/react-transformer/package.json +17 -0
- package/packages/react/node_modules/@domql/report/LICENSE +21 -0
- package/packages/react/node_modules/@domql/report/index.js +62 -0
- package/packages/react/node_modules/@domql/report/package.json +7 -0
- package/packages/react/node_modules/@domql/state/LICENSE +21 -0
- package/packages/react/node_modules/@domql/state/package.json +11 -0
- package/packages/react/node_modules/@domql/state/src/index.js +51 -0
- package/packages/react/node_modules/@domql/tree/LICENSE +21 -0
- package/packages/react/node_modules/@domql/tree/index.js +6 -0
- package/packages/react/node_modules/@domql/tree/package.json +10 -0
- package/packages/react/node_modules/@domql/tree/root.js +8 -0
- package/packages/react/node_modules/@domql/utils/LICENSE +21 -0
- package/packages/react/node_modules/@domql/utils/package.json +13 -0
- package/packages/react/node_modules/@domql/utils/src/index.js +5 -0
- package/packages/react/node_modules/@domql/utils/src/node.js +10 -0
- package/packages/react/node_modules/@domql/utils/src/object.js +193 -0
- package/packages/react/node_modules/@domql/utils/src/protoUtils.js +119 -0
- package/packages/react/node_modules/@symbo.ls/block/package.json +7 -0
- package/packages/react/node_modules/@symbo.ls/block/packages/react/index.js +1 -0
- package/packages/react/node_modules/@symbo.ls/block/packages/react/package.json +7 -0
- package/packages/react/node_modules/@symbo.ls/block/src/index.js +90 -0
- package/packages/react/node_modules/@symbo.ls/block/src/style.js +5 -0
- package/packages/react/node_modules/@symbo.ls/datepicker/package.json +12 -0
- package/packages/react/node_modules/@symbo.ls/datepicker/packages/react/index.js +1 -0
- package/packages/react/node_modules/@symbo.ls/datepicker/packages/react/package.json +7 -0
- package/packages/react/node_modules/@symbo.ls/datepicker/src/index.js +115 -0
- package/packages/react/node_modules/@symbo.ls/datepicker/src/style.js +100 -0
- package/packages/react/node_modules/@symbo.ls/icon/package.json +10 -0
- package/packages/react/node_modules/@symbo.ls/icon/packages/react/index.js +1 -0
- package/packages/react/node_modules/@symbo.ls/icon/packages/react/package.json +7 -0
- package/packages/react/node_modules/@symbo.ls/icon/src/index.js +14 -0
- package/packages/react/node_modules/@symbo.ls/icon/src/style.js +8 -0
- package/packages/react/node_modules/@symbo.ls/shape/package.json +7 -0
- package/packages/react/node_modules/@symbo.ls/shape/packages/react/index.js +1 -0
- package/packages/react/node_modules/@symbo.ls/shape/packages/react/package.json +7 -0
- package/packages/react/node_modules/@symbo.ls/shape/src/index.js +43 -0
- package/packages/react/node_modules/@symbo.ls/shape/src/style.js +102 -0
- package/packages/react/node_modules/@symbo.ls/svg/package.json +7 -0
- package/packages/react/node_modules/@symbo.ls/svg/packages/react/index.js +1 -0
- package/packages/react/node_modules/@symbo.ls/svg/packages/react/package.json +7 -0
- package/packages/react/node_modules/@symbo.ls/svg/src/index.js +14 -0
- package/packages/react/node_modules/js-tokens/CHANGELOG.md +151 -0
- package/packages/react/node_modules/js-tokens/LICENSE +21 -0
- package/packages/react/node_modules/js-tokens/README.md +240 -0
- package/packages/react/node_modules/js-tokens/index.js +23 -0
- package/packages/react/node_modules/js-tokens/package.json +30 -0
- package/packages/react/node_modules/loose-envify/LICENSE +21 -0
- package/packages/react/node_modules/loose-envify/README.md +45 -0
- package/packages/react/node_modules/loose-envify/cli.js +16 -0
- package/packages/react/node_modules/loose-envify/custom.js +4 -0
- package/packages/react/node_modules/loose-envify/index.js +3 -0
- package/packages/react/node_modules/loose-envify/loose-envify.js +36 -0
- package/packages/react/node_modules/loose-envify/package.json +36 -0
- package/packages/react/node_modules/loose-envify/replace.js +65 -0
- package/packages/react/node_modules/object-assign/index.js +90 -0
- package/packages/react/node_modules/object-assign/license +21 -0
- package/packages/react/node_modules/object-assign/package.json +42 -0
- package/packages/react/node_modules/object-assign/readme.md +61 -0
- package/packages/react/node_modules/react/LICENSE +21 -0
- package/packages/react/node_modules/react/README.md +13 -0
- package/packages/react/node_modules/react/build-info.json +8 -0
- package/packages/react/node_modules/react/cjs/react-jsx-dev-runtime.development.js +1203 -0
- package/packages/react/node_modules/react/cjs/react-jsx-dev-runtime.production.min.js +9 -0
- package/packages/react/node_modules/react/cjs/react-jsx-dev-runtime.profiling.min.js +9 -0
- package/packages/react/node_modules/react/cjs/react-jsx-runtime.development.js +1221 -0
- package/packages/react/node_modules/react/cjs/react-jsx-runtime.production.min.js +10 -0
- package/packages/react/node_modules/react/cjs/react-jsx-runtime.profiling.min.js +10 -0
- package/packages/react/node_modules/react/cjs/react.development.js +2333 -0
- package/packages/react/node_modules/react/cjs/react.production.min.js +23 -0
- package/packages/react/node_modules/react/index.js +7 -0
- package/packages/react/node_modules/react/jsx-dev-runtime.js +7 -0
- package/packages/react/node_modules/react/jsx-runtime.js +7 -0
- package/packages/react/node_modules/react/package.json +39 -0
- package/packages/react/node_modules/react/umd/react.development.js +3357 -0
- package/packages/react/node_modules/react/umd/react.production.min.js +31 -0
- package/packages/react/node_modules/react/umd/react.profiling.min.js +36 -0
- package/packages/react/node_modules/react-dom/LICENSE +21 -0
- package/packages/react/node_modules/react-dom/README.md +54 -0
- package/packages/react/node_modules/react-dom/build-info.json +8 -0
- package/packages/react/node_modules/react-dom/cjs/react-dom-server.browser.development.js +4342 -0
- package/packages/react/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js +51 -0
- package/packages/react/node_modules/react-dom/cjs/react-dom-server.node.development.js +4383 -0
- package/packages/react/node_modules/react-dom/cjs/react-dom-server.node.production.min.js +52 -0
- package/packages/react/node_modules/react-dom/cjs/react-dom-test-utils.development.js +2118 -0
- package/packages/react/node_modules/react-dom/cjs/react-dom-test-utils.production.min.js +43 -0
- package/packages/react/node_modules/react-dom/cjs/react-dom.development.js +26262 -0
- package/packages/react/node_modules/react-dom/cjs/react-dom.production.min.js +297 -0
- package/packages/react/node_modules/react-dom/cjs/react-dom.profiling.min.js +310 -0
- package/packages/react/node_modules/react-dom/index.js +38 -0
- package/packages/react/node_modules/react-dom/package.json +49 -0
- package/packages/react/node_modules/react-dom/profiling.js +38 -0
- package/packages/react/node_modules/react-dom/server.browser.js +7 -0
- package/packages/react/node_modules/react-dom/server.js +3 -0
- package/packages/react/node_modules/react-dom/server.node.js +7 -0
- package/packages/react/node_modules/react-dom/test-utils.js +7 -0
- package/packages/react/node_modules/react-dom/umd/react-dom-server.browser.development.js +4341 -0
- package/packages/react/node_modules/react-dom/umd/react-dom-server.browser.production.min.js +46 -0
- package/packages/react/node_modules/react-dom/umd/react-dom-test-utils.development.js +2136 -0
- package/packages/react/node_modules/react-dom/umd/react-dom-test-utils.production.min.js +35 -0
- package/packages/react/node_modules/react-dom/umd/react-dom.development.js +26292 -0
- package/packages/react/node_modules/react-dom/umd/react-dom.production.min.js +245 -0
- package/packages/react/node_modules/react-dom/umd/react-dom.profiling.min.js +252 -0
- package/packages/react/node_modules/regenerator-runtime/LICENSE +21 -0
- package/packages/react/node_modules/regenerator-runtime/README.md +31 -0
- package/packages/react/node_modules/regenerator-runtime/package.json +19 -0
- package/packages/react/node_modules/regenerator-runtime/path.js +11 -0
- package/packages/react/node_modules/regenerator-runtime/runtime.js +754 -0
- package/packages/react/node_modules/scheduler/LICENSE +21 -0
- package/packages/react/node_modules/scheduler/README.md +9 -0
- package/packages/react/node_modules/scheduler/build-info.json +8 -0
- package/packages/react/node_modules/scheduler/cjs/scheduler-tracing.development.js +347 -0
- package/packages/react/node_modules/scheduler/cjs/scheduler-tracing.production.min.js +9 -0
- package/packages/react/node_modules/scheduler/cjs/scheduler-tracing.profiling.min.js +16 -0
- package/packages/react/node_modules/scheduler/cjs/scheduler-unstable_mock.development.js +665 -0
- package/packages/react/node_modules/scheduler/cjs/scheduler-unstable_mock.production.min.js +19 -0
- package/packages/react/node_modules/scheduler/cjs/scheduler-unstable_post_task.development.js +206 -0
- package/packages/react/node_modules/scheduler/cjs/scheduler-unstable_post_task.production.min.js +13 -0
- package/packages/react/node_modules/scheduler/cjs/scheduler.development.js +646 -0
- package/packages/react/node_modules/scheduler/cjs/scheduler.production.min.js +20 -0
- package/packages/react/node_modules/scheduler/index.js +7 -0
- package/packages/react/node_modules/scheduler/package.json +40 -0
- package/packages/react/node_modules/scheduler/tracing-profiling.js +7 -0
- package/packages/react/node_modules/scheduler/tracing.js +7 -0
- package/packages/react/node_modules/scheduler/umd/scheduler-tracing.development.js +80 -0
- package/packages/react/node_modules/scheduler/umd/scheduler-tracing.production.min.js +80 -0
- package/packages/react/node_modules/scheduler/umd/scheduler-tracing.profiling.min.js +80 -0
- package/packages/react/node_modules/scheduler/umd/scheduler-unstable_mock.development.js +664 -0
- package/packages/react/node_modules/scheduler/umd/scheduler-unstable_mock.production.min.js +18 -0
- package/packages/react/node_modules/scheduler/umd/scheduler.development.js +152 -0
- package/packages/react/node_modules/scheduler/umd/scheduler.production.min.js +146 -0
- package/packages/react/node_modules/scheduler/umd/scheduler.profiling.min.js +146 -0
- package/packages/react/node_modules/scheduler/unstable_mock.js +7 -0
- package/packages/react/node_modules/scheduler/unstable_post_task.js +7 -0
- package/packages/react/package.json +6 -2
- package/packages/react/yarn.lock +229 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { isArray, isFunction, isObject } from './object'
|
|
4
|
+
|
|
5
|
+
export const generateHash = () => Math.random().toString(36).substring(2)
|
|
6
|
+
|
|
7
|
+
// hashing
|
|
8
|
+
export const protoStackRegistry = {}
|
|
9
|
+
export const protoCachedRegistry = {}
|
|
10
|
+
|
|
11
|
+
window.protoStackRegistry = protoStackRegistry
|
|
12
|
+
window.protoCachedRegistry = protoCachedRegistry
|
|
13
|
+
|
|
14
|
+
export const getHashedProto = proto => {
|
|
15
|
+
return protoStackRegistry[proto.__hash]
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const setHashedProto = (proto, stack) => {
|
|
19
|
+
const hash = generateHash()
|
|
20
|
+
proto.__hash = hash
|
|
21
|
+
protoStackRegistry[hash] = stack
|
|
22
|
+
return protoStackRegistry[hash]
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const getProtoStackRegistry = (proto, stack) => {
|
|
26
|
+
if (proto.__hash) {
|
|
27
|
+
return stack.concat(getHashedProto(proto))
|
|
28
|
+
} else {
|
|
29
|
+
setHashedProto(proto, stack)
|
|
30
|
+
}
|
|
31
|
+
return stack // .concat(hashedProto)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// stacking
|
|
35
|
+
export const extractArrayProto = (proto, stack) => {
|
|
36
|
+
proto.forEach(each => flattenProto(each, stack))
|
|
37
|
+
return stack
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export const deepProto = (proto, stack) => {
|
|
41
|
+
const protoOflattenProto = proto.proto
|
|
42
|
+
if (protoOflattenProto) {
|
|
43
|
+
flattenProto(protoOflattenProto, stack)
|
|
44
|
+
}
|
|
45
|
+
return stack
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export const flattenProto = (proto, stack) => {
|
|
49
|
+
if (!proto) return stack
|
|
50
|
+
if (isArray(proto)) return extractArrayProto(proto, stack)
|
|
51
|
+
stack.push(proto)
|
|
52
|
+
if (proto.proto) deepProto(proto, stack)
|
|
53
|
+
return stack
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// merging
|
|
57
|
+
export const deepCloneProto = obj => {
|
|
58
|
+
const o = {}
|
|
59
|
+
for (const prop in obj) {
|
|
60
|
+
if (['parent', 'node', '__element', '__root', '__key'].indexOf(prop) > -1) continue
|
|
61
|
+
const objProp = obj[prop]
|
|
62
|
+
if (isObject(objProp)) {
|
|
63
|
+
o[prop] = deepCloneProto(objProp)
|
|
64
|
+
} else if (isArray(objProp)) {
|
|
65
|
+
o[prop] = objProp.map(x => x)
|
|
66
|
+
} else o[prop] = objProp
|
|
67
|
+
}
|
|
68
|
+
return o
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export const deepMergeProto = (element, proto) => {
|
|
72
|
+
for (const e in proto) {
|
|
73
|
+
if (['parent', 'node', '__element', '__root'].indexOf(e) > -1) continue
|
|
74
|
+
const elementProp = element[e]
|
|
75
|
+
const protoProp = proto[e]
|
|
76
|
+
if (elementProp === undefined) {
|
|
77
|
+
element[e] = protoProp
|
|
78
|
+
} else if (isObject(elementProp) && isObject(protoProp)) {
|
|
79
|
+
deepMergeProto(elementProp, protoProp)
|
|
80
|
+
} else if (isArray(elementProp) && isArray(protoProp)) {
|
|
81
|
+
element[e] = elementProp.concat(protoProp)
|
|
82
|
+
} else if (isArray(elementProp) && isObject(protoProp)) {
|
|
83
|
+
const obj = deepMergeProto({}, elementProp)
|
|
84
|
+
element[e] = deepMergeProto(obj, protoProp)
|
|
85
|
+
} else if (elementProp === undefined && isFunction(protoProp)) {
|
|
86
|
+
element[e] = protoProp
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return element
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export const cloneAndMergeArrayProto = stack => {
|
|
93
|
+
return stack.reduce((a, c) => {
|
|
94
|
+
return deepMergeProto(a, deepCloneProto(c))
|
|
95
|
+
}, {})
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// joint stacks
|
|
99
|
+
export const jointStacks = (protoStack, childProtoStack) => {
|
|
100
|
+
return []
|
|
101
|
+
.concat(protoStack.slice(0, 1))
|
|
102
|
+
.concat(childProtoStack.slice(0, 1))
|
|
103
|
+
.concat(protoStack.slice(1))
|
|
104
|
+
.concat(childProtoStack.slice(1))
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// init
|
|
108
|
+
export const getProtoStack = proto => {
|
|
109
|
+
if (!proto) return []
|
|
110
|
+
if (proto.__hash) return getHashedProto(proto)
|
|
111
|
+
const stack = flattenProto(proto, [])
|
|
112
|
+
// console.log(stack)
|
|
113
|
+
return getProtoStackRegistry(proto, stack)
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export const getProtoMerged = proto => {
|
|
117
|
+
const stack = getProtoStack(proto)
|
|
118
|
+
return cloneAndMergeArrayProto(stack)
|
|
119
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict'
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { SPACING, mapSpacing } from '@symbo.ls/scratch'
|
|
4
|
+
import style from './style'
|
|
5
|
+
|
|
6
|
+
export const mapBasedOnRatio = (props, prop) => {
|
|
7
|
+
const { spacingRatio } = props
|
|
8
|
+
const val = props[prop]
|
|
9
|
+
if (spacingRatio) {
|
|
10
|
+
const params = SPACING[spacingRatio]
|
|
11
|
+
|
|
12
|
+
if (!params) {
|
|
13
|
+
SPACING[spacingRatio] = {
|
|
14
|
+
base: SPACING.base,
|
|
15
|
+
type: 'spacing',
|
|
16
|
+
ratio: spacingRatio,
|
|
17
|
+
range: [-5, +7],
|
|
18
|
+
subSequence: true,
|
|
19
|
+
sequence: {},
|
|
20
|
+
scales: {}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const result = mapSpacing(val, prop, params)
|
|
25
|
+
|
|
26
|
+
return result
|
|
27
|
+
}
|
|
28
|
+
return mapSpacing(val, prop)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const Block = {
|
|
32
|
+
style,
|
|
33
|
+
|
|
34
|
+
props: {},
|
|
35
|
+
|
|
36
|
+
class: {
|
|
37
|
+
width: ({ props }) => props.width && mapBasedOnRatio(props, 'width'),
|
|
38
|
+
height: ({ props }) => props.height && mapBasedOnRatio(props, 'height'),
|
|
39
|
+
boxSize: ({ props }) => {
|
|
40
|
+
if (typeof props.boxSize !== 'string') return
|
|
41
|
+
const [width, height] = props.boxSize.split(' ')
|
|
42
|
+
return {
|
|
43
|
+
...mapSpacing(width, 'width'),
|
|
44
|
+
...mapSpacing(height, 'height')
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
maxWidth: ({ props }) => props.maxWidth && mapBasedOnRatio(props, 'maxWidth'),
|
|
49
|
+
minWidth: ({ props }) => props.minWidth && mapBasedOnRatio(props, 'minWidth'),
|
|
50
|
+
widthRange: ({ props }) => {
|
|
51
|
+
if (typeof props.widthRange !== 'string') return
|
|
52
|
+
const [minWidth, maxWidth] = props.widthRange.split(' ')
|
|
53
|
+
return {
|
|
54
|
+
...mapSpacing(minWidth, 'minWidth'),
|
|
55
|
+
...mapSpacing(maxWidth, 'maxWidth')
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
|
|
59
|
+
maxHeight: ({ props }) => props.maxHeight && mapBasedOnRatio(props, 'maxHeight'),
|
|
60
|
+
minHeight: ({ props }) => props.minHeight && mapBasedOnRatio(props, 'minHeight'),
|
|
61
|
+
heightRange: ({ props }) => {
|
|
62
|
+
if (typeof props.heightRange !== 'string') return
|
|
63
|
+
const [minHeight, maxHeight] = props.heightRange.split(' ')
|
|
64
|
+
return {
|
|
65
|
+
...mapSpacing(minHeight, 'minHeight'),
|
|
66
|
+
...mapSpacing(maxHeight, 'maxHeight')
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
|
|
70
|
+
aspectRatio: ({ props }) => ({ aspectRatio: props.aspectRatio }),
|
|
71
|
+
|
|
72
|
+
padding: ({ props }) => mapBasedOnRatio(props, 'padding'),
|
|
73
|
+
margin: ({ props }) => mapBasedOnRatio(props, 'margin'),
|
|
74
|
+
gap: ({ props }) => mapBasedOnRatio(props, 'gap'),
|
|
75
|
+
|
|
76
|
+
flexFlow: ({ props }) => props.flexFlow && ({
|
|
77
|
+
display: 'flex',
|
|
78
|
+
flexFlow: props.flexFlow
|
|
79
|
+
}),
|
|
80
|
+
flexAlign: ({ props }) => {
|
|
81
|
+
if (typeof props.flexAlign !== 'string') return
|
|
82
|
+
const [alignItems, justifyContent] = props.flexAlign.split(' ')
|
|
83
|
+
return {
|
|
84
|
+
display: 'flex',
|
|
85
|
+
alignItems: alignItems,
|
|
86
|
+
justifyContent: justifyContent
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@symbo.ls/datepicker",
|
|
3
|
+
"version": "0.5.3",
|
|
4
|
+
"main": "src/index.js",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"gitHead": "f0c29fae632536241c4e803b880991748344f7c5",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"@symbo.ls/block": "^0.5.3",
|
|
9
|
+
"@symbo.ls/icon": "^0.5.3",
|
|
10
|
+
"@symbo.ls/shape": "^0.5.3"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict'
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import style from './style'
|
|
4
|
+
|
|
5
|
+
import { Icon } from '@symbo.ls/icon'
|
|
6
|
+
import { Shape } from '@symbo.ls/shape'
|
|
7
|
+
import { Block } from '@symbo.ls/block'
|
|
8
|
+
|
|
9
|
+
export const DatePicker = {
|
|
10
|
+
style,
|
|
11
|
+
|
|
12
|
+
proto: [Shape, Block],
|
|
13
|
+
props: {
|
|
14
|
+
theme: 'lightDark',
|
|
15
|
+
padding: 'A',
|
|
16
|
+
round: 'Z',
|
|
17
|
+
depth: 16
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
aside: {
|
|
21
|
+
childProto: { tag: 'button' },
|
|
22
|
+
...[
|
|
23
|
+
{ text: '2020' },
|
|
24
|
+
{ text: '2021' },
|
|
25
|
+
{ text: '2022' },
|
|
26
|
+
{ text: '2023' },
|
|
27
|
+
{ text: '2024' },
|
|
28
|
+
{ text: '2025' },
|
|
29
|
+
{ text: '2026' },
|
|
30
|
+
{ text: '2026' },
|
|
31
|
+
{ text: '2026' }
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
main: {
|
|
36
|
+
header: {
|
|
37
|
+
icon: {
|
|
38
|
+
proto: Icon,
|
|
39
|
+
props: { icon: 'arrowMediumLeft' }
|
|
40
|
+
},
|
|
41
|
+
month: {
|
|
42
|
+
childProto: { tag: 'span' },
|
|
43
|
+
...[
|
|
44
|
+
{ text: 'january' },
|
|
45
|
+
{ text: 'february' },
|
|
46
|
+
{ text: 'march' },
|
|
47
|
+
{ text: 'april' },
|
|
48
|
+
{ text: 'may' },
|
|
49
|
+
{ text: 'june' },
|
|
50
|
+
{ text: 'july' },
|
|
51
|
+
{ text: 'august' },
|
|
52
|
+
{ text: 'september' },
|
|
53
|
+
{ text: 'october' },
|
|
54
|
+
{ text: 'november' },
|
|
55
|
+
{ text: 'december' }
|
|
56
|
+
]
|
|
57
|
+
},
|
|
58
|
+
icon2: {
|
|
59
|
+
proto: Icon,
|
|
60
|
+
props: { icon: 'arrowMediumRight' }
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
days: {
|
|
64
|
+
tag: 'section',
|
|
65
|
+
header: {
|
|
66
|
+
childProto: { tag: 'span' },
|
|
67
|
+
...[
|
|
68
|
+
{ text: 'Mo' },
|
|
69
|
+
{ text: 'Tu' },
|
|
70
|
+
{ text: 'We' },
|
|
71
|
+
{ text: 'Th' },
|
|
72
|
+
{ text: 'Fr' },
|
|
73
|
+
{ text: 'Sa' },
|
|
74
|
+
{ text: 'Su' }
|
|
75
|
+
]
|
|
76
|
+
},
|
|
77
|
+
content: {
|
|
78
|
+
childProto: { tag: 'button' },
|
|
79
|
+
...[
|
|
80
|
+
{ text: '1' },
|
|
81
|
+
{ text: '2' },
|
|
82
|
+
{ text: '3' },
|
|
83
|
+
{ text: '4' },
|
|
84
|
+
{ text: '5' },
|
|
85
|
+
{ text: '6' },
|
|
86
|
+
{ text: '7' },
|
|
87
|
+
{ text: '8' },
|
|
88
|
+
{ text: '9' },
|
|
89
|
+
{ text: '10' },
|
|
90
|
+
{ text: '11' },
|
|
91
|
+
{ text: '12' },
|
|
92
|
+
{ text: '13' },
|
|
93
|
+
{ text: '14' },
|
|
94
|
+
{ text: '15' },
|
|
95
|
+
{ text: '16' },
|
|
96
|
+
{ text: '17' },
|
|
97
|
+
{ text: '18' },
|
|
98
|
+
{ text: '19' },
|
|
99
|
+
{ text: '20' },
|
|
100
|
+
{ text: '21' },
|
|
101
|
+
{ text: '22' },
|
|
102
|
+
{ text: '23' },
|
|
103
|
+
{ text: '24' },
|
|
104
|
+
{ text: '25' },
|
|
105
|
+
{ text: '26' },
|
|
106
|
+
{ text: '27' },
|
|
107
|
+
{ text: '28' },
|
|
108
|
+
{ text: '29' },
|
|
109
|
+
{ text: '30' },
|
|
110
|
+
{ text: '31' }
|
|
111
|
+
]
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
maxWidth: `${336 / 16}em`,
|
|
5
|
+
maxHeight: `${260 / 16}em`,
|
|
6
|
+
display: 'flex',
|
|
7
|
+
padding: '0 1em',
|
|
8
|
+
boxSizing: 'border-box',
|
|
9
|
+
borderRadius: '10px',
|
|
10
|
+
button: {
|
|
11
|
+
border: 'none',
|
|
12
|
+
outline: 'none',
|
|
13
|
+
background: 'transparent',
|
|
14
|
+
cursor: 'pointer'
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
aside: {
|
|
18
|
+
display: 'flex',
|
|
19
|
+
flexDirection: 'column',
|
|
20
|
+
overflowX: 'auto',
|
|
21
|
+
paddingRight: `${10 / 16}em`,
|
|
22
|
+
|
|
23
|
+
button: {
|
|
24
|
+
opacity: 0.5,
|
|
25
|
+
marginBottom: `${22 / 12}em`
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
main: {
|
|
30
|
+
flex: 1,
|
|
31
|
+
paddingTop: `${14 / 16}em`,
|
|
32
|
+
paddingBottom: `${10 / 16}em`,
|
|
33
|
+
overflow: 'hidden',
|
|
34
|
+
|
|
35
|
+
display: 'flex',
|
|
36
|
+
flexDirection: 'column',
|
|
37
|
+
|
|
38
|
+
'> header': {
|
|
39
|
+
display: 'flex',
|
|
40
|
+
alignItems: 'center',
|
|
41
|
+
height: 'auto',
|
|
42
|
+
overflow: 'hidden',
|
|
43
|
+
width: '100%',
|
|
44
|
+
padding: `0 ${8 / 16}em ${14 / 16}em ${8 / 16}em`,
|
|
45
|
+
boxSizing: 'border-box'
|
|
46
|
+
},
|
|
47
|
+
'> header > svg': {
|
|
48
|
+
cursor: 'pointer'
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
'> header > div': {
|
|
52
|
+
display: 'flex',
|
|
53
|
+
overflow: 'hidden',
|
|
54
|
+
flex: 1
|
|
55
|
+
},
|
|
56
|
+
'> header span': {
|
|
57
|
+
minWidth: '100%',
|
|
58
|
+
textTransform: 'capitalize',
|
|
59
|
+
textAlign: 'center',
|
|
60
|
+
fontWeight: 'bold'
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
section: {
|
|
64
|
+
flex: 1,
|
|
65
|
+
display: 'flex',
|
|
66
|
+
flexDirection: 'column'
|
|
67
|
+
},
|
|
68
|
+
'section > header': {
|
|
69
|
+
height: 'auto',
|
|
70
|
+
display: 'grid',
|
|
71
|
+
gridTemplateColumns: 'repeat(7, 1fr)',
|
|
72
|
+
gap: '6px',
|
|
73
|
+
paddingBottom: `${2 / 16}em`
|
|
74
|
+
},
|
|
75
|
+
'section > header span': {
|
|
76
|
+
textAlign: 'center',
|
|
77
|
+
fontWeight: 'bold'
|
|
78
|
+
},
|
|
79
|
+
'section > header span:nth-child(6)': {
|
|
80
|
+
opacity: 0.5
|
|
81
|
+
},
|
|
82
|
+
'section > header span:nth-child(7)': {
|
|
83
|
+
opacity: 0.5
|
|
84
|
+
},
|
|
85
|
+
'section > div': {
|
|
86
|
+
flex: 1,
|
|
87
|
+
display: 'grid',
|
|
88
|
+
gridTemplateColumns: 'repeat(7, 1fr)',
|
|
89
|
+
gap: '6px'
|
|
90
|
+
},
|
|
91
|
+
'section > div button': {
|
|
92
|
+
},
|
|
93
|
+
'section > div button:nth-child(7n)': {
|
|
94
|
+
opacity: 0.5
|
|
95
|
+
},
|
|
96
|
+
'section > div button:nth-child(7n - 1)': {
|
|
97
|
+
opacity: 0.5
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict'
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import style from './style'
|
|
4
|
+
|
|
5
|
+
import { SVG } from '@symbo.ls/svg'
|
|
6
|
+
|
|
7
|
+
export const Icon = {
|
|
8
|
+
proto: SVG,
|
|
9
|
+
style,
|
|
10
|
+
define: { name: param => param },
|
|
11
|
+
name: ({ props }) => props.icon,
|
|
12
|
+
attr: { viewBox: '0 0 24 24' },
|
|
13
|
+
src: ({ key, name }) => name || key || 'noIcon'
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
'use strict'
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { mapSpacing, getTheme, getColor } from '@symbo.ls/scratch'
|
|
4
|
+
|
|
5
|
+
import style, { shape, depth } from './style'
|
|
6
|
+
|
|
7
|
+
export const Shape = {
|
|
8
|
+
class: {
|
|
9
|
+
default: style,
|
|
10
|
+
shape: ({ props }) => props.shape && shape[props.shape],
|
|
11
|
+
shapeDirection: ({ props }) => props.shape && shape[props.shape][props.shapeDirection || 'top'],
|
|
12
|
+
shapeDirectionColor: ({ props, ...el }) => props.shapeDirection && { '&:before': { borderColor: el.class.backgroundColor } },
|
|
13
|
+
depth: ({ props }) => depth[props.depth],
|
|
14
|
+
round: ({ props, key, ...el }) => props.round && (mapSpacing(props.round, 'borderRadius') || ({ borderRadius: props.round })),
|
|
15
|
+
theme: ({ props }) => props.theme && getTheme(props.theme),
|
|
16
|
+
color: ({ props }) => props.color && ({ color: getColor(props.color) }),
|
|
17
|
+
border: ({ props }) => props.border ? ({ border: getColor(props.border) }) : 'transparent 0',
|
|
18
|
+
background: ({ props }) => props.background && ({ backgroundColor: getColor(props.background) })
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// mode: {
|
|
22
|
+
// dark: {
|
|
23
|
+
// theme: 'white'
|
|
24
|
+
// }
|
|
25
|
+
// }
|
|
26
|
+
|
|
27
|
+
// theme: {
|
|
28
|
+
// default: 'primary',
|
|
29
|
+
// dark: 'whiteish'
|
|
30
|
+
// }
|
|
31
|
+
|
|
32
|
+
// size: {
|
|
33
|
+
// default: 'auto',
|
|
34
|
+
// mobile: 'fit'
|
|
35
|
+
// }
|
|
36
|
+
|
|
37
|
+
// padding: {
|
|
38
|
+
// default: ratio.phi,
|
|
39
|
+
// mobile: ratio.perfect
|
|
40
|
+
// }
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export default Shape
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { UNIT } from '@symbo.ls/scratch'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
boxSizing: 'border-box'
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const depth = {
|
|
10
|
+
4: { boxShadow: `rgba(0,0,0,.10) 0 2${UNIT.default} 4${UNIT.default}` },
|
|
11
|
+
6: { boxShadow: `rgba(0,0,0,.10) 0 3${UNIT.default} 6${UNIT.default}` },
|
|
12
|
+
10: { boxShadow: `rgba(0,0,0,.10) 0 4${UNIT.default} 10${UNIT.default}` },
|
|
13
|
+
16: { boxShadow: `rgba(0,0,0,.10) 0 8${UNIT.default} 16${UNIT.default}` },
|
|
14
|
+
26: { boxShadow: `rgba(0,0,0,.10) 0 14${UNIT.default} 26${UNIT.default}` },
|
|
15
|
+
42: { boxShadow: `rgba(0,0,0,.10) 0 20${UNIT.default} 42${UNIT.default}` }
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const shape = {
|
|
19
|
+
rectangle: {},
|
|
20
|
+
circle: { borderRadius: '100%' },
|
|
21
|
+
bubble: {},
|
|
22
|
+
tooltip: {
|
|
23
|
+
position: 'relative',
|
|
24
|
+
'&:before': {
|
|
25
|
+
content: '""',
|
|
26
|
+
display: 'block',
|
|
27
|
+
width: '0px',
|
|
28
|
+
height: '0px',
|
|
29
|
+
border: '6px solid #343434',
|
|
30
|
+
position: 'absolute',
|
|
31
|
+
borderRadius: '2px'
|
|
32
|
+
},
|
|
33
|
+
top: {
|
|
34
|
+
'&:before': {
|
|
35
|
+
top: '2px',
|
|
36
|
+
left: '50%',
|
|
37
|
+
transform: 'translate(-50%, -50%) rotate(45deg)'
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
right: {
|
|
41
|
+
'&:before': {
|
|
42
|
+
top: '50%',
|
|
43
|
+
right: '-10px',
|
|
44
|
+
transform: 'translate(-50%, -50%) rotate(45deg)'
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
bottom: {
|
|
48
|
+
'&:before': {
|
|
49
|
+
bottom: '-10px',
|
|
50
|
+
left: '50%',
|
|
51
|
+
transform: 'translate(-50%, -50%) rotate(45deg)'
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
left: {
|
|
55
|
+
'&:before': {
|
|
56
|
+
top: '50%',
|
|
57
|
+
left: '2px',
|
|
58
|
+
transform: 'translate(-50%, -50%) rotate(45deg)'
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
tag: {
|
|
63
|
+
position: 'relative',
|
|
64
|
+
'&:before': {
|
|
65
|
+
content: '""',
|
|
66
|
+
display: 'block',
|
|
67
|
+
width: '0',
|
|
68
|
+
height: '0',
|
|
69
|
+
border: '16px solid #343434',
|
|
70
|
+
borderRadius: '6px',
|
|
71
|
+
position: 'absolute'
|
|
72
|
+
},
|
|
73
|
+
top: {
|
|
74
|
+
'&:before': {
|
|
75
|
+
bottom: '100%',
|
|
76
|
+
left: '50%',
|
|
77
|
+
transform: 'translate(-50%, 60%) rotate(45deg)'
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
right: {
|
|
81
|
+
'&:before': {
|
|
82
|
+
top: '50%',
|
|
83
|
+
left: '100%',
|
|
84
|
+
transform: 'translate(-60%, -50%) rotate(45deg)'
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
bottom: {
|
|
88
|
+
'&:before': {
|
|
89
|
+
top: '100%',
|
|
90
|
+
left: '50%',
|
|
91
|
+
transform: 'translate(-50%, -60%) rotate(45deg)'
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
left: {
|
|
95
|
+
'&:before': {
|
|
96
|
+
top: '50%',
|
|
97
|
+
right: '100%',
|
|
98
|
+
transform: 'translate(60%, -50%) rotate(45deg)'
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}
|